Bug 1297850 - part 1, Remove dead code left behind after JPZ removal. r=jchen
authorRandall Barker <rbarker@mozilla.com>
Wed, 24 Aug 2016 10:00:02 -0700
changeset 311288 b2b2bb8abf7b69f0e5f5f6d6a263c1aeef41dbd3
parent 311287 76813f407a8cf03a6740532b06538c952af864c1
child 311289 1641b474f9d35dc628eeaa97221e0ec555ab241e
push id20395
push userryanvm@gmail.com
push dateFri, 26 Aug 2016 13:37:30 +0000
treeherderfx-team@a65b35c8e5b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjchen
bugs1297850
milestone51.0a1
Bug 1297850 - part 1, Remove dead code left behind after JPZ removal. r=jchen
gfx/layers/client/ClientLayerManager.cpp
gfx/layers/client/ClientLayerManager.h
mobile/android/base/java/org/mozilla/gecko/prompts/Prompt.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/LayerView.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/NativePanZoomController.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/PanZoomController.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/PanZoomTarget.java
widget/android/AndroidBridge.cpp
widget/android/AndroidBridge.h
widget/android/GeneratedJNINatives.h
widget/android/GeneratedJNIWrappers.cpp
widget/android/GeneratedJNIWrappers.h
widget/android/nsWindow.cpp
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -791,44 +791,16 @@ ClientLayerManager::GetBackendName(nsASt
 #endif
       return;
     }
     default: NS_RUNTIMEABORT("Invalid backend");
   }
 }
 
 bool
-ClientLayerManager::ProgressiveUpdateCallback(bool aHasPendingNewThebesContent,
-                                              FrameMetrics& aMetrics,
-                                              bool aDrawingCritical)
-{
-#ifdef MOZ_WIDGET_ANDROID
-  MOZ_ASSERT(aMetrics.IsScrollable());
-  // This is derived from the code in
-  // gfx/layers/ipc/CompositorBridgeParent.cpp::TransformShadowTree.
-  CSSToLayerScale paintScale = aMetrics.LayersPixelsPerCSSPixel().ToScaleFactor();
-  const CSSRect& metricsDisplayPort =
-    (aDrawingCritical && !aMetrics.GetCriticalDisplayPort().IsEmpty()) ?
-      aMetrics.GetCriticalDisplayPort() : aMetrics.GetDisplayPort();
-  LayerRect displayPort = (metricsDisplayPort + aMetrics.GetScrollOffset()) * paintScale;
-
-  ParentLayerPoint scrollOffset;
-  CSSToParentLayerScale zoom;
-  bool ret = AndroidBridge::Bridge()->ProgressiveUpdateCallback(
-    aHasPendingNewThebesContent, displayPort, paintScale.scale, aDrawingCritical,
-    scrollOffset, zoom);
-  aMetrics.SetScrollOffset(scrollOffset / zoom);
-  aMetrics.SetZoom(CSSToParentLayerScale2D(zoom));
-  return ret;
-#else
-  return false;
-#endif
-}
-
-bool
 ClientLayerManager::AsyncPanZoomEnabled() const
 {
   return mWidget && mWidget->AsyncPanZoomEnabled();
 }
 
 void
 ClientLayerManager::SetNextPaintSyncId(int32_t aSyncId)
 {
--- a/gfx/layers/client/ClientLayerManager.h
+++ b/gfx/layers/client/ClientLayerManager.h
@@ -150,32 +150,16 @@ public:
 
   CompositorBridgeChild* GetRemoteRenderer();
 
   CompositorBridgeChild* GetCompositorBridgeChild();
 
   // Disable component alpha layers with the software compositor.
   virtual bool ShouldAvoidComponentAlphaLayers() override { return !IsCompositingCheap(); }
 
-  /**
-   * Called for each iteration of a progressive tile update. Updates
-   * aMetrics with the current scroll offset and scale being used to composite
-   * the primary scrollable layer in this manager, to determine what area
-   * intersects with the target composition bounds.
-   * aDrawingCritical will be true if the current drawing operation is using
-   * the critical displayport.
-   * Returns true if the update should continue, or false if it should be
-   * cancelled.
-   * This is only called if gfxPlatform::UseProgressiveTilePainting() returns
-   * true.
-   */
-  bool ProgressiveUpdateCallback(bool aHasPendingNewThebesContent,
-                                 FrameMetrics& aMetrics,
-                                 bool aDrawingCritical);
-
   bool InConstruction() { return mPhase == PHASE_CONSTRUCTION; }
 #ifdef DEBUG
   bool InDrawing() { return mPhase == PHASE_DRAWING; }
   bool InForward() { return mPhase == PHASE_FORWARD; }
 #endif
   bool InTransaction() { return mPhase != PHASE_NONE; }
 
   void SetNeedsComposite(bool aNeedsComposite)
--- a/mobile/android/base/java/org/mozilla/gecko/prompts/Prompt.java
+++ b/mobile/android/base/java/org/mozilla/gecko/prompts/Prompt.java
@@ -174,20 +174,16 @@ public class Prompt implements OnClickLi
                 Log.i(LOGTAG, "Location change");
                 mDialog.cancel();
                 break;
         }
     }
 
     private void create(String title, String text, PromptListItem[] listItems, int choiceMode)
             throws IllegalStateException {
-        final LayerView view = GeckoAppShell.getLayerView();
-        if (view != null) {
-            view.abortPanning();
-        }
 
         AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
         if (!TextUtils.isEmpty(title)) {
             // Long strings can delay showing the dialog, so we cap the number of characters shown to 256.
             builder.setTitle(title.substring(0, Math.min(title.length(), 256)));
         }
 
         if (!TextUtils.isEmpty(text)) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
@@ -1139,30 +1139,16 @@ public class GeckoAppShell
             @Override
             public void run() {
                 // TODO
             }
         });
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    public static void notifyDefaultPrevented(final boolean defaultPrevented) {
-        ThreadUtils.postToUiThread(new Runnable() {
-            @Override
-            public void run() {
-                LayerView view = getLayerView();
-                PanZoomController controller = (view == null ? null : view.getPanZoomController());
-                if (controller != null) {
-                    controller.notifyDefaultActionPrevented(defaultPrevented);
-                }
-            }
-        });
-    }
-
-    @WrapForJNI(calledFrom = "gecko")
     public static boolean isNetworkLinkUp() {
         ConnectivityManager cm = (ConnectivityManager)
            getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
         try {
             NetworkInfo info = cm.getActiveNetworkInfo();
             if (info == null || !info.isConnected())
                 return false;
         } catch (SecurityException se) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
@@ -84,18 +84,16 @@ class GeckoLayerClient implements LayerV
      * 1) reading mViewportMetrics from any thread is fine without synchronization
      * 2) writing to mViewportMetrics requires synchronizing on the layer controller object
      * 3) whenever reading multiple fields from mViewportMetrics without synchronization (i.e. in
      *    case 1 above) you should always first grab a local copy of the reference, and then use
      *    that because mViewportMetrics might get reassigned in between reading the different
      *    fields. */
     private volatile ImmutableViewportMetrics mViewportMetrics;
 
-    private ZoomConstraints mZoomConstraints;
-
     private volatile boolean mGeckoIsReady;
 
     private final PanZoomController mPanZoomController;
     private final DynamicToolbarAnimator mToolbarAnimator;
     private final LayerView mView;
 
     /* This flag is true from the time that browser.js detects a first-paint is about to start,
      * to the time that we receive the first-paint composite notification from the compositor.
@@ -120,21 +118,18 @@ class GeckoLayerClient implements LayerV
         mCurrentViewTransform = new ViewTransform(0, 0, 1);
         mProgressiveUpdateData = new ProgressiveUpdateData();
         mProgressiveUpdateDisplayPort = new DisplayPortMetrics();
 
         mForceRedraw = true;
         DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
         mViewportMetrics = new ImmutableViewportMetrics(displayMetrics)
                            .setViewportSize(view.getWidth(), view.getHeight());
-        mZoomConstraints = new ZoomConstraints(false);
-
         Tab tab = Tabs.getInstance().getSelectedTab();
         if (tab != null) {
-            mZoomConstraints = tab.getZoomConstraints();
             mViewportMetrics = mViewportMetrics.setIsRTL(tab.getIsRTL());
         }
 
         mFrameMetrics = mViewportMetrics;
 
         mDrawListeners = new ArrayList<DrawListener>();
         mToolbarAnimator = new DynamicToolbarAnimator(this);
         mPanZoomController = PanZoomController.Factory.create(this, view, eventDispatcher);
@@ -178,34 +173,16 @@ class GeckoLayerClient implements LayerV
 
     public void destroy() {
         mPanZoomController.destroy();
         mToolbarAnimator.destroy();
         mDrawListeners.clear();
         mGeckoIsReady = false;
     }
 
-    /**
-     * Returns true if this client is fine with performing a redraw operation or false if it
-     * would prefer that the action didn't take place.
-     */
-    private boolean getRedrawHint() {
-        if (mForceRedraw) {
-            mForceRedraw = false;
-            return true;
-        }
-
-        if (!mPanZoomController.getRedrawHint()) {
-            return false;
-        }
-
-        return DisplayPortCalculator.aboutToCheckerboard(mViewportMetrics,
-                mPanZoomController.getVelocityVector(), mDisplayPort);
-    }
-
     public LayerView getView() {
         return mView;
     }
 
     public FloatSize getViewportSize() {
         return mViewportMetrics.getSize();
     }
 
@@ -313,211 +290,41 @@ class GeckoLayerClient implements LayerV
         mViewportMetrics = mViewportMetrics.setPageRect(rect, cssRect);
 
         // Page size is owned by the layer client, so no need to notify it of
         // this change.
 
         post(new Runnable() {
             @Override
             public void run() {
-                mPanZoomController.pageRectUpdated();
                 mView.requestRender();
             }
         });
     }
 
-    /** Aborts any pan/zoom animation that is currently in progress. */
-    private void abortPanZoomAnimation() {
-        if (mPanZoomController != null) {
-            post(new Runnable() {
-                @Override
-                public void run() {
-                    mPanZoomController.abortAnimation();
-                }
-            });
-        }
-    }
-
     /**
      * The different types of Viewport messages handled. All viewport events
      * expect a display-port to be returned, but can handle one not being
      * returned.
      */
     private enum ViewportMessageType {
         UPDATE,       // The viewport has changed and should be entirely updated
         PAGE_SIZE     // The viewport's page-size has changed
     }
 
-    /** Viewport message handler. */
-    private DisplayPortMetrics handleViewportMessage(ImmutableViewportMetrics messageMetrics, ViewportMessageType type) {
-        synchronized (getLock()) {
-            ImmutableViewportMetrics newMetrics;
-            ImmutableViewportMetrics oldMetrics = getViewportMetrics();
-
-            switch (type) {
-            default:
-            case UPDATE:
-                // Keep the old viewport size
-                newMetrics = messageMetrics.setViewportSize(oldMetrics.viewportRectWidth, oldMetrics.viewportRectHeight);
-                if (mToolbarAnimator.isResizing()) {
-                    // If we're in the middle of a resize, we don't want to clobber
-                    // the scroll offset, so grab the one from the oldMetrics and
-                    // keep using that. We also don't want to abort animations,
-                    // because at that point we're guaranteed to not be animating
-                    // anyway, and calling abortPanZoomAnimation has a nasty
-                    // side-effect of clmaping and clobbering the metrics, which
-                    // we don't want here.
-                    newMetrics = newMetrics.setViewportOrigin(oldMetrics.viewportRectLeft, oldMetrics.viewportRectTop);
-                    break;
-                }
-                if (!oldMetrics.fuzzyEquals(newMetrics)) {
-                    abortPanZoomAnimation();
-                }
-                break;
-            case PAGE_SIZE:
-                // adjust the page dimensions to account for differences in zoom
-                // between the rendered content (which is what Gecko tells us)
-                // and our zoom level (which may have diverged).
-                float scaleFactor = oldMetrics.zoomFactor / messageMetrics.zoomFactor;
-                newMetrics = oldMetrics.setPageRect(RectUtils.scale(messageMetrics.getPageRect(), scaleFactor), messageMetrics.getCssPageRect());
-                break;
-            }
-
-            // Update the Gecko-side viewport metrics. Make sure to do this
-            // before modifying the metrics below.
-            final ImmutableViewportMetrics geckoMetrics = newMetrics.clamp();
-            post(new Runnable() {
-                @Override
-                public void run() {
-                    mGeckoViewport = geckoMetrics;
-                }
-            });
-
-            setViewportMetrics(newMetrics, type == ViewportMessageType.UPDATE);
-            mDisplayPort = DisplayPortCalculator.calculate(getViewportMetrics(), null);
-        }
-        return mDisplayPort;
-    }
-
     @WrapForJNI(calledFrom = "gecko")
     void contentDocumentChanged() {
         mContentDocumentIsDisplayed = false;
     }
 
     @WrapForJNI(calledFrom = "gecko")
     boolean isContentDocumentDisplayed() {
         return mContentDocumentIsDisplayed;
     }
 
-    // This is called on the Gecko thread to determine if we're still interested
-    // in the update of this display-port to continue. We can return true here
-    // to abort the current update and continue with any subsequent ones. This
-    // is useful for slow-to-render pages when the display-port starts lagging
-    // behind enough that continuing to draw it is wasted effort.
-    @WrapForJNI
-    public ProgressiveUpdateData progressiveUpdateCallback(boolean aHasPendingNewThebesContent,
-                                                           float x, float y, float width, float height,
-                                                           float resolution, boolean lowPrecision) {
-        // Reset the checkerboard risk flag when switching to low precision
-        // rendering.
-        if (lowPrecision && !mLastProgressiveUpdateWasLowPrecision) {
-            // Skip low precision rendering until we're at risk of checkerboarding.
-            if (!mProgressiveUpdateWasInDanger) {
-                mProgressiveUpdateData.abort = true;
-                return mProgressiveUpdateData;
-            }
-            mProgressiveUpdateWasInDanger = false;
-        }
-        mLastProgressiveUpdateWasLowPrecision = lowPrecision;
-
-        // Grab a local copy of the last display-port sent to Gecko and the
-        // current viewport metrics to avoid races when accessing them.
-        DisplayPortMetrics displayPort = mDisplayPort;
-        ImmutableViewportMetrics viewportMetrics = mViewportMetrics;
-        mProgressiveUpdateData.setViewport(viewportMetrics);
-        mProgressiveUpdateData.abort = false;
-
-        // Always abort updates if the resolution has changed. There's no use
-        // in drawing at the incorrect resolution.
-        if (!FloatUtils.fuzzyEquals(resolution, viewportMetrics.zoomFactor)) {
-            Log.d(LOGTAG, "Aborting draw due to resolution change: " + resolution + " != " + viewportMetrics.zoomFactor);
-            mProgressiveUpdateData.abort = true;
-            return mProgressiveUpdateData;
-        }
-
-        // Store the high precision displayport for comparison when doing low
-        // precision updates.
-        if (!lowPrecision) {
-            if (!FloatUtils.fuzzyEquals(resolution, mProgressiveUpdateDisplayPort.resolution) ||
-                !FloatUtils.fuzzyEquals(x, mProgressiveUpdateDisplayPort.getLeft()) ||
-                !FloatUtils.fuzzyEquals(y, mProgressiveUpdateDisplayPort.getTop()) ||
-                !FloatUtils.fuzzyEquals(x + width, mProgressiveUpdateDisplayPort.getRight()) ||
-                !FloatUtils.fuzzyEquals(y + height, mProgressiveUpdateDisplayPort.getBottom())) {
-                mProgressiveUpdateDisplayPort =
-                    new DisplayPortMetrics(x, y, x + width, y + height, resolution);
-            }
-        }
-
-        // If we're not doing low precision draws and we're about to
-        // checkerboard, enable low precision drawing.
-        if (!lowPrecision && !mProgressiveUpdateWasInDanger) {
-            if (DisplayPortCalculator.aboutToCheckerboard(viewportMetrics,
-                  mPanZoomController.getVelocityVector(), mProgressiveUpdateDisplayPort)) {
-                mProgressiveUpdateWasInDanger = true;
-            }
-        }
-
-        // XXX All sorts of rounding happens inside Gecko that becomes hard to
-        //     account exactly for. Given we align the display-port to tile
-        //     boundaries (and so they rarely vary by sub-pixel amounts), just
-        //     check that values are within a couple of pixels of the
-        //     display-port bounds.
-
-        // Never abort drawing if we can't be sure we've sent a more recent
-        // display-port. If we abort updating when we shouldn't, we can end up
-        // with blank regions on the screen and we open up the risk of entering
-        // an endless updating cycle.
-        if (Math.abs(displayPort.getLeft() - mProgressiveUpdateDisplayPort.getLeft()) <= 2 &&
-            Math.abs(displayPort.getTop() - mProgressiveUpdateDisplayPort.getTop()) <= 2 &&
-            Math.abs(displayPort.getBottom() - mProgressiveUpdateDisplayPort.getBottom()) <= 2 &&
-            Math.abs(displayPort.getRight() - mProgressiveUpdateDisplayPort.getRight()) <= 2) {
-            return mProgressiveUpdateData;
-        }
-
-        // Abort updates when the display-port no longer contains the visible
-        // area of the page (that is, the viewport cropped by the page
-        // boundaries).
-        // XXX This makes the assumption that we never let the visible area of
-        //     the page fall outside of the display-port.
-        if (Math.max(viewportMetrics.viewportRectLeft, viewportMetrics.pageRectLeft) + 1 < x ||
-            Math.max(viewportMetrics.viewportRectTop, viewportMetrics.pageRectTop) + 1 < y ||
-            Math.min(viewportMetrics.viewportRectRight(), viewportMetrics.pageRectRight) - 1 > x + width ||
-            Math.min(viewportMetrics.viewportRectBottom(), viewportMetrics.pageRectBottom) - 1 > y + height) {
-            Log.d(LOGTAG, "Aborting update due to viewport not in display-port");
-            mProgressiveUpdateData.abort = true;
-
-            // Enable low-precision drawing, as we're likely to be in danger if
-            // this situation has been encountered.
-            mProgressiveUpdateWasInDanger = true;
-
-            return mProgressiveUpdateData;
-        }
-
-        // Abort drawing stale low-precision content if there's a more recent
-        // display-port in the pipeline.
-        if (lowPrecision && !aHasPendingNewThebesContent) {
-          mProgressiveUpdateData.abort = true;
-        }
-        return mProgressiveUpdateData;
-    }
-
-    void setZoomConstraints(ZoomConstraints constraints) {
-        mZoomConstraints = constraints;
-    }
-
     void setIsRTL(boolean aIsRTL) {
         synchronized (getLock()) {
             ImmutableViewportMetrics newMetrics = getViewportMetrics().setIsRTL(aIsRTL);
             setViewportMetrics(newMetrics, false);
         }
     }
 
     /** The compositor invokes this function just before compositing a frame where the document
@@ -552,28 +359,18 @@ class GeckoLayerClient implements LayerV
                     mGeckoViewport = newMetrics;
                 }
             });
 
             setViewportMetrics(newMetrics);
 
             if (tab != null) {
                 mView.setBackgroundColor(tab.getBackgroundColor());
-                setZoomConstraints(tab.getZoomConstraints());
             }
 
-            // At this point, we have just switched to displaying a different document than we
-            // we previously displaying. This means we need to abort any panning/zooming animations
-            // that are in progress and send an updated display port request to browser.js as soon
-            // as possible. The call to PanZoomController.abortAnimation accomplishes this by calling the
-            // forceRedraw function, which sends the viewport to gecko. The display port request is
-            // actually a full viewport update, which is fine because if browser.js has somehow moved to
-            // be out of sync with this first-paint viewport, then we force them back in sync.
-            abortPanZoomAnimation();
-
             // Indicate that the document is about to be composited so the
             // LayerView background can be removed.
             if (mView.getPaintState() == LayerView.PAINT_START) {
                 mView.setPaintState(LayerView.PAINT_BEFORE_FIRST);
             }
         }
         DisplayPortCalculator.resetPageState();
         mDrawTimingQueue.reset();
@@ -909,22 +706,16 @@ class GeckoLayerClient implements LayerV
     /** Implementation of PanZoomTarget */
     @Override
     public ImmutableViewportMetrics getViewportMetrics() {
         return mViewportMetrics;
     }
 
     /** Implementation of PanZoomTarget */
     @Override
-    public ZoomConstraints getZoomConstraints() {
-        return mZoomConstraints;
-    }
-
-    /** Implementation of PanZoomTarget */
-    @Override
     public FullScreenState getFullScreenState() {
         return mView.getFullScreenState();
     }
 
     /** Implementation of PanZoomTarget */
     @Override
     public PointF getVisibleEndOfLayerView() {
         return mToolbarAnimator.getVisibleEndOfLayerView();
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/LayerView.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/LayerView.java
@@ -372,22 +372,16 @@ public class LayerView extends ScrollVie
 
     public PanZoomController getPanZoomController() { return mPanZoomController; }
     public DynamicToolbarAnimator getDynamicToolbarAnimator() { return mToolbarAnimator; }
 
     public ImmutableViewportMetrics getViewportMetrics() {
         return mLayerClient.getViewportMetrics();
     }
 
-    public void abortPanning() {
-        if (mPanZoomController != null) {
-            mPanZoomController.abortPanning();
-        }
-    }
-
     public PointF convertViewPointToLayerPoint(PointF viewPoint) {
         return mLayerClient.convertViewPointToLayerPoint(viewPoint);
     }
 
     public Matrix getMatrixForLayerRectToViewRect() {
         return mLayerClient.getMatrixForLayerRectToViewRect();
     }
 
@@ -402,37 +396,20 @@ public class LayerView extends ScrollVie
     }
 
     void setSurfaceBackgroundColor(int newColor) {
         if (mSurfaceView != null) {
             mSurfaceView.setBackgroundColor(newColor);
         }
     }
 
-    public void setZoomConstraints(ZoomConstraints constraints) {
-        mLayerClient.setZoomConstraints(constraints);
-    }
-
     public void setIsRTL(boolean aIsRTL) {
         mLayerClient.setIsRTL(aIsRTL);
     }
 
-    @Override
-    public boolean onKeyDown(int keyCode, KeyEvent event) {
-        if (!mLayerClient.isGeckoReady()) {
-            // If gecko isn't loaded yet, don't try sending events to the
-            // native code because it's just going to crash
-            return true;
-        }
-        if (mPanZoomController != null && mPanZoomController.onKeyEvent(event)) {
-            return true;
-        }
-        return false;
-    }
-
     public void requestRender() {
         if (mCompositorCreated) {
             mCompositor.syncInvalidateAndScheduleComposite();
         }
     }
 
     public void postRenderTask(RenderTask task) {
         mRenderer.postRenderTask(task);
@@ -790,17 +767,16 @@ public class LayerView extends ScrollVie
 
     public float getSurfaceTranslation() {
         return mSurfaceTranslation;
     }
 
     @Override
     public void onTabChanged(Tab tab, Tabs.TabEvents msg, String data) {
         if (msg == Tabs.TabEvents.VIEWPORT_CHANGE && Tabs.getInstance().isSelectedTab(tab) && mLayerClient != null) {
-            setZoomConstraints(tab.getZoomConstraints());
             setIsRTL(tab.getIsRTL());
         }
     }
 
     // Public hooks for dynamic toolbar translation
 
     public interface DynamicToolbarListener {
         public void onTranslationChanged(float aToolbarTranslation, float aLayerViewTranslation);
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/NativePanZoomController.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/NativePanZoomController.java
@@ -186,67 +186,20 @@ class NativePanZoomController extends JN
                    (action == MotionEvent.ACTION_HOVER_EXIT)) {
             return handleMouseEvent(event);
         } else {
             return false;
         }
     }
 
     @Override
-    public boolean onKeyEvent(KeyEvent event) {
-        // FIXME implement this
-        return false;
-    }
-
-    @Override
     public void onMotionEventVelocity(final long aEventTime, final float aSpeedY) {
         handleMotionEventVelocity(aEventTime, aSpeedY);
     }
 
-    @Override
-    public PointF getVelocityVector() {
-        // FIXME implement this
-        return new PointF(0, 0);
-    }
-
-    @Override
-    public void pageRectUpdated() {
-        // no-op in APZC, I think
-    }
-
-    @Override
-    public void abortPanning() {
-        // no-op in APZC, I think
-    }
-
-    @Override
-    public void notifyDefaultActionPrevented(boolean prevented) {
-        // no-op: This could get called if accessibility is enabled and the events
-        // are sent to Gecko directly without going through APZ. In this case
-        // we just want to ignore this callback.
-    }
-
-    @WrapForJNI(stubName = "AbortAnimation", calledFrom = "ui")
-    private native void nativeAbortAnimation();
-
-    @Override // PanZoomController
-    public void abortAnimation()
-    {
-        if (!mDestroyed) {
-            nativeAbortAnimation();
-        }
-    }
-
-    @Override // PanZoomController
-    public boolean getRedrawHint()
-    {
-        // FIXME implement this
-        return true;
-    }
-
     @Override @WrapForJNI(calledFrom = "ui") // PanZoomController
     public void destroy() {
         if (mDestroyed || !mTarget.isGeckoReady()) {
             return;
         }
         mDestroyed = true;
         disposeNative();
     }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/PanZoomController.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/PanZoomController.java
@@ -9,42 +9,29 @@ import org.mozilla.gecko.GeckoAppShell;
 import org.mozilla.gecko.EventDispatcher;
 
 import android.graphics.PointF;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.View;
 
 public interface PanZoomController {
-    // The distance the user has to pan before we recognize it as such (e.g. to avoid 1-pixel pans
-    // between the touch-down and touch-up of a click). In units of density-independent pixels.
-    public static final float PAN_THRESHOLD = 1 / 16f * GeckoAppShell.getDpi();
-
     // Threshold for sending touch move events to content
     public static final float CLICK_THRESHOLD = 1 / 50f * GeckoAppShell.getDpi();
 
     static class Factory {
         static PanZoomController create(PanZoomTarget target, View view, EventDispatcher dispatcher) {
             return new NativePanZoomController(target, view);
         }
     }
 
     public void destroy();
 
     public boolean onTouchEvent(MotionEvent event);
     public boolean onMotionEvent(MotionEvent event);
-    public boolean onKeyEvent(KeyEvent event);
     public void onMotionEventVelocity(final long aEventTime, final float aSpeedY);
-    public void notifyDefaultActionPrevented(boolean prevented);
-
-    public boolean getRedrawHint();
-    public PointF getVelocityVector();
-
-    public void pageRectUpdated();
-    public void abortPanning();
-    public void abortAnimation();
 
     public void setOverscrollHandler(final Overscroll controller);
 
     public void setIsLongpressEnabled(boolean isLongpressEnabled);
 
     public ImmutableViewportMetrics adjustScrollForSurfaceShift(ImmutableViewportMetrics aMetrics, PointF aShift);
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/PanZoomTarget.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/PanZoomTarget.java
@@ -7,17 +7,16 @@ package org.mozilla.gecko.gfx;
 
 import org.mozilla.gecko.ZoomConstraints;
 
 import android.graphics.Matrix;
 import android.graphics.PointF;
 
 public interface PanZoomTarget {
     public ImmutableViewportMetrics getViewportMetrics();
-    public ZoomConstraints getZoomConstraints();
     public FullScreenState getFullScreenState();
     public PointF getVisibleEndOfLayerView();
 
     public void setAnimationTarget(ImmutableViewportMetrics viewport);
     public void setViewportMetrics(ImmutableViewportMetrics viewport);
     public void scrollBy(float dx, float dy);
     public void panZoomStopped();
     /** This triggers an (asynchronous) viewport update/redraw. */
--- a/widget/android/AndroidBridge.cpp
+++ b/widget/android/AndroidBridge.cpp
@@ -1397,43 +1397,16 @@ bool
 AndroidBridge::IsContentDocumentDisplayed()
 {
     if (!mLayerClient)
         return false;
 
     return mLayerClient->IsContentDocumentDisplayed();
 }
 
-bool
-AndroidBridge::ProgressiveUpdateCallback(bool aHasPendingNewThebesContent,
-                                         const LayerRect& aDisplayPort, float aDisplayResolution,
-                                         bool aDrawingCritical, ParentLayerPoint& aScrollOffset,
-                                         CSSToParentLayerScale& aZoom)
-{
-    if (!mLayerClient) {
-        ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__);
-        return false;
-    }
-
-    ProgressiveUpdateData::LocalRef progressiveUpdateData =
-            mLayerClient->ProgressiveUpdateCallback(aHasPendingNewThebesContent,
-                                                    (float)aDisplayPort.x,
-                                                    (float)aDisplayPort.y,
-                                                    (float)aDisplayPort.width,
-                                                    (float)aDisplayPort.height,
-                                                           aDisplayResolution,
-                                                          !aDrawingCritical);
-
-    aScrollOffset.x = progressiveUpdateData->X();
-    aScrollOffset.y = progressiveUpdateData->Y();
-    aZoom.scale = progressiveUpdateData->Scale();
-
-    return progressiveUpdateData->Abort();
-}
-
 class AndroidBridge::DelayedTask
 {
     using TimeStamp = mozilla::TimeStamp;
     using TimeDuration = mozilla::TimeDuration;
 
 public:
     DelayedTask(already_AddRefed<Runnable> aTask)
         : mTask(aTask)
--- a/widget/android/AndroidBridge.h
+++ b/widget/android/AndroidBridge.h
@@ -146,19 +146,16 @@ public:
 
     /* These are all implemented in Java */
     bool GetThreadNameJavaProfiling(uint32_t aThreadId, nsCString & aResult);
     bool GetFrameNameJavaProfiling(uint32_t aThreadId, uint32_t aSampleId, uint32_t aFrameId, nsCString & aResult);
 
     void ContentDocumentChanged();
     bool IsContentDocumentDisplayed();
 
-    bool ProgressiveUpdateCallback(bool aHasPendingNewThebesContent, const LayerRect& aDisplayPort, float aDisplayResolution, bool aDrawingCritical,
-                                   mozilla::ParentLayerPoint& aScrollOffset, mozilla::CSSToParentLayerScale& aZoom);
-
     void SetLayerClient(java::GeckoLayerClient::Param jobj);
     const java::GeckoLayerClient::Ref& GetLayerClient() { return mLayerClient; }
 
     bool GetHandlersForURL(const nsAString& aURL,
                            nsIMutableArray* handlersArray = nullptr,
                            nsIHandlerApp **aDefaultApp = nullptr,
                            const nsAString& aAction = EmptyString());
 
--- a/widget/android/GeneratedJNINatives.h
+++ b/widget/android/GeneratedJNINatives.h
@@ -536,17 +536,17 @@ const JNINativeMethod LayerView::Composi
             mozilla::jni::NativeStub<LayerView::Compositor::SyncResumeResizeCompositor_t, Impl>
             ::template Wrap<&Impl::SyncResumeResizeCompositor>)
 };
 
 template<class Impl>
 class NativePanZoomController::Natives : public mozilla::jni::NativeImpl<NativePanZoomController, Impl>
 {
 public:
-    static const JNINativeMethod methods[8];
+    static const JNINativeMethod methods[7];
 };
 
 template<class Impl>
 const JNINativeMethod NativePanZoomController::Natives<Impl>::methods[] = {
 
     mozilla::jni::MakeNativeMethod<NativePanZoomController::AdjustScrollForSurfaceShift_t>(
             mozilla::jni::NativeStub<NativePanZoomController::AdjustScrollForSurfaceShift_t, Impl>
             ::template Wrap<&Impl::AdjustScrollForSurfaceShift>),
@@ -566,20 +566,16 @@ const JNINativeMethod NativePanZoomContr
     mozilla::jni::MakeNativeMethod<NativePanZoomController::HandleMouseEvent_t>(
             mozilla::jni::NativeStub<NativePanZoomController::HandleMouseEvent_t, Impl>
             ::template Wrap<&Impl::HandleMouseEvent>),
 
     mozilla::jni::MakeNativeMethod<NativePanZoomController::HandleScrollEvent_t>(
             mozilla::jni::NativeStub<NativePanZoomController::HandleScrollEvent_t, Impl>
             ::template Wrap<&Impl::HandleScrollEvent>),
 
-    mozilla::jni::MakeNativeMethod<NativePanZoomController::AbortAnimation_t>(
-            mozilla::jni::NativeStub<NativePanZoomController::AbortAnimation_t, Impl>
-            ::template Wrap<&Impl::AbortAnimation>),
-
     mozilla::jni::MakeNativeMethod<NativePanZoomController::SetIsLongpressEnabled_t>(
             mozilla::jni::NativeStub<NativePanZoomController::SetIsLongpressEnabled_t, Impl>
             ::template Wrap<&Impl::SetIsLongpressEnabled>)
 };
 
 template<class Impl>
 class CodecProxy::NativeCallbacks::Natives : public mozilla::jni::NativeImpl<NativeCallbacks, Impl>
 {
--- a/widget/android/GeneratedJNIWrappers.cpp
+++ b/widget/android/GeneratedJNIWrappers.cpp
@@ -583,24 +583,16 @@ auto GeckoAppShell::MoveTaskToBack() -> 
 }
 
 constexpr char GeckoAppShell::NotifyObservers_t::name[];
 constexpr char GeckoAppShell::NotifyObservers_t::signature[];
 
 constexpr char GeckoAppShell::NotifyAlertListener_t::name[];
 constexpr char GeckoAppShell::NotifyAlertListener_t::signature[];
 
-constexpr char GeckoAppShell::NotifyDefaultPrevented_t::name[];
-constexpr char GeckoAppShell::NotifyDefaultPrevented_t::signature[];
-
-auto GeckoAppShell::NotifyDefaultPrevented(bool a0) -> void
-{
-    return mozilla::jni::Method<NotifyDefaultPrevented_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
 constexpr char GeckoAppShell::NotifyUriVisited_t::name[];
 constexpr char GeckoAppShell::NotifyUriVisited_t::signature[];
 
 constexpr char GeckoAppShell::NotifyWakeLockChanged_t::name[];
 constexpr char GeckoAppShell::NotifyWakeLockChanged_t::signature[];
 
 auto GeckoAppShell::NotifyWakeLockChanged(mozilla::jni::String::Param a0, mozilla::jni::String::Param a1) -> void
 {
@@ -1303,24 +1295,16 @@ auto GeckoLayerClient::IsContentDocument
 constexpr char GeckoLayerClient::OnGeckoReady_t::name[];
 constexpr char GeckoLayerClient::OnGeckoReady_t::signature[];
 
 auto GeckoLayerClient::OnGeckoReady() const -> void
 {
     return mozilla::jni::Method<OnGeckoReady_t>::Call(GeckoLayerClient::mCtx, nullptr);
 }
 
-constexpr char GeckoLayerClient::ProgressiveUpdateCallback_t::name[];
-constexpr char GeckoLayerClient::ProgressiveUpdateCallback_t::signature[];
-
-auto GeckoLayerClient::ProgressiveUpdateCallback(bool a0, float a1, float a2, float a3, float a4, float a5, bool a6) const -> mozilla::jni::Object::LocalRef
-{
-    return mozilla::jni::Method<ProgressiveUpdateCallback_t>::Call(GeckoLayerClient::mCtx, nullptr, a0, a1, a2, a3, a4, a5, a6);
-}
-
 constexpr char GeckoLayerClient::SetFirstPaintViewport_t::name[];
 constexpr char GeckoLayerClient::SetFirstPaintViewport_t::signature[];
 
 auto GeckoLayerClient::SetFirstPaintViewport(float a0, float a1, float a2, float a3, float a4, float a5, float a6) const -> void
 {
     return mozilla::jni::Method<SetFirstPaintViewport_t>::Call(GeckoLayerClient::mCtx, nullptr, a0, a1, a2, a3, a4, a5, a6);
 }
 
@@ -1501,19 +1485,16 @@ constexpr char NativePanZoomController::
 constexpr char NativePanZoomController::HandleMotionEventVelocity_t::signature[];
 
 constexpr char NativePanZoomController::HandleMouseEvent_t::name[];
 constexpr char NativePanZoomController::HandleMouseEvent_t::signature[];
 
 constexpr char NativePanZoomController::HandleScrollEvent_t::name[];
 constexpr char NativePanZoomController::HandleScrollEvent_t::signature[];
 
-constexpr char NativePanZoomController::AbortAnimation_t::name[];
-constexpr char NativePanZoomController::AbortAnimation_t::signature[];
-
 constexpr char NativePanZoomController::SetIsLongpressEnabled_t::name[];
 constexpr char NativePanZoomController::SetIsLongpressEnabled_t::signature[];
 
 constexpr char NativePanZoomController::OnSelectionDragState_t::name[];
 constexpr char NativePanZoomController::OnSelectionDragState_t::signature[];
 
 auto NativePanZoomController::OnSelectionDragState(bool a0) const -> void
 {
--- a/widget/android/GeneratedJNIWrappers.h
+++ b/widget/android/GeneratedJNIWrappers.h
@@ -1566,36 +1566,16 @@ public:
         static const mozilla::jni::ExceptionMode exceptionMode =
                 mozilla::jni::ExceptionMode::ABORT;
         static const mozilla::jni::CallingThread callingThread =
                 mozilla::jni::CallingThread::ANY;
         static const mozilla::jni::DispatchTarget dispatchTarget =
                 mozilla::jni::DispatchTarget::GECKO;
     };
 
-    struct NotifyDefaultPrevented_t {
-        typedef GeckoAppShell Owner;
-        typedef void ReturnType;
-        typedef void SetterType;
-        typedef mozilla::jni::Args<
-                bool> Args;
-        static constexpr char name[] = "notifyDefaultPrevented";
-        static constexpr char signature[] =
-                "(Z)V";
-        static const bool isStatic = true;
-        static const mozilla::jni::ExceptionMode exceptionMode =
-                mozilla::jni::ExceptionMode::ABORT;
-        static const mozilla::jni::CallingThread callingThread =
-                mozilla::jni::CallingThread::GECKO;
-        static const mozilla::jni::DispatchTarget dispatchTarget =
-                mozilla::jni::DispatchTarget::CURRENT;
-    };
-
-    static auto NotifyDefaultPrevented(bool) -> void;
-
     struct NotifyUriVisited_t {
         typedef GeckoAppShell Owner;
         typedef void ReturnType;
         typedef void SetterType;
         typedef mozilla::jni::Args<
                 mozilla::jni::String::Param> Args;
         static constexpr char name[] = "notifyUriVisited";
         static constexpr char signature[] =
@@ -4253,42 +4233,16 @@ public:
         static const mozilla::jni::CallingThread callingThread =
                 mozilla::jni::CallingThread::GECKO;
         static const mozilla::jni::DispatchTarget dispatchTarget =
                 mozilla::jni::DispatchTarget::CURRENT;
     };
 
     auto OnGeckoReady() const -> void;
 
-    struct ProgressiveUpdateCallback_t {
-        typedef GeckoLayerClient Owner;
-        typedef mozilla::jni::Object::LocalRef ReturnType;
-        typedef mozilla::jni::Object::Param SetterType;
-        typedef mozilla::jni::Args<
-                bool,
-                float,
-                float,
-                float,
-                float,
-                float,
-                bool> Args;
-        static constexpr char name[] = "progressiveUpdateCallback";
-        static constexpr char signature[] =
-                "(ZFFFFFZ)Lorg/mozilla/gecko/gfx/ProgressiveUpdateData;";
-        static const bool isStatic = false;
-        static const mozilla::jni::ExceptionMode exceptionMode =
-                mozilla::jni::ExceptionMode::ABORT;
-        static const mozilla::jni::CallingThread callingThread =
-                mozilla::jni::CallingThread::ANY;
-        static const mozilla::jni::DispatchTarget dispatchTarget =
-                mozilla::jni::DispatchTarget::CURRENT;
-    };
-
-    auto ProgressiveUpdateCallback(bool, float, float, float, float, float, bool) const -> mozilla::jni::Object::LocalRef;
-
     struct SetFirstPaintViewport_t {
         typedef GeckoLayerClient Owner;
         typedef void ReturnType;
         typedef void SetterType;
         typedef mozilla::jni::Args<
                 float,
                 float,
                 float,
@@ -4975,33 +4929,16 @@ public:
         static const mozilla::jni::ExceptionMode exceptionMode =
                 mozilla::jni::ExceptionMode::ABORT;
         static const mozilla::jni::CallingThread callingThread =
                 mozilla::jni::CallingThread::UI;
         static const mozilla::jni::DispatchTarget dispatchTarget =
                 mozilla::jni::DispatchTarget::CURRENT;
     };
 
-    struct AbortAnimation_t {
-        typedef NativePanZoomController Owner;
-        typedef void ReturnType;
-        typedef void SetterType;
-        typedef mozilla::jni::Args<> Args;
-        static constexpr char name[] = "nativeAbortAnimation";
-        static constexpr char signature[] =
-                "()V";
-        static const bool isStatic = false;
-        static const mozilla::jni::ExceptionMode exceptionMode =
-                mozilla::jni::ExceptionMode::ABORT;
-        static const mozilla::jni::CallingThread callingThread =
-                mozilla::jni::CallingThread::UI;
-        static const mozilla::jni::DispatchTarget dispatchTarget =
-                mozilla::jni::DispatchTarget::CURRENT;
-    };
-
     struct SetIsLongpressEnabled_t {
         typedef NativePanZoomController Owner;
         typedef void ReturnType;
         typedef void SetterType;
         typedef mozilla::jni::Args<
                 bool> Args;
         static constexpr char name[] = "nativeSetIsLongpressEnabled";
         static constexpr char signature[] =
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -532,35 +532,16 @@ public:
 
         NativePanZoomController::GlobalRef npzc = mNPZC;
         AndroidBridge::Bridge()->PostTaskToUiThread(NewRunnableFunction(
                 static_cast<void(*)(const NPZCRef&)>(callDestroy),
                 mozilla::Move(npzc)), 0);
     }
 
 public:
-    void AbortAnimation()
-    {
-        MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
-
-        RefPtr<IAPZCTreeManager> controller;
-        RefPtr<CompositorBridgeParent> compositor;
-
-        if (LockedWindowPtr window{mWindow}) {
-            controller = window->mAPZC;
-            compositor = window->GetCompositorBridgeParent();
-        }
-
-        if (controller && compositor) {
-            // TODO: Pass in correct values for presShellId and viewId.
-            controller->CancelAnimation(ScrollableLayerGuid(
-                    compositor->RootLayerTreeId(), 0, 0));
-        }
-    }
-
     void AdjustScrollForSurfaceShift(float aX, float aY)
     {
         MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
 
         RefPtr<IAPZCTreeManager> controller;
 
         if (LockedWindowPtr window{mWindow}) {
             controller = window->mAPZC;