[wp-trac] [WordPress Trac] #56969: decoding="async" breaks my site

WordPress Trac noreply at wordpress.org
Tue Nov 8 20:18:58 UTC 2022


#56969: decoding="async" breaks my site
-------------------------------+------------------------------
 Reporter:  rodricus           |       Owner:  adamsilverstein
     Type:  defect (bug)       |      Status:  assigned
 Priority:  normal             |   Milestone:  6.1.1
Component:  Media              |     Version:  6.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  performance
-------------------------------+------------------------------

Comment (by flixos90):

 After further investigation with @adamsilverstein, we found what is
 probably the most straightforward and reliable fix here:
 * The lazy-loading implementation is slightly different most importantly
 in the sense that it also checks for `src="`, which means it'll only touch
 `img` tags that use regular double quotes, i.e. no single quotes or
 escaped double quotes.
 * This ensures it doesn't break any JS code where e.g. `img` tags may use
 other single quotes or escaped quotes.

 So the best fix for this bug would probably be to add a similar check
 before adding any `decoding` attribute: If there is no `src="` in the
 `img` tag, don't add the attribute. (If there is no `src` attribute, it's
 probably some special case that core shouldn't handle anyway.)

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


More information about the wp-trac mailing list