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