Feature #88772

Omit type=text/javascript in HTML5 script tags

Added by Benni Mack 2 months ago. Updated 9 days ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Miscellaneous
Target version:
-
Start date:
2019-07-15
Due date:
% Done:

100%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Related issues

Related to TYPO3 Core - Bug #45512: Make the type attribute optional on script, style and link elements Accepted 2013-02-15

Associated revisions

Revision 327fdc1b (diff)
Added by Benni Mack 2 months ago

[!!!][FEATURE] Omit type=text/javascript in HTML5 script tags

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 <>
Reviewed-by: Georg Ringer <>
Reviewed-by: Oliver Klee <>
Reviewed-by: Andreas Fernandez <>
Reviewed-by: Oliver Hader <>
Tested-by: TYPO3com <>
Tested-by: Georg Ringer <>
Tested-by: Oliver Hader <>

History

#1 Updated by Gerrit Code Review 2 months ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61300

#2 Updated by Riccardo De Contardi 2 months ago

  • Related to Bug #45512: Make the type attribute optional on script, style and link elements added

#3 Updated by Gerrit Code Review 2 months ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61300

#4 Updated by Gerrit Code Review 2 months ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61300

#5 Updated by Benni Mack 2 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#6 Updated by Benni Mack about 2 months ago

  • Status changed from Resolved to Closed

#7 Updated by Martin Weymayer 9 days ago

... not working in 9.5.9! Still output type="text/javascript"

#8 Updated by Benni Mack 9 days ago

Hey Martin,

thank you for your feedback. This change was only added to TYPO3 v10.0 - as this is a breaking change (= modifies Frontend output) it is not possible by Core to add this to TYPO3 v9. However, I consider it would be possible to create an extension that solves this issue also for TYPO3 v9.

All the best,
Benni.

Also available in: Atom PDF