position:sticky inside partially-offscreen position:fixed container has a different behavior in Chrome/Edge vs Firefox
Categories
(Core :: Layout, defect, P3)
Tracking
()
Webcompat Priority | P3 |
People
(Reporter: karlcow, Unassigned)
References
(Blocks 1 open bug, )
Details
(Keywords: webcompat:platform-bug, Whiteboard: [webcompat] [css])
Attachments
(3 files)
Reporter | ||
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Updated•7 years ago
|
Comment 3•6 years ago
|
||
I think this is a pretty substantial bug to sticky in Firefox.
Another way to illustrate the issue is to set a negative top value on the fixed container:
instead of acting like position fixed and stick to its specified position, it acts like position absolute and follows the parent container, ignoring the specified position of the sticky element.
Comment 4•6 years ago
|
||
(In reply to jklintestam from comment #3)
Clarification:
instead of acting like position fixed and stick to its specified position, the sticky element acts like position absolute and follows the parent container, ignoring the specified position of said sticky element.
Comment 5•6 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Comment 6•6 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Comment 7•6 years ago
|
||
Updated•6 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 9•2 years ago
|
||
Testcase still reproduces, but the sites no longer show this issue. P3 for now.
Updated•2 years ago
|
Comment 10•2 years ago
|
||
(In reply to Dennis Schubert [:denschub] from comment #9)
Testcase still reproduces, but the sites no longer show this issue. P3 for now.
Hi, what do you mean by "the sites no longer show this issue"? We have an issue in our production site — only on Firefox — where opening a modal sets position:fixed
(necessary to prevent scrolling on iOS) and an offset top
position. As a result, all sticky elements such as our header and map "disappear". Is there any way the priority can be revisited?
Comment 11•2 years ago
|
||
(In reply to focusvisiblewebkitbugzilla from comment #10)
Hi, what do you mean by "the sites no longer show this issue"
I think Dennis was referring to one or more specific site where this had been causing trouble in the wild, which apparently have changed to no longer trip over this bug. (Likely distinct from the site that you develop where you're encountering this.)
Thanks for letting us know that your site is affected by this; I can add it to a list of bugs to revisit/investigate. Would it be possible to share a link to an affected page on your site, so that we can confirm that the eventual fix does indeed address the issue that you're running into?
Comment 12•2 years ago
|
||
A sort of shot in the dark diagnosis: I suspect the underlying issue here is that the fixed-position thing escapes the root scroller at some level; and so, when the sticky-positioned box looks for a scrollable ancestor, it doesn't find anything, so it doesn't think it needs to adjust its position. (This matters because sticky positioning is defined as being relative to the "nearest ancestor scroll container’s scrollport".)
We probably should treat the root viewport frame as if it were a scroll container, for the purpose of this nearest ancestor scroll container search. It looks like we already do this when it has overflow:clip
which makes it not-a-scrollport. It would make sense for consistency for that same behavior to happen for fixed-position children (regardless of overflow
), as well.
Comment 13•2 years ago
•
|
||
illustrating my last comment slightly: here's a testcase where we match Chromium and WebKit, comparing overflow:clip
on the root element vs. on an element vs. overflow:scroll on an element.
-
The leftmost area is testing
overflow:clip
on the root element and how it interacts with sticky -- there's a sticky-positioned box whose static position is offscreen, via its abspos parent with a negativetop
value; but it in fact, the sticky box remains onscreen. Apparently sticky positioning causes it to remain onscreen (despite it sort-of not having any ancestor scroll container); the viewport does successfully contain it here despite not forming a scroll container. -
The center area has
overflow:clip
on a black-bordered container div. In this case, that div does not form a scrollport and so the sticky-positioned thing doesn't get contained by it. -
The rightmost area is the same but now with
overflow:scroll
, which does indeed form a scrollport and hence does contain the sticky-positioned thing.
Updated•1 year ago
|
Comment 14•1 year ago
|
||
Clear a needinfo that is pending on an inactive user.
Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE
.
For more information, please visit BugBot documentation.
Comment 15•1 year ago
|
||
(In reply to BugBot [:suhaib / :marco/ :calixte] from comment #14)
Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as
INCOMPLETE
.
(No need to close here. The needinfo in question was from comment 11, asking for the URL of an affected site that the user mentioned. Anyway, we still have testcases that reproduce the bug & make it actionable, once someone can start working on this.)
Updated•2 months ago
|
Description
•