Content that overflows off the "start" side of a "flex-direction: *-reverse" flex container is not scrollable (but should be)
Categories
(Core :: Layout: Flexbox, defect, P2)
Tracking
()
People
(Reporter: rik, Assigned: TYLin)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [layout:backlog:quality][layout:backlog:2020], [wptsync upstream])
Attachments
(11 files)
618 bytes,
text/html
|
Details | |
545 bytes,
text/html
|
Details | |
1.45 KB,
text/html
|
Details | |
949 bytes,
text/html
|
Details | |
1.26 KB,
text/html
|
Details | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
1.04 KB,
text/html
|
Details |
Updated•11 years ago
|
Comment 1•11 years ago
|
||
Comment 2•11 years ago
|
||
Comment 3•11 years ago
|
||
Reporter | ||
Comment 4•11 years ago
|
||
Comment 5•11 years ago
|
||
Comment 6•11 years ago
|
||
Comment 7•11 years ago
|
||
Comment 8•11 years ago
|
||
Updated•11 years ago
|
Comment 9•11 years ago
|
||
Comment 10•11 years ago
|
||
Comment 11•11 years ago
|
||
Comment 12•11 years ago
|
||
Comment 13•10 years ago
|
||
Comment 15•10 years ago
|
||
Comment 16•9 years ago
|
||
Comment 17•9 years ago
|
||
Comment 18•9 years ago
|
||
Updated•9 years ago
|
Updated•9 years ago
|
Updated•9 years ago
|
Comment 20•9 years ago
|
||
Comment 21•9 years ago
|
||
Updated•8 years ago
|
Updated•8 years ago
|
Comment 23•8 years ago
|
||
Comment 26•6 years ago
|
||
Comment 28•6 years ago
|
||
Comment 29•6 years ago
|
||
Updated•6 years ago
|
Comment 30•6 years ago
|
||
Comment 31•6 years ago
|
||
Comment 32•6 years ago
|
||
Comment 33•6 years ago
|
||
Comment 34•6 years ago
|
||
Comment 35•6 years ago
|
||
Comment 36•6 years ago
|
||
Comment 38•6 years ago
|
||
+1 to this bug for me as well. Our chat app is not scrolling to the bottom in FF when there are new messages using overflow: auto
and flex: column-reverse
. Chrome and Safari works.
Comment 39•6 years ago
|
||
This is our exact use case too, a chat app. I was very excited when this worked in Chrome (no JS chat app scroll?! Yay!), and very sad when I tried it in Firefox.
Comment 40•6 years ago
|
||
Same here, chat app and this is still an issue.
Comment 41•5 years ago
|
||
Hey, this is still an issue. I'm pinging this in the hopes that someone will see it an be assigned to this bug.
Comment 42•5 years ago
|
||
(In reply to Miguel from comment #41)
Hey, this is still an issue. I'm pinging this in the hopes that someone will see it an be assigned to this bug.
It's been more than 5 years now. I doubt Firefox is going to fix this anytime soon. As an workaround, just keep your content scrolled with plugins like stay-scrolled or if you use stuff like React ( on image / content load, just call scrollToBottom, there are tons of examples on SO ).
I've decided to replace this even if it's working just fine on Chrone, Opera, and Edge (DEV).
Comment 43•5 years ago
|
||
This bug has been causing problems for a lot of people. Any plans to fix it anytime soon? Why has the bug been lying around for ~5yrs?
Comment 44•5 years ago
|
||
Support has changed in MDN docs for flex-direction. Suport went from fully supported to partially support due to this issue. Can FireFox please fix this issue?
Updated•5 years ago
|
Comment 45•5 years ago
|
||
Hey, I'd love to help out with this, can anyone point me to relevant code?
Cheers,
Jon
Comment 46•5 years ago
|
||
Daniel is on parental leave, but I can try to help.
The relevant code for the flex layout algorithm is nsFlexContainerFrame.cpp
. I'd probably start looking at users of mFlexDirection
in layout/
, then their callers, etc.
The scrollability of a scroll container is determined in nsHTMLScrollFrame::ReflowScrolledFrame
.
Sorry I can't point to exact steps to fix this (as I don't know where the bug is myself), but the above would be the first places where I'd look at.
Also good for debugging are ./mach run -layoutdebug
(which allows you to dump the layout tree easily) and rr.
Comment 47•5 years ago
|
||
Thanks very much! (In reply to Emilio Cobos Álvarez (:emilio) from comment #46)
Daniel is on parental leave, but I can try to help.
The relevant code for the flex layout algorithm is
nsFlexContainerFrame.cpp
. I'd probably start looking at users ofmFlexDirection
inlayout/
, then their callers, etc.The scrollability of a scroll container is determined in
nsHTMLScrollFrame::ReflowScrolledFrame
.Sorry I can't point to exact steps to fix this (as I don't know where the bug is myself), but the above would be the first places where I'd look at.
Also good for debugging are
./mach run -layoutdebug
(which allows you to dump the layout tree easily) and rr.
Updated•5 years ago
|
Comment hidden (advocacy) |
Comment 49•5 years ago
|
||
Noted. It's on our shortlist of bugs to consider this year already. That's all we can promise right now. Voting up the bug does help.
Comment 51•5 years ago
|
||
Please Fix this. It would be extremely helpful for us. Thanks
Comment 52•5 years ago
|
||
(In reply to Sean Voisen (:svoisen) from comment #49)
Noted. It's on our shortlist of bugs to consider this year already. That's all we can promise right now. Voting up the bug does help.
Very happy to read it’s on the shortlist. Anyone concerned, please take above message serious and upvote the bug.
Looking forward to this bug being fixed.
Comment 53•5 years ago
|
||
I've been working on a chat client, too.
Our solution has (rather humorously) been to make some creative use of transform: scaleY(-1)
.
...yeah.
Comment 55•5 years ago
|
||
At least for the use case of chat windows, this bug seems to admit an easy workaround: just wrap the misbehaving flex div
in an extra non-flex div
. Example adapted from working fix:
(function scrollify() {
setTimeout(scrollify, 5000) ;
for (const chatbox of document.getElementsByClassName("overflow-y-scroll flex flex-column-reverse ..."))
{
const chatwrap = document.createElement("div") ;
chatwrap.style.overflowY = "scroll" ;
chatwrap.style.height = "100%" ;
chatbox.style.removeProperty("height") ;
chatbox.classList.remove("overflow-y-scroll") ;
chatbox.parentNode.insertBefore(chatwrap, chatbox) ;
chatwrap.appendChild(chatbox) ;
chatwrap.scrollTop = 0x7fffffff ;
}
})()
Feel free to use in polyfills or whatever.
Comment 56•5 years ago
|
||
This seems also related for a problem (including a demo) mentioned in https://twitter.com/jaffathecake/status/1250761594612723713
The central piece of the code that's relevant to this is probably ScrollFrameHelper::GetScrolledRect
, particularly near the end where it branches on GetScrolledFrameDir()
to handle scroll ranges for right-to-left (RTL) direction pages (e.g., Arabic, Hebrew).
However, there are likely a bunch of interesting side-effects of changing that, such as:
- we need to make sure the various scrolling-related APIs are compatible with other implementations (e.g.,
Element::scrollTo
,Element.scrollTop
,Element.scrollLeft
) in terms of what point is considered0
(that is, is it the left/top edge or is it the initial position?). (We might have incompatibility with other browsers for the RTL case here today.) - there might be some pieces of code that make assumptions about not scrolling above the initial position, or the initial scroll position being 0, or the vertical scroll position never being negative
The underlying design question around a bunch of these differences is that it's not clear whether to model this as the initial scroll position being 0
and the rest of the range being negative (which I believe is how we model it for RTL in Gecko), or whether to model it as the scroll range all being positive positions but the initial scroll position being nonzero. So it's worth looking into what other browsers expose both for the flex case and for the RTL case.
Updated•5 years ago
|
Comment 58•5 years ago
|
||
Now that we triage by severity, setting this bug's priority to P2 to represent near-term backlog status. See https://wiki.mozilla.org/Platform/Layout#Backlog_Tracking_in_Bugzilla
Updated•5 years ago
|
Comment 59•5 years ago
|
||
Same problem. I use column-reverse for my chat. No way to go around it with no js and Firefox is the only browser that has doesn't work correctly. I think in 2020 many chat app developers would highly appreciate the fix!
Comment hidden (advocacy) |
Comment 61•4 years ago
|
||
Please fix this.
Comment 62•4 years ago
|
||
Same problem. Column-reverse break scroll.
Assignee | ||
Comment 63•4 years ago
|
||
Assignee | ||
Comment 64•4 years ago
|
||
Depends on D86075
Assignee | ||
Comment 65•4 years ago
|
||
This struct is going to be used in the next part in nsLayoutUtils::GetScrolledRect().
Depends on D86076
Assignee | ||
Comment 66•4 years ago
|
||
Depends on D86077
Assignee | ||
Comment 67•4 years ago
|
||
scrollbar-no-margin.html
is adapted from scrollbar.html
with margin
removed from flex-items, to workaround bug 1527539.
font-size: 0
added to .flex
is to workaround bug 1302700. Also,
adjust scrollbar-width
and scrollbar-color
to avoid fuzzy rendering
on rounded-corner slider on some platforms.
Depends on D86078
Updated•4 years ago
|
Assignee | ||
Comment 68•4 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #9)
dbaron suggests the might behavior might fall out naturally from
nsLayoutUtils::GetScrolledRect, if we tweak that function to be aware of
flexbox main/cross axes.
Yes, it's sufficient to tweak nsLayoutUtils::GetScrolledRect
to let it aware of flexbox's main and cross axes so that it clips the correct physical side of the scrollable rect.
(In reply to David Baron :dbaron: 🏴 ⌚UTC-8 from comment #57)
The underlying design question around a bunch of these differences is that it's not clear whether to model this as the initial scroll position being
0
and the rest of the range being negative (which I believe is how we model it for RTL in Gecko), or whether to model it as the scroll range all being positive positions but the initial scroll position being nonzero. So it's worth looking into what other browsers expose both for the flex case and for the RTL case.
In our current implementation regarding various writing-mode & RTL combination, the initial scroll position is always 0
, and the rest of the range is negative if the physical scrolling direction is going from right-to-left or bottom-to-top. I believe this is consistent with Google Chrome.
Updated•4 years ago
|
Comment 69•4 years ago
|
||
Comment 71•4 years ago
|
||
Backed out 5 changesets (bug 1042151) for causing wpt failures in negative-overflow.html.
https://hg.mozilla.org/integration/autoland/rev/b5a790f3355971fa0716f00cfeefb949bb8525a6
Failure log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=312337424&repo=autoland&lineNumber=6860
Assignee | ||
Comment 73•4 years ago
•
|
||
The negative-overflow.html
failures demonstrate the testcase attached here, where reversing the cross-axis (flex-wrap:wrap-reverse
) can create overflow. My proposed patches allow the overflow to be scrollable. For now, the testcase doesn't work in Google Chrome 86. I guess Google Chrome only tweaks the scroll area when the main-axis is reversed, but not the cross-axis. I don't see any reason to treat main and cross different in terms of scrollability.
We already have existing failures in negative-overflow.html
tracked in bug 1626108, so I'm going to adjust the test expectation in Part 4, and reland my patches. We can do follow-up there and reason the correctness of the testcase.
Daniel, does the plan sound good to you?
Comment 74•4 years ago
|
||
(In reply to Ting-Yu Lin [:TYLin] (UTC-7) from comment #73)
I don't see any reason to treat main and cross different in terms of scrollability.
Agreed. Mind filing a Chrome bug on this? (at https://crbug.com/ )
I'm going to adjust the test expectation in Part 4, and reland my patches. We can do follow-up there and reason the correctness of the testcase.
Daniel, does the plan sound good to you?
Works for me. Thanks!
Comment 75•4 years ago
|
||
Assignee | ||
Comment 76•4 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #74)
Agreed. Mind filing a Chrome bug on this? (at https://crbug.com/ )
Filed https://bugs.chromium.org/p/chromium/issues/detail?id=1114306
Comment 77•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f9d4918600d7
https://hg.mozilla.org/mozilla-central/rev/5558e9475e40
https://hg.mozilla.org/mozilla-central/rev/9dd61fc2cbbd
https://hg.mozilla.org/mozilla-central/rev/d4f4e419c975
https://hg.mozilla.org/mozilla-central/rev/56299d5ad3f6
Comment 78•4 years ago
|
||
The patch landed in nightly and beta is affected.
:TYLin, is this bug important enough to require an uplift?
If not please set status_beta
to wontfix
.
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 79•4 years ago
•
|
||
This bug is not trivial and depends on the clean-up patches in bug 1657540.
Comment 80•4 years ago
|
||
Thank you so much, everyone! My web app finally works well on Firefox 81!!!
Comment 81•4 years ago
|
||
Thank you!
Comment 82•4 years ago
|
||
version 78.7.0esr (64-bit) still remains with the bug.
Comment 83•4 years ago
|
||
ESR78 will not be receiving this fix.
Comment 84•4 years ago
|
||
Thank you for letting me know.
Description
•