Skip to content

Test naturalWidth for sizes=auto images with object-fit - #65706

Closed
flowgrow wants to merge 1 commit into
web-platform-tests:masterfrom
flowgrow:test-auto-sizes-object-fit-natural-width
Closed

flowgrow wants to merge 1 commit into
web-platform-tests:masterfrom
flowgrow:test-auto-sizes-object-fit-natural-width

Conversation

@flowgrow

Copy link
Copy Markdown

Add four tentative testharness cases for lazy sizes=auto images with width and height attributes in a square CSS box. A single width-descriptor candidate makes the density-corrected naturalWidth observable independently of candidate choice and device pixel ratio.

Chrome 158.0.8127.37 and Playwright Firefox 159.0 passed two cases locally. Both returned 20 CSS pixels for landscape cover (expected 40) and portrait contain (expected 10). Chrome Canary 160.0.8183.0 passed all four with SrcsetTwoDimensionalSizes enabled.

Related to Chromium 572724710 and whatwg/html#13053.

@flowgrow

Copy link
Copy Markdown
Author

Closing this PR because the existing two-dimensional sizes=auto WPT already covers the object-fit candidate-selection behavior that prompted it. This PR measures naturalWidth directly, but the underlying implementation work is already tracked in Chromium issue 572724710.

@flowgrow flowgrow closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants