? Pending

User tests: Successful: Unsuccessful:

avatar iamrobert
iamrobert
30 Jun 2020

If scripts have type='text/javascript' in it - it triggers a warning in html5 validation:

Warning: The type attribute is unnecessary for JavaScript resources.

In our templates we can set $doc->setHtml5(true) to remove type='text/javascript' from script.
But in the email.php its hard coded - so it doesn't seem to work.

Is there away to do this?

Pull Request for Issue # .

Summary of Changes

Remove type='text/javascript' to pass html5 validation

Testing Instructions

Actual result BEFORE applying this Pull Request

<script type='text/javascript'> ### Expected result AFTER applying this Pull Request <script> ### Documentation Changes Required
avatar iamrobert iamrobert - open - 30 Jun 2020
avatar iamrobert iamrobert - change - 30 Jun 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 Jun 2020
Category Libraries
avatar iamrobert iamrobert - change - 30 Jun 2020
Labels Added: ?
avatar SharkyKZ
SharkyKZ - comment - 30 Jun 2020

We shouldn't change this in J3 because non-HTML5 documents are supported. Or at least this should be conditional based on document type. Personally, I wouldn't bother with this. This doesn't causes any issues and is already fixed in J4.

avatar mbabker
mbabker - comment - 4 Jul 2020

This doesn't work efficiently, that's why it is honestly better to just leave it alone for 3.x.

Unless you have a system plugin calling $doc->setHtml5(true); very early in the process, these HTML helpers are still going to print the HTML4 compatible syntax. Your template's index.php file is not actually executed until after components are processed but before modules are processed, so setting the mode in the template makes no difference.

This should just be closed. Yes, it generates an annoying warning in an HTML5 validator because HTML5 allows you to omit attributes where the value matches the default in some circumstances, but it is not breaking any functionality to keep it.

BTW, to properly fix this and other potential mixed HTML4/HTML5/XHTML issues so that all locations "respect" the template option, you would have to rewrite Joomla's execution cycle to allow the template to make system changes much sooner in the process. That is quite a major change just to silence a type attribute on <script> tags.

avatar Quy
Quy - comment - 4 Jul 2020

Closing for stated reason. Thanks.

avatar Quy Quy - change - 4 Jul 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-07-04 18:05:06
Closed_By Quy
avatar Quy Quy - close - 4 Jul 2020

Add a Comment

Login with GitHub to post a comment