Repository navigation
Use the dimension attribute aspect ratio for srcset source selection - #64084
Merged
Merged
Conversation
Third part of whatwg/html#13053, behind the `SrcsetTwoDimensionalSizes` runtime flag. For srcset candidates without an `h` descriptor, use the dimension attribute aspect ratio (from the `width`/`height` attributes of the `<img>`, or of the `<source>` when it has one of them) as the source aspect ratio when computing the source concrete width for a two-dimensional size. This is also applied in the preload scanner. Since these attributes now affect source selection, changing them on an `<img>` or a previous sibling `<source>` is a relevant mutation, so re-run source selection. To keep that re-selection side-effect free when the selected URL did not change, `SelectSourceURL()` now only resets the layout disposition when it actually updates the image loader. Bug: 572724710 Change-Id: I2317a0b452ef8f0ca2438c41d8574312d19b9135 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8563321 Reviewed-by: Stefan Zager <szager@chromium.org> Commit-Queue: Noam Rosenthal <nrosenthal@google.com> Cr-Commit-Position: refs/heads/main@{#1724591}
wpt-pr-bot
approved these changes
Oct 23, 2026
wpt-pr-bot
left a comment
Collaborator
There was a problem hiding this comment.
The review process for this patch is being conducted in the Chromium project.
Contributor
|
Retrying due to transient GitHub Actions artifact download failure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third part of whatwg/html#13053, behind the
SrcsetTwoDimensionalSizesruntime flag.For srcset candidates without an
hdescriptor, use the dimensionattribute aspect ratio (from the
width/heightattributes of the\<img>, or of the\<source>when it has one of them) as the sourceaspect ratio when computing the source concrete width for a
two-dimensional size. This is also applied in the preload scanner.
Since these attributes now affect source selection, changing them on an
\<img>or a previous sibling\<source>is a relevant mutation, so re-runsource selection. To keep that re-selection side-effect free when the
selected URL did not change,
SelectSourceURL()now only resets thelayout disposition when it actually updates the image loader.
Bug: 572724710
Change-Id: I2317a0b452ef8f0ca2438c41d8574312d19b9135
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8563321
Reviewed-by: Stefan Zager <szager@chromium.org>
Commit-Queue: Noam Rosenthal <nrosenthal@google.com>
Cr-Commit-Position: refs/heads/main@{#1724591}