Ensure that if the animation is aborted by changing the value of
mState (such as if we get an onTouchStart and set the mState to
TOUCHING), then we don't clobber it and set it back to NOTHING.
Only set it back to NOTHING when the animation finishes normally.
Ensure that all public functions in PZC are always called from
the UI thread, so that internal variables are not mutated on
different threads. I also made animatedZoomTo private so that
it can't be inadvertently called from a non-UI thread outside
the class.
Since the geometryChanged function does nothing if the parameter passed
in is false, better to rename the function to be more indicative of
what it actually does, and remove all the resulting dead code.
This introduces a friction factor, so that the deceleration is relative to
the current velocity. Now, the faster you scroll, the slower the view
decelerates, allowing you to page through longer pages easier.
Some cleanup: ensure we abort and re-bounce the viewport
if the device is rotated during a double-tap zoom. Also
rename variables to be more appropriate
The new Java compositor only handles scrolling the top-level scroll-frame. Use
browser.js to detect when a sub-frame is being scrolled and send an 'override'
event to Java to tell it to pass us scroll events instead of calling the
scroll function on the LayerController.
The velocity filter patch from bug #705114 changed how displace worked during
panning, but this accidentally changed how it worked in some non-panning
situations (such as at the end of a fling or snap animation).
If the Java code is in the middle of a fling when Gecko sends
a viewport update, abort the fling, cancel the velocity, and
re-fling. The re-fling is purely to get the page snapped to an
edge if needed.
Certain devices, such as the HTC Flyer, deliver motion events with identical
coordinates before a touch-release event. This causes kinetic panning to fail,
as the calculated velocity is only based on the last two events.
Introduce a velocity change factor, so that the velocity can only change by a
certain amount per event. This has the effect of smoothing velocity changes
and fixes the bug on the HTC Flyer, at least.
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
Tapping while the page is in overscroll cancels the snap
back and leaves the page stuck in overscroll. To fix,
ensure we always try a snapback when the user removes their
finger.