Closed Bug 732364 Opened 13 years ago Closed 13 years ago

Scrolling vertically is near impossible after scrolling horizontally in some pages

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(firefox14 verified, firefox15 verified, blocking-fennec1.0 soft)

VERIFIED FIXED
Firefox 15
Tracking Status
firefox14 --- verified
firefox15 --- verified
blocking-fennec1.0 --- soft

People

(Reporter: reuben, Assigned: kats)

References

()

Details

(Whiteboard: [viewport])

Attachments

(2 files)

Samsung Galaxy S2, running CyanogenMod 7.1 and today's Maple nightly build. STR: 1. Go to https://github.com/travis-ci/travis-hub/blob/master/lib/travis/hub.rb 2. Scroll down the code a bit. 3. Scroll the code to the left. 4. Try to scroll down or up again. Actual results: Scrolling vertically is almost impossible after the horizontal scroll. This may be related to bug 705877. Expected results: Smooth scrolling :)
blocking-fennec1.0: --- → ?
You might be hitting our axis locking. Are you lifting your finger after step #3?
I don't see this happening so not blocking
blocking-fennec1.0: ? → -
I was able to reproduce this on the Galaxy Nexus, and I don't think it's axis locking. The github source viewer has some sort of subdocument that is scrollable, but it isn't behaving like the normal iframe scrolling bugs or expected behaviour. This will need more investigation.
(In reply to Mark Finkle (:mfinkle) from comment #1) > You might be hitting our axis locking. Are you lifting your finger after > step #3? Sorry, this got lost in bugmail. Yes, I am.
Just to copy my STR over from the bug I just duped: Running Nightly on a Motorola Photon phone running Gingerbread. 1) Subscribe to a graphics-heavy feed like joystiq.com on reader.google.com 2) Visit reader.google.com/i on an Android device running Nightly 3) Tap on some feed entries to expand them. 3) Feed entries with wide graphics can be panned from side to side, but the page itself cannot be panned vertically unless I very carefully swipe on what feels like a single pixel gutter on the extreme left or right of the page. FWIW, I lift my finger plenty of times. It just seems as if the horizontally-scrolling part swallows and ignores all vertical scrolling events altogether.
Whiteboard: [viewport]
This happens in Google Reader all the time. I hear that's a popular web app! ;-)
blocking-fennec1.0: - → ?
blocking-fennec1.0: ? → soft
Assignee: nobody → bugmail.mozilla
A few changes here: 1. the scroll coordinates coming in would sometimes be 1.99234 instead of 2.0, and they would get truncated, so make sure to round them first. 2. _elementCanScroll always checked both axes, even if the user was only scrolling on one axis. This meant that if the horizontal axis was scrollable and the vertical axis was not, and the requested scroll was something like (0, 5), _elementCanScroll would return true even though it was actually impossible to scroll in the direction the user was requesting. The new code only returns true if the axis is scrollable AND there is a nonzero scroll amount on that axis.
Attachment #620332 - Flags: review?(chrislord.net)
Axis locking was being ignored on subdocument scrolling, so if you had a subdocument that was horizontally scrollable and not vertical scrollable, you basically had to move your finger in a strict vertical line for _elementCanScroll to return false and pan the main document. Applying axis locking fixes this problem because minute horizontal variations are filtered out. Also it makes the behaviour more consistent in general.
Attachment #620334 - Flags: review?(chrislord.net)
Comment on attachment 620332 [details] [diff] [review] (1/2) Fix _elementCanScroll Review of attachment 620332 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me. ::: mobile/android/chrome/content/browser.js @@ +2552,5 @@ > // the user wanted, and neither can any non-root sub-frame, cancel the > // override so that Java can handle panning the main document. > let data = JSON.parse(aData); > + data.x = Math.round(data.x); > + data.y = Math.round(data.y); Do we need to round here? A comment about it would be good. @@ +2821,4 @@ > > + if (x < 0 && elem.scrollLeft > 0) { > + scrollX = true; > + } else if (x > 0 && elem.scrollLeft < (elem.scrollWidth - elem.clientWidth)) { I think this would still be readable as a single if statement, just putting the clauses in brackets on separate lines. @@ +2826,5 @@ > } > > + if (y < 0 && elem.scrollTop > 0) { > + scrollY = true; > + } else if (y > 0 && elem.scrollTop < (elem.scrollHeight - elem.clientHeight)) { ditto here.
Attachment #620332 - Flags: review?(chrislord.net) → review+
Comment on attachment 620334 [details] [diff] [review] (2/2) Apply axis locking on subdocument scrolling Review of attachment 620334 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me.
Attachment #620334 - Flags: review?(chrislord.net) → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 15
Comment on attachment 620332 [details] [diff] [review] (1/2) Fix _elementCanScroll [Approval Request Comment] Regression caused by (bug #): User impact if declined: scrolling on iframes/subdocuments behaves poorly when the element is scrollable on both axes Testing completed (on m-c, etc.): locally, on m-c for a couple of days Risk to taking this patch (and alternatives if risky): mobile-only, low risk String changes made by this patch: none
Attachment #620332 - Flags: approval-mozilla-aurora?
Comment on attachment 620334 [details] [diff] [review] (2/2) Apply axis locking on subdocument scrolling [Approval Request Comment] same as above
Attachment #620334 - Flags: approval-mozilla-aurora?
Attachment #620334 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Attachment #620332 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
FWIW, unless I'm imagining things, it looks like this fix landed in my Aurora on Android after I updated. And, it seems to work great. No more issues scrolling through Google Reader, so I am a happy camper. Thank you!
Verified fixed on Nightly 15.0a1 (2012-05-21) Aurora 14.0a2 (2012-05-21) Samsung Nexus (4.0.2)
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: