Bug 892246 - Allow subdocument scrolling to reveal margins. r=kats

This adds a notification callback to PanZoomTarget that the PanZoomController
can call to notify GeckoLayerClient that a subdocument is being scrolled. This
allows GeckoLayerClient to call LayerMarginsAnimator and alter the margins
accordingly, stopping a page from trapping the toolbar on/off the screen with
a screen-covering subframe.
This commit is contained in:
Chris Lord
2013-07-15 17:03:24 +01:00
parent 03d9ff427f
commit fc99017549
3 changed files with 21 additions and 1 deletions

View File

@@ -806,7 +806,11 @@ class JavaPanZoomController
if (FloatUtils.fuzzyEquals(displacement.x, 0.0f) && FloatUtils.fuzzyEquals(displacement.y, 0.0f)) {
return;
}
if (! mSubscroller.scrollBy(displacement)) {
if (mSubscroller.scrollBy(displacement)) {
synchronized (mTarget.getLock()) {
mTarget.onSubdocumentScrollBy(displacement.x, displacement.y);
}
} else {
synchronized (mTarget.getLock()) {
scrollBy(displacement.x, displacement.y);
}