Closed Bug 1537958 Opened 5 years ago Closed 5 years ago

Visual viewport resize/scroll events can get lost

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox66 --- wontfix
firefox67 --- wontfix
firefox68 --- fixed

People

(Reporter: kats, Assigned: kats)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

The mechanism added in bug 1478776 to dispatch the visual viewport scroll/resize events has a flaw because the VisualViewport object is owned by the nsGlobalWindow, and therefore has a lifetime longer than that of the presshell/refreshdriver it uses to dispatch events. So for example the VisualViewport object can set mResizeEvent to new resize event which registers itself with a refresh driver. Then that presShell gets torn down, and so the event never fires, and mResizeEvent is never cleared. Subsequent attempts at firing a resize event will also not work because mResizeEvent is already non-null.

FWIW I'm seeing this while running ./mach mochitest --verify gfx/layers/apz/test/mochitest/test_group_zoom.html on an android x86 emulator, while investigating intermittent failures in that test. At least some of the failures on file might be caused by this.

Assignee: nobody → kats
Priority: -- → P3

It seems that in some scenarios, the lifetime of the visual viewport
object exceeds the lifetime of the prescontext. In particular, the
prescontext produced by GetPresContext() can be torn down and a new one
installed. This can leave the visual viewport in a wedged state where it
has scheduled events to be dispatched, but they will never actually be
dispatched, and then subsequent events will not get scheduled. This
patch checks to see if the prescontext has changed, and if so, discards
the old events and reschedules new ones.

No longer blocks: 1478776
Regressed by: 1478776
Keywords: regression
Pushed by kgupta@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4d0388ce7f1a
Discard and reschedule visual viewport events if the prescontext changes. r=botond
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68

I'm happy to let this ride the trains given the slightly risky nature of the patch

Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: