Closed
Bug 1482173
Opened 6 years ago
Closed 6 years ago
'contain:size' doesn't work correctly on elements with overflow:hidden / scroll / auto
Categories
(Core :: Layout, defect, P3)
Core
Layout
Tracking
()
RESOLVED
DUPLICATE
of bug 1514843
Tracking | Status | |
---|---|---|
firefox63 | --- | affected |
People
(Reporter: dholbert, Unassigned)
References
Details
Attachments
(2 files)
(deleted),
text/html
|
Details | |
(deleted),
patch
|
Details | Diff | Splinter Review |
STR:
0. Flip layout.css.contain.enabled = true
1. Load attached testcase
ACTUAL RESULTS:
The black border stretches to wrap the text in the 2nd, 3rd, and 4th boxes.
EXPECTED RESULTS:
Black border should *not* stretch to wrap the text. It should just collapse to a single point (perhaps with visible-but-useless scrollbars in the 3rd box -- the overflow:scroll one), as if there were no contents.
Chrome gives "expected results" (without any visible scrollbars on the 3rd box, FWIW - not sure if that's a chrome bug or not).
(Thanks to Gerard for bringing this issue up in bug 1478550 comment 17.)
Reporter | ||
Comment 1•6 years ago
|
||
Reporter | ||
Comment 2•6 years ago
|
||
I suspect the cleanest way to fix this would be to adjust nsHTMLScrollFrame::ReflowContents [1] or nsHTMLScrollFrame::ReflowScrolledFrame [2] or some code around there to test whether we have contain:size, and to be sure to ignore our scrolled frame's size when determining our own "outer" scroll-frame size.
[1] https://dxr.mozilla.org/mozilla-central/rev/4e56a2f51ad739ca52046723448f3129a58f1666/layout/generic/nsGfxScrollFrame.cpp#698-701
[2] https://dxr.mozilla.org/mozilla-central/rev/4e56a2f51ad739ca52046723448f3129a58f1666/layout/generic/nsGfxScrollFrame.cpp#482-487
Reporter | ||
Comment 3•6 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #0)
> Chrome gives "expected results" (without any visible scrollbars on the 3rd
> box, FWIW - not sure if that's a chrome bug or not).
(I filed https://bugs.chromium.org/p/chromium/issues/detail?id=872794 on this Chrome side-issue, BTW.)
Summary: 'contain:size' doesn't work correctly on elements with overflow:hidden → 'contain:size' doesn't work correctly on elements with overflow:hidden / scroll / auto
Reporter | ||
Updated•6 years ago
|
Priority: -- → P3
Comment 4•6 years ago
|
||
This is a partial patch I've written with dholbert's test included. The patch reduces the BSize of overflow:[hidden | auto] elements to zero. It doesn't address overflow:scroll elements. Tests to add might include:
* elements with contain:size, an overflow property, and fixed height
* elements with contain:size, an overflow property, and fixed width
* elements with contain:size, an overflow property, and fixed height and width
for all three overflow variants.
It's probably easiest to grab one of the contain-size-block* or contain-size-fieldset* reftests as a boilerplate, since may of those test cases can have overflow:[hidden | auto | scroll] added.
Comment 5•6 years ago
|
||
2 tests with 'contain: size; overflow: hidden':
http://test.csswg.org/harness/test/css-contain-1_dev/single/contain-size-011/format/html5/
http://test.csswg.org/harness/test/css-contain-1_dev/single/contain-size-061/format/html5/
Reporter | ||
Comment 6•6 years ago
|
||
I believe this was fixed in bug 1514843, which added contain:size
support for scrollable elements.
Both testcases linked in comment 5 pass in current Nightly, and the attached testcase from comment 0 passes as well.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•