Fennec allows scrolling of pages with overflow:hidden on the body element

RESOLVED FIXED in Firefox 48



Firefox for Android
5 years ago
2 years ago


(Reporter: kats, Unassigned)


(Blocks: 2 bugs)

Firefox 48
Dependency tree / graph

Firefox Tracking Flags




(1 attachment)

Created attachment 767401 [details]
Test case

If there is a page with overflow:hidden set on the body, it shouldn't be scrollable.
Attachment #767401 - Attachment mime type: text/plain → text/html
For reference I like the behaviour we now have on B2G, where we allow panning/zooming on the initially-visible area for documents with overflow:hidden on the root. If we switch Fennec to APZ we should be able to get this behaviour mostly for free, but if that gets delayed we could modify the JPZC code to behave that way too.
See Also: → bug 975962
Blocks: 988996

Comment 2

3 years ago
This bug prevents creating a proper slideout side menu. When the menu is out, the body shouldn't be scrollable, but at this point on FF there's no way to prevent it.

Comment 3

3 years ago
It would be great to see this bug fixed given how long it's been open. Otherwise, it's impossible to scroll inside an overlay.
If this needs to be fixed sooner than switching Fennec to C++ APZ, it shouldn't be too hard. Whoever does triage can let us know.
tracking-fennec: --- → ?
Our goal is to get on C++ APZC within the next
Blocks: 776030
tracking-fennec: ? → 41+

Comment 6

3 years ago
So we're looking at next September?
No longer blocks: 776030
Depends on: 776030

Comment 7

3 years ago
Has anyone found a fix for this? It doesn't look very good. Please share it if you have, I would really appreciate it!
Assignee: nobody → snorp

Comment 8

3 years ago
It looks like this isn't isolated to just the body element, it looks like overflow on a particular axis isn't respected on an element inside body either.  For instance, overflow-y: hidden appears to not work correctly, see this Pen: http://codepen.io/mkascel/pen/XbRbvK
Duplicate of this bug: 1181973
tracking-fennec: 41+ → Nightly+
Assignee: snorp → rbarker

Comment 11

3 years ago
I'm not sure this workaround will work for other implementations but or me it does work with Bootstrap 3 off canvas. (left hand, haven't tried right)

if (navigator.userAgent.match(/Android/i) && navigator.userAgent.match(/Firefox/i)) {
//$('body').css('overflow','hidden');/* jQuery */
document.getElementsByTagName('body')[0].style='overflow:hidden';/* vanilla */

I can still scroll vertically on mobile while the horizontal overflow is hidden.
This is fixed in Fennec nightly with the switch to APZ. Marking this dependent on APZ riding the trains on Fennec, so that we close this with the right target milestone when it rides.
Depends on: 1206874
No longer depends on: 776030
Assignee: rbarker → nobody
tracking-fennec: Nightly+ → 48+
Resolved with the APZ stuff
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48

Comment 14

2 years ago
Just tested this before and after updating to 48 on Android, and confirmed the problem has been fixed.
Great, thanks for checking!
You need to log in before you can comment on or make changes to this bug.