Skip to content

Make sizes="auto" two-dimensional - #64058

Merged
chromium-wpt-export-bot merged 1 commit into
masterfrom
chromium-export-39270f6075
Oct 23, 2026
Merged

chromium-wpt-export-bot merged 1 commit into
masterfrom
chromium-export-39270f6075

Conversation

@chromium-wpt-export-bot

Copy link
Copy Markdown
Collaborator

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}

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-pr-bot wpt-pr-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot
chromium-wpt-export-bot merged commit 080cafc into master Oct 23, 2026
29 checks passed
@chromium-wpt-export-bot
chromium-wpt-export-bot deleted the chromium-export-39270f6075 branch October 23, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants