Project

General

Profile

Actions

Bug #45512

closed

Make the type attribute optional on script, style and link elements

Added by Ian Devlin about 11 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2013-02-15
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

With HTML5, the type attribute is no longer required on script, style and link[rel="stylesheet"] elements, as they automatically default to "text/javascript" and "text/css" (x2) respectively.

It should be possible to configure this via TypoScript.


Related issues 8 (0 open8 closed)

Related to TYPO3 Core - Feature #47857: Delete adding type="text/javascript" if doctype is HTML5ClosedPatrick Broens2013-05-03

Actions
Related to TYPO3 Core - Feature #11287: Fluid section for header codeClosed2010-12-05

Actions
Related to TYPO3 Core - Task #83633: The type attribute is unnecessary for JavaScript resources.Closed2018-01-22

Actions
Related to TYPO3 Core - Bug #85053: Page Validation WarningClosed2018-05-21

Actions
Related to TYPO3 Core - Feature #86759: nomodule attribute on script tagClosed2018-10-26

Actions
Related to TYPO3 Core - Bug #88316: Do not set type attribute by default in script tag for page.includeJS (HTML5 compliance)Closed2019-05-09

Actions
Related to TYPO3 Core - Feature #88772: Omit type=text/javascript in HTML5 script tagsClosedBenni Mack2019-07-15

Actions
Related to TYPO3 Core - Bug #92126: Still <script type="text/javascript" ... hardcoded in PageRenderer.php -> leads to validity warningClosed2020-08-28

Actions
Actions #1

Updated by Patrick Broens about 11 years ago

  • Complexity set to easy

This can simply be checked by using config.doctype = html5. We have to be aware that "type" can be set to a different value. I agree it can be removed when it is using the default value of text/javascript. Same for link tag and the style attribute.

Actions #2

Updated by Mathias Schreiber over 9 years ago

  • Target version set to 7.2 (Frontend)
  • Is Regression set to No
Actions #3

Updated by Benni Mack almost 9 years ago

  • Target version changed from 7.2 (Frontend) to 7.4 (Backend)
Actions #4

Updated by Susanne Moog over 8 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #5

Updated by Benni Mack over 8 years ago

  • Target version changed from 7.5 to 7 LTS
Actions #6

Updated by Mathias Schreiber over 8 years ago

  • Target version deleted (7 LTS)
Actions #7

Updated by Riccardo De Contardi over 8 years ago

  • Status changed from New to Accepted
Actions #8

Updated by Gerrit Code Review over 7 years ago

  • Status changed from Accepted to Under Review

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

Actions #9

Updated by Gerrit Code Review over 7 years ago

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/49500

Actions #10

Updated by David Bruchmann over 6 years ago

Even not required after this issue is solved the type for javascript is now "application/javascript" and "text/javascript" is obsolet.

Actions #11

Updated by Oliver Hader over 6 years ago

  • Category changed from 1050 to Frontend
Actions #12

Updated by Wittkiel Gruppe over 6 years ago

Would be nice for 8 and 9 LTS, because since ~December 2017 W3C-Validator shows a warning, for example:

Warning: The type attribute is unnecessary for JavaScript resources.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js" type="text/javascript"></script>

See https://github.com/validator/validator/issues/560

Actions #13

Updated by Riccardo De Contardi over 6 years ago

  • Related to Task #83633: The type attribute is unnecessary for JavaScript resources. added
Actions #14

Updated by Riccardo De Contardi about 6 years ago

I add here my two cents:

I wonder if it would be better to remove the attribute at all instead of making it optional with a condition on doctype, and let people add it explicitly; something similar to the "meta" (https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Meta/Index.html#meta) like:

includeJS {
  file1 = fileadmin/helloworld.js
  file1.attribute.type = text/javascript
}
Actions #15

Updated by Riccardo De Contardi almost 6 years ago

  • Related to Bug #85053: Page Validation Warning added
Actions #16

Updated by Martin Weymayer over 5 years ago

  • TYPO3 Version changed from 6.0 to 9

seems this "bug" is in 9.5??

Actions #17

Updated by Susanne Moog about 5 years ago

  • Status changed from Under Review to Accepted

Review was abandoned.

Actions #18

Updated by Benni Mack about 5 years ago

We need the attribute, to also do stuff like "type=module" https://caniuse.com/#feat=es6-module

Actions #19

Updated by Benni Mack about 5 years ago

Actions #20

Updated by Riccardo De Contardi almost 5 years ago

  • Related to Bug #88316: Do not set type attribute by default in script tag for page.includeJS (HTML5 compliance) added
Actions #21

Updated by Riccardo De Contardi almost 5 years ago

  • Related to Feature #88772: Omit type=text/javascript in HTML5 script tags added
Actions #22

Updated by Georg Ringer over 4 years ago

  • Status changed from Accepted to Closed

resolved with #88772 therefore I am closing this issue

Actions #23

Updated by Riccardo De Contardi over 4 years ago

  • Status changed from Closed to Accepted

I re-open this one; the part about style and link tags are still missing

Actions #24

Updated by Gerrit Code Review over 3 years ago

  • Status changed from Accepted to Under Review

Patch set 1 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/+/65548

Actions #25

Updated by Gerrit Code Review over 3 years ago

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/+/65548

Actions #26

Updated by Gerrit Code Review over 3 years 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/+/65548

Actions #27

Updated by Gerrit Code Review over 3 years 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/+/65548

Actions #28

Updated by Riccardo De Contardi over 3 years ago

  • Related to Bug #92126: Still <script type="text/javascript" ... hardcoded in PageRenderer.php -> leads to validity warning added
Actions #29

Updated by Gerrit Code Review over 3 years ago

Patch set 5 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/+/65548

Actions #30

Updated by Gerrit Code Review over 3 years ago

Patch set 6 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/+/65548

Actions #31

Updated by Gerrit Code Review over 3 years ago

Patch set 7 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/+/65548

Actions #32

Updated by Gerrit Code Review over 3 years ago

Patch set 8 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/+/65548

Actions #33

Updated by Benni Mack over 3 years ago

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

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF