[wp-trac] [WordPress Trac] #53232: Add async decoding attribute as default to the HTML image tags generated by WordPress

WordPress Trac noreply at wordpress.org
Fri May 21 07:11:25 UTC 2021


#53232: Add async decoding attribute as default to the HTML image tags generated by
WordPress
-----------------------------+------------------------------
 Reporter:  isaumya          |       Owner:  (none)
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Media            |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:  performance
-----------------------------+------------------------------

Comment (by isaumya):

 You are absolutely right @westonruter. Haha! It's funny, I also asked in
 the Slack core channel if anyone has a trac ticket open about
 `decoding="async"` and no one replied to me. So, I thought, let's open
 one, and if there is already an existing ticket about this, at most it
 will get closed/merged with that ticket. I even
 [https://twitter.com/iSaumya/status/1395101913159323650 tweeted about it].

 > I'm not clear on the specifics of the legacy reasons. I think it may
 have to do with if you try to load an image with JavaScript and then try
 to access its pixels. With async decoding, you then have to use the decode
 method to get a promise for when it is decoded.

 I think you are right. But this still should be the default, as there is
 no easy way to add it to Gutenberg generated images as I stated above.

 > I'm not clear on the specifics of the legacy reasons. I think it may
 have to do with if you try to load an image with JavaScript and then try
 to access its pixels. With async decoding, you then have to use the decode
 method to get a promise for when it is decoded.

 I think it would be beneficial even if there is a single image and no
 `srcset` and a single image url. Don't you think?

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


More information about the wp-trac mailing list