Force updates to the Java-side viewport from
browser.js when loading a new page and switching
tabs. Ensure the scroll position and zoom are also
reset when needed.
This applies the same patch made to the default preferences of XUL
fennec (mobile/xul/app/mobile.js) in Bug 627842, patch 4 (changeset
d3e230bec2f9, r=roc) to the default preferences of Android Fennec.
This implements computation of the font size inflation factor for a
given frame. Since Fennec does layout using a fake viewport whose width
represents a typical viewport width on the desktop and then allows users
to pan and zoom, fonts are not always readable even when zoomed. The
goal of this font size inflation is to ensure that when a block of text
is zoomed to fill the width of the device, the fonts are large enough to
read. We do this by increasing the font sizes in the page. Since this
increase is a function of the width of the text's container, the
inflation must be performed (in later patches in this series) after
style data computation and after intrinsic width computation.
The font size inflation factor does not vary *within* a block.
Since sync uses a whitelist (the services.sync.prefs.sync.* prefs) for
preferences (i.e., preferences are not synced by default), this patch
does not make any changes relating to sync, since we do not want the
inflation preferences synced across devices (since preferred settings
are likely to be device-specific).
If we sent a viewport to Gecko that causes no change in what's drawn on the
screen, we wouldn't receive a reply and this would cause us to deadlock until
a redraw happens for some other reason.
As viewport changes are throttled at max 1 per 350ms, just remove this check.
After IRC discussion, it was deemed unnecessary.
Earlier patches mistakenly removed the redraw hint. This restores it, and
alters its behaviour to work correctly with regards to the viewport. This
should help mitigate some checker-boarding and performance issues when panning
and zooming.
This patch reinstates pinch-zooming and adds CSS re-scaling so that after
zooming, the page is rendered at the scaled resolution and you get clear text.
--HG--
rename : mobile/android/base/gfx/IntSize.java => mobile/android/base/gfx/FloatSize.java
This patch refactors the code to make some of the value names and ownership
clearer, and to add the idea of a 'viewport' within a 'displayport'. The
displayport is the area of the page which is visible to the underlying buffer
and the viewport is the area of the page which is visible through the
application window.
--HG--
rename : mobile/android/base/ui/ViewportController.java => mobile/android/base/gfx/ViewportMetrics.java