Repository navigation
Conversation
beckysiegel
pushed a commit
to chromium/chromium
that referenced
this pull request
Oct 16, 2026
Implements the parsing parts of whatwg/html#13053 behind the `SrcsetTwoDimensionalSizes` runtime flag: - Represent a resolved source size as a `TargetBoxSize` (`width`, optional `height`, and `object_fit`), and thread it through `SizesAttributeParser`, `HTMLImageElement::SourceSize()`, the preload scanner and `BestFitSource*`. One-dimensional sizes populate only `width`, so this is a no-op refactor for existing behavior. - Parse the `<positive-integer>h` height descriptor in `srcset` when paired with a `w` descriptor, and compute each candidate's source concrete width from the `TargetBoxSize` and the candidate's aspect ratio when fitting with `contain` or `cover`. - Parse the explicit `[contain | cover] <length> <length>` source size syntax in `sizes`. Making `sizes="auto"` two-dimensional (using the box height and computed `object-fit`), and using the `width`/`height` attributes as a default aspect ratio for candidates without an `h` descriptor, are implemented in follow-up CLs. Bug: 572724710 Change-Id: I17fd93318d0955fbb3d6ce8aed7d085174671ddd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8559899 Reviewed-by: Stefan Zager <szager@chromium.org> Commit-Queue: Noam Rosenthal <nrosenthal@google.com> Cr-Commit-Position: refs/heads/main@{#1720204}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Oct 16, 2026
Implements the parsing parts of whatwg/html#13053 behind the `SrcsetTwoDimensionalSizes` runtime flag: - Represent a resolved source size as a `TargetBoxSize` (`width`, optional `height`, and `object_fit`), and thread it through `SizesAttributeParser`, `HTMLImageElement::SourceSize()`, the preload scanner and `BestFitSource*`. One-dimensional sizes populate only `width`, so this is a no-op refactor for existing behavior. - Parse the `<positive-integer>h` height descriptor in `srcset` when paired with a `w` descriptor, and compute each candidate's source concrete width from the `TargetBoxSize` and the candidate's aspect ratio when fitting with `contain` or `cover`. - Parse the explicit `[contain | cover] <length> <length>` source size syntax in `sizes`. Making `sizes="auto"` two-dimensional (using the box height and computed `object-fit`), and using the `width`/`height` attributes as a default aspect ratio for candidates without an `h` descriptor, are implemented in follow-up CLs. Bug: 572724710 Change-Id: I17fd93318d0955fbb3d6ce8aed7d085174671ddd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8559899 Reviewed-by: Stefan Zager <szager@chromium.org> Commit-Queue: Noam Rosenthal <nrosenthal@google.com> Cr-Commit-Position: refs/heads/main@{#1720204}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Oct 16, 2026
Implements the parsing parts of whatwg/html#13053 behind the `SrcsetTwoDimensionalSizes` runtime flag: - Represent a resolved source size as a `TargetBoxSize` (`width`, optional `height`, and `object_fit`), and thread it through `SizesAttributeParser`, `HTMLImageElement::SourceSize()`, the preload scanner and `BestFitSource*`. One-dimensional sizes populate only `width`, so this is a no-op refactor for existing behavior. - Parse the `<positive-integer>h` height descriptor in `srcset` when paired with a `w` descriptor, and compute each candidate's source concrete width from the `TargetBoxSize` and the candidate's aspect ratio when fitting with `contain` or `cover`. - Parse the explicit `[contain | cover] <length> <length>` source size syntax in `sizes`. Making `sizes="auto"` two-dimensional (using the box height and computed `object-fit`), and using the `width`/`height` attributes as a default aspect ratio for candidates without an `h` descriptor, are implemented in follow-up CLs. Bug: 572724710 Change-Id: I17fd93318d0955fbb3d6ce8aed7d085174671ddd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8559899 Reviewed-by: Stefan Zager <szager@chromium.org> Commit-Queue: Noam Rosenthal <nrosenthal@google.com> Cr-Commit-Position: refs/heads/main@{#1720204}
brave-builds
pushed a commit
to brave/chromium
that referenced
this pull request
Oct 20, 2026
Second part of whatwg/html#13053, behind the `SrcsetTwoDimensionalSizes` runtime flag. When `sizes="auto"` is used, resolve it to the layout box's width and height together with the computed `object-fit`, so that the source concrete width of candidates with an `h` descriptor accounts for how the image is fit into the box. The last auto-sizes size (used when the image is not being rendered) stores the full `TargetBoxSize`. A change to the computed `object-fit` of a lazy-loaded `sizes="auto"` image is a relevant mutation, so re-run source selection (in a task, as this is detected during style recalc). Using the `width`/`height` attributes as a default aspect ratio for candidates without an `h` descriptor is implemented in a follow-up CL. Bug: 572724710 Change-Id: Ie4ce4feffc447102862fea230ba852ecdcc9dc3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8563320 Commit-Queue: Noam Rosenthal <nrosenthal@google.com> Reviewed-by: Stefan Zager <szager@chromium.org> Cr-Commit-Position: refs/heads/main@{#1722995}
beckysiegel
pushed a commit
to chromium/chromium
that referenced
this pull request
Oct 22, 2026
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}
noamr
marked this pull request as ready for review
October 22, 2026 10:41
noamr
force-pushed
the
noamr/srcset-2d
branch
from
October 22, 2026 11:04
e1b89d1 to
9d50862
Compare
zcorpan
added a commit
to whatwg/spec-ai
that referenced
this pull request
Oct 22, 2026
Distill generalizable review patterns from the multi-round reviews of whatwg/html#13053 and whatwg/html#12758 into the html-spec-review skill: * Reactivity and mutation-hook parity. * Re-validating DOM invariants after author script can run. * Auditing shared parser algorithms across all parser contexts. * CSS syntax and HTML microsyntax boundaries. * Keeping notes, PR descriptions, and tests in sync after review fixes. * WPT tests that mask failures, can't fail, or stall. Also require span markup for continue and break in algorithm steps. Add matching static checks: * ALGO-LOOP-CONTROL-SPAN flags bare "continue." or "break." in algorithm blocks. * WPT-EARLY-SCRIPT-CLOSE flags a literal </script> inside a JS comment or string literal in an inline script of an HTML test file, since it closes the script element early. * WPT-UNGUARDED-TYPEERROR flags TypeError assertions on methods added in a spec diff when the test file doesn't check that the method exists, since calling an unimplemented method also throws TypeError. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Simon Pieters <zcorpan@gmail.com>
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Oct 23, 2026
Second part of whatwg/html#13053, behind the `SrcsetTwoDimensionalSizes` runtime flag. When `sizes="auto"` is used, resolve it to the layout box's width and height together with the computed `object-fit`, so that the source concrete width of candidates with an `h` descriptor accounts for how the image is fit into the box. The last auto-sizes size (used when the image is not being rendered) stores the full `TargetBoxSize`. A change to the computed `object-fit` of a lazy-loaded `sizes="auto"` image is a relevant mutation, so re-run source selection (in a task, as this is detected during style recalc). Using the `width`/`height` attributes as a default aspect ratio for candidates without an `h` descriptor is implemented in a follow-up CL. Bug: 572724710 Change-Id: Ie4ce4feffc447102862fea230ba852ecdcc9dc3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8563320 Commit-Queue: Noam Rosenthal <nrosenthal@google.com> Reviewed-by: Stefan Zager <szager@chromium.org> Cr-Commit-Position: refs/heads/main@{#1722995}
LunaStev
pushed a commit
to wavefnd-labs/blink
that referenced
this pull request
Oct 27, 2026
Implements the parsing parts of whatwg/html#13053 behind the `SrcsetTwoDimensionalSizes` runtime flag: - Represent a resolved source size as a `TargetBoxSize` (`width`, optional `height`, and `object_fit`), and thread it through `SizesAttributeParser`, `HTMLImageElement::SourceSize()`, the preload scanner and `BestFitSource*`. One-dimensional sizes populate only `width`, so this is a no-op refactor for existing behavior. - Parse the `<positive-integer>h` height descriptor in `srcset` when paired with a `w` descriptor, and compute each candidate's source concrete width from the `TargetBoxSize` and the candidate's aspect ratio when fitting with `contain` or `cover`. - Parse the explicit `[contain | cover] <length> <length>` source size syntax in `sizes`. Making `sizes="auto"` two-dimensional (using the box height and computed `object-fit`), and using the `width`/`height` attributes as a default aspect ratio for candidates without an `h` descriptor, are implemented in follow-up CLs. Bug: 572724710 Change-Id: I17fd93318d0955fbb3d6ce8aed7d085174671ddd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8559899 Reviewed-by: Stefan Zager <szager@chromium.org> Commit-Queue: Noam Rosenthal <nrosenthal@google.com> Cr-Commit-Position: refs/heads/main@{#1720204}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Oct 27, 2026
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}
This was referenced Nov 2, 2026
lando-worker Bot
pushed a commit
to mozilla-firefox/firefox
that referenced
this pull request
Nov 4, 2026
…dimensional sizes, a=testonly Automatic update from web-platform-tests Implement srcset 'h' descriptor and two-dimensional sizes Implements the parsing parts of whatwg/html#13053 behind the `SrcsetTwoDimensionalSizes` runtime flag: - Represent a resolved source size as a `TargetBoxSize` (`width`, optional `height`, and `object_fit`), and thread it through `SizesAttributeParser`, `HTMLImageElement::SourceSize()`, the preload scanner and `BestFitSource*`. One-dimensional sizes populate only `width`, so this is a no-op refactor for existing behavior. - Parse the `<positive-integer>h` height descriptor in `srcset` when paired with a `w` descriptor, and compute each candidate's source concrete width from the `TargetBoxSize` and the candidate's aspect ratio when fitting with `contain` or `cover`. - Parse the explicit `[contain | cover] <length> <length>` source size syntax in `sizes`. Making `sizes="auto"` two-dimensional (using the box height and computed `object-fit`), and using the `width`/`height` attributes as a default aspect ratio for candidates without an `h` descriptor, are implemented in follow-up CLs. Bug: 572724710 Change-Id: I17fd93318d0955fbb3d6ce8aed7d085174671ddd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8559899 Reviewed-by: Stefan Zager <szager@chromium.org> Commit-Queue: Noam Rosenthal <nrosenthal@google.com> Cr-Commit-Position: refs/heads/main@{#1720204} -- wpt-commits: d2727a54348e2af3f8fc7cbdfd4956d75927c938 wpt-pr: 63737
noamr
force-pushed
the
noamr/srcset-2d
branch
from
November 4, 2026 12:03
276c408 to
5949382
Compare
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Nov 4, 2026
…dimensional sizes, a=testonly Automatic update from web-platform-tests Implement srcset 'h' descriptor and two-dimensional sizes Implements the parsing parts of whatwg/html#13053 behind the `SrcsetTwoDimensionalSizes` runtime flag: - Represent a resolved source size as a `TargetBoxSize` (`width`, optional `height`, and `object_fit`), and thread it through `SizesAttributeParser`, `HTMLImageElement::SourceSize()`, the preload scanner and `BestFitSource*`. One-dimensional sizes populate only `width`, so this is a no-op refactor for existing behavior. - Parse the `<positive-integer>h` height descriptor in `srcset` when paired with a `w` descriptor, and compute each candidate's source concrete width from the `TargetBoxSize` and the candidate's aspect ratio when fitting with `contain` or `cover`. - Parse the explicit `[contain | cover] <length> <length>` source size syntax in `sizes`. Making `sizes="auto"` two-dimensional (using the box height and computed `object-fit`), and using the `width`/`height` attributes as a default aspect ratio for candidates without an `h` descriptor, are implemented in follow-up CLs. Bug: 572724710 Change-Id: I17fd93318d0955fbb3d6ce8aed7d085174671ddd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8559899 Reviewed-by: Stefan Zager <szagerchromium.org> Commit-Queue: Noam Rosenthal <nrosenthalgoogle.com> Cr-Commit-Position: refs/heads/main{#1720204} -- wpt-commits: d2727a54348e2af3f8fc7cbdfd4956d75927c938 wpt-pr: 63737 UltraBlame original commit: 0c74713bdbf7630f551e353ba718aa0734d8faaa
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Nov 4, 2026
…dimensional sizes, a=testonly Automatic update from web-platform-tests Implement srcset 'h' descriptor and two-dimensional sizes Implements the parsing parts of whatwg/html#13053 behind the `SrcsetTwoDimensionalSizes` runtime flag: - Represent a resolved source size as a `TargetBoxSize` (`width`, optional `height`, and `object_fit`), and thread it through `SizesAttributeParser`, `HTMLImageElement::SourceSize()`, the preload scanner and `BestFitSource*`. One-dimensional sizes populate only `width`, so this is a no-op refactor for existing behavior. - Parse the `<positive-integer>h` height descriptor in `srcset` when paired with a `w` descriptor, and compute each candidate's source concrete width from the `TargetBoxSize` and the candidate's aspect ratio when fitting with `contain` or `cover`. - Parse the explicit `[contain | cover] <length> <length>` source size syntax in `sizes`. Making `sizes="auto"` two-dimensional (using the box height and computed `object-fit`), and using the `width`/`height` attributes as a default aspect ratio for candidates without an `h` descriptor, are implemented in follow-up CLs. Bug: 572724710 Change-Id: I17fd93318d0955fbb3d6ce8aed7d085174671ddd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8559899 Reviewed-by: Stefan Zager <szagerchromium.org> Commit-Queue: Noam Rosenthal <nrosenthalgoogle.com> Cr-Commit-Position: refs/heads/main{#1720204} -- wpt-commits: d2727a54348e2af3f8fc7cbdfd4956d75927c938 wpt-pr: 63737 UltraBlame original commit: 0c74713bdbf7630f551e353ba718aa0734d8faaa
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Nov 4, 2026
…dimensional sizes, a=testonly Automatic update from web-platform-tests Implement srcset 'h' descriptor and two-dimensional sizes Implements the parsing parts of whatwg/html#13053 behind the `SrcsetTwoDimensionalSizes` runtime flag: - Represent a resolved source size as a `TargetBoxSize` (`width`, optional `height`, and `object_fit`), and thread it through `SizesAttributeParser`, `HTMLImageElement::SourceSize()`, the preload scanner and `BestFitSource*`. One-dimensional sizes populate only `width`, so this is a no-op refactor for existing behavior. - Parse the `<positive-integer>h` height descriptor in `srcset` when paired with a `w` descriptor, and compute each candidate's source concrete width from the `TargetBoxSize` and the candidate's aspect ratio when fitting with `contain` or `cover`. - Parse the explicit `[contain | cover] <length> <length>` source size syntax in `sizes`. Making `sizes="auto"` two-dimensional (using the box height and computed `object-fit`), and using the `width`/`height` attributes as a default aspect ratio for candidates without an `h` descriptor, are implemented in follow-up CLs. Bug: 572724710 Change-Id: I17fd93318d0955fbb3d6ce8aed7d085174671ddd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8559899 Reviewed-by: Stefan Zager <szagerchromium.org> Commit-Queue: Noam Rosenthal <nrosenthalgoogle.com> Cr-Commit-Position: refs/heads/main{#1720204} -- wpt-commits: d2727a54348e2af3f8fc7cbdfd4956d75927c938 wpt-pr: 63737 UltraBlame original commit: 0c74713bdbf7630f551e353ba718aa0734d8faaa
noamr
force-pushed
the
noamr/srcset-2d
branch
2 times, most recently
from
November 5, 2026 16:07
5949382 to
43d1ce7
Compare
lando-worker Bot
pushed a commit
to mozilla-firefox/firefox
that referenced
this pull request
Nov 6, 2026
…tonly Automatic update from web-platform-tests Make sizes="auto" two-dimensional Second part of whatwg/html#13053, behind the `SrcsetTwoDimensionalSizes` runtime flag. When `sizes="auto"` is used, resolve it to the layout box's width and height together with the computed `object-fit`, so that the source concrete width of candidates with an `h` descriptor accounts for how the image is fit into the box. The last auto-sizes size (used when the image is not being rendered) stores the full `TargetBoxSize`. A change to the computed `object-fit` of a lazy-loaded `sizes="auto"` image is a relevant mutation, so re-run source selection (in a task, as this is detected during style recalc). Using the `width`/`height` attributes as a default aspect ratio for candidates without an `h` descriptor is implemented in a follow-up CL. Bug: 572724710 Change-Id: Ie4ce4feffc447102862fea230ba852ecdcc9dc3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8563320 Commit-Queue: Noam Rosenthal <nrosenthal@google.com> Reviewed-by: Stefan Zager <szager@chromium.org> Cr-Commit-Position: refs/heads/main@{#1722995} -- wpt-commits: 080cafcc9fdc08e314a3949bcbe6bb5edc5b6b6d wpt-pr: 64058
…a sizes attribute
…s, and algorithm phrasing
Contributor
Author
Open questionsTwo pre-existing
Findings and fixesSpecification (
|
lando-worker Bot
pushed a commit
to mozilla-firefox/firefox
that referenced
this pull request
Nov 11, 2026
… for srcset source selection, a=testonly Automatic update from web-platform-tests Use the dimension attribute aspect ratio for srcset source selection 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-commits: 41a91b97e0ee996c8d9e6f9ac9beda5f014ab7cf wpt-pr: 64084
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Nov 11, 2026
… for srcset source selection, a=testonly Automatic update from web-platform-tests Use the dimension attribute aspect ratio for srcset source selection 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 <szagerchromium.org> Commit-Queue: Noam Rosenthal <nrosenthalgoogle.com> Cr-Commit-Position: refs/heads/main{#1724591} -- wpt-commits: 41a91b97e0ee996c8d9e6f9ac9beda5f014ab7cf wpt-pr: 64084 UltraBlame original commit: 32041176a193e436160930d3e4d7c1cbcebcab11
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Nov 11, 2026
… for srcset source selection, a=testonly Automatic update from web-platform-tests Use the dimension attribute aspect ratio for srcset source selection 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 <szagerchromium.org> Commit-Queue: Noam Rosenthal <nrosenthalgoogle.com> Cr-Commit-Position: refs/heads/main{#1724591} -- wpt-commits: 41a91b97e0ee996c8d9e6f9ac9beda5f014ab7cf wpt-pr: 64084 UltraBlame original commit: 32041176a193e436160930d3e4d7c1cbcebcab11
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Nov 11, 2026
… for srcset source selection, a=testonly Automatic update from web-platform-tests Use the dimension attribute aspect ratio for srcset source selection 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 <szagerchromium.org> Commit-Queue: Noam Rosenthal <nrosenthalgoogle.com> Cr-Commit-Position: refs/heads/main{#1724591} -- wpt-commits: 41a91b97e0ee996c8d9e6f9ac9beda5f014ab7cf wpt-pr: 64084 UltraBlame original commit: 32041176a193e436160930d3e4d7c1cbcebcab11
# Conflicts: # source
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.
This allows responsive image selection to account for both dimensions and object fitting (
contain/cover), fixing source selection when an image is constrained by height orobject-fit.<height-descriptor>(<positive-integer>h) alongside<width-descriptor>(w) insrcsetimage candidate strings so each candidate's aspect ratio can be determined before fetching.<source-size-value>to accept[ contain | cover ] <length> <length>, representing a fit mode, width, and height. Bare 2D<source-size>items without a<media-condition>are permitted before the final item in a<source-size-list>without a parse error so authors can provide a 1D fallback for legacy user agents (e.g.,sizes="cover 400px 400px, 400px").concrete object sizewidth (which depends on the already-loaded image's natural aspect ratio or causes inconsistent selection withobject-fit: cover/contain),sizes="auto"now resolves to asource sizestruct using theimgelement'scontent boxwidth and height and its computed'object-fit'value ('contain'/'scale-down'->"contain",'cover'->"cover",'fill'/'none'->"fill").wandhdescriptors (falling back to thedimension attribute aspect ratiofromwidth/heightattributes on the element, derives the candidate'ssource concrete widthgiven thesource size'swidth,height, andfit, and normalizes the candidate's pixel density using that concrete width prior toselect an image source from a source set(covering<img>,<picture><source>,<link rel="preload" as="image">, andLink:HTTP preload headers).widthandheightattribute mutations on<img>and preceding<source>elements in<picture>, and forsizes="auto", reacts to changes in theimg'scontent boxwidth or height or computed'object-fit'property.Fixes #12248.
Fixes #2973.
(This comment was updated by the HTML Standard PR Preview Bot.)
/embedded-content.html ( diff )
/images.html ( diff )
/infrastructure.html ( diff )
/semantics.html ( diff )