Backed out changeset b84baa03b9d1 (bug 868341) for mochitest -4 and bc testfailures

This commit is contained in:
Carsten "Tomcat" Book
2013-12-20 12:42:16 +01:00
parent 0cb3b15a69
commit 9fd8972b64
2 changed files with 22 additions and 49 deletions

View File

@@ -245,16 +245,12 @@ class JavaPanZoomController
final RectF zoomRect = new RectF(x, y,
x + (float)message.getDouble("w"),
y + (float)message.getDouble("h"));
if (message.optBoolean("animate", true)) {
mTarget.post(new Runnable() {
@Override
public void run() {
animatedZoomTo(zoomRect);
}
});
} else {
mTarget.setViewportMetrics(getMetricsToZoomTo(zoomRect));
}
mTarget.post(new Runnable() {
@Override
public void run() {
animatedZoomTo(zoomRect);
}
});
} else if (MESSAGE_ZOOM_PAGE.equals(event)) {
ImmutableViewportMetrics metrics = getMetrics();
RectF cssPageRect = metrics.getCssPageRect();
@@ -268,16 +264,12 @@ class JavaPanZoomController
y + dh/2,
cssPageRect.width(),
y + dh/2 + newHeight);
if (message.optBoolean("animate", true)) {
mTarget.post(new Runnable() {
@Override
public void run() {
animatedZoomTo(r);
}
});
} else {
mTarget.setViewportMetrics(getMetricsToZoomTo(r));
}
mTarget.post(new Runnable() {
@Override
public void run() {
animatedZoomTo(r);
}
});
} else if (MESSAGE_TOUCH_LISTENER.equals(event)) {
int tabId = message.getInt("tabID");
final Tab tab = Tabs.getInstance().getTab(tabId);
@@ -1407,7 +1399,7 @@ class JavaPanZoomController
* While we usually use device pixels, @zoomToRect must be specified in CSS
* pixels.
*/
private ImmutableViewportMetrics getMetricsToZoomTo(RectF zoomToRect) {
private boolean animatedZoomTo(RectF zoomToRect) {
final float startZoom = getMetrics().zoomFactor;
RectF viewport = getMetrics().getViewport();
@@ -1442,11 +1434,8 @@ class JavaPanZoomController
// 2. now run getValidViewportMetrics on it, so that the target viewport is
// clamped down to prevent overscroll, over-zoom, and other bad conditions.
finalMetrics = getValidViewportMetrics(finalMetrics);
return finalMetrics;
}
private boolean animatedZoomTo(RectF zoomToRect) {
bounce(getMetricsToZoomTo(zoomToRect), PanZoomState.ANIMATED_ZOOM);
bounce(finalMetrics, PanZoomState.ANIMATED_ZOOM);
return true;
}