Closed Bug 1703705 Opened 3 years ago Closed 3 years ago

Overscroll gets stuck by pressing Ctrl (Command) during pan (or pan momentum maybe)

Categories

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

defect

Tracking

()

VERIFIED FIXED
90 Branch
Tracking Status
firefox89 --- verified
firefox90 --- verified

People

(Reporter: hiro, Assigned: hiro)

References

Details

(Whiteboard: [proton-uplift])

Attachments

(3 files, 1 obsolete file)

This is the item 1 in bug 1703645 comment 1 Botond found.

STR;

  1. Overscroll by pan
  2. Keep your fingers on touchpad and press Ctrl (or Command) key
  3. Keep pressing Ctrl key and leave your fingers from the touchpad
Severity: -- → S3
Priority: -- → P2
Blocks: overscroll-nightly
No longer blocks: overscroll-release

A problem is here in APZCTreeManager::ReceiveInputEvent, when we receive a PanEnd event during pressing Ctrl, WillHandleInput call returns Nothing() since with the Ctrl modifier the WeelPrefs::Action is ACTION_ZOOM, thus it's not one of actions we need to handle in APZC.

I also noticed that overscrolling gets stuck on double tapping by two fingers during overscrolling;

A STR is;

  1. Overscroll by panning (keep your fingers on the touchpad) near the edge of the container
  2. Leave your fingers and do double tap quickly in the overscroll gutter

We receive a PANGESTURE_CANCELLED event in this case, I think we should call StartOverscrollAnimation in OnPanCancelled too.

Also to fix the original issue in comment 0, I suppose we should send a fake PANGESTURE_CANCELLED event when we fall into this if branch on a PANGESTURE_END event.

Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED

(In reply to Hiroyuki Ikezoe (:hiro) from comment #2)

I also noticed that overscrolling gets stuck on double tapping by two fingers during overscrolling;

A STR is;

  1. Overscroll by panning (keep your fingers on the touchpad) near the edge of the container
  2. Leave your fingers and do double tap quickly in the overscroll gutter

We receive a PANGESTURE_CANCELLED event in this case, I think we should call StartOverscrollAnimation in OnPanCancelled too.

This is wrong. Actually we receive a PANGESTURE_CANCELLED event, but we also receive PANGESTURE_END event before the PANGESTURE_CANCELLED event. What I did actually was clicking the content. With the clicking event, we call CancelAnimationsForNewBlock, then it ends up calling CancelAnimation with ExcludeOverscroll flag, thus the overscroll state gets stuck there. I don't see any reasons we need to keep overscroll state on mouse events because overscroll will never happen with mouse events as far as I know.

Just pushed a patch to fix the case in comment 3.

I am still thinking how to fix the original case in comment 0. Two approaches I am thinking;

  1. Call AsyncPanZoomController::ClearOverscroll directly from APZCTreeManager here if panInput.mHandledByAPZ is Nothing and the pan event is PAN_END and if we've already confirmed the target APZC
  2. Add a new PanGestureType PANGESTURE_INTERRUPTED (or some such) and call ReceiveInputEvent with the new type and handle it in the target APZC to clear overscroll state (or start an OverscrollAnimation)

Per discussion with Martin, this is a release blocker but not necessarily a nightly blocker.

Blocks: overscroll-release
No longer blocks: overscroll-nightly

(In reply to Hiroyuki Ikezoe (:hiro) from comment #3)

This is wrong. Actually we receive a PANGESTURE_CANCELLED event, but we also receive PANGESTURE_END event before the PANGESTURE_CANCELLED event. What I did actually was clicking the content. With the clicking event, we call CancelAnimationsForNewBlock, then it ends up calling CancelAnimation with ExcludeOverscroll flag, thus the overscroll state gets stuck there. I don't see any reasons we need to keep overscroll state on mouse events because overscroll will never happen with mouse events as far as I know.

One use case to keep in mind is the "click link while overscrolled" use case:

  • Position the cursor slightly below a link
  • Without moving the cursor, overscroll until the until transform moves the link to be under the cursor
  • Click the link

We should avoid breaking this case.

Attachment #9215912 - Attachment is obsolete: true

Thank you Botond, I am going to focus on the issue with Ctrl modifier case in this bug. I will defer the case that pan gestures are intrrupted by other events which will be handled by APZ to bug 1704488.

The gtest in this change unfortunately runs only with WebRender because the test
needs to be run through APZCTreeManager's hit testing code path which requires
either WebRender scroll data structures or layer structures. Though we already
have the machinery to create layer structures in gtests, the WebRender backend
is more valuable in these days, this test would be a small first step to provide
a generic way to work with both the WebRender/Layers backends.

Depends on D112310

Attachment #9216305 - Attachment description: Bug 1703705 - Call AsyncPanZoomController::CancelAnimation if we get pan gesture events which will not be handled by APZ. r?botond → Bug 1703705 - Add PanInterruped type pan gesture and send it to restore overscrolled state, etc. r?botond
Pushed by hikezoe.birchill@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/de93bec5a450
Drop APZCTreeManager argument from the ctor of ScopedLayerTreeRegistration. r=botond
https://hg.mozilla.org/integration/autoland/rev/e0ddabdbfd9c
Add another variant ctor of ScopedLayerTreeRegistration for WebRender. r=botond
https://hg.mozilla.org/integration/autoland/rev/c2e446814a27
Add PanInterruped type pan gesture and send it to restore overscrolled state, etc. r=botond
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch

Verified fixed on the latest version of Nightly 90.0a1 (2021-04-21) (20210421095627) on MacOS 11.2.3 (MacBook Pro).

Status: RESOLVED → VERIFIED

Comment on attachment 9216305 [details]
Bug 1703705 - Add PanInterruped type pan gesture and send it to restore overscrolled state, etc. r?botond

Beta/Release Uplift Approval Request

  • User impact if declined: [Required for MR1 / Proton] overscroll state gets stuck
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce: It's already done
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The change itself is relatively straight forward and will unlikely cause any side effects. Also note that relevant patches are only for testing purpose, not for the fix itself.
  • String changes made/needed: none
Attachment #9216305 - Flags: approval-mozilla-beta?
Attachment #9216303 - Flags: approval-mozilla-beta?
Attachment #9216304 - Flags: approval-mozilla-beta?
Whiteboard: [proton-uplift]

Comment on attachment 9216305 [details]
Bug 1703705 - Add PanInterruped type pan gesture and send it to restore overscrolled state, etc. r?botond

Approved for 89 beta 3, thanks.

Attachment #9216305 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9216303 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9216304 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Verified fixed on Beta 98.0b3 (20210422190146) on MacOS 11.2.3.

Regressions: 1711633
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: