Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(819)

Unified Diff: Source/core/layout/LayoutBox.cpp

Issue 1025543002: Remove old pinch-zoom paths from Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorLayerTreeAgent.cpp ('k') | Source/core/layout/LayoutFullScreen.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBox.cpp
diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp
index c63614f0b9605af6edc66573eebaae90736a8689..b812d6ffe77b869fa111a506aa9b56d5556f8f34 100644
--- a/Source/core/layout/LayoutBox.cpp
+++ b/Source/core/layout/LayoutBox.cpp
@@ -520,34 +520,28 @@ void LayoutBox::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignmen
}
}
} else {
- if (frame()->settings()->pinchVirtualViewportEnabled()) {
- PinchViewport& pinchViewport = frame()->page()->frameHost().pinchViewport();
-
- // We want to move the rect into the viewport that excludes the scrollbars so we intersect
- // the pinch viewport with the scrollbar-excluded frameView content rect. However, we don't
- // use visibleContentRect directly since it floors the scroll position. Instead, we use
- // FrameView::scrollPositionDouble and construct a LayoutRect from that (the FrameView size
- // is always integer sized.
- LayoutRect frameRect = LayoutRect(
- frameView->scrollPositionDouble(),
- frameView->visibleContentRect().size());
- LayoutRect viewRect = intersection(
- LayoutRect(pinchViewport.visibleRectInDocument()), frameRect);
- LayoutRect r = ScrollAlignment::getRectToExpose(viewRect, rect, alignX, alignY);
-
- // pinchViewport.scrollIntoView will attempt to center the given rect within the viewport
- // so to prevent it from adjusting r's coordinates the rect must match the viewport's size
- // i.e. add the subtracted scrollbars from above back in.
- // FIXME: This is hacky and required because getRectToExpose doesn't naturally account
- // for the two viewports. crbug.com/449340.
- r.setSize(LayoutSize(pinchViewport.visibleRectInDocument().size()));
-
- pinchViewport.scrollIntoView(r);
- } else {
- LayoutRect viewRect = LayoutRect(frameView->visibleContentRect());
- LayoutRect r = ScrollAlignment::getRectToExpose(viewRect, rect, alignX, alignY);
- frameView->setScrollPosition(DoublePoint(r.location()));
- }
+ PinchViewport& pinchViewport = frame()->page()->frameHost().pinchViewport();
+
+ // We want to move the rect into the viewport that excludes the scrollbars so we intersect
+ // the pinch viewport with the scrollbar-excluded frameView content rect. However, we don't
+ // use visibleContentRect directly since it floors the scroll position. Instead, we use
+ // FrameView::scrollPositionDouble and construct a LayoutRect from that (the FrameView size
+ // is always integer sized.
+ LayoutRect frameRect = LayoutRect(
+ frameView->scrollPositionDouble(),
+ frameView->visibleContentRect().size());
+ LayoutRect viewRect = intersection(
+ LayoutRect(pinchViewport.visibleRectInDocument()), frameRect);
+ LayoutRect r = ScrollAlignment::getRectToExpose(viewRect, rect, alignX, alignY);
+
+ // pinchViewport.scrollIntoView will attempt to center the given rect within the viewport
+ // so to prevent it from adjusting r's coordinates the rect must match the viewport's size
+ // i.e. add the subtracted scrollbars from above back in.
+ // FIXME: This is hacky and required because getRectToExpose doesn't naturally account
+ // for the two viewports. crbug.com/449340.
+ r.setSize(LayoutSize(pinchViewport.visibleRectInDocument().size()));
+
+ pinchViewport.scrollIntoView(r);
}
}
}
« no previous file with comments | « Source/core/inspector/InspectorLayerTreeAgent.cpp ('k') | Source/core/layout/LayoutFullScreen.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698