Closed Bug 2087374 Opened 1 month ago Closed 23 days ago

[wpt-sync] Sync PR 64084 - Use the dimension attribute aspect ratio for srcset source selection

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 64084 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/64084
Details from upstream follow.

Noam Rosenthal <nrosenthal@chromium.org> wrote:

Use the dimension attribute aspect ratio for srcset source selection

Third part of https://github.com/whatwg/html/pull/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}

PR 64084 applied with additional changes from upstream: d2727a54348e2af3f8fc7cbdfd4956d75927c938, 080cafcc9fdc08e314a3949bcbe6bb5edc5b6b6d

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests and 20 subtests

Status Summary

Firefox

OK : 1
PASS : 67
FAIL : 59
TIMEOUT: 3

Chrome

OK : 1
PASS : 119
FAIL : 8
TIMEOUT: 2

Safari

OK : 1
PASS : 84
FAIL : 42
TIMEOUT: 3

Links

GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

  • /html/semantics/embedded-content/the-img-element/sizes/sizes-2d.tentative.html [wpt.fyi]
    • <img sizes="(min-width: 0px) and (min-height: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?img16 50w 50h, /images/green-16x16.png?img16 51w 51h">: FAIL
    • <picture><source sizes="(min-width: 0px) and (min-height: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?picture16 50w 50h, /images/green-16x16.png?picture16 51w 51h"><img></picture>: FAIL
    • <link rel="preload" as="image" imagesizes="(min-width: 0px) and (min-height: 0px) cover 10px 1000px, 1px" imagesrcset="/images/green-1x1.png?link16 50w 50h, /images/green-16x16.png?link16 51w 51h">: FAIL
    • <img sizes="(max-width: 0px) or (min-height: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?img18 50w 50h, /images/green-16x16.png?img18 51w 51h">: FAIL
    • <picture><source sizes="(max-width: 0px) or (min-height: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?picture18 50w 50h, /images/green-16x16.png?picture18 51w 51h"><img></picture>: FAIL
    • <link rel="preload" as="image" imagesizes="(max-width: 0px) or (min-height: 0px) cover 10px 1000px, 1px" imagesrcset="/images/green-1x1.png?link18 50w 50h, /images/green-16x16.png?link18 51w 51h">: FAIL
    • <img sizes="(width >= 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?img19 50w 50h, /images/green-16x16.png?img19 51w 51h">: FAIL
    • <picture><source sizes="(width >= 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?picture19 50w 50h, /images/green-16x16.png?picture19 51w 51h"><img></picture>: FAIL
    • <link rel="preload" as="image" imagesizes="(width >= 0px) cover 10px 1000px, 1px" imagesrcset="/images/green-1x1.png?link19 50w 50h, /images/green-16x16.png?link19 51w 51h">: FAIL
    • <img sizes="(min-width: 0px) cover 10px 1000px, (min-width: 0px) 1px" srcset="/images/green-1x1.png?img23 50w 50h, /images/green-16x16.png?img23 51w 51h">: FAIL
    • <picture><source sizes="(min-width: 0px) cover 10px 1000px, (min-width: 0px) 1px" srcset="/images/green-1x1.png?picture23 50w 50h, /images/green-16x16.png?picture23 51w 51h"><img></picture>: FAIL
    • <link rel="preload" as="image" imagesizes="(min-width: 0px) cover 10px 1000px, (min-width: 0px) 1px" imagesrcset="/images/green-1x1.png?link23 50w 50h, /images/green-16x16.png?link23 51w 51h">: FAIL
    • <img sizes="auto, (min-width: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?img37 50w 50h, /images/green-16x16.png?img37 51w 51h">: FAIL
    • <picture><source sizes="auto, (min-width: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?picture37 50w 50h, /images/green-16x16.png?picture37 51w 51h"><img></picture>: FAIL
    • <link rel="preload" as="image" imagesizes="auto, (min-width: 0px) cover 10px 1000px, 1px" imagesrcset="/images/green-1x1.png?link37 50w 50h, /images/green-16x16.png?link37 51w 51h">: FAIL

New Tests That Don't Pass

  • /html/semantics/embedded-content/the-img-element/sizes/sizes-2d.tentative.html [wpt.fyi]
    • <img sizes="contain 10px 1000px" srcset="/images/green-1x1.png?img1 50w 50h, /images/green-16x16.png?img1 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source sizes="contain 10px 1000px" srcset="/images/green-1x1.png?picture1 50w 50h, /images/green-16x16.png?picture1 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: FAIL)
    • <link rel="preload" as="image" imagesizes="contain 10px 1000px" imagesrcset="/images/green-1x1.png?link1 50w 50h, /images/green-16x16.png?link1 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <img sizes="CONTAIN 10px 1000px" srcset="/images/green-1x1.png?img2 50w 50h, /images/green-16x16.png?img2 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source sizes="CONTAIN 10px 1000px" srcset="/images/green-1x1.png?picture2 50w 50h, /images/green-16x16.png?picture2 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: FAIL)
    • <link rel="preload" as="image" imagesizes="CONTAIN 10px 1000px" imagesrcset="/images/green-1x1.png?link2 50w 50h, /images/green-16x16.png?link2 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <img sizes="contain 10px 1000px, cover 10px 1000px" srcset="/images/green-1x1.png?img5 50w 50h, /images/green-16x16.png?img5 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source sizes="contain 10px 1000px, cover 10px 1000px" srcset="/images/green-1x1.png?picture5 50w 50h, /images/green-16x16.png?picture5 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: FAIL)
    • <link rel="preload" as="image" imagesizes="contain 10px 1000px, cover 10px 1000px" imagesrcset="/images/green-1x1.png?link5 50w 50h, /images/green-16x16.png?link5 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <img sizes="contain 10px 10px" srcset="/images/green-1x1.png?img7 50w 1h, /images/green-16x16.png?img7 51w 2h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source sizes="contain 10px 10px" srcset="/images/green-1x1.png?picture7 50w 1h, /images/green-16x16.png?picture7 51w 2h"><img></picture>: FAIL (Chrome: PASS, Safari: FAIL)
    • <link rel="preload" as="image" imagesizes="contain 10px 10px" imagesrcset="/images/green-1x1.png?link7 50w 1h, /images/green-16x16.png?link7 51w 2h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <img sizes="(min-width: 0px) contain 10px 1000px, cover 10px 1000px" srcset="/images/green-1x1.png?img8 50w 50h, /images/green-16x16.png?img8 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source sizes="(min-width: 0px) contain 10px 1000px, cover 10px 1000px" srcset="/images/green-1x1.png?picture8 50w 50h, /images/green-16x16.png?picture8 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: FAIL)
    • <link rel="preload" as="image" imagesizes="(min-width: 0px) contain 10px 1000px, cover 10px 1000px" imagesrcset="/images/green-1x1.png?link8 50w 50h, /images/green-16x16.png?link8 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <img sizes="(max-width: 0px) cover 10px 1000px, contain 10px 1000px" srcset="/images/green-1x1.png?img10 50w 50h, /images/green-16x16.png?img10 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source sizes="(max-width: 0px) cover 10px 1000px, contain 10px 1000px" srcset="/images/green-1x1.png?picture10 50w 50h, /images/green-16x16.png?picture10 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: FAIL)
    • <link rel="preload" as="image" imagesizes="(max-width: 0px) cover 10px 1000px, contain 10px 1000px" imagesrcset="/images/green-1x1.png?link10 50w 50h, /images/green-16x16.png?link10 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <img sizes="(min-width: 0px) contain 10px 1000px, 1000px" srcset="/images/green-1x1.png?img11 50w 50h, /images/green-16x16.png?img11 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source sizes="(min-width: 0px) contain 10px 1000px, 1000px" srcset="/images/green-1x1.png?picture11 50w 50h, /images/green-16x16.png?picture11 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: FAIL)
    • <link rel="preload" as="image" imagesizes="(min-width: 0px) contain 10px 1000px, 1000px" imagesrcset="/images/green-1x1.png?link11 50w 50h, /images/green-16x16.png?link11 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <img sizes="(max-width: 0px) contain 1000px 1000px, contain 10px 1000px" srcset="/images/green-1x1.png?img12 50w 50h, /images/green-16x16.png?img12 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source sizes="(max-width: 0px) contain 1000px 1000px, contain 10px 1000px" srcset="/images/green-1x1.png?picture12 50w 50h, /images/green-16x16.png?picture12 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: FAIL)
    • <link rel="preload" as="image" imagesizes="(max-width: 0px) contain 1000px 1000px, contain 10px 1000px" imagesrcset="/images/green-1x1.png?link12 50w 50h, /images/green-16x16.png?link12 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <img sizes="(max-width: 0px) cover 10px 1000px, (min-width: 0px) contain 10px 1000px, 1000px" srcset="/images/green-1x1.png?img13 50w 50h, /images/green-16x16.png?img13 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source sizes="(max-width: 0px) cover 10px 1000px, (min-width: 0px) contain 10px 1000px, 1000px" srcset="/images/green-1x1.png?picture13 50w 50h, /images/green-16x16.png?picture13 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: FAIL)
    • <link rel="preload" as="image" imagesizes="(max-width: 0px) cover 10px 1000px, (min-width: 0px) contain 10px 1000px, 1000px" imagesrcset="/images/green-1x1.png?link13 50w 50h, /images/green-16x16.png?link13 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <img sizes="not (max-width: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?img14 50w 50h, /images/green-16x16.png?img14 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source sizes="not (max-width: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?picture14 50w 50h, /images/green-16x16.png?picture14 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: FAIL)
    • <link rel="preload" as="image" imagesizes="not (max-width: 0px) cover 10px 1000px, 1px" imagesrcset="/images/green-1x1.png?link14 50w 50h, /images/green-16x16.png?link14 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <img sizes="(min-width: 0px) and (min-height: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?img16 50w 50h, /images/green-16x16.png?img16 51w 51h">: FAIL (Chrome: PASS, Safari: PASS)
    • <picture><source sizes="(min-width: 0px) and (min-height: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?picture16 50w 50h, /images/green-16x16.png?picture16 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: PASS)
    • <link rel="preload" as="image" imagesizes="(min-width: 0px) and (min-height: 0px) cover 10px 1000px, 1px" imagesrcset="/images/green-1x1.png?link16 50w 50h, /images/green-16x16.png?link16 51w 51h">: FAIL (Chrome: PASS, Safari: PASS)
    • <img sizes="(max-width: 0px) or (min-height: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?img18 50w 50h, /images/green-16x16.png?img18 51w 51h">: FAIL (Chrome: PASS, Safari: PASS)
    • <picture><source sizes="(max-width: 0px) or (min-height: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?picture18 50w 50h, /images/green-16x16.png?picture18 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: PASS)
    • <link rel="preload" as="image" imagesizes="(max-width: 0px) or (min-height: 0px) cover 10px 1000px, 1px" imagesrcset="/images/green-1x1.png?link18 50w 50h, /images/green-16x16.png?link18 51w 51h">: FAIL (Chrome: PASS, Safari: PASS)
    • <img sizes="(width >= 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?img19 50w 50h, /images/green-16x16.png?img19 51w 51h">: FAIL (Chrome: PASS, Safari: PASS)
    • <picture><source sizes="(width >= 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?picture19 50w 50h, /images/green-16x16.png?picture19 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: PASS)
    • <link rel="preload" as="image" imagesizes="(width >= 0px) cover 10px 1000px, 1px" imagesrcset="/images/green-1x1.png?link19 50w 50h, /images/green-16x16.png?link19 51w 51h">: FAIL (Chrome: PASS, Safari: PASS)
    • <img sizes="(min-width: 0px) cover 10px 1000px, (min-width: 0px) 1px" srcset="/images/green-1x1.png?img23 50w 50h, /images/green-16x16.png?img23 51w 51h">: FAIL (Chrome: PASS, Safari: PASS)
    • <picture><source sizes="(min-width: 0px) cover 10px 1000px, (min-width: 0px) 1px" srcset="/images/green-1x1.png?picture23 50w 50h, /images/green-16x16.png?picture23 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: PASS)
    • <link rel="preload" as="image" imagesizes="(min-width: 0px) cover 10px 1000px, (min-width: 0px) 1px" imagesrcset="/images/green-1x1.png?link23 50w 50h, /images/green-16x16.png?link23 51w 51h">: FAIL (Chrome: PASS, Safari: PASS)
    • <img sizes="(min-width: 0px) cover 10px 1000px, 1px" width="1" height="1" srcset="/images/green-1x1.png?img32 50w, /images/green-16x16.png?img32 51w">: FAIL (Chrome: FAIL, Safari: PASS)
    • <picture><source sizes="(min-width: 0px) cover 10px 1000px, 1px" width="1" height="1" srcset="/images/green-1x1.png?picture32 50w, /images/green-16x16.png?picture32 51w"><img></picture>: FAIL (Chrome: FAIL, Safari: PASS)
    • <img sizes="cover 10px 1000px" srcset="/images/green-1x1.png?img33 50w, /images/green-16x16.png?img33 51w">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source sizes="cover 10px 1000px" srcset="/images/green-1x1.png?picture33 50w, /images/green-16x16.png?picture33 51w"><img></picture>: FAIL (Chrome: PASS, Safari: FAIL)
    • <link rel="preload" as="image" imagesizes="cover 10px 1000px" imagesrcset="/images/green-1x1.png?link33 50w, /images/green-16x16.png?link33 51w">: FAIL (Chrome: PASS, Safari: FAIL)
    • <img sizes="cover 10px 10px" width="1" height="1" srcset="/images/green-1x1.png?img34 50w 50h, /images/green-16x16.png?img34 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source sizes="cover 10px 10px" width="1" height="1" srcset="/images/green-1x1.png?picture34 50w 50h, /images/green-16x16.png?picture34 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: FAIL)
    • <img sizes="contain 10px 1000px" style="object-fit: cover" srcset="/images/green-1x1.png?img35 50w 50h, /images/green-16x16.png?img35 51w 51h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source sizes="contain 10px 1000px" srcset="/images/green-1x1.png?picture35 50w 50h, /images/green-16x16.png?picture35 51w 51h"><img style="object-fit: cover"></picture>: FAIL (Chrome: PASS, Safari: FAIL)
    • <img sizes="auto, (min-width: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?img37 50w 50h, /images/green-16x16.png?img37 51w 51h">: FAIL (Chrome: PASS, Safari: PASS)
    • <picture><source sizes="auto, (min-width: 0px) cover 10px 1000px, 1px" srcset="/images/green-1x1.png?picture37 50w 50h, /images/green-16x16.png?picture37 51w 51h"><img></picture>: FAIL (Chrome: PASS, Safari: PASS)
    • <link rel="preload" as="image" imagesizes="auto, (min-width: 0px) cover 10px 1000px, 1px" imagesrcset="/images/green-1x1.png?link37 50w 50h, /images/green-16x16.png?link37 51w 51h">: FAIL (Chrome: PASS, Safari: PASS)
    • <picture><source sizes="cover 10px 1000px" srcset="/images/green-1x1.png?picture-source-width-only 50w, /images/green-16x16.png?picture-source-width-only 51w" width="1"><img width="1" height="1"></picture>: FAIL (Chrome: PASS, Safari: FAIL)
  • /html/semantics/embedded-content/the-img-element/sizes/sizes-auto-2d.tentative.html [wpt.fyi]: TIMEOUT (Chrome: TIMEOUT, Safari: TIMEOUT)
    • <img loading="lazy" sizes="auto" width="1" height="1" style="object-fit: cover" srcset="/images/green-1x1.png?img6 50w, /images/green-16x16.png?img6 51w">: FAIL (Chrome: FAIL, Safari: FAIL)
    • <img loading="lazy" sizes="auto" style="object-fit: cover" srcset="/images/green-1x1.png?img10 50w 1h, /images/green-16x16.png?img10 51w 2h">: FAIL (Chrome: PASS, Safari: FAIL)
    • <picture><source srcset="/images/green-1x1.png?picture-img-dims 50w, /images/green-16x16.png?picture-img-dims 51w"><img loading="lazy" sizes="auto" width="1" height="1" style="object-fit: cover;"></picture>: FAIL (Chrome: FAIL, Safari: FAIL)
    • <picture><source srcset="/images/green-1x1.png?picture-source-dims 50w, /images/green-16x16.png?picture-source-dims 51w" width="1" height="1"><img loading="lazy" sizes="auto" width="1" height="100" style="object-fit: cover;"></picture>: FAIL (Chrome: FAIL, Safari: FAIL)
    • Changing computed object-fit on an auto-sized img updates currentSrc: TIMEOUT (Chrome: PASS, Safari: TIMEOUT)
    • Changing dimension attributes on an auto-sized img updates currentSrc: TIMEOUT (Chrome: TIMEOUT, Safari: TIMEOUT)
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Status: NEW → RESOLVED
Closed: 23 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.