Race condition in viewport update causes 1x1 viewport

RESOLVED FIXED

Status

()

Firefox for Android
General
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: kats, Assigned: kats)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Race condition under the following circumstances:

1. about:home loads
2. you load another page
3. the surface size change event gets sent from the LayerRenderer to the LayerView to the LayerController (which updates the viewport) to the GeckoSoftwareLayerClient, which calls render(). The render() call gets queued because of the throttling.
4. Meanwhile the page underneath finishes loading and fires a DOMContentLoaded event.
5. This triggers the JS code to send a viewport update back to Java (with it's 1x1 last-known viewport size)
6. The JS viewport update clobbers the LayerController's viewport, and sets the viewport size to 1x1
7. The previously throttled Java-initiated viewport change gets sent, but with the new 1x1 viewport size.

This chain of events effectively discards the surface size changed event, and ends up with a 1x1 viewport.

Patch forthcoming.
Created attachment 578682 [details] [diff] [review]
Disallow js from setting java viewport size
Attachment #578682 - Flags: review?(pwalton)
Comment on attachment 578682 [details] [diff] [review]
Disallow js from setting java viewport size

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

LGTM
Attachment #578682 - Flags: review?(pwalton) → review+
https://hg.mozilla.org/projects/birch/rev/e0d050bbd783
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.