[wp-trac] [WordPress Trac] #53675: Omit lazy-loading attribute on first content image/iframe

WordPress Trac noreply at wordpress.org
Sun Jul 18 20:00:58 UTC 2021


#53675: Omit lazy-loading attribute on first content image/iframe
------------------------------------------+--------------------------
 Reporter:  flixos90                      |       Owner:  flixos90
     Type:  enhancement                   |      Status:  assigned
 Priority:  normal                        |   Milestone:  5.9
Component:  Media                         |     Version:  5.5
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  performance
------------------------------------------+--------------------------
Changes (by azaozz):

 * milestone:  Awaiting Review => 5.9


Comment:

 > lazy-loading elements above the fold can lead to slight regressions in
 the Largest Contentful Paint metric

 Sounds like something that needs to be fixed in the web browsers? They
 seem to be in a much better position to "see" (or guess) when an image or
 an iframe will be above the fold. Having said that, WP can also try to
 improve the situation until this is fixed in the browsers.

 > For reference, this Gist has the prototype plugin
 > ...
 > For the core implementation, we could e.g. introduce a filter to allow
 modification.

 Right. The Gist looks good but seems the code in core will be quite
 different once implemented.

 > Usually a lot of plugins create widget with iframes...

 Yes, but thinking these plugins should be adding the `loading` attribute
 to their HTML themselves. Such plugins can usually detect when a widget is
 at the top, in the sidebar, or in the footer.

 Lets look at this during 5.9.

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


More information about the wp-trac mailing list