[wp-trac] [WordPress Trac] #62345: Issue on Google Chrome with lazy=load images = sizes=auto + css width: fit-content
WordPress Trac
noreply at wordpress.org
Wed Nov 20 14:31:19 UTC 2024
#62345: Issue on Google Chrome with lazy=load images = sizes=auto + css width:
fit-content
--------------------------+-----------------------
Reporter: mosne | Owner: flixos90
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 6.7
Component: Editor | Version: 6.7
Severity: normal | Resolution: fixed
Keywords: has-patch | Focuses: css
--------------------------+-----------------------
Comment (by desrosj):
In [changeset:"59435" 59435]:
{{{
#!CommitTicketReference repository="" revision="59435"
Media: Avoid images with `sizes=auto` to be displayed downsized in
supporting browsers.
Based on the user agent stylesheet rules outlined in
https://html.spec.whatwg.org/multipage/rendering.html#img-contain-size,
images that have `sizes=auto` while applying `width: auto` or `width: fit-
content` would be constrained to only 300px width.
This changeset overrides said user agent stylesheet rule with a much
larger constraint, to avoid the problem.
Additionally, it introduces a filter `wp_img_tag_add_auto_sizes` which can
be used to opt out of the functionality, as an additional measure.
Reviewed by desrosj, joemcgill.
Merges [59415] to the 6.7 branch.
Props joemcgill, flixos90, dooperweb, SirLouen, azaozz, mukesh27, apermo.
Fixes #62413.
See #61847, #62345.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62345#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list