[!!!][FEATURE] Omit type=text/javascript in HTML5 script tags 00/61300/5
authorBenni Mack <benni@typo3.org>
Mon, 15 Jul 2019 14:56:39 +0000 (16:56 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 16 Jul 2019 16:13:15 +0000 (18:13 +0200)
HTML5 defines that <script tags do not need "type=text/javascript"
as additional attribute.

TYPO3 Backend is fully HTML5, so all parts can be removed there.

For Frontend, when having config.doctype = html5 (or empty),
then the attributes do not get added anymore as well.

If necessary, for Frontend rendering the attribute can be
added in HTML5 by specifying
includeJS.myfile.type = text/javascript
in TypoScript.

As this modifies Frontend output, it is considered breaking.

Also see W3C specification:
https://www.w3.org/TR/html52/semantics-scripting.html#element-attrdef-script-type

Resolves: #88772
Releases: master
Change-Id: I26ca4361e84cae680eedbf6855e209a6311c33da
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61300
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
25 files changed:
typo3/sysext/adminpanel/Classes/Utility/ResourceUtility.php
typo3/sysext/backend/Classes/Controller/Wizard/EditController.php
typo3/sysext/backend/Resources/Private/Templates/NewContentElement/Main.html
typo3/sysext/backend/Resources/Public/Html/Close.html
typo3/sysext/beuser/Resources/Private/Templates/Permission/Edit.html
typo3/sysext/core/Classes/Page/PageRenderer.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-88772-JavaScriptScriptTagsOmitTypetextjavascriptInHTML5.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Functional/Page/PageRendererTest.php
typo3/sysext/extbase/Classes/Mvc/Web/Response.php
typo3/sysext/fluid/Classes/ViewHelpers/Widget/AutocompleteViewHelper.php
typo3/sysext/fluid/Resources/Private/Templates/ViewHelpers/Be/Widget/Paginate/Index.html
typo3/sysext/form/Resources/Private/Backend/Layouts/FormEditor.html
typo3/sysext/form/Resources/Private/Backend/Templates/FormManager/Index.html
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/Http/RequestHandler.php
typo3/sysext/frontend/Tests/Unit/Controller/Fixtures/renderedPage.html
typo3/sysext/install/Classes/ViewHelpers/Form/TypoScriptConstantsViewHelper.php
typo3/sysext/install/Resources/Private/Templates/Installer/Init.html
typo3/sysext/install/Resources/Private/Templates/Layout/Init.html
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
typo3/sysext/redirects/Resources/Private/Partials/Pagination.html
typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionAdditionalFieldProvider.php
typo3/sysext/t3editor/Resources/Private/tsref.xml
typo3/sysext/workspaces/Resources/Private/Templates/Review/Index.html

index 46f4002..f3ab4a0 100644 (file)
@@ -111,7 +111,7 @@ class ResourceUtility
      */
     protected static function getJsTag(string $jsFileLocation): string
     {
-        $js = '<script type="text/javascript" src="' .
+        $js = '<script src="' .
               htmlspecialchars(
                   PathUtility::getAbsoluteWebPath(GeneralUtility::getFileAbsFileName($jsFileLocation)),
                   ENT_QUOTES | ENT_HTML5
index 117a21f..ca08a8a 100644 (file)
@@ -59,7 +59,7 @@ class EditController extends AbstractWizardController
      *
      * @var string
      */
-    protected $closeWindow = '<script language="javascript" type="text/javascript">close();</script>';
+    protected $closeWindow = '<script>close();</script>';
 
     /**
      * Injects the request object for the current request or subrequest
index ac16541..18260d9 100644 (file)
@@ -5,7 +5,7 @@
             <f:form.hidden name="defValues" value="" />
             <f:if condition="{onClickEvent}">
                 <f:then>
-                    <script type="text/javascript">
+                    <script>
                         function goToalt_doc() {<f:format.raw>{onClickEvent}</f:format.raw>}
                     </script>
                     {renderedTabs -> f:format.raw()}
index 1a4faf6..8c2af86 100644 (file)
@@ -5,7 +5,7 @@
                <!-- TYPO3 Script ID: typo3/sysext/backend/Resources/Public/Html/Close.html -->
                <meta charset="utf-8" />
                <title>Close</title>
-               <script type="text/javascript">
+               <script>
                        self.close();
                        window.opener.location.reload(true);
                </script>
index 9a27138..ab7f1c3 100644 (file)
@@ -96,7 +96,7 @@
     </p>
     <p><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:def" /></p>
 
-    <script type="text/javascript">
+    <script>
         require(["jquery", "TYPO3/CMS/Beuser/Permissions"], function($, Permissions) {
             Permissions.setCheck("check[perms_user]", "tx_beuser_system_beusertxpermission[data][pages][{id}][perms_user]");
             Permissions.setCheck("check[perms_group]", "tx_beuser_system_beusertxpermission[data][pages][{id}][perms_group]");
index 8661bf6..6a8c809 100644 (file)
@@ -1019,11 +1019,8 @@ class PageRenderer implements SingletonInterface
      * @param bool $defer Flag if property 'defer="defer"' should be added to JavaScript tags
      * @param string $crossorigin CORS settings attribute
      */
-    public function addJsLibrary($name, $file, $type = 'text/javascript', $compress = false, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $async = false, $integrity = '', $defer = false, $crossorigin = '')
+    public function addJsLibrary($name, $file, $type = '', $compress = false, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $async = false, $integrity = '', $defer = false, $crossorigin = '')
     {
-        if (!$type) {
-            $type = 'text/javascript';
-        }
         if (!in_array(strtolower($name), $this->jsLibs)) {
             $this->jsLibs[strtolower($name)] = [
                 'file' => $file,
@@ -1058,11 +1055,8 @@ class PageRenderer implements SingletonInterface
      * @param bool $defer Flag if property 'defer="defer"' should be added to JavaScript tags
      * @param string $crossorigin CORS settings attribute
      */
-    public function addJsFooterLibrary($name, $file, $type = 'text/javascript', $compress = false, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $async = false, $integrity = '', $defer = false, $crossorigin = '')
+    public function addJsFooterLibrary($name, $file, $type = '', $compress = false, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $async = false, $integrity = '', $defer = false, $crossorigin = '')
     {
-        if (!$type) {
-            $type = 'text/javascript';
-        }
         $name .= '_jsFooterLibrary';
         if (!in_array(strtolower($name), $this->jsLibs)) {
             $this->jsLibs[strtolower($name)] = [
@@ -1097,11 +1091,8 @@ class PageRenderer implements SingletonInterface
      * @param bool $defer Flag if property 'defer="defer"' should be added to JavaScript tags
      * @param string $crossorigin CORS settings attribute
      */
-    public function addJsFile($file, $type = 'text/javascript', $compress = true, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $async = false, $integrity = '', $defer = false, $crossorigin = '')
+    public function addJsFile($file, $type = '', $compress = true, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $async = false, $integrity = '', $defer = false, $crossorigin = '')
     {
-        if (!$type) {
-            $type = 'text/javascript';
-        }
         if (!isset($this->jsFiles[$file])) {
             $this->jsFiles[$file] = [
                 'file' => $file,
@@ -1135,11 +1126,8 @@ class PageRenderer implements SingletonInterface
      * @param bool $defer Flag if property 'defer="defer"' should be added to JavaScript tags
      * @param string $crossorigin CORS settings attribute
      */
-    public function addJsFooterFile($file, $type = 'text/javascript', $compress = true, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $async = false, $integrity = '', $defer = false, $crossorigin = '')
+    public function addJsFooterFile($file, $type = '', $compress = true, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $async = false, $integrity = '', $defer = false, $crossorigin = '')
     {
-        if (!$type) {
-            $type = 'text/javascript';
-        }
         if (!isset($this->jsFiles[$file])) {
             $this->jsFiles[$file] = [
                 'file' => $file,
@@ -1448,14 +1436,14 @@ class PageRenderer implements SingletonInterface
         // directly after that, include the require.js file
         $html .= '<script src="'
             . $this->processJsFile($this->requireJsPath . 'require.js')
-            . '" type="text/javascript"></script>' . LF;
+            . '"></script>' . LF;
 
         if (!empty($requireJsConfig['typo3BaseUrl'])) {
             $html .= '<script src="'
                 . $this->processJsFile(
                     'EXT:core/Resources/Public/JavaScript/requirejs-loader.js'
                 )
-                . '" type="text/javascript"></script>' . LF;
+                . '"></script>' . LF;
         }
 
         return $html;
@@ -2165,11 +2153,12 @@ class PageRenderer implements SingletonInterface
         if (!empty($this->jsFiles)) {
             foreach ($this->jsFiles as $file => $properties) {
                 $file = $this->getStreamlinedFileName($file);
+                $type = $properties['type'] ? ' type="' . htmlspecialchars($properties['type']) . '"' : '';
                 $async = $properties['async'] ? ' async="async"' : '';
                 $defer = $properties['defer'] ? ' defer="defer"' : '';
                 $integrity = $properties['integrity'] ? ' integrity="' . htmlspecialchars($properties['integrity']) . '"' : '';
                 $crossorigin = $properties['crossorigin'] ? ' crossorigin="' . htmlspecialchars($properties['crossorigin']) . '"' : '';
-                $tag = '<script src="' . htmlspecialchars($file) . '" type="' . htmlspecialchars($properties['type']) . '"' . $async . $defer . $integrity . $crossorigin . '></script>';
+                $tag = '<script src="' . htmlspecialchars($file) . '"' . $type . $async . $defer . $integrity . $crossorigin . '></script>';
                 if ($properties['allWrap']) {
                     $wrapArr = explode($properties['splitChar'] ?: '|', $properties['allWrap'], 2);
                     $tag = $wrapArr[0] . $tag . $wrapArr[1];
index 0a206d0..41ad29c 100644 (file)
@@ -1324,7 +1324,7 @@ class GeneralUtility
             if (preg_match('/^(\\t+)/', $string, $match)) {
                 $string = str_replace($match[1], "\t", $string);
             }
-            return '<script type="text/javascript">
+            return '<script>
 /*<![CDATA[*/
 ' . $string . '
 /*]]>*/
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-88772-JavaScriptScriptTagsOmitTypetextjavascriptInHTML5.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-88772-JavaScriptScriptTagsOmitTypetextjavascriptInHTML5.rst
new file mode 100644 (file)
index 0000000..35e09b8
--- /dev/null
@@ -0,0 +1,54 @@
+.. include:: ../../Includes.txt
+
+============================================================================
+Breaking: #88772 - JavaScript script tags omit type=text/javascript in HTML5
+============================================================================
+
+See :issue:`88772`
+
+Description
+===========
+
+When rendering HTML5 output, `<script>` tags do not the additional attribute `type=text/javascript`
+anymore as it is considered optional, and if none given, modern browsers fall back to this type
+already.
+
+See the official W3C definition here: https://www.w3.org/TR/html52/semantics-scripting.html#element-attrdef-script-type
+
+For this reason, all of TYPO3's Backend (which is rendering HTML5) and Installer do not include
+this optional attribute in `<script>` tags anymore.
+
+For TYPO3 Frontend rendering, the attribute is omitted when having no doctype or HTML5 as doctype
+configured (via TypoScript :typoscript:`config.doctype = html5`). This leads to a minimal smaller
+HTML document submitted to the client.
+
+For any XHTML or HTML4-based website, the attribute is still added.
+
+
+Impact
+======
+
+TYPO3's Frontend rendering does not render `type=text/javascript` anymore in `<script>` tags when
+rendering a HTML5 output, unless explicitly specified.
+
+
+Affected Installations
+======================
+
+Any TYPO3 installation running a HTML5-based frontend output.
+
+
+Migration
+=========
+
+As all modern browsers do not need this tag, and the specification says it's optional, there is
+no migration needed at all.
+
+If still requested by a specific project, it can be added via:
+
+.. code-block:: javascript
+
+   page.includeJS.myfile = EXT:site_mysite/Resources/Public/JavaScript/myfile.js
+   page.includeJS.myfile.type = text/javascript
+
+.. index:: Frontend, TypoScript, NotScanned
\ No newline at end of file
index 0ab898a..ca3b29a 100644 (file)
@@ -74,6 +74,9 @@ class PageRendererTest extends \TYPO3\TestingFramework\Core\Functional\Functiona
         $subject->addJsFile('fileadmin/test.js', 'text/javascript', false, false, 'wrapBeforeXwrapAfter', false, 'X');
         $expectedJsFileRegExp = '#wrapBefore<script src="fileadmin/test\\.(js|\\d+\\.js|js\\?\\d+)" type="text/javascript"></script>wrapAfter#';
 
+        $subject->addJsFile('fileadmin/test-plain.js', '', false, false, 'wrapBeforeXwrapAfter', false, 'X');
+        $expectedJsFileWithoutTypeRegExp = '#wrapBefore<script src="fileadmin/test-plain\\.(js|\\d+\\.js|js\\?\\d+)"></script>wrapAfter#';
+
         $jsInlineCode = $expectedJsInlineCodeString = 'var x = "' . $this->getUniqueId('jsInline-') . '"';
         $subject->addJsInlineCode($this->getUniqueId(), $jsInlineCode);
 
@@ -99,6 +102,7 @@ class PageRendererTest extends \TYPO3\TestingFramework\Core\Functional\Functiona
         $this->assertStringContainsString($expectedHeaderData, $renderedString);
         $this->assertRegExp($expectedJsLibraryRegExp, $renderedString);
         $this->assertRegExp($expectedJsFileRegExp, $renderedString);
+        $this->assertRegExp($expectedJsFileWithoutTypeRegExp, $renderedString);
         $this->assertStringContainsString($expectedJsInlineCodeString, $renderedString);
         $this->assertStringContainsString($expectedCssFileString, $renderedString);
         $this->assertStringContainsString($expectedCssInlineBlockOnTopString, $renderedString);
index 68ff688..faf4774 100644 (file)
@@ -267,7 +267,7 @@ class Response extends \TYPO3\CMS\Extbase\Mvc\Response
 
     /**
      * Adds an additional header data (something like
-     * '<script src="myext/Resources/JavaScript/my.js" type="text/javascript"></script>'
+     * '<script src="myext/Resources/JavaScript/my.js"></script>'
      * )
      *
      * @TODO The workround and the $request member should be removed again, once the PageRender does support non-cached USER_INTs
index 1e11949..364cbb0 100644 (file)
@@ -21,8 +21,8 @@ use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
  * .. note::
  *     Make sure to include jQuery and jQuery UI in the HTML, like that::
  *
- *         <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
- *         <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
+ *         <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
+ *         <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
  *         <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/base/jquery-ui.css" type="text/css" media="all" />
  *         <link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all" />
  *
index a7923bf..d27ecb2 100644 (file)
@@ -3,7 +3,7 @@
 </f:if>
 
 <f:if condition="{configuration.insertAbove} || {configuration.insertBelow}">
-    <script type="text/javascript">
+    <script>
         function goToPage(formObject) {
             var formField = formObject.elements['paginator-target-page'];
             var url = formField.dataset.url;
index 1c54638..2607b92 100644 (file)
@@ -25,7 +25,7 @@
         <f:render section="Inspector" />
     </section>
 </div>
-<script type="text/javascript">
+<script>
     require(['{dynamicRequireJsModules.app}', '{dynamicRequireJsModules.mediator}', '{dynamicRequireJsModules.viewModel}'], function (formEditorApp, mediator, viewModel) {
         window.TYPO3.FORMEDITOR_APP = formEditorApp.getInstance(
             <f:format.htmlentitiesDecode>{formEditorAppInitialData}</f:format.htmlentitiesDecode>,
index 211b648..8543308 100644 (file)
@@ -2,7 +2,7 @@
 <f:layout name="FormManager" />
 <f:section name="MainContent">
 
-    <script type="text/javascript">
+    <script>
         require(['{dynamicRequireJsModules.app}', '{dynamicRequireJsModules.viewModel}'], function (formManagerApp, viewModel) {
             var FORMMANAGER_APP = formManagerApp.getInstance(
                 <f:format.htmlentitiesDecode>{formManagerAppInitialData}</f:format.htmlentitiesDecode>,
index c264045..3c709b6 100644 (file)
@@ -2907,8 +2907,11 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             : $this->additionalJavaScript;
         $additionalJavaScript = trim($additionalJavaScript);
         if ($jsCode !== '' || $additionalJavaScript !== '') {
+            $doctype = $controller->config['config']['doctype'] ?? 'html5';
+            $scriptAttribute = $doctype === 'html5' ? '' : ' type="text/javascript"';
+
             $this->additionalHeaderData['JSCode'] = '
-<script type="text/javascript">
+<script' . $scriptAttribute . '>
        /*<![CDATA[*/
 <!--
 ' . $additionalJavaScript . '
index f7052a8..4d09855 100644 (file)
@@ -247,6 +247,7 @@ class RequestHandler implements RequestHandlerInterface
         }
         // Part 2: DTD
         $doctype = $controller->config['config']['doctype'] ?? null;
+        $defaultTypeAttributeForJavaScript = 'text/javascript';
         if ($doctype) {
             switch ($doctype) {
                 case 'xhtml_trans':
@@ -275,6 +276,7 @@ class RequestHandler implements RequestHandlerInterface
     "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">';
                     break;
                 case 'html5':
+                    $defaultTypeAttributeForJavaScript = '';
                     $docTypeParts[] = '<!DOCTYPE html>';
                     if ($xmlDocument) {
                         $pageRenderer->setMetaCharsetTag('<meta charset="|" />');
@@ -294,6 +296,7 @@ class RequestHandler implements RequestHandlerInterface
             } else {
                 $pageRenderer->setMetaCharsetTag('<meta charset="|">');
             }
+            $defaultTypeAttributeForJavaScript = '';
         }
         if ($htmlLang) {
             if ($controller->xhtmlVersion) {
@@ -497,10 +500,7 @@ class RequestHandler implements RequestHandlerInterface
                     }
                     if ($ss) {
                         $jsFileConfig = &$controller->pSetup['includeJSLibs.'][$key . '.'];
-                        $type = $jsFileConfig['type'];
-                        if (!$type) {
-                            $type = 'text/javascript';
-                        }
+                        $type = $jsFileConfig['type'] ?? $defaultTypeAttributeForJavaScript;
                         $crossOrigin = $jsFileConfig['crossorigin'];
                         if (!$crossOrigin && $jsFileConfig['integrity'] && $jsFileConfig['external']) {
                             $crossOrigin = 'anonymous';
@@ -541,10 +541,7 @@ class RequestHandler implements RequestHandlerInterface
                     }
                     if ($ss) {
                         $jsFileConfig = &$controller->pSetup['includeJSFooterlibs.'][$key . '.'];
-                        $type = $jsFileConfig['type'];
-                        if (!$type) {
-                            $type = 'text/javascript';
-                        }
+                        $type = $jsFileConfig['type'] ?? $defaultTypeAttributeForJavaScript;
                         $crossorigin = $jsFileConfig['crossorigin'];
                         if (!$crossorigin && $jsFileConfig['integrity'] && $jsFileConfig['external']) {
                             $crossorigin = 'anonymous';
@@ -586,10 +583,7 @@ class RequestHandler implements RequestHandlerInterface
                     }
                     if ($ss) {
                         $jsConfig = &$controller->pSetup['includeJS.'][$key . '.'];
-                        $type = $jsConfig['type'];
-                        if (!$type) {
-                            $type = 'text/javascript';
-                        }
+                        $type = $jsConfig['type'] ?? $defaultTypeAttributeForJavaScript;
                         $crossorigin = $jsConfig['crossorigin'];
                         if (!$crossorigin && $jsConfig['integrity'] && $jsConfig['external']) {
                             $crossorigin = 'anonymous';
@@ -629,10 +623,7 @@ class RequestHandler implements RequestHandlerInterface
                     }
                     if ($ss) {
                         $jsConfig = &$controller->pSetup['includeJSFooter.'][$key . '.'];
-                        $type = $jsConfig['type'];
-                        if (!$type) {
-                            $type = 'text/javascript';
-                        }
+                        $type = $jsConfig['type'] ?? $defaultTypeAttributeForJavaScript;
                         $crossorigin = $jsConfig['crossorigin'];
                         if (!$crossorigin && $jsConfig['integrity'] && $jsConfig['external']) {
                             $crossorigin = 'anonymous';
@@ -802,7 +793,7 @@ class RequestHandler implements RequestHandlerInterface
                 $pageRenderer->addJsInlineCode('TS_inlineJSint', $inlineJSint, $controller->config['config']['compressJs']);
             }
             if (trim($scriptJsCode . $inlineJS)) {
-                $pageRenderer->addJsFile(GeneralUtility::writeJavaScriptContentToTemporaryFile($scriptJsCode . $inlineJS), 'text/javascript', $controller->config['config']['compressJs']);
+                $pageRenderer->addJsFile(GeneralUtility::writeJavaScriptContentToTemporaryFile($scriptJsCode . $inlineJS), $defaultTypeAttributeForJavaScript, $controller->config['config']['compressJs']);
             }
             if ($inlineFooterJs) {
                 $inlineFooterJSint = '';
@@ -810,7 +801,7 @@ class RequestHandler implements RequestHandlerInterface
                 if ($inlineFooterJSint) {
                     $pageRenderer->addJsFooterInlineCode('TS_inlineFooterJSint', $inlineFooterJSint, $controller->config['config']['compressJs']);
                 }
-                $pageRenderer->addJsFooterFile(GeneralUtility::writeJavaScriptContentToTemporaryFile($inlineFooterJs), 'text/javascript', $controller->config['config']['compressJs']);
+                $pageRenderer->addJsFooterFile(GeneralUtility::writeJavaScriptContentToTemporaryFile($inlineFooterJs), $defaultTypeAttributeForJavaScript, $controller->config['config']['compressJs']);
             }
         } else {
             // Include only inlineJS
index 174b0fc..4920202 100644 (file)
@@ -20,7 +20,7 @@
 
 
 
-<script src="typo3temp/assets/js/175aa1ef20.js?1340313498" type="text/javascript"></script>
+<script src="typo3temp/assets/js/175aa1ef20.js?1340313498"></script>
 
 
 <!--HD_679b52796e75d474ccbbed486b6837ab-->
index 2d9e650..074327b 100644 (file)
@@ -115,7 +115,7 @@ class TypoScriptConstantsViewHelper extends AbstractTagBasedViewHelper
             <div class="form-wizards-element">
                 <input class="form-control t3js-color-input formengine-colorpickerelement t3js-color-picker" type="text"
                   name="' . htmlspecialchars($elementName) . '" value="' . $this->tag->getAttribute('value') . '"/>
-                <script type="text/javascript">
+                <script>
                     require([\'TYPO3/CMS/Backend/ColorPicker\'], function(ColorPicker){ColorPicker.initialize()});
                 </script>
             </div>';
index 6ef74ff..3e01b61 100644 (file)
@@ -9,9 +9,9 @@
     <script>
         var __bust = '{bust}';
     </script>
-    <script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/RequireJSConfig.js')}?{bust}"></script>
-    <script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/Contrib/require.js', extensionName: 'Core')}?{bust}"></script>
-    <script type="text/javascript">
+    <script src="{f:uri.resource(path: 'JavaScript/RequireJSConfig.js')}?{bust}"></script>
+    <script src="{f:uri.resource(path: 'JavaScript/Contrib/require.js', extensionName: 'Core')}?{bust}"></script>
+    <script>
         require(['TYPO3/CMS/Install/Installer']);
     </script>
 </head>
index 9de8e15..5ae5b22 100644 (file)
@@ -10,9 +10,9 @@
         var TYPO3 = TYPO3 || {};
         var __bust = '{bust}';
     </script>
-    <script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/RequireJSConfig.js')}?{bust}"></script>
-    <script type="text/javascript" src="{f:uri.resource(path: 'JavaScript/Contrib/require.js', extensionName: 'Core')}?{bust}"></script>
-    <script type="text/javascript">
+    <script src="{f:uri.resource(path: 'JavaScript/RequireJSConfig.js')}?{bust}"></script>
+    <script src="{f:uri.resource(path: 'JavaScript/Contrib/require.js', extensionName: 'Core')}?{bust}"></script>
+    <script>
         require(['TYPO3/CMS/Install/Install']);
     </script>
 </head>
index 86375cb..5906464 100644 (file)
@@ -1877,7 +1877,7 @@ class DatabaseRecordList
         if ($renderPart === 'top') {
             // Add js to traverse a page select input to a pointer value
             $content = '
-<script type="text/javascript">
+<script>
 /*<![CDATA[*/
        function calculatePointer(page) {
                if (page > ' . $totalPages . ') {
index b1df98e..1e2625c 100644 (file)
@@ -1,7 +1,7 @@
 <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
             data-namespace-typo3-fluid="true">
 
-<script type="text/javascript">
+<script>
     function goToPage(formObject) {
         var formField = formObject.elements['paginator-target-page'];
         var url = formField.dataset.url;
index cd0b014..067bec8 100644 (file)
@@ -129,7 +129,7 @@ class TableGarbageCollectionAdditionalFieldProvider extends AbstractAdditionalFi
         // Add table drop down html
         $fieldHtml[] = '<select class="form-control" name="' . $fieldName . '"' . $disabled . ' id="' . $fieldId . '">' . implode(LF, $options) . '</select>';
         // Add js array for default 'number of days' values
-        $fieldHtml[] = '<script type="text/javascript">/*<![CDATA[*/<!--';
+        $fieldHtml[] = '<script>/*<![CDATA[*/<!--';
         $fieldHtml[] = 'var defaultNumberOfDays = ' . json_encode($this->defaultNumberOfDays) . ';';
         $fieldHtml[] = '// -->/*]]>*/</script>';
         $fieldConfiguration = [
index 22ddd3c..8b1526f 100644 (file)
@@ -4139,7 +4139,7 @@ The file definition must be a valid "resource" datatype, otherwise nothing is in
 
 Each file has optional properties:
 
-.type - setting the MIME type of the script (default: text/javascript)
+.type - setting the MIME type of the script (default: empty, set it to "text/javascript" for backwards-compatibility)
 
 .forceOnTop - boolean flag. If set, this file will be added on top of all other files.
 
index 3fe4dc9..c817e3a 100644 (file)
@@ -4,7 +4,7 @@
 <f:section name="main">
 
     <f:if condition="{performWorkspaceSwitch}">
-        <script type="text/javascript">
+        <script>
             top.TYPO3.ModuleMenu.App.refreshMenu();
             top.TYPO3.WorkspacesMenu.performWorkspaceSwitch({activeWorkspaceUid}, "{activeWorkspaceTitle}");
         </script>