Interrupting smooth scrolls can result in not receiving touch events

RESOLVED FIXED in Firefox 41

Status

()

Core
Panning and Zooming
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: cwiiis, Assigned: cwiiis)

Tracking

Trunk
mozilla41
All
Gonk (Firefox OS)
Points:
---

Firefox Tracking Flags

(firefox41 fixed)

Details

(Whiteboard: [gfx-noted])

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

3 years ago
Created attachment 8616723 [details]
Simple test-case

If the user interrupts a JS-initiated smooth scroll before it finishes, those touch events may not be delivered.

The attached test-case contains a red document that will turn green when touched and scroll to the top when the user lets go of it. If you swipe twice in quick succession, the second will 'catch' the JS-initiated smooth scroll and the touchstart/touchend events won't be delivered.

This feels like unexpected behaviour.
What's happening here is what you suspected - the smooth scroll puts the APZC in the "fast motion" state and so the second touch block doesn't get sent to content (but does get sent to the APZC). I think we need to restrict the definition of "fast motion" to be more like "user-initiated fast motion" somehow.
Whiteboard: [gfx-noted]
(Assignee)

Comment 2

3 years ago
Created attachment 8617366 [details] [diff] [review]
Don't skip delivering touch events during smooth scroll

This just checks the mState to make sure it's FLING before returning true in IsFastMoving (which is renamed to IsFastFlinging and the comments updated accordingly).

I suppose this will also stop the same thing happening during overscroll animations, which might make the Twitter mobile website marginally less irritating to use.
Attachment #8617366 - Flags: review?(bugmail.mozilla)
Comment on attachment 8617366 [details] [diff] [review]
Don't skip delivering touch events during smooth scroll

Review of attachment 8617366 [details] [diff] [review]:
-----------------------------------------------------------------

There's also IsDuringFastMotion and mDuringFastMotion in InputBlockState.*
Attachment #8617366 - Flags: review?(bugmail.mozilla) → feedback+
(Also make sure the gtests pass. |mach gtest "A*"| on a desktop build should do it, or a try push.)
(Assignee)

Comment 5

3 years ago
Created attachment 8617438 [details] [diff] [review]
Don't skip delivering touch events during smooth scroll v2

Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=11baa388f4a8

Will flag when/if try comes back green.
Assignee: nobody → chrislord.net
Attachment #8617366 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8617438 - Flags: feedback+
(Assignee)

Comment 6

3 years ago
Comment on attachment 8617438 [details] [diff] [review]
Don't skip delivering touch events during smooth scroll v2

Looking pretty green.
Attachment #8617438 - Flags: review?(bugmail.mozilla)
Comment on attachment 8617438 [details] [diff] [review]
Don't skip delivering touch events during smooth scroll v2

Review of attachment 8617438 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM
Attachment #8617438 - Flags: review?(bugmail.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/7f0b45781f24
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox41: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.