[wp-trac] [WordPress Trac] #52139: Twenty Twenty-One: Skip loading attribute on featured image instead of loading=eager
WordPress Trac
noreply at wordpress.org
Mon Dec 21 17:38:18 UTC 2020
#52139: Twenty Twenty-One: Skip loading attribute on featured image instead of
loading=eager
---------------------------+-----------------------
Reporter: flixos90 | Owner: flixos90
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.6.1
Component: Bundled Theme | Version: 5.6
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
---------------------------+-----------------------
Comment (by ryelle):
The reasoning for not adding `loading="eager"` [https://web.dev/browser-
level-lazy-loading-for-cmss/#allow-per-element-modifications described
here] makes sense to me.
> While using `loading="eager"` is a supported alternative, this would
tell the browser explicitly to always load the image right away, which
would prevent potential benefits if browsers implemented further
mechanisms and heuristics to automatically decide which elements to lazy-
load.
While `eager` is the default value for `loading`, explicitly setting it
communicates something to the browser that might block future performance
benefits.
Setting `loading` to `false` removes the lazy-loading from the image,
which should prevent any layout shift.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52139#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list