Closed Bug 1544121 Opened 7 months ago Closed 7 months ago

size containment should make replaced elements behave as if they were 0x0

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(2 files)

Attached file testcase 1

I just noticed this in the size containment spec text:

Replaced elements must be treated as having an intrinsic width and height of 0.

https://drafts.csswg.org/css-contain/#containment-size

We need to implement this part.

Testcase attached, with some replaced elements all of which have contain:size and should be rendered with a content-box size of 0x0.

For comparison, Chrome renders nearly every element in the testcase with a 0x0 content-box, with one exception: they render <audio controls> as a full-size audio widget -- this is a Chrome bug, because this element is definitely expected to be treated as a replaced element per https://html.spec.whatwg.org/multipage/rendering.html#embedded-content-rendering-rules :

The audio element, when it is exposing a user interface, is expected to be treated as a replaced element

(where I believe "exposing a user interface" means "has the controls attribute", basically)

I filed https://bugs.chromium.org/p/chromium/issues/detail?id=952414 on this Chrome bug.

Depends on: 1546210
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #9059401 - Attachment description: Bug 1544121: Make size-contained replaced elements behave as if they had 0x0 intrinsic size and ratio. → Bug 1544121: Make size-contained replaced elements behave as if they had 0x0 intrinsic size and ratio. r?TYLin

Note that Chrome doesn't quite pass the new WPT tests -- the first one (contain-size-replaced-003a.html ) fails due to the Chrome bug that I linked above:
https://bugs.chromium.org/p/chromium/issues/detail?id=952414
and the other two (003b.html and 003c.html) fail due to:
https://bugs.chromium.org/p/chromium/issues/detail?id=955163

Depends on: 1547126
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/792aae9f893a
Make size-contained replaced elements behave as if they had 0x0 intrinsic size and ratio. r=TYLin
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Regressions: 1548985
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16699 for changes under testing/web-platform/tests
You need to log in before you can comment on or make changes to this bug.