[wp-trac] [WordPress Trac] #51837: Adding `add_theme_support` for html5 for scripts, does not remove the type attribute from `wp-emoji-release.min.js`

WordPress Trac noreply at wordpress.org
Sun Nov 22 23:17:52 UTC 2020


#51837: Adding `add_theme_support` for html5 for scripts, does not remove the type
attribute from `wp-emoji-release.min.js`
---------------------------+------------------------------
 Reporter:  kanlukasz      |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:  5.3
 Severity:  normal         |  Resolution:
 Keywords:  needs-patch    |     Focuses:
---------------------------+------------------------------
Changes (by peterwilsoncc):

 * version:  5.5.3 => 5.3


Comment:

 Hello @kanlukasz and welcome to trac!

 I've been able to confirm the report, the script is loaded using
 JavaScript in `emoji-loader.js` and the theme support setting is not
 passed to the JavaScript to determine if the type attribute should be
 included.


 From [https://github.com/WordPress/wordpress-
 develop/blob/master/src/js/_enqueues/lib/emoji-loader.js#L153-L159
 /src/js/_enqueues/lib/emoji-loader.js]:
 {{{#!js
 function addScript( src ) {
         var script = document.createElement( 'script' );

         script.src = src;
         script.defer = script.type = 'text/javascript';
         document.getElementsByTagName( 'head' )[0].appendChild( script );
 }
 }}}

 At a quick glance the same issue applies to `src/js/_enqueues/lib/zxcvbn-
 async.js` if it's loaded on the front-end of a site. Some external
 libraries may include the `type` too but unfortunately they are out of
 WordPress's control.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51837#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list