From 9a3fae864faf369cd5bd023412e581fce3e38cc5 Mon Sep 17 00:00:00 2001 From: Randall Barker Date: Fri, 5 Aug 2016 14:38:51 -0700 Subject: [PATCH] Bug 1291373 - [geckoview] part 3, Remove MOZ_ANDROID_APZ r=botond,snorp --- gfx/layers/apz/src/APZCTreeManager.cpp | 2 +- gfx/layers/apz/src/AsyncPanZoomController.cpp | 6 +- gfx/layers/apz/util/APZCCallbackHelper.cpp | 2 +- gfx/layers/apz/util/APZEventState.cpp | 2 +- gfx/layers/apz/util/APZThreadUtils.cpp | 6 +- gfx/layers/client/TiledContentClient.cpp | 16 -- .../composite/AsyncCompositionManager.cpp | 6 +- .../composite/AsyncCompositionManager.h | 2 +- gfx/layers/ipc/RemoteContentController.cpp | 2 +- gfx/layers/moz.build | 2 +- gfx/thebes/gfxPlatform.cpp | 2 +- layout/base/nsDisplayList.cpp | 2 - layout/base/nsLayoutUtils.cpp | 8 - layout/base/nsPresShell.cpp | 7 - layout/generic/nsGfxScrollFrame.cpp | 7 - mobile/android/app/mobile.js | 6 +- mobile/android/chrome/content/browser.js | 173 +++++------------- mobile/android/moz.configure | 8 - mobile/android/themes/core/jar.mn | 4 - .../android/themes/core/scrollbar-nonapz.css | 10 - modules/libpref/init/all.js | 7 - toolkit/modules/AppConstants.jsm | 6 - widget/android/nsWindow.cpp | 25 --- 23 files changed, 60 insertions(+), 251 deletions(-) delete mode 100644 mobile/android/themes/core/scrollbar-nonapz.css diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index 4fe608f167cc..a18937814787 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -1768,7 +1768,7 @@ APZCTreeManager::FindRootContentOrRootApzc() const // Note: this is intended to find the same "root" that would be found // by AsyncCompositionManager::ApplyAsyncContentTransformToTree inside - // the MOZ_ANDROID_APZ block. That is, it should find the RCD node if there + // the MOZ_WIDGET_ANDROID block. That is, it should find the RCD node if there // is one, or the root APZC if there is not. // Since BreadthFirstSearch is a pre-order search, we first do a search for // the RCD, and then if we don't find one, we do a search for the root APZC. diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 036cf405a59a..712cc09544d0 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -74,9 +74,9 @@ #include "SharedMemoryBasic.h" // for SharedMemoryBasic #include "ScrollSnap.h" // for ScrollSnapUtils #include "WheelScrollAnimation.h" -#if defined(MOZ_ANDROID_APZ) +#if defined(MOZ_WIDGET_ANDROID) #include "AndroidAPZ.h" -#endif // defined(MOZ_ANDROID_APZ) +#endif // defined(MOZ_WIDGET_ANDROID) #define ENABLE_APZC_LOGGING 0 // #define ENABLE_APZC_LOGGING 1 @@ -105,7 +105,7 @@ typedef mozilla::gfx::Matrix4x4 Matrix4x4; using mozilla::gfx::PointTyped; // Choose between platform-specific implementations. -#ifdef MOZ_ANDROID_APZ +#ifdef MOZ_WIDGET_ANDROID typedef WidgetOverscrollEffect OverscrollEffect; typedef AndroidSpecificState PlatformSpecificState; typedef AndroidFlingAnimation FlingAnimation; diff --git a/gfx/layers/apz/util/APZCCallbackHelper.cpp b/gfx/layers/apz/util/APZCCallbackHelper.cpp index 408d727f27b0..a39bbb3ee354 100644 --- a/gfx/layers/apz/util/APZCCallbackHelper.cpp +++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp @@ -567,7 +567,7 @@ GetRootDocumentElementFor(nsIWidget* aWidget) static nsIFrame* UpdateRootFrameForTouchTargetDocument(nsIFrame* aRootFrame) { -#if defined(MOZ_ANDROID_APZ) +#if defined(MOZ_WIDGET_ANDROID) // Re-target so that the hit test is performed relative to the frame for the // Root Content Document instead of the Root Document which are different in // Android. See bug 1229752 comment 16 for an explanation of why this is necessary. diff --git a/gfx/layers/apz/util/APZEventState.cpp b/gfx/layers/apz/util/APZEventState.cpp index 06dbd9863cf4..1861ba681b3c 100644 --- a/gfx/layers/apz/util/APZEventState.cpp +++ b/gfx/layers/apz/util/APZEventState.cpp @@ -454,7 +454,7 @@ APZEventState::ProcessClusterHit() { // If we hit a cluster of links then we shouldn't activate any of them, // as we will be showing the zoomed view. (This is only called on Fennec). -#ifndef MOZ_ANDROID_APZ +#ifndef MOZ_WIDGET_ANDROID MOZ_ASSERT(false); #endif mActiveElementManager->ClearActivation(); diff --git a/gfx/layers/apz/util/APZThreadUtils.cpp b/gfx/layers/apz/util/APZThreadUtils.cpp index d9fb0a4d9e85..46f67d010fb8 100644 --- a/gfx/layers/apz/util/APZThreadUtils.cpp +++ b/gfx/layers/apz/util/APZThreadUtils.cpp @@ -6,7 +6,7 @@ #include "mozilla/layers/APZThreadUtils.h" #include "mozilla/layers/Compositor.h" -#ifdef MOZ_ANDROID_APZ +#ifdef MOZ_WIDGET_ANDROID #include "AndroidBridge.h" #endif @@ -57,7 +57,7 @@ APZThreadUtils::RunOnControllerThread(already_AddRefed aTask) { RefPtr task = aTask; -#ifdef MOZ_ANDROID_APZ +#ifdef MOZ_WIDGET_ANDROID // This is needed while nsWindow::ConfigureAPZControllerThread is not propper // implemented. if (AndroidBridge::IsJavaUiThread()) { @@ -83,7 +83,7 @@ APZThreadUtils::RunOnControllerThread(already_AddRefed aTask) /*static*/ bool APZThreadUtils::IsControllerThread() { -#ifdef MOZ_ANDROID_APZ +#ifdef MOZ_WIDGET_ANDROID return AndroidBridge::IsJavaUiThread(); #else return sControllerThread == MessageLoop::current(); diff --git a/gfx/layers/client/TiledContentClient.cpp b/gfx/layers/client/TiledContentClient.cpp index fb01f02c5484..a7a6676c94c5 100644 --- a/gfx/layers/client/TiledContentClient.cpp +++ b/gfx/layers/client/TiledContentClient.cpp @@ -1187,21 +1187,6 @@ ClientMultiTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& a // first, and see if we should just abort this paint. Aborting is usually // caused by there being an incoming, more relevant paint. AsyncTransform viewTransform; -#if defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_ANDROID_APZ) - FrameMetrics contentMetrics = scrollAncestor.Metrics(); - bool abortPaint = false; - // On Android, only the primary scrollable layer is async-scrolled, and the only one - // that the Java-side code can provide details about. If we're tiling some other layer - // then we already have all the information we need about it. - if (contentMetrics.GetScrollId() == mManager->GetRootScrollableLayerId()) { - FrameMetrics compositorMetrics = contentMetrics; - // The ProgressiveUpdateCallback updates the compositorMetrics - abortPaint = mManager->ProgressiveUpdateCallback(!staleRegion.Contains(aInvalidRegion), - compositorMetrics, - !drawingLowPrecision); - viewTransform = ComputeViewTransform(contentMetrics, compositorMetrics); - } -#else MOZ_ASSERT(mSharedFrameMetricsHelper); bool abortPaint = @@ -1210,7 +1195,6 @@ ClientMultiTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& a !staleRegion.Contains(aInvalidRegion), drawingLowPrecision, viewTransform); -#endif TILING_LOG("TILING %p: Progressive update view transform %s zoom %f abort %d\n", mPaintedLayer, ToString(viewTransform.mTranslation).c_str(), viewTransform.mScale.scale, abortPaint); diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index 0a7189dde055..37b6d1f4930a 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -793,7 +793,7 @@ ExpandRootClipRect(Layer* aLayer, const ScreenMargin& aFixedLayerMargins) } } -#ifdef MOZ_ANDROID_APZ +#ifdef MOZ_WIDGET_ANDROID static void MoveScrollbarForLayerMargin(Layer* aRoot, FrameMetrics::ViewID aRootScrollId, const ScreenMargin& aFixedLayerMargins) @@ -930,7 +930,7 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer, const ScrollMetadata& scrollMetadata = layer->GetScrollMetadata(i); const FrameMetrics& metrics = scrollMetadata.GetMetrics(); -#if defined(MOZ_ANDROID_APZ) +#if defined(MOZ_WIDGET_ANDROID) // If we find a metrics which is the root content doc, use that. If not, use // the root layer. Since this function recurses on children first we should // only end up using the root layer if the entire tree was devoid of a @@ -1506,7 +1506,7 @@ AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame, // in Gecko and partially in Java. bool foundRoot = false; if (ApplyAsyncContentTransformToTree(root, &foundRoot)) { -#if defined(MOZ_ANDROID_APZ) +#if defined(MOZ_WIDGET_ANDROID) MOZ_ASSERT(foundRoot); if (foundRoot && mFixedLayerMargins != ScreenMargin()) { MoveScrollbarForLayerMargin(root, mRootScrollableId, mFixedLayerMargins); diff --git a/gfx/layers/composite/AsyncCompositionManager.h b/gfx/layers/composite/AsyncCompositionManager.h index e87c02610079..bf9d1d1f5958 100644 --- a/gfx/layers/composite/AsyncCompositionManager.h +++ b/gfx/layers/composite/AsyncCompositionManager.h @@ -246,7 +246,7 @@ private: TimeStamp mPreviousFrameTimeStamp; -#ifdef MOZ_ANDROID_APZ +#ifdef MOZ_WIDGET_ANDROID // The following two fields are only needed on Fennec with C++ APZ, because // then we need to reposition the gecko scrollbar to deal with the // dynamic toolbar shifting content around. diff --git a/gfx/layers/ipc/RemoteContentController.cpp b/gfx/layers/ipc/RemoteContentController.cpp index 72e9a0c0b194..318f9f916fcd 100644 --- a/gfx/layers/ipc/RemoteContentController.cpp +++ b/gfx/layers/ipc/RemoteContentController.cpp @@ -90,7 +90,7 @@ RemoteContentController::HandleTap(TapType aTapType, void RemoteContentController::PostDelayedTask(already_AddRefed aTask, int aDelayMs) { -#ifdef MOZ_ANDROID_APZ +#ifdef MOZ_WIDGET_ANDROID AndroidBridge::Bridge()->PostTaskToUiThread(Move(aTask), aDelayMs); #else (MessageLoop::current() ? MessageLoop::current() : mUILoop)-> diff --git a/gfx/layers/moz.build b/gfx/layers/moz.build index 50b6aab85712..9347d27cb22b 100644 --- a/gfx/layers/moz.build +++ b/gfx/layers/moz.build @@ -260,7 +260,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': 'ipc/ShadowLayerUtilsGralloc.cpp', ] -if CONFIG['MOZ_ANDROID_APZ']: +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': UNIFIED_SOURCES += [ 'apz/src/AndroidAPZ.cpp', ] diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 8972694b1c87..cd463bd846b2 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -2348,7 +2348,7 @@ gfxPlatform::AsyncPanZoomEnabled() return false; } #endif -#ifdef MOZ_ANDROID_APZ +#ifdef MOZ_WIDGET_ANDROID return true; #else return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly(); diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 322d2aa87b32..3d8cf7e57c78 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -1846,9 +1846,7 @@ already_AddRefed nsDisplayList::PaintRoot(nsDisplayListBuilder* aB // The only case we don't want to do this is in non-APZ fennec, where // we want the root xul document to get a null scroll id so that the root // content document gets the first non-null scroll id. -#if !defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ANDROID_APZ) content = document->GetDocumentElement(); -#endif } diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index b56a6e1f21b9..c08936099455 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -891,11 +891,7 @@ nsLayoutUtils::AsyncPanZoomEnabled(nsIFrame* aFrame) float nsLayoutUtils::GetCurrentAPZResolutionScale(nsIPresShell* aShell) { -#if !defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ANDROID_APZ) return aShell ? aShell->GetCumulativeNonRootScaleResolution() : 1.0; -#else - return 1.0f; -#endif } // Return the maximum displayport size, based on the LayerManager's maximum @@ -3476,7 +3472,6 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram } } } -#if !defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ANDROID_APZ) else if (presShell->GetDocument() && presShell->GetDocument()->IsRootDisplayDocument() && !presShell->GetRootScrollFrame()) { // In cases where the root document is a XUL document, we want to take @@ -3487,7 +3482,6 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram id = nsLayoutUtils::FindOrCreateIDFor(element); } } -#endif nsDisplayListBuilder::AutoCurrentScrollParentIdSetter idSetter(&builder, id); @@ -8479,7 +8473,6 @@ nsLayoutUtils::CalculateScrollableRectForFrame(nsIScrollableFrame* aScrollableFr // provide the special behaviour, this code will cause it to break. We can remove // the ifndef once Fennec switches over to APZ or if we add the special handling // to Fennec -#if !defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ANDROID_APZ) nsPoint scrollPosition = aScrollableFrame->GetScrollPosition(); if (aScrollableFrame->GetScrollbarStyles().mVertical == NS_STYLE_OVERFLOW_HIDDEN) { contentBounds.y = scrollPosition.y; @@ -8489,7 +8482,6 @@ nsLayoutUtils::CalculateScrollableRectForFrame(nsIScrollableFrame* aScrollableFr contentBounds.x = scrollPosition.x; contentBounds.width = 0; } -#endif contentBounds.width += aScrollableFrame->GetScrollPortRect().width; contentBounds.height += aScrollableFrame->GetScrollPortRect().height; diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 0dfbcb28f17d..630be8daae00 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -793,14 +793,7 @@ PresShell::PresShell() mIsActive = true; mIsHidden = false; // FIXME/bug 735029: find a better solution to this problem -#if defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_ANDROID_APZ) - // The java pan/zoom code uses this to mean approximately "request a - // reset of pan/zoom state" which doesn't necessarily correspond - // with the first paint of content. - mIsFirstPaint = false; -#else mIsFirstPaint = true; -#endif mPresShellId = sNextPresShellId++; mFrozen = false; mRenderFlags = 0; diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 9d30fe07e732..c9f5a45f3130 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -3578,13 +3578,6 @@ ScrollFrameHelper::ComputeScrollMetadata(Layer* aLayer, bool isRootContent = mIsRoot && mOuter->PresContext()->IsRootContentDocument(); bool thisScrollFrameUsesAsyncScrolling = nsLayoutUtils::UsesAsyncScrolling(mOuter); -#if defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_ANDROID_APZ) - // Android without apzc (aka the java pan zoom code) only uses async scrolling - // for the root scroll frame of the root content document. - if (!isRootContent) { - thisScrollFrameUsesAsyncScrolling = false; - } -#endif if (!thisScrollFrameUsesAsyncScrolling) { if (parentLayerClip) { // If APZ is not enabled, we still need the displayport to be clipped diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js index 30798a121b57..eae635ba2e14 100644 --- a/mobile/android/app/mobile.js +++ b/mobile/android/app/mobile.js @@ -54,7 +54,7 @@ pref("browser.viewport.desktopWidth", 980); // the value is divided by 1000 and clamped to hard-coded min/max scale values. pref("browser.viewport.defaultZoom", -1); -#ifdef MOZ_ANDROID_APZ +#ifdef MOZ_WIDGET_ANDROID // Show/Hide scrollbars when active/inactive pref("ui.showHideScrollbars", 1); pref("ui.useOverlayScrollbars", 1); @@ -561,10 +561,6 @@ pref("ui.dragThresholdY", 25); pref("layers.acceleration.disabled", false); pref("layers.async-video.enabled", true); -#ifndef MOZ_ANDROID_APZ -pref("layers.async-pan-zoom.enabled", false); -#endif - pref("apz.content_response_timeout", 600); pref("apz.allow_immediate_handoff", false); pref("apz.touch_start_tolerance", "0.06"); diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 75ccc7f101a4..eab439eeaed6 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -1523,58 +1523,46 @@ var BrowserApp = { if (formHelperMode == kFormHelperModeDisabled) return; - if (!AppConstants.MOZ_ANDROID_APZ) { - let focused = this.getFocusedInput(aBrowser); - if (focused) { - let shouldZoom = Services.prefs.getBoolPref("formhelper.autozoom"); - if (formHelperMode == kFormHelperModeDynamic && this.isTablet) - shouldZoom = false; - // ZoomHelper.zoomToElement will handle not sending any message if this input is already mostly filling the screen - ZoomHelper.zoomToElement(focused, -1, false, - aAllowZoom && shouldZoom && !ViewportHandler.isViewportSpecified(aBrowser.contentWindow)); - } - } else { - let dwu = aBrowser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); - if (!dwu) { - return; - } - - let apzFlushDone = function() { - Services.obs.removeObserver(apzFlushDone, "apz-repaints-flushed", false); - dwu.zoomToFocusedInput(); - }; - - let paintDone = function() { - window.removeEventListener("MozAfterPaint", paintDone, false); - if (dwu.flushApzRepaints()) { - Services.obs.addObserver(apzFlushDone, "apz-repaints-flushed", false); - } else { - apzFlushDone(); - } - }; - - let gotResizeWindow = false; - let resizeWindow = function(e) { - gotResizeWindow = true; - aBrowser.contentWindow.removeEventListener("resize", resizeWindow, false); - if (dwu.isMozAfterPaintPending) { - window.addEventListener("MozAfterPaint", paintDone, false); - } else { - paintDone(); - } - } - - aBrowser.contentWindow.addEventListener("resize", resizeWindow, false); - - // The "resize" event sometimes fails to fire, so set a timer to catch that case - // and unregister the event listener. See Bug 1253469 - setTimeout(function(e) { - if (!gotResizeWindow) { - aBrowser.contentWindow.removeEventListener("resize", resizeWindow, false); - dwu.zoomToFocusedInput(); - } - }, 500); + let dwu = aBrowser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); + if (!dwu) { + return; } + + let apzFlushDone = function() { + Services.obs.removeObserver(apzFlushDone, "apz-repaints-flushed", false); + dwu.zoomToFocusedInput(); + }; + + let paintDone = function() { + window.removeEventListener("MozAfterPaint", paintDone, false); + if (dwu.flushApzRepaints()) { + Services.obs.addObserver(apzFlushDone, "apz-repaints-flushed", false); + } else { + apzFlushDone(); + } + }; + + let gotResizeWindow = false; + let resizeWindow = function(e) { + gotResizeWindow = true; + aBrowser.contentWindow.removeEventListener("resize", resizeWindow, false); + if (dwu.isMozAfterPaintPending) { + window.addEventListener("MozAfterPaint", paintDone, false); + } else { + paintDone(); + } + } + + aBrowser.contentWindow.addEventListener("resize", resizeWindow, false); + + // The "resize" event sometimes fails to fire, so set a timer to catch that case + // and unregister the event listener. See Bug 1253469 + setTimeout(function(e) { + if (!gotResizeWindow) { + aBrowser.contentWindow.removeEventListener("resize", resizeWindow, false); + dwu.zoomToFocusedInput(); + } + }, 500); }, getUALocalePref: function () { @@ -3801,43 +3789,11 @@ Tab.prototype = { }, setViewport: function(aViewport) { - if (AppConstants.MOZ_ANDROID_APZ) { - // This should already be getting short-circuited out in GeckoLayerClient, - // but this is an extra safety precaution - return; - } - - // Transform coordinates based on zoom - let x = aViewport.x / aViewport.zoom; - let y = aViewport.y / aViewport.zoom; - - this.setScrollClampingSize(aViewport.zoom); - - let win = this.browser.contentWindow; - win.scrollTo(x, y); - this.saveSessionZoom(aViewport.zoom); - - this.userScrollPos.x = win.scrollX; - this.userScrollPos.y = win.scrollY; - this.setResolution(aViewport.zoom, false); - - if (aViewport.displayPort) - this.setDisplayPort(aViewport.displayPort); + return; }, setResolution: function(aZoom, aForce) { - if (AppConstants.MOZ_ANDROID_APZ) { - return; - } - // Set zoom level - if (aForce || !fuzzyEquals(aZoom, this._zoom)) { - this._zoom = aZoom; - if (BrowserApp.selectedTab == this) { - let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); - this._drawZoom = aZoom; - cwu.setResolutionAndScaleTo(aZoom / window.devicePixelRatio); - } - } + return; }, getViewport: function() { @@ -3902,13 +3858,7 @@ Tab.prototype = { }, sendViewportUpdate: function(aPageSizeUpdate) { - if (AppConstants.MOZ_ANDROID_APZ) { - return; - } - let viewport = this.getViewport(); - let displayPort = Services.androidBridge.getDisplayPort(aPageSizeUpdate, BrowserApp.isBrowserContentDocumentDisplayed(), this.id, viewport); - if (displayPort != null) - this.setDisplayPort(displayPort); + return; }, // These constants are used to prioritize high quality metadata over low quality data, so that @@ -4696,15 +4646,7 @@ var BrowserEventHandler = { Services.obs.addObserver(this, "Gesture:SingleTap", false); Services.obs.addObserver(this, "Gesture:ClickInZoomedView", false); - if (!AppConstants.MOZ_ANDROID_APZ) { - Services.obs.addObserver(this, "Gesture:CancelTouch", false); - Services.obs.addObserver(this, "Gesture:DoubleTap", false); - Services.obs.addObserver(this, "Gesture:Scroll", false); - Services.obs.addObserver(this, "dom-touch-listener-added", false); - BrowserApp.deck.addEventListener("touchstart", this, true); - } else { - BrowserApp.deck.addEventListener("touchend", this, true); - } + BrowserApp.deck.addEventListener("touchend", this, true); BrowserApp.deck.addEventListener("DOMUpdatePageReport", PopupBlockerObserver.onUpdatePageReport, false); BrowserApp.deck.addEventListener("MozMouseHittest", this, true); @@ -4928,21 +4870,8 @@ var BrowserEventHandler = { if (this._clickInZoomedView != true) { this._closeZoomedView(); } - if (!AppConstants.MOZ_ANDROID_APZ) { - // The _highlightElement was chosen after fluffing the touch events - // that led to this SingleTap, so by fluffing the mouse events, they - // should find the same target since we fluff them again below. - this._sendMouseEvent("mousemove", x, y); - this._sendMouseEvent("mousedown", x, y); - this._sendMouseEvent("mouseup", x, y); - } } this._clickInZoomedView = false; - if (!AppConstants.MOZ_ANDROID_APZ) { - // scrollToFocusedInput does its own checks to find out if an element should be zoomed into - BrowserApp.scrollToFocusedInput(BrowserApp.selectedBrowser); - } - this._cancelTapHighlight(); break; } @@ -5016,9 +4945,6 @@ var BrowserEventHandler = { _highlightElement: null, _doTapHighlight: function _doTapHighlight(aElement) { - if (!AppConstants.MOZ_ANDROID_APZ) { - DOMUtils.setContentState(aElement, kStateActive); - } this._highlightElement = aElement; }, @@ -5026,15 +4952,6 @@ var BrowserEventHandler = { if (!this._highlightElement) return; - if (!AppConstants.MOZ_ANDROID_APZ) { - // If the active element is in a sub-frame, we need to make that frame's document - // active to remove the element's active state. - if (this._highlightElement.ownerDocument != BrowserApp.selectedBrowser.contentWindow.document) - DOMUtils.setContentState(this._highlightElement.ownerDocument.documentElement, kStateActive); - - DOMUtils.setContentState(BrowserApp.selectedBrowser.contentWindow.document.documentElement, kStateActive); - } - this._highlightElement = null; }, @@ -5987,10 +5904,6 @@ var ViewportHandler = { let scrollChange = JSON.parse(aData); let windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); windowUtils.setNextPaintSyncId(scrollChange.id); - if (!AppConstants.MOZ_ANDROID_APZ) { - let win = BrowserApp.selectedTab.browser.contentWindow; - win.scrollBy(scrollChange.x, scrollChange.y); - } } }, diff --git a/mobile/android/moz.configure b/mobile/android/moz.configure index 23e6f971fa6d..f1747d32b33b 100644 --- a/mobile/android/moz.configure +++ b/mobile/android/moz.configure @@ -55,14 +55,6 @@ option(env='MOZ_ANDROID_ACTIVITY_STREAM', set_config('MOZ_ANDROID_ACTIVITY_STREAM', depends_if('MOZ_ANDROID_ACTIVITY_STREAM')(lambda _: True)) -option('--disable-android-apz', env='MOZ_ANDROID_APZ', - help='Disable the C++ async pan/zoom code and use the Java version instead') - -android_apz = depends_if('--disable-android-apz')(lambda _: True) - -set_config('MOZ_ANDROID_APZ', android_apz) -set_define('MOZ_ANDROID_APZ', android_apz) - option(env='MOZ_ANDROID_PACKAGE_INSTALL_BOUNCER', help='Build and package the install bouncer APK', default=True) diff --git a/mobile/android/themes/core/jar.mn b/mobile/android/themes/core/jar.mn index 92623f0b9803..3ae6ea4853a0 100644 --- a/mobile/android/themes/core/jar.mn +++ b/mobile/android/themes/core/jar.mn @@ -23,11 +23,7 @@ chrome.jar: skin/aboutSupport.css (aboutSupport.css) skin/browser.css (browser.css) skin/content.css (content.css) -#ifdef MOZ_ANDROID_APZ skin/scrollbar.css (scrollbar-apz.css) -#else - skin/scrollbar.css (scrollbar-nonapz.css) -#endif skin/config.css (config.css) skin/defines.css (defines.css) skin/touchcontrols.css (touchcontrols.css) diff --git a/mobile/android/themes/core/scrollbar-nonapz.css b/mobile/android/themes/core/scrollbar-nonapz.css deleted file mode 100644 index 2b3f38037080..000000000000 --- a/mobile/android/themes/core/scrollbar-nonapz.css +++ /dev/null @@ -1,10 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -@namespace url("http://www.w3.org/1999/xhtml"); -@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); - -html xul|scrollbar { - display: none; -} diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 7b4c9ab48d9a..622812d79379 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -3870,16 +3870,9 @@ pref("print.print_paper_size", 0); // around the content of the page for Print Preview only pref("print.print_extra_margin", 0); // twips -// CSSOM-View scroll-behavior smooth scrolling and scroll snap requires the C++ APZC -#ifdef MOZ_ANDROID_APZ pref("layout.css.scroll-behavior.enabled", true); pref("layout.css.scroll-behavior.property-enabled", true); pref("layout.css.scroll-snap.enabled", true); -#else -pref("layout.css.scroll-behavior.enabled", false); -pref("layout.css.scroll-behavior.property-enabled", false); -pref("layout.css.scroll-snap.enabled", false); -#endif /* PostScript print module prefs */ // pref("print.postscript.enabled", true); diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm index 1008c9249681..98178367ec78 100644 --- a/toolkit/modules/AppConstants.jsm +++ b/toolkit/modules/AppConstants.jsm @@ -317,12 +317,6 @@ this.AppConstants = Object.freeze({ MOZ_B2G_VERSION: @MOZ_B2G_VERSION@, MOZ_B2G_OS_NAME: @MOZ_B2G_OS_NAME@, - MOZ_ANDROID_APZ: -#ifdef MOZ_ANDROID_APZ - true, -#else - false, -#endif DEBUG_JS_MODULES: "@DEBUG_JS_MODULES@", // URL to the hg revision this was built from (e.g. diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index abfe6ee76a88..dedf92ab553f 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -1033,14 +1033,12 @@ public: } } -#ifdef MOZ_ANDROID_APZ MOZ_ASSERT(aNPZC); auto npzc = NativePanZoomController::LocalRef( jni::GetGeckoThreadEnv(), NativePanZoomController::Ref::From(aNPZC)); NPZCSupport::AttachNative( npzc, mozilla::MakeUnique(&window, npzc)); -#endif layerClient->OnGeckoReady(); } @@ -3686,30 +3684,7 @@ nsWindow::UpdateZoomConstraints(const uint32_t& aPresShellId, const FrameMetrics::ViewID& aViewId, const mozilla::Maybe& aConstraints) { -#ifdef MOZ_ANDROID_APZ nsBaseWidget::UpdateZoomConstraints(aPresShellId, aViewId, aConstraints); -#else - if (!aConstraints) { - // This is intended to "clear" previously stored constraints but in our - // case we don't need to bother since they'll get GC'd from browser.js - return; - } - nsIContent* content = nsLayoutUtils::FindContentFor(aViewId); - nsIDocument* doc = content ? content->GetComposedDoc() : nullptr; - if (!doc) { - return; - } - nsCOMPtr obsServ = mozilla::services::GetObserverService(); - nsPrintfCString json("{ \"allowZoom\": %s," - " \"allowDoubleTapZoom\": %s," - " \"minZoom\": %f," - " \"maxZoom\": %f }", - aConstraints->mAllowZoom ? "true" : "false", - aConstraints->mAllowDoubleTapZoom ? "true" : "false", - aConstraints->mMinZoom.scale, aConstraints->mMaxZoom.scale); - obsServ->NotifyObservers(doc, "zoom-constraints-updated", - NS_ConvertASCIItoUTF16(json.get()).get()); -#endif } CompositorBridgeParent*