Closed Bug 1980787 Opened 10 months ago Closed 9 months ago

aspect-ratio breaks size containment

Categories

(Core :: Layout, defect, P3)

Firefox 141
defect

Tracking

()

RESOLVED FIXED
143 Branch
Tracking Status
firefox143 --- fixed

People

(Reporter: psychpsyo, Assigned: TYLin)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file contain-size-014.html

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0

Steps to reproduce:

Specifying an aspect-ratio on an element with size containment (containerType: size) breaks the size containment.
I've already PRed a new web platform test for this here: https://github.com/web-platform-tests/wpt/pull/54107

Actual results:

The element now sizes to its children.

Expected results:

The element should be sized as if empty. (= it should be the specified aspect-ratio)

The Bugbug bot thinks this bug should belong to the 'Core::Layout' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout
Product: Firefox → Core
Blocks: aspect-ratio

Thanks, I agree it's a bug.

Boris, ni? in case it's an easy fix :)

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(boris.chiou)
Priority: -- → P3

I have an idea to fix this.

Also, the upstream PR https://github.com/web-platform-tests/wpt/pull/54107 will be imported in Bug 1980709.

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Flags: needinfo?(boris.chiou)
Duplicate of this bug: 1981833

When the block-axis has size containment, the block-size can be determined
without considering the element's children. Therefore, aspect-ratio's automatic
content-based minimum sizes should not apply in this case.
https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum

This behavior is aligned with blink and webkit.

Pushed by aethanyc@gmail.com: https://github.com/mozilla-firefox/firefox/commit/f0270510e179 https://hg.mozilla.org/integration/autoland/rev/8024b8577a94 Apply aspect-ratio's auto content-based min block-size only when block-axis has no size containment. r=layout-reviewers,emilio
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
QA Whiteboard: [qa-triage-done-c144/b143]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: