Closed Bug 1231177 Opened 9 years ago Closed 4 years ago

Robustify against multiple scrollframes doing interleaved smooth scrolling

Categories

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

defect

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: kats, Assigned: kats)

References

Details

(Keywords: correctness, Whiteboard: [gfx-noted])

Attachments

(2 files)

See bug 1228407 comment 17 for backstory. The patch in that bug was intended to make APZ smooth scrolling better when there's a continual flow of incoming smooth-scroll requests from JS. However the patch leaves an edge case unfixed, where if the page has two separate scrollframes and they are getting smooth-scrolled by JS in an interleaved fashion, then we might run into badness. Filing this bug to take care of this in a follow-up.
Keywords: correctness
Whiteboard: [gfx-noted]

This is a little puzzling to me. In a process with a single scrollframe, mScrollGeneration is always equal to sScrollGenerationCounter, because mScrollGeneration is only ever assigned to by statements of the form mScrollGeneration = ++sScrollGenerationCounter. So we can say that mScrollGeneration != sScrollGenerationCounter if and only if there is another scrollframe in the process, and that scrollframe got a new scroll request. And that's precisely the case that we want to ignore in this bug, which means we should be able to accomplish it by simply removing that clause from the if condition. The fact that mApzSmoothScrollDestination gets reset to Nothing() via other scroll methods should be sufficient to guarantee correctness.

Not a strict blocker, but getting rid of the use site of sScrollGenerationCounter makes things cleaner.

Blocks: 1662019

Retro-test to ensure we don't regress the scenario from bug 1228407.

In the case where there are two scrollframes that get scrolled in an
interleaved manner, the scroll generation counter continually advances
and blocks APZ from updating the main-thread scroll position. This
fixes that by removing the scroll generation counter check from the
relevant condition. The clause is entirely redundant when there is only
a single scrollframe and only causes problems when there are multiple
scrollframes.

Depends on D97033

Pushed by kgupta@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/05c9cf63ecb0
Add a test for bug 1228407. r=botond
https://hg.mozilla.org/integration/autoland/rev/f970b5bdfdbe
Allow scroll position to advance when spamming multiple scrollframes in an interleaved manner. r=botond
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: