Closed Bug 1601185 Opened 5 years ago Closed 5 years ago

Left/right touchpad scrolling is preempted by forward/back gesture when body is overflow hidden when zoomed in with pref apz.allow_zooming=true

Categories

(Core :: Panning and Zooming, defect, P3)

70 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla73
Tracking Status
firefox73 --- verified

People

(Reporter: tnikkel, Assigned: tnikkel)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

On mac, Steps to reproduce:

  1. Enable apz.allow_zooming in about:config.
  2. Use the touchpad pinch gesture to zoom in on gmail.com or new reddit.com on a comment page
  3. Try to scroll the page left or right using the touchpad two-finger gesture.

Actual results:

Firefox goes forward or back in history.

Expected results:

Page should scroll left or right until the edge of the page is reached. At that point, further use of the two-finger left/right gesture should trigger the forward/back action.

In a debug build I hit this assert

https://searchfox.org/mozilla-central/rev/8bc24752246aeac8a9aed566cf1caccf88d97d11/gfx/layers/apz/src/AsyncPanZoomController.cpp#1208

which likely explains why this is happening.

Note that it seems to be hard to get gmail to zoom in, most of the time nothing happens. I usually hit the above assert after some trying, but one time I was able to zoom in and scroll and it caused the history swipe even though I was in the debug build, so somehow I managed to avoid the assert.

Attached patch untitled.diff (obsolete) (deleted) — Splinter Review

Fixing the assert with a patch like this does not fix the bug.

Attached file pan.html (deleted) —

This seems to be a minimal testcase for the reddit problem.

Summary: Left/right touchpad scrolling is preempted by forward/back gesture on some websites when zoomed in with pref apz.allow_zooming=true → Left/right touchpad scrolling is preempted by forward/back gesture when body is overflow hidden when zoomed in with pref apz.allow_zooming=true

Doing a rudimentary patch that makes sure we don't consider the scroll frame overflow hidden if we have a visual viewport set and the visual scroll range differs from the scroll range fixes this bug. But that doesn't seem like the right way to detect an overflow hidden scroll frame that is zoomed in so it's actually scrollable.

Botond, do you know what the best way to detect an overflow hidden scroll frame that is zoomed and therefore scrollable on the main thread?

Flags: needinfo?(botond)

(In reply to Timothy Nikkel (:tnikkel) from comment #5)

Botond, do you know what the best way to detect an overflow hidden scroll frame that is zoomed and therefore scrollable on the main thread?

It sounds like what we want is a "scroll range for user input events", computed as follows:

scrollable rect = overflow:hidden ? layout viewport : scrollable rect
scroll port = have visual viewport ? visual viewport : layout viewport
// compute scroll range based on scrollable rect and scroll port

Note that, in the case of a non-root (no visual viewport) overflow:hidden frame, an empty scroll range naturally falls out of this, since the scrollable rect and the scroll port will both be the layout viewport.

Flags: needinfo?(botond)
Depends on: 1601527

(In reply to Timothy Nikkel (:tnikkel) from comment #0)

In a debug build I hit this assert

https://searchfox.org/mozilla-central/rev/8bc24752246aeac8a9aed566cf1caccf88d97d11/gfx/layers/apz/src/AsyncPanZoomController.cpp#1208

which likely explains why this is happening.

This seems to be a separate issue so I moved it to bug 1601527.

Attachment #9113408 - Attachment is obsolete: true

Previously we were just checking overflow hidden here, which is not enough because we can scroll overflow hidden if we are zoomed in.

Depends on D55917

Assignee: nobody → tnikkel
Attachment #9113701 - Attachment description: Bug 1601185. Add a function that returns if a user can scroll on a given scroll frame in either direction and use it in EventStateManager::ComputeScrollTargetAndMayAdjustWheelEvent. r?botond → Bug 1601185. Add a function that returns if a user can scroll on a given scroll frame in either direction and use it in EventStateManager::ComputeScrollTargetAndMayAdjustWheelEvent. r=botond
Pushed by tnikkel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/329340b1608d
Add a function that returns if a user can scroll on a given scroll frame in either direction and use it in EventStateManager::ComputeScrollTargetAndMayAdjustWheelEvent. r=botond
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
Flags: qe-verify+

Confirmed the issue with 73.0a1(2019-12-03) on macOS 10.15.
Fix verified with 74.0a1(2020-01-29) and 73.0b11.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: