Relatively Positioned Element Should Not Decrease the Scroll Area of Its Container
Categories
(Core :: Layout: Scrolling and Overflow, defect)
Tracking
()
People
(Reporter: dshin, Assigned: dshin)
References
Details
Attachments
(2 files, 1 obsolete file)
As per the standard: "The box is laid out as for static, then offset from the resulting position. This offsetting is a purely visual effect, and does not affect the size or position of any other box, except insofar as it increases the scrollable overflow area of its ancestors."
STR: Load test case
Expected Behaviour:
- First div's scrollbar width is 200px
- Second div's scrollbar width is 300px
- Third div's scrollbar width is 200px
Actual behaviour: First and second divs behaves as expected, but the third scrollbar does not appear
| Assignee | ||
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Huh, I would've expected this to take care of it: https://searchfox.org/mozilla-central/rev/0e3d9bfae6fdaa6cb29cbce3f25471d5708aedc3/layout/generic/nsIFrame.cpp#7686
| Assignee | ||
Comment 2•3 years ago
|
||
Tracking calls to that function down, looks like the behaviour is more correct if I trigger UnionChildOverflow (Which calls down to GetActualAndNormalOverflowAreasRelativeToParent) by turning the relevant pref on and applying overflow-clip-box: content-box.
But this feels like we're calculating the overflow area all over again - should we not be returning the correct overflow area (e.g. what GetActualAndNormalOverflowAreasRelativeToParent returns) in the first place at the end of reflow?
Comment 3•3 years ago
•
|
||
(In reply to David Shin[:dshin] from comment #2)
should we not be returning the correct overflow area (e.g. what
GetActualAndNormalOverflowAreasRelativeToParentreturns) in the first place at the end of reflow?
I think you're right, yeah; we should probably be incorporating the actual-and-normal-position-based overflow areas there.
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Comment 4•3 years ago
|
||
With this, a relatively positioned element e.g. being offset to the left
should not decrease the scrollport size. For this, overflow area calculation
for relatively positioned elements must behave like
nsIFrame::GetActualAndNormalOverflowAreasRelativeToParent. We aren't
using the function directly since it's meant to be called post-reflow, and
we want to report it correctly during reflow in the first place.
Comment 7•3 years ago
|
||
Backed out for causing Wr failures.
Backout link: https://hg.mozilla.org/integration/autoland/rev/82bdd9ac89e3935aaabd32354622f07d9b8ff97f
Failure log:
https://treeherder.mozilla.org/logviewer?job_id=381444944&repo=autoland&lineNumber=1716
https://treeherder.mozilla.org/logviewer?job_id=381445395&repo=autoland&lineNumber=4273
Updated•3 years ago
|
Comment 9•3 years ago
|
||
Here's a testcase (using essentially the third piece of the original testcase, and a variant of that piece with a wrapper div).
There are two scrollable areas in the testcase.
- Firefox Nightly shows no scrollbars at all.
- Chrome shows scrollbars on the first part but not the second part.
- Firefox with the attached patch shows scrollbars on both.
The second part is sort of like the failing WPT test where we end up creating scrollbars unnecessarily for a relative-positioned grandchild of the scrollable element, whose static position would overflow but its actual (positioned) position does not:
https://wpt.live/css/CSS2/linebox/empty-inline-002.xht
I think the crux here is that we only want to do this for the "in-flow children" -- e.g. the "in-flow bounds" that we need to consider for bug 1768921 should probably include the normal position of relatively-positioned children.
Comment 10•3 years ago
|
||
Per bug 1772593 comment 14, I think a proper fix for that bug over there would also fix this bug here (make us agree with Chrome on testcase 1 and testcase 2 here).
So I think maybe we should just dupe this and proceed to fix bug 1772593?
| Assignee | ||
Comment 11•3 years ago
|
||
Ok - agreed.
Updated•3 years ago
|
Description
•