Bug 1291373 - [geckoview] part 3, Remove MOZ_ANDROID_APZ r=botond,snorp

This commit is contained in:
Randall Barker 2016-08-05 14:38:51 -07:00
Родитель d81ee14d7e
Коммит 9a3fae864f
23 изменённых файлов: 60 добавлений и 251 удалений

Просмотреть файл

@ -1768,7 +1768,7 @@ APZCTreeManager::FindRootContentOrRootApzc() const
// Note: this is intended to find the same "root" that would be found // Note: this is intended to find the same "root" that would be found
// by AsyncCompositionManager::ApplyAsyncContentTransformToTree inside // 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. // is one, or the root APZC if there is not.
// Since BreadthFirstSearch is a pre-order search, we first do a search for // 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. // the RCD, and then if we don't find one, we do a search for the root APZC.

Просмотреть файл

@ -74,9 +74,9 @@
#include "SharedMemoryBasic.h" // for SharedMemoryBasic #include "SharedMemoryBasic.h" // for SharedMemoryBasic
#include "ScrollSnap.h" // for ScrollSnapUtils #include "ScrollSnap.h" // for ScrollSnapUtils
#include "WheelScrollAnimation.h" #include "WheelScrollAnimation.h"
#if defined(MOZ_ANDROID_APZ) #if defined(MOZ_WIDGET_ANDROID)
#include "AndroidAPZ.h" #include "AndroidAPZ.h"
#endif // defined(MOZ_ANDROID_APZ) #endif // defined(MOZ_WIDGET_ANDROID)
#define ENABLE_APZC_LOGGING 0 #define ENABLE_APZC_LOGGING 0
// #define ENABLE_APZC_LOGGING 1 // #define ENABLE_APZC_LOGGING 1
@ -105,7 +105,7 @@ typedef mozilla::gfx::Matrix4x4 Matrix4x4;
using mozilla::gfx::PointTyped; using mozilla::gfx::PointTyped;
// Choose between platform-specific implementations. // Choose between platform-specific implementations.
#ifdef MOZ_ANDROID_APZ #ifdef MOZ_WIDGET_ANDROID
typedef WidgetOverscrollEffect OverscrollEffect; typedef WidgetOverscrollEffect OverscrollEffect;
typedef AndroidSpecificState PlatformSpecificState; typedef AndroidSpecificState PlatformSpecificState;
typedef AndroidFlingAnimation FlingAnimation; typedef AndroidFlingAnimation FlingAnimation;

Просмотреть файл

@ -567,7 +567,7 @@ GetRootDocumentElementFor(nsIWidget* aWidget)
static nsIFrame* static nsIFrame*
UpdateRootFrameForTouchTargetDocument(nsIFrame* aRootFrame) 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 // 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 // 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. // Android. See bug 1229752 comment 16 for an explanation of why this is necessary.

Просмотреть файл

@ -454,7 +454,7 @@ APZEventState::ProcessClusterHit()
{ {
// If we hit a cluster of links then we shouldn't activate any of them, // 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). // 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); MOZ_ASSERT(false);
#endif #endif
mActiveElementManager->ClearActivation(); mActiveElementManager->ClearActivation();

Просмотреть файл

@ -6,7 +6,7 @@
#include "mozilla/layers/APZThreadUtils.h" #include "mozilla/layers/APZThreadUtils.h"
#include "mozilla/layers/Compositor.h" #include "mozilla/layers/Compositor.h"
#ifdef MOZ_ANDROID_APZ #ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h" #include "AndroidBridge.h"
#endif #endif
@ -57,7 +57,7 @@ APZThreadUtils::RunOnControllerThread(already_AddRefed<Runnable> aTask)
{ {
RefPtr<Runnable> task = aTask; RefPtr<Runnable> task = aTask;
#ifdef MOZ_ANDROID_APZ #ifdef MOZ_WIDGET_ANDROID
// This is needed while nsWindow::ConfigureAPZControllerThread is not propper // This is needed while nsWindow::ConfigureAPZControllerThread is not propper
// implemented. // implemented.
if (AndroidBridge::IsJavaUiThread()) { if (AndroidBridge::IsJavaUiThread()) {
@ -83,7 +83,7 @@ APZThreadUtils::RunOnControllerThread(already_AddRefed<Runnable> aTask)
/*static*/ bool /*static*/ bool
APZThreadUtils::IsControllerThread() APZThreadUtils::IsControllerThread()
{ {
#ifdef MOZ_ANDROID_APZ #ifdef MOZ_WIDGET_ANDROID
return AndroidBridge::IsJavaUiThread(); return AndroidBridge::IsJavaUiThread();
#else #else
return sControllerThread == MessageLoop::current(); return sControllerThread == MessageLoop::current();

Просмотреть файл

@ -1187,21 +1187,6 @@ ClientMultiTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& a
// first, and see if we should just abort this paint. Aborting is usually // first, and see if we should just abort this paint. Aborting is usually
// caused by there being an incoming, more relevant paint. // caused by there being an incoming, more relevant paint.
AsyncTransform viewTransform; 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); MOZ_ASSERT(mSharedFrameMetricsHelper);
bool abortPaint = bool abortPaint =
@ -1210,7 +1195,6 @@ ClientMultiTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& a
!staleRegion.Contains(aInvalidRegion), !staleRegion.Contains(aInvalidRegion),
drawingLowPrecision, drawingLowPrecision,
viewTransform); viewTransform);
#endif
TILING_LOG("TILING %p: Progressive update view transform %s zoom %f abort %d\n", TILING_LOG("TILING %p: Progressive update view transform %s zoom %f abort %d\n",
mPaintedLayer, ToString(viewTransform.mTranslation).c_str(), viewTransform.mScale.scale, abortPaint); mPaintedLayer, ToString(viewTransform.mTranslation).c_str(), viewTransform.mScale.scale, abortPaint);

Просмотреть файл

@ -793,7 +793,7 @@ ExpandRootClipRect(Layer* aLayer, const ScreenMargin& aFixedLayerMargins)
} }
} }
#ifdef MOZ_ANDROID_APZ #ifdef MOZ_WIDGET_ANDROID
static void static void
MoveScrollbarForLayerMargin(Layer* aRoot, FrameMetrics::ViewID aRootScrollId, MoveScrollbarForLayerMargin(Layer* aRoot, FrameMetrics::ViewID aRootScrollId,
const ScreenMargin& aFixedLayerMargins) const ScreenMargin& aFixedLayerMargins)
@ -930,7 +930,7 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer,
const ScrollMetadata& scrollMetadata = layer->GetScrollMetadata(i); const ScrollMetadata& scrollMetadata = layer->GetScrollMetadata(i);
const FrameMetrics& metrics = scrollMetadata.GetMetrics(); 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 // 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 // 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 // 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. // in Gecko and partially in Java.
bool foundRoot = false; bool foundRoot = false;
if (ApplyAsyncContentTransformToTree(root, &foundRoot)) { if (ApplyAsyncContentTransformToTree(root, &foundRoot)) {
#if defined(MOZ_ANDROID_APZ) #if defined(MOZ_WIDGET_ANDROID)
MOZ_ASSERT(foundRoot); MOZ_ASSERT(foundRoot);
if (foundRoot && mFixedLayerMargins != ScreenMargin()) { if (foundRoot && mFixedLayerMargins != ScreenMargin()) {
MoveScrollbarForLayerMargin(root, mRootScrollableId, mFixedLayerMargins); MoveScrollbarForLayerMargin(root, mRootScrollableId, mFixedLayerMargins);

Просмотреть файл

@ -246,7 +246,7 @@ private:
TimeStamp mPreviousFrameTimeStamp; TimeStamp mPreviousFrameTimeStamp;
#ifdef MOZ_ANDROID_APZ #ifdef MOZ_WIDGET_ANDROID
// The following two fields are only needed on Fennec with C++ APZ, because // 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 // then we need to reposition the gecko scrollbar to deal with the
// dynamic toolbar shifting content around. // dynamic toolbar shifting content around.

Просмотреть файл

@ -90,7 +90,7 @@ RemoteContentController::HandleTap(TapType aTapType,
void void
RemoteContentController::PostDelayedTask(already_AddRefed<Runnable> aTask, int aDelayMs) RemoteContentController::PostDelayedTask(already_AddRefed<Runnable> aTask, int aDelayMs)
{ {
#ifdef MOZ_ANDROID_APZ #ifdef MOZ_WIDGET_ANDROID
AndroidBridge::Bridge()->PostTaskToUiThread(Move(aTask), aDelayMs); AndroidBridge::Bridge()->PostTaskToUiThread(Move(aTask), aDelayMs);
#else #else
(MessageLoop::current() ? MessageLoop::current() : mUILoop)-> (MessageLoop::current() ? MessageLoop::current() : mUILoop)->

Просмотреть файл

@ -260,7 +260,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
'ipc/ShadowLayerUtilsGralloc.cpp', 'ipc/ShadowLayerUtilsGralloc.cpp',
] ]
if CONFIG['MOZ_ANDROID_APZ']: if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
UNIFIED_SOURCES += [ UNIFIED_SOURCES += [
'apz/src/AndroidAPZ.cpp', 'apz/src/AndroidAPZ.cpp',
] ]

Просмотреть файл

@ -2348,7 +2348,7 @@ gfxPlatform::AsyncPanZoomEnabled()
return false; return false;
} }
#endif #endif
#ifdef MOZ_ANDROID_APZ #ifdef MOZ_WIDGET_ANDROID
return true; return true;
#else #else
return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly(); return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly();

Просмотреть файл

@ -1846,9 +1846,7 @@ already_AddRefed<LayerManager> nsDisplayList::PaintRoot(nsDisplayListBuilder* aB
// The only case we don't want to do this is in non-APZ fennec, where // 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 // 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. // content document gets the first non-null scroll id.
#if !defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ANDROID_APZ)
content = document->GetDocumentElement(); content = document->GetDocumentElement();
#endif
} }

Просмотреть файл

@ -891,11 +891,7 @@ nsLayoutUtils::AsyncPanZoomEnabled(nsIFrame* aFrame)
float float
nsLayoutUtils::GetCurrentAPZResolutionScale(nsIPresShell* aShell) { nsLayoutUtils::GetCurrentAPZResolutionScale(nsIPresShell* aShell) {
#if !defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ANDROID_APZ)
return aShell ? aShell->GetCumulativeNonRootScaleResolution() : 1.0; return aShell ? aShell->GetCumulativeNonRootScaleResolution() : 1.0;
#else
return 1.0f;
#endif
} }
// Return the maximum displayport size, based on the LayerManager's maximum // 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() else if (presShell->GetDocument() && presShell->GetDocument()->IsRootDisplayDocument()
&& !presShell->GetRootScrollFrame()) { && !presShell->GetRootScrollFrame()) {
// In cases where the root document is a XUL document, we want to take // 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); id = nsLayoutUtils::FindOrCreateIDFor(element);
} }
} }
#endif
nsDisplayListBuilder::AutoCurrentScrollParentIdSetter idSetter(&builder, id); 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 // 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 // the ifndef once Fennec switches over to APZ or if we add the special handling
// to Fennec // to Fennec
#if !defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ANDROID_APZ)
nsPoint scrollPosition = aScrollableFrame->GetScrollPosition(); nsPoint scrollPosition = aScrollableFrame->GetScrollPosition();
if (aScrollableFrame->GetScrollbarStyles().mVertical == NS_STYLE_OVERFLOW_HIDDEN) { if (aScrollableFrame->GetScrollbarStyles().mVertical == NS_STYLE_OVERFLOW_HIDDEN) {
contentBounds.y = scrollPosition.y; contentBounds.y = scrollPosition.y;
@ -8489,7 +8482,6 @@ nsLayoutUtils::CalculateScrollableRectForFrame(nsIScrollableFrame* aScrollableFr
contentBounds.x = scrollPosition.x; contentBounds.x = scrollPosition.x;
contentBounds.width = 0; contentBounds.width = 0;
} }
#endif
contentBounds.width += aScrollableFrame->GetScrollPortRect().width; contentBounds.width += aScrollableFrame->GetScrollPortRect().width;
contentBounds.height += aScrollableFrame->GetScrollPortRect().height; contentBounds.height += aScrollableFrame->GetScrollPortRect().height;

Просмотреть файл

@ -793,14 +793,7 @@ PresShell::PresShell()
mIsActive = true; mIsActive = true;
mIsHidden = false; mIsHidden = false;
// FIXME/bug 735029: find a better solution to this problem // 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; mIsFirstPaint = true;
#endif
mPresShellId = sNextPresShellId++; mPresShellId = sNextPresShellId++;
mFrozen = false; mFrozen = false;
mRenderFlags = 0; mRenderFlags = 0;

Просмотреть файл

@ -3578,13 +3578,6 @@ ScrollFrameHelper::ComputeScrollMetadata(Layer* aLayer,
bool isRootContent = mIsRoot && mOuter->PresContext()->IsRootContentDocument(); bool isRootContent = mIsRoot && mOuter->PresContext()->IsRootContentDocument();
bool thisScrollFrameUsesAsyncScrolling = nsLayoutUtils::UsesAsyncScrolling(mOuter); 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 (!thisScrollFrameUsesAsyncScrolling) {
if (parentLayerClip) { if (parentLayerClip) {
// If APZ is not enabled, we still need the displayport to be clipped // If APZ is not enabled, we still need the displayport to be clipped

Просмотреть файл

@ -54,7 +54,7 @@ pref("browser.viewport.desktopWidth", 980);
// the value is divided by 1000 and clamped to hard-coded min/max scale values. // the value is divided by 1000 and clamped to hard-coded min/max scale values.
pref("browser.viewport.defaultZoom", -1); pref("browser.viewport.defaultZoom", -1);
#ifdef MOZ_ANDROID_APZ #ifdef MOZ_WIDGET_ANDROID
// Show/Hide scrollbars when active/inactive // Show/Hide scrollbars when active/inactive
pref("ui.showHideScrollbars", 1); pref("ui.showHideScrollbars", 1);
pref("ui.useOverlayScrollbars", 1); pref("ui.useOverlayScrollbars", 1);
@ -561,10 +561,6 @@ pref("ui.dragThresholdY", 25);
pref("layers.acceleration.disabled", false); pref("layers.acceleration.disabled", false);
pref("layers.async-video.enabled", true); 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.content_response_timeout", 600);
pref("apz.allow_immediate_handoff", false); pref("apz.allow_immediate_handoff", false);
pref("apz.touch_start_tolerance", "0.06"); pref("apz.touch_start_tolerance", "0.06");

Просмотреть файл

@ -1523,58 +1523,46 @@ var BrowserApp = {
if (formHelperMode == kFormHelperModeDisabled) if (formHelperMode == kFormHelperModeDisabled)
return; return;
if (!AppConstants.MOZ_ANDROID_APZ) { let dwu = aBrowser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
let focused = this.getFocusedInput(aBrowser); if (!dwu) {
if (focused) { return;
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 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 () { getUALocalePref: function () {
@ -3801,43 +3789,11 @@ Tab.prototype = {
}, },
setViewport: function(aViewport) { setViewport: function(aViewport) {
if (AppConstants.MOZ_ANDROID_APZ) { return;
// 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);
}, },
setResolution: function(aZoom, aForce) { setResolution: function(aZoom, aForce) {
if (AppConstants.MOZ_ANDROID_APZ) { return;
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);
}
}
}, },
getViewport: function() { getViewport: function() {
@ -3902,13 +3858,7 @@ Tab.prototype = {
}, },
sendViewportUpdate: function(aPageSizeUpdate) { sendViewportUpdate: function(aPageSizeUpdate) {
if (AppConstants.MOZ_ANDROID_APZ) { return;
return;
}
let viewport = this.getViewport();
let displayPort = Services.androidBridge.getDisplayPort(aPageSizeUpdate, BrowserApp.isBrowserContentDocumentDisplayed(), this.id, viewport);
if (displayPort != null)
this.setDisplayPort(displayPort);
}, },
// These constants are used to prioritize high quality metadata over low quality data, so that // 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:SingleTap", false);
Services.obs.addObserver(this, "Gesture:ClickInZoomedView", false); Services.obs.addObserver(this, "Gesture:ClickInZoomedView", false);
if (!AppConstants.MOZ_ANDROID_APZ) { BrowserApp.deck.addEventListener("touchend", this, true);
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("DOMUpdatePageReport", PopupBlockerObserver.onUpdatePageReport, false); BrowserApp.deck.addEventListener("DOMUpdatePageReport", PopupBlockerObserver.onUpdatePageReport, false);
BrowserApp.deck.addEventListener("MozMouseHittest", this, true); BrowserApp.deck.addEventListener("MozMouseHittest", this, true);
@ -4928,21 +4870,8 @@ var BrowserEventHandler = {
if (this._clickInZoomedView != true) { if (this._clickInZoomedView != true) {
this._closeZoomedView(); 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; 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(); this._cancelTapHighlight();
break; break;
} }
@ -5016,9 +4945,6 @@ var BrowserEventHandler = {
_highlightElement: null, _highlightElement: null,
_doTapHighlight: function _doTapHighlight(aElement) { _doTapHighlight: function _doTapHighlight(aElement) {
if (!AppConstants.MOZ_ANDROID_APZ) {
DOMUtils.setContentState(aElement, kStateActive);
}
this._highlightElement = aElement; this._highlightElement = aElement;
}, },
@ -5026,15 +4952,6 @@ var BrowserEventHandler = {
if (!this._highlightElement) if (!this._highlightElement)
return; 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; this._highlightElement = null;
}, },
@ -5987,10 +5904,6 @@ var ViewportHandler = {
let scrollChange = JSON.parse(aData); let scrollChange = JSON.parse(aData);
let windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); let windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
windowUtils.setNextPaintSyncId(scrollChange.id); windowUtils.setNextPaintSyncId(scrollChange.id);
if (!AppConstants.MOZ_ANDROID_APZ) {
let win = BrowserApp.selectedTab.browser.contentWindow;
win.scrollBy(scrollChange.x, scrollChange.y);
}
} }
}, },

Просмотреть файл

@ -55,14 +55,6 @@ option(env='MOZ_ANDROID_ACTIVITY_STREAM',
set_config('MOZ_ANDROID_ACTIVITY_STREAM', set_config('MOZ_ANDROID_ACTIVITY_STREAM',
depends_if('MOZ_ANDROID_ACTIVITY_STREAM')(lambda _: True)) 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', option(env='MOZ_ANDROID_PACKAGE_INSTALL_BOUNCER',
help='Build and package the install bouncer APK', help='Build and package the install bouncer APK',
default=True) default=True)

Просмотреть файл

@ -23,11 +23,7 @@ chrome.jar:
skin/aboutSupport.css (aboutSupport.css) skin/aboutSupport.css (aboutSupport.css)
skin/browser.css (browser.css) skin/browser.css (browser.css)
skin/content.css (content.css) skin/content.css (content.css)
#ifdef MOZ_ANDROID_APZ
skin/scrollbar.css (scrollbar-apz.css) skin/scrollbar.css (scrollbar-apz.css)
#else
skin/scrollbar.css (scrollbar-nonapz.css)
#endif
skin/config.css (config.css) skin/config.css (config.css)
skin/defines.css (defines.css) skin/defines.css (defines.css)
skin/touchcontrols.css (touchcontrols.css) skin/touchcontrols.css (touchcontrols.css)

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -3870,16 +3870,9 @@ pref("print.print_paper_size", 0);
// around the content of the page for Print Preview only // around the content of the page for Print Preview only
pref("print.print_extra_margin", 0); // twips 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.enabled", true);
pref("layout.css.scroll-behavior.property-enabled", true); pref("layout.css.scroll-behavior.property-enabled", true);
pref("layout.css.scroll-snap.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 */ /* PostScript print module prefs */
// pref("print.postscript.enabled", true); // pref("print.postscript.enabled", true);

Просмотреть файл

@ -317,12 +317,6 @@ this.AppConstants = Object.freeze({
MOZ_B2G_VERSION: @MOZ_B2G_VERSION@, MOZ_B2G_VERSION: @MOZ_B2G_VERSION@,
MOZ_B2G_OS_NAME: @MOZ_B2G_OS_NAME@, 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@", DEBUG_JS_MODULES: "@DEBUG_JS_MODULES@",
// URL to the hg revision this was built from (e.g. // URL to the hg revision this was built from (e.g.

Просмотреть файл

@ -1033,14 +1033,12 @@ public:
} }
} }
#ifdef MOZ_ANDROID_APZ
MOZ_ASSERT(aNPZC); MOZ_ASSERT(aNPZC);
auto npzc = NativePanZoomController::LocalRef( auto npzc = NativePanZoomController::LocalRef(
jni::GetGeckoThreadEnv(), jni::GetGeckoThreadEnv(),
NativePanZoomController::Ref::From(aNPZC)); NativePanZoomController::Ref::From(aNPZC));
NPZCSupport::AttachNative( NPZCSupport::AttachNative(
npzc, mozilla::MakeUnique<NPZCSupport>(&window, npzc)); npzc, mozilla::MakeUnique<NPZCSupport>(&window, npzc));
#endif
layerClient->OnGeckoReady(); layerClient->OnGeckoReady();
} }
@ -3686,30 +3684,7 @@ nsWindow::UpdateZoomConstraints(const uint32_t& aPresShellId,
const FrameMetrics::ViewID& aViewId, const FrameMetrics::ViewID& aViewId,
const mozilla::Maybe<ZoomConstraints>& aConstraints) const mozilla::Maybe<ZoomConstraints>& aConstraints)
{ {
#ifdef MOZ_ANDROID_APZ
nsBaseWidget::UpdateZoomConstraints(aPresShellId, aViewId, aConstraints); 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<nsIObserverService> 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* CompositorBridgeParent*