зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1501665 Part 4: Use the new function as a replacement for APZAllowZooming. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D19239 --HG-- extra : source : cf42ea4e8443cdcb5f446dfb95d92d5998f55f24
This commit is contained in:
Родитель
83ef115c9e
Коммит
7fc19a53b5
|
@ -64,6 +64,8 @@ nsEventStatus APZInputBridge::ReceiveInputEvent(
|
|||
// mouse event undergoes (in PositionedEventTargeting.cpp) uses
|
||||
// the IGNORE_ROOT_SCROLL_FRAME flag, which is needed for correct
|
||||
// hit testing in a zoomed-in or zoomed-out state.
|
||||
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
|
||||
// per-document basis.
|
||||
if (gfxPrefs::APZAllowZooming()) {
|
||||
mouseEvent.mIgnoreRootScrollFrame = true;
|
||||
}
|
||||
|
|
|
@ -1525,6 +1525,8 @@ nsEventStatus AsyncPanZoomController::OnScaleBegin(
|
|||
|
||||
// For platforms that don't support APZ zooming, dispatch a message to the
|
||||
// content controller, it may want to do something else with this gesture.
|
||||
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
|
||||
// per-document basis.
|
||||
if (!gfxPrefs::APZAllowZooming()) {
|
||||
if (RefPtr<GeckoContentController> controller =
|
||||
GetGeckoContentController()) {
|
||||
|
@ -1569,6 +1571,8 @@ nsEventStatus AsyncPanZoomController::OnScale(const PinchGestureInput& aEvent) {
|
|||
mY.UpdateWithTouchAtDevicePoint(aEvent.mLocalFocusPoint.y, aEvent.mTime);
|
||||
}
|
||||
|
||||
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
|
||||
// per-document basis.
|
||||
if (!gfxPrefs::APZAllowZooming()) {
|
||||
if (RefPtr<GeckoContentController> controller =
|
||||
GetGeckoContentController()) {
|
||||
|
@ -1702,6 +1706,8 @@ nsEventStatus AsyncPanZoomController::OnScaleEnd(
|
|||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
|
||||
// per-document basis.
|
||||
if (!gfxPrefs::APZAllowZooming()) {
|
||||
if (RefPtr<GeckoContentController> controller =
|
||||
GetGeckoContentController()) {
|
||||
|
@ -4074,6 +4080,8 @@ AsyncPanZoomController::GetCurrentAsyncTransformForFixedAdjustment(
|
|||
// Use the layout viewport to adjust fixed position elements if and only if
|
||||
// it's larger than the visual viewport (assuming we're scrolling the RCD-RSF
|
||||
// with apz.allow_zooming enabled).
|
||||
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
|
||||
// per-document basis.
|
||||
return (gfxPrefs::APZAllowZooming() && Metrics().IsRootContent() &&
|
||||
Metrics().GetVisualViewport().Size() <=
|
||||
Metrics().GetLayoutViewport().Size())
|
||||
|
|
|
@ -307,7 +307,8 @@ void APZCCallbackHelper::UpdateRootFrame(const RepaintRequest& aRequest) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (gfxPrefs::APZAllowZooming() && aRequest.GetScrollOffsetUpdated()) {
|
||||
if (nsLayoutUtils::AllowZoomingForDocument(shell->GetDocument()) &&
|
||||
aRequest.GetScrollOffsetUpdated()) {
|
||||
// If zooming is disabled then we don't really want to let APZ fiddle
|
||||
// with these things. In theory setting the resolution here should be a
|
||||
// no-op, but setting the visual viewport size is bad because it can cause a
|
||||
|
@ -671,7 +672,8 @@ static bool PrepareForSetTargetAPZCNotification(
|
|||
nsPoint point = nsLayoutUtils::GetEventCoordinatesRelativeTo(
|
||||
aWidget, aRefPoint, aRootFrame);
|
||||
EnumSet<FrameForPointOption> options;
|
||||
if (gfxPrefs::APZAllowZooming()) {
|
||||
if (nsLayoutUtils::AllowZoomingForDocument(
|
||||
aRootFrame->PresShell()->GetDocument())) {
|
||||
// If zooming is enabled, we need IgnoreRootScrollFrame for correct
|
||||
// hit testing. Otherwise, don't use it because it interferes with
|
||||
// hit testing for some purposes such as scrollbar dragging (this will
|
||||
|
|
|
@ -506,7 +506,7 @@ void MobileViewportManager::RefreshViewportSize(bool aForceAdjustResolution) {
|
|||
MVM_LOG("%p: Updating properties because %d || %d\n", this, mIsFirstPaint,
|
||||
mMobileViewportSize != viewport);
|
||||
|
||||
if (gfxPrefs::APZAllowZooming()) {
|
||||
if (nsLayoutUtils::AllowZoomingForDocument(mDocument)) {
|
||||
UpdateResolution(viewportInfo, displaySize, viewport,
|
||||
displayWidthChangeRatio, UpdateType::ViewportSize);
|
||||
} else {
|
||||
|
@ -545,8 +545,8 @@ void MobileViewportManager::ShrinkToDisplaySizeIfNeeded(
|
|||
return;
|
||||
}
|
||||
|
||||
if (!gfxPrefs::APZAllowZooming()) {
|
||||
// If the APZ is disabled, we don't scale down wider contents to fit them
|
||||
if (!nsLayoutUtils::AllowZoomingForDocument(mDocument)) {
|
||||
// If zoom is disabled, we don't scale down wider contents to fit them
|
||||
// into device screen because users won't be able to zoom out the tiny
|
||||
// contents.
|
||||
return;
|
||||
|
|
|
@ -10502,9 +10502,10 @@ nsresult PresShell::SetIsActive(bool aIsActive) {
|
|||
}
|
||||
|
||||
void PresShell::UpdateViewportOverridden(bool aAfterInitialization) {
|
||||
// Determine if we require a MobileViewportManager.
|
||||
bool needMVM = nsLayoutUtils::ShouldHandleMetaViewport(mDocument) ||
|
||||
gfxPrefs::APZAllowZooming();
|
||||
// Determine if we require a MobileViewportManager. This logic is
|
||||
// equivalent to ShouldHandleMetaViewport, which will check gfxPrefs if
|
||||
// there are not meta viewport overrides.
|
||||
bool needMVM = nsLayoutUtils::ShouldHandleMetaViewport(mDocument);
|
||||
|
||||
if (needMVM == !!mMobileViewportManager) {
|
||||
// Either we've need one and we've already got it, or we don't need one
|
||||
|
|
|
@ -114,7 +114,8 @@ nsIFrame* TouchManager::SetupTarget(WidgetTouchEvent* aEvent,
|
|||
// Setting this flag will skip the scrollbars on the root frame from
|
||||
// participating in hit-testing, and we only want that to happen on
|
||||
// zoomable platforms (for now).
|
||||
if (gfxPrefs::APZAllowZooming()) {
|
||||
dom::Document* doc = aFrame->PresContext()->Document();
|
||||
if (nsLayoutUtils::AllowZoomingForDocument(doc)) {
|
||||
flags |= INPUT_IGNORE_ROOT_SCROLL_FRAME;
|
||||
}
|
||||
|
||||
|
|
|
@ -168,10 +168,10 @@ void ZoomConstraintsClient::ScreenSizeChanged() {
|
|||
}
|
||||
|
||||
static mozilla::layers::ZoomConstraints ComputeZoomConstraintsFromViewportInfo(
|
||||
const nsViewportInfo& aViewportInfo) {
|
||||
const nsViewportInfo& aViewportInfo, Document* aDocument) {
|
||||
mozilla::layers::ZoomConstraints constraints;
|
||||
constraints.mAllowZoom =
|
||||
aViewportInfo.IsZoomAllowed() && gfxPrefs::APZAllowZooming();
|
||||
constraints.mAllowZoom = aViewportInfo.IsZoomAllowed() &&
|
||||
nsLayoutUtils::AllowZoomingForDocument(aDocument);
|
||||
constraints.mAllowDoubleTapZoom =
|
||||
constraints.mAllowZoom && gfxPrefs::APZAllowDoubleTapZooming();
|
||||
if (constraints.mAllowZoom) {
|
||||
|
@ -209,7 +209,7 @@ void ZoomConstraintsClient::RefreshZoomConstraints() {
|
|||
screenSize, PixelCastJustification::LayoutDeviceIsScreenForBounds));
|
||||
|
||||
mozilla::layers::ZoomConstraints zoomConstraints =
|
||||
ComputeZoomConstraintsFromViewportInfo(viewportInfo);
|
||||
ComputeZoomConstraintsFromViewportInfo(viewportInfo, mDocument);
|
||||
|
||||
if (mDocument->Fullscreen()) {
|
||||
ZCC_LOG("%p is in fullscreen, disallowing zooming\n", this);
|
||||
|
|
|
@ -9351,7 +9351,8 @@ static void UpdateDisplayPortMarginsForPendingMetrics(
|
|||
return;
|
||||
}
|
||||
|
||||
if (gfxPrefs::APZAllowZooming() && aMetrics.IsRootContent()) {
|
||||
if (nsLayoutUtils::AllowZoomingForDocument(shell->GetDocument()) &&
|
||||
aMetrics.IsRootContent()) {
|
||||
// See APZCCallbackHelper::UpdateRootFrame for details.
|
||||
float presShellResolution = shell->GetResolution();
|
||||
if (presShellResolution != aMetrics.GetPresShellResolution()) {
|
||||
|
|
|
@ -3678,6 +3678,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
|||
return;
|
||||
}
|
||||
|
||||
// FIXME: bug 1525793 -- this may need to handle zooming or not on a per-document basis.
|
||||
if (gfxPrefs::APZAllowZooming()) {
|
||||
NSPoint locationInWindow = nsCocoaUtils::EventLocationForWindow(anEvent, [self window]);
|
||||
ScreenPoint position =
|
||||
|
|
Загрузка…
Ссылка в новой задаче