Visual viewport resize/scroll events can get lost
Categories
(Core :: Panning and Zooming, defect, P3)
Tracking
()
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.
Assignee | ||
Comment 1•6 years ago
|
||
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 | ||
Updated•6 years ago
|
Assignee | ||
Comment 2•6 years ago
|
||
Assignee | ||
Comment 3•6 years ago
|
||
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.
Assignee | ||
Comment 4•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&group_state=expanded&revision=eb5a3d92d6563fa367ec1c765262d89fcce59c9e uses a weakptr and is looking much greener
Updated•6 years ago
|
Updated•6 years ago
|
Comment 6•6 years ago
|
||
bugherder |
Assignee | ||
Comment 7•6 years ago
|
||
I'm happy to let this ride the trains given the slightly risky nature of the patch
Updated•3 years ago
|
Description
•