Prior to this change, isBrowserContentDocumentDisplayed returned false
from the time that the isFirstPaint flag was set in layout to the time
that layout handed off the rendered document to the compositor. However
the way the function is used meant that it needs to return false until
the compositor actually composites the "first-paint" rendering,
otherwise other events can sneak in and run before the compositor. This
patch moves the tracking for the flag into GeckoLayerClient so that it
can be queried and modified synchronously from both the Gecko thread in
browser.js and the compositor thread in setFirstPaintViewport.
This stops margins from being exposed unless the drag was started in an area
of the viewport that's near said margin. The margins will always be exposed
when reaching the edge of the page.
Refactor the dynamic toolbar code so that the ownership of various properties
is clearer, and the page is offset by the toolbar instead of being overlapped.
This fixes problems with the scroll origin of the page not corresponding to
the visible origin on the screen.
Refactor the dynamic toolbar code so that the ownership of various properties
is clearer, and the page is offset by the toolbar instead of being overlapped.
This fixes problems with the scroll origin of the page not corresponding to
the visible origin on the screen.
The viewport wasn't being recalculated when the viewport margins changed, and
was also subject to some rounding errors. Round off the values before
comparing them (as they're screen pixels), and make sure to update the viewport
when the margins change. Margins were also not correctly being altered when
in overscroll, which could cause bottom-aligned fixed position content to be
incorrectly offset.
This patch matches previous behaviour, but adds the following scenarios:
- When rendering is aborted due to the viewport falling out of the displayport,
enable low precision rendering.
- When the viewport falls out of the displayport during low precision rendering,
low precision rendering will be enabled on the next frame.
Make sure to offset the viewport *after* setting the Gecko viewport on
setFirstPaintViewport callbacks, so that we don't store an incorrect viewport
origin and end up offsetting events incorrectly.
Similarly, on page size updates, the Java-side viewport metrics are used to
update the Gecko metrics, so make sure they're clamped so that they aren't
incorrect during overscroll.
If overscroll eats into a fixed margin, we need to apply the opposite
offset to the opposite side of the axis this occurred on. This has the effect
of fixed-position elements aligned to the bottom of the screen remaining
visible when at the top of the page.