Bug 716403 - Make the top of the page accessible with the toolbar visible. r=kats

This makes it possible to scroll to the top of the page with the toolbar visible
in Firefox for Android. It also causes JavaScript scrolling to position 0 to
expose the toolbar.
This commit is contained in:
Chris Lord
2013-03-01 15:46:34 +00:00
parent 9292e6cf3c
commit 444cf7a338
4 changed files with 82 additions and 21 deletions

View File

@@ -857,7 +857,7 @@ class JavaPanZoomController
}
/* Now we pan to the right origin. */
viewportMetrics = viewportMetrics.clamp();
viewportMetrics = viewportMetrics.clampWithMargins();
return viewportMetrics;
}
@@ -869,9 +869,15 @@ class JavaPanZoomController
@Override
protected float getViewportLength() { return getMetrics().getWidth(); }
@Override
protected float getPageStart() { return getMetrics().pageRectLeft; }
protected float getPageStart() {
ImmutableViewportMetrics metrics = getMetrics();
return metrics.pageRectLeft - metrics.fixedLayerMarginLeft;
}
@Override
protected float getPageLength() { return getMetrics().getPageWidth(); }
protected float getPageLength() {
ImmutableViewportMetrics metrics = getMetrics();
return metrics.getPageWidth() + metrics.fixedLayerMarginLeft + metrics.fixedLayerMarginRight;
}
}
private class AxisY extends Axis {
@@ -881,9 +887,15 @@ class JavaPanZoomController
@Override
protected float getViewportLength() { return getMetrics().getHeight(); }
@Override
protected float getPageStart() { return getMetrics().pageRectTop; }
protected float getPageStart() {
ImmutableViewportMetrics metrics = getMetrics();
return metrics.pageRectTop - metrics.fixedLayerMarginTop;
}
@Override
protected float getPageLength() { return getMetrics().getPageHeight(); }
protected float getPageLength() {
ImmutableViewportMetrics metrics = getMetrics();
return metrics.getPageHeight() + metrics.fixedLayerMarginTop + metrics.fixedLayerMarginBottom;
}
}
/*