[wp-trac] [WordPress Trac] #56930: Block themes: improve omitting lazy-loading attribute on first content image/iframe

WordPress Trac noreply at wordpress.org
Mon Feb 13 18:32:54 UTC 2023


#56930: Block themes: improve omitting lazy-loading attribute on first content
image/iframe
-------------------------------------------------+-------------------------
 Reporter:  adamsilverstein                      |       Owner:  flixos90
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.2
Component:  Media                                |     Version:  5.9
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests has-        |     Focuses:
  testing-info commit                            |  performance
-------------------------------------------------+-------------------------
Changes (by flixos90):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"55318" 55318]:
 {{{
 #!CommitTicketReference repository="" revision="55318"
 Media: Enhance logic to determine LCP image in block themes and avoid
 lazy-loading it.

 [52065] originally introduced the logic to guess the LCP image based on
 certain heuristics and to not lazy-load that image. However, with the
 introduction of block themes, that logic was not functioning correctly,
 resulting in all featured images to be lazy-loaded, regardless of whether
 it was the LCP image or not.

 Together with an update to the `core/post-featured-image` block included
 in [55079], this changeset fixes the logic to correctly handle featured
 images in block themes as well.

 Additionally, in combination with an update to the `core/template-part`
 block from [55246], this changeset includes an enhancement which uses the
 benefits of block template parts to avoid lazy-loading images in the
 `header` block template part, making the lazy-loading heuristics even more
 accurate for sites using a block theme.

 Props flixos90, adamsilverstein, mamaduka, antonvlasenko, shahidul95,
 reduanmasud, costdev, mukesh27, ironprogrammer, manfcarlo,
 robinwpdeveloper, spacedmonkey.
 Fixes #56930.
 }}}

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


More information about the wp-trac mailing list