[Webkit-unassigned] [Bug 246283] New: The size of <Img> with `contain:size` and css `asppect-ratio`

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 10 10:57:59 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=246283

            Bug ID: 246283
           Summary: The size of <Img> with `contain:size` and css
                    `asppect-ratio`
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: cathiechen at igalia.com

Created attachment 462909

  --> https://bugs.webkit.org/attachment.cgi?id=462909&action=review

test-case.html

```
<img style="contain: size; aspect-ratio: 90 / 53;" src="https://www.w3.org/2008/site/images/logo-w3c-mobile-lg">
```

See the test above, when an `<img>` with contain and aspect-ratio, what size it should have?

Chromium and Gecko: 0 x 0.
WebKit: container width x height, respects to the value of CSS aspect-ratio.

Not quite sure which one is correct, need to dig into the specifications.

[1] https://w3c.github.io/csswg-drafts/css-contain-2/#containment-size
[2] https://w3c.github.io/csswg-drafts/css-sizing-4/#preferred-aspect-ratio

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221010/d72f5f9e/attachment-0001.htm>


More information about the webkit-unassigned mailing list