https://bugs.webkit.org/show_bug.cgi?id=127456
Reviewed by Antti Koivisto.
On iOS, visibleContentRect() returns the entire document rect for historical
reasons, and actualVisibleContentRect() returns what visibleContentRect()
returns on other platforms.
In addition, actualVisibleContentRect() was returning an empty rect in WK2.
Reduce the confusion of #ifdefs by making visibleContentRect() behave like
actualVisibleContentRect() by default on iOS. Where it needs the old behavior,
an optional parameter, LegacyIOSDocumentVisibleRect, provides this.
Achieve this by having the virtual ScrollableArea::visibleContentRectInternal(),
which is called by non-virtual visibleContentRect() and visibleContentRectIncludingScrollbars().
Similarly clean up visibleHeight/visibleWidth functions by having visibleSize() be virtual,
with non-virtual visibleHeight() and visibleWidth().
ScrollableArea subclasses override visibleContentRectInternal() and visibleSize() where necessary.
Mechanically change all the call sites of actualVisibleContentRect() to
use visibleContentRect(), and the call sites of visibleContentRect()
to visibleContentRect(..., LegacyIOSDocumentVisibleRect), adding comments
where this may not be appropriate.
Change callers of visibleContentRect(IncludeScrollbars...) to visibleContentRectIncludingScrollbars().
Also add actualScrollPosition(), and clean up some actualScroll* call sites.
No behavior change.
Source/WebCore:
* WebCore.exp.in:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isOnscreen):
(WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isOffScreen):
* dom/Document.cpp:
(WebCore::Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale):
(WebCore::Document::adjustFloatRectForScrollAndAbsoluteZoomAndFrameScale):
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
* editing/Editor.cpp:
(WebCore::Editor::countMatchesForText):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::bounds):
(WebCore::FrameSelection::getClippedVisibleTextRectangles):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollLeft):
(WebCore::HTMLBodyElement::scrollTop):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::imageFitsInWindow):
(WebCore::ImageDocument::windowSizeChanged):
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::update):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::innerHeight):
(WebCore::DOMWindow::innerWidth):
(WebCore::DOMWindow::scrollX):
(WebCore::DOMWindow::scrollY):
(WebCore::DOMWindow::scrollBy):
* page/FrameView.cpp:
(WebCore::FrameView::calculateScrollbarModesForLayout):
(WebCore::FrameView::layout):
(WebCore::FrameView::scrollContentsSlowPath):
(WebCore::FrameView::repaintContentRectangle):
(WebCore::FrameView::sendResizeEventIfNeeded):
(WebCore::FrameView::windowClipRect):
(WebCore::FrameView::isScrollable):
(WebCore::FrameView::paintControlTints):
* page/SpatialNavigation.cpp:
(WebCore::canScrollInDirection):
* platform/ScrollView.cpp:
(WebCore::ScrollView::unscaledVisibleContentSize):
(WebCore::ScrollView::visibleContentRectInternal):
(WebCore::ScrollView::updateScrollbars):
(WebCore::ScrollView::paint):
* platform/ScrollView.h:
(WebCore::ScrollView::scrollOffset):
(WebCore::ScrollView::actualScrollX):
(WebCore::ScrollView::actualScrollY):
(WebCore::ScrollView::actualScrollPosition):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::visibleContentRect):
(WebCore::ScrollableArea::visibleContentRectIncludingScrollbars):
(WebCore::ScrollableArea::visibleContentRectInternal):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::visibleWidth):
(WebCore::ScrollableArea::visibleHeight):
* platform/graphics/IntSize.h:
(WebCore::IntSize::expandedTo): Drive-by cleanup.
(WebCore::IntSize::shrunkTo):
* platform/gtk/ScrollViewGtk.cpp:
(WebCore::ScrollView::visibleContentRect):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::maximumScrollPosition):
(WebCore::RenderLayer::visibleContentRectInternal):
(WebCore::RenderLayer::hitTest):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateCompositedBounds):
* rendering/RenderListBox.cpp:
* rendering/RenderListBox.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::viewRect):
(WebCore::RenderView::viewportSize):
Source/WebKit:
* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
Source/WebKit2:
* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
(WebKit::ViewGestureGeometryCollector::collectGeometryForMagnificationGesture):
(WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::visibleContentBounds):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
(WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162663
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-01-23 Simon Fraser <simon.fraser@apple.com>
+
+ Make visibleContentRect() return actualVisibleContentRect() on iOS most of the time
+ https://bugs.webkit.org/show_bug.cgi?id=127456
+
+ Reviewed by Antti Koivisto.
+
+ On iOS, visibleContentRect() returns the entire document rect for historical
+ reasons, and actualVisibleContentRect() returns what visibleContentRect()
+ returns on other platforms.
+
+ In addition, actualVisibleContentRect() was returning an empty rect in WK2.
+
+ Reduce the confusion of #ifdefs by making visibleContentRect() behave like
+ actualVisibleContentRect() by default on iOS. Where it needs the old behavior,
+ an optional parameter, LegacyIOSDocumentVisibleRect, provides this.
+
+ Achieve this by having the virtual ScrollableArea::visibleContentRectInternal(),
+ which is called by non-virtual visibleContentRect() and visibleContentRectIncludingScrollbars().
+
+ Similarly clean up visibleHeight/visibleWidth functions by having visibleSize() be virtual,
+ with non-virtual visibleHeight() and visibleWidth().
+
+ ScrollableArea subclasses override visibleContentRectInternal() and visibleSize() where necessary.
+
+ Mechanically change all the call sites of actualVisibleContentRect() to
+ use visibleContentRect(), and the call sites of visibleContentRect()
+ to visibleContentRect(..., LegacyIOSDocumentVisibleRect), adding comments
+ where this may not be appropriate.
+
+ Change callers of visibleContentRect(IncludeScrollbars...) to visibleContentRectIncludingScrollbars().
+
+ Also add actualScrollPosition(), and clean up some actualScroll* call sites.
+
+ No behavior change.
+
+ * WebCore.exp.in:
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::isOnscreen):
+ (WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::isOffScreen):
+ * dom/Document.cpp:
+ (WebCore::Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale):
+ (WebCore::Document::adjustFloatRectForScrollAndAbsoluteZoomAndFrameScale):
+ * dom/MouseRelatedEvent.cpp:
+ (WebCore::MouseRelatedEvent::MouseRelatedEvent):
+ * editing/Editor.cpp:
+ (WebCore::Editor::countMatchesForText):
+ * editing/FrameSelection.cpp:
+ (WebCore::FrameSelection::bounds):
+ (WebCore::FrameSelection::getClippedVisibleTextRectangles):
+ * html/HTMLBodyElement.cpp:
+ (WebCore::HTMLBodyElement::scrollLeft):
+ (WebCore::HTMLBodyElement::scrollTop):
+ * html/ImageDocument.cpp:
+ (WebCore::ImageDocument::imageFitsInWindow):
+ (WebCore::ImageDocument::windowSizeChanged):
+ * inspector/InspectorOverlay.cpp:
+ (WebCore::InspectorOverlay::update):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::innerHeight):
+ (WebCore::DOMWindow::innerWidth):
+ (WebCore::DOMWindow::scrollX):
+ (WebCore::DOMWindow::scrollY):
+ (WebCore::DOMWindow::scrollBy):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::calculateScrollbarModesForLayout):
+ (WebCore::FrameView::layout):
+ (WebCore::FrameView::scrollContentsSlowPath):
+ (WebCore::FrameView::repaintContentRectangle):
+ (WebCore::FrameView::sendResizeEventIfNeeded):
+ (WebCore::FrameView::windowClipRect):
+ (WebCore::FrameView::isScrollable):
+ (WebCore::FrameView::paintControlTints):
+ * page/SpatialNavigation.cpp:
+ (WebCore::canScrollInDirection):
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::unscaledVisibleContentSize):
+ (WebCore::ScrollView::visibleContentRectInternal):
+ (WebCore::ScrollView::updateScrollbars):
+ (WebCore::ScrollView::paint):
+ * platform/ScrollView.h:
+ (WebCore::ScrollView::scrollOffset):
+ (WebCore::ScrollView::actualScrollX):
+ (WebCore::ScrollView::actualScrollY):
+ (WebCore::ScrollView::actualScrollPosition):
+ * platform/ScrollableArea.cpp:
+ (WebCore::ScrollableArea::visibleContentRect):
+ (WebCore::ScrollableArea::visibleContentRectIncludingScrollbars):
+ (WebCore::ScrollableArea::visibleContentRectInternal):
+ * platform/ScrollableArea.h:
+ (WebCore::ScrollableArea::visibleWidth):
+ (WebCore::ScrollableArea::visibleHeight):
+ * platform/graphics/IntSize.h:
+ (WebCore::IntSize::expandedTo): Drive-by cleanup.
+ (WebCore::IntSize::shrunkTo):
+ * platform/gtk/ScrollViewGtk.cpp:
+ (WebCore::ScrollView::visibleContentRect):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::scrollRectToVisible):
+ (WebCore::RenderLayer::maximumScrollPosition):
+ (WebCore::RenderLayer::visibleContentRectInternal):
+ (WebCore::RenderLayer::hitTest):
+ * rendering/RenderLayer.h:
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateCompositedBounds):
+ * rendering/RenderListBox.cpp:
+ * rendering/RenderListBox.h:
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::viewRect):
+ (WebCore::RenderView::viewportSize):
+
2014-01-20 Myles C. Maxfield <mmaxfield@apple.com>
Turn text-decoration-skip: ink on for all underlines
__ZNK7WebCore10ScrollView16windowToContentsERKNS_8IntPointE
__ZNK7WebCore10ScrollView18contentsToRootViewERKNS_7IntRectE
__ZNK7WebCore10ScrollView18contentsToRootViewERKNS_8IntPointE
-__ZNK7WebCore10ScrollView18visibleContentRectENS_14ScrollableArea36VisibleContentRectIncludesScrollbarsE
__ZNK7WebCore10ScrollView23rootViewToTotalContentsERKNS_8IntPointE
__ZNK7WebCore10ScrollView30scrollOffsetRelativeToDocumentEv
__ZNK7WebCore10StorageMap6lengthEv
__ZNK7WebCore14ResourceLoader11frameLoaderEv
__ZNK7WebCore14ScrollableArea14scrollAnimatorEv
__ZNK7WebCore14ScrollableArea17totalContentsSizeEv
+__ZNK7WebCore14ScrollableArea18visibleContentRectENS0_26VisibleContentRectBehaviorE
__ZNK7WebCore14ScrollableArea20contentAreaWillPaintEv
__ZNK7WebCore14ScrollableArea21mouseEnteredScrollbarEPNS_9ScrollbarE
__ZNK7WebCore14ScrollableArea21scrollbarsCanBeActiveEv
__ZNK7WebCore14ScrollableArea22mouseExitedContentAreaEv
__ZNK7WebCore14ScrollableArea23mouseEnteredContentAreaEv
__ZNK7WebCore14ScrollableArea23mouseMovedInContentAreaEv
+__ZNK7WebCore14ScrollableArea26visibleContentRectInternalENS0_36VisibleContentRectIncludesScrollbarsENS0_26VisibleContentRectBehaviorE
+__ZNK7WebCore14ScrollableArea37visibleContentRectIncludingScrollbarsENS0_26VisibleContentRectBehaviorE
__ZNK7WebCore14SecurityOrigin10canDisplayERKNS_3URLE
__ZNK7WebCore14SecurityOrigin11toRawStringEv
__ZNK7WebCore14SecurityOrigin12isolatedCopyEv
__ZN7WebCore8IntPointC1ERK8_NSPoint
__ZN7WebCore9FloatRectC1ERK7_NSRect
__ZNK7WebCore10FloatPointcv8_NSPointEv
-__ZNK7WebCore14ScrollableArea18visibleContentRectENS0_36VisibleContentRectIncludesScrollbarsE
__ZNK7WebCore6Cursor14platformCursorEv
__ZNK7WebCore7IntRectcv7_NSRectEv
__ZNK7WebCore7IntSizecv6CGSizeEv
for (size_t i = levels; i >= 1; i--) {
const AccessibilityObject* outer = objects[i];
const AccessibilityObject* inner = objects[i - 1];
- const IntRect outerRect = i < levels ? pixelSnappedIntRect(outer->boundingBoxRect()) : outer->getScrollableAreaIfScrollable()->visibleContentRect();
+ // FIXME: unclear if we need LegacyIOSDocumentVisibleRect.
+ const IntRect outerRect = i < levels ? pixelSnappedIntRect(outer->boundingBoxRect()) : outer->getScrollableAreaIfScrollable()->visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
const IntRect innerRect = pixelSnappedIntRect(inner->isAccessibilityScrollView() ? inner->parentObject()->boundingBoxRect() : inner->boundingBoxRect());
if (!outerRect.intersects(innerRect)) {
LayoutRect objectRect = boundingBoxRect();
IntPoint scrollPosition = scrollableArea->scrollPosition();
- IntRect scrollVisibleRect = scrollableArea->visibleContentRect();
+ // FIXME: unclear if we need LegacyIOSDocumentVisibleRect.
+ IntRect scrollVisibleRect = scrollableArea->visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
int desiredX = computeBestScrollOffset(
scrollPosition.x(),
{
ASSERT(m_renderer);
IntRect contentRect = pixelSnappedIntRect(m_renderer->absoluteClippedOverflowRect());
- IntRect viewRect = m_renderer->view().frameView().visibleContentRect();
+ // FIXME: unclear if we need LegacyIOSDocumentVisibleRect.
+ IntRect viewRect = m_renderer->view().frameView().visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
viewRect.intersect(contentRect);
return viewRect.isEmpty();
}
if (frame())
inverseFrameScale = 1 / frame()->frameScaleFactor();
-#if PLATFORM(IOS)
- LayoutRect visibleContentRect = view()->actualVisibleContentRect();
-#else
LayoutRect visibleContentRect = view()->visibleContentRect();
-#endif
for (size_t i = 0; i < quads.size(); ++i) {
quads[i].move(-visibleContentRect.x(), -visibleContentRect.y());
if (zoom != 1)
if (frame())
inverseFrameScale = 1 / frame()->frameScaleFactor();
-#if PLATFORM(IOS)
- LayoutRect visibleContentRect = view()->actualVisibleContentRect();
-#else
LayoutRect visibleContentRect = view()->visibleContentRect();
-#endif
rect.move(-visibleContentRect.x(), -visibleContentRect.y());
if (zoom != 1)
rect.scale(1 / zoom);
#if !PLATFORM(IOS)
scrollPosition = frameView->scrollPosition();
#else
- scrollPosition = frameView->actualVisibleContentRect().location();
+ scrollPosition = frameView->actualScrollPosition();
#endif
adjustedPageLocation = frameView->windowToContents(windowLocation);
float scaleFactor = 1 / (frame->pageZoomFactor() * frame->frameScaleFactor());
// Do a "fake" paint in order to execute the code that computes the rendered rect for each text match.
if (m_frame.view() && m_frame.contentRenderer()) {
document().updateLayout(); // Ensure layout is up to date.
- LayoutRect visibleRect = m_frame.view()->visibleContentRect();
+ // FIXME: unclear if we need LegacyIOSDocumentVisibleRect.
+ // FIXME: this should probably look at paintsEntireContents()
+ LayoutRect visibleRect = m_frame.view()->visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
if (!visibleRect.isEmpty()) {
GraphicsContext context((PlatformGraphicsContext*)0);
context.setPaintingDisabled(true);
return LayoutRect();
LayoutRect selectionRect = root->selectionBounds(clipToVisibleContent);
- return clipToVisibleContent ? intersection(selectionRect, view->visibleContentRect()) : selectionRect;
+ return clipToVisibleContent ? intersection(selectionRect, view->visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect)) : selectionRect;
}
void FrameSelection::getClippedVisibleTextRectangles(Vector<FloatRect>& rectangles) const
if (!root)
return;
- FloatRect visibleContentRect = m_frame->view()->visibleContentRect();
+ FloatRect visibleContentRect = m_frame->view()->visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
Vector<FloatQuad> quads;
toNormalizedRange()->textQuads(quads, true);
if (!view)
return 0;
#if PLATFORM(IOS)
- return adjustForZoom(view->actualVisibleContentRect().x(), *frame);
+ return adjustForZoom(view->actualScrollX(), *frame);
#else
return adjustForZoom(view->scrollX(), *frame);
#endif
if (!view)
return 0;
#if PLATFORM(IOS)
- return adjustForZoom(view->actualVisibleContentRect().y(), *frame);
+ return adjustForZoom(view->actualScrollY(), *frame);
#else
return adjustForZoom(view->scrollY(), *frame);
#endif
LayoutSize imageSize = m_imageElement->cachedImage()->imageSizeForRenderer(m_imageElement->renderer(), pageZoomFactor(this));
#if PLATFORM(IOS)
- LayoutSize windowSize = view->contentsToScreen(view->actualVisibleContentRect()).size();
+ LayoutSize windowSize = view->contentsToScreen(view->visibleContentRect()).size();
#else
LayoutSize windowSize = LayoutSize(view->width(), view->height());
#endif
return;
LayoutSize imageSize = m_imageElement->cachedImage()->imageSizeForRenderer(m_imageElement->renderer(), pageZoomFactor(this));
- LayoutRect visibleScreenSize = frame()->view()->contentsToScreen(frame()->view()->actualVisibleContentRect());
+ LayoutRect visibleScreenSize = frame()->view()->contentsToScreen(frame()->view()->visibleContentRect());
float widthScale = static_cast<float>(visibleScreenSize.width()) / imageSize.width();
float heightScale = static_cast<float>(visibleScreenSize.height()) / imageSize.height();
FrameView* overlayView = overlayPage()->mainFrame().view();
IntSize viewportSize = view->visibleContentRect().size();
- IntSize frameViewFullSize = view->visibleContentRect(ScrollableArea::IncludeScrollbars).size();
+ IntSize frameViewFullSize = view->visibleContentRectIncludingScrollbars().size();
IntSize size = m_size.isEmpty() ? frameViewFullSize : m_size;
overlayPage()->setPageScaleFactor(m_page.pageScaleFactor(), IntPoint());
size.scale(m_page.pageScaleFactor());
if (!view)
return 0;
-#if PLATFORM(IOS)
- return view->mapFromLayoutToCSSUnits(static_cast<int>(view->actualVisibleContentRect().height()));
-#else
- return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(ScrollableArea::IncludeScrollbars).height()));
-#endif
+ return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRectIncludingScrollbars().height()));
}
int DOMWindow::innerWidth() const
if (!view)
return 0;
-#if PLATFORM(IOS)
- return view->mapFromLayoutToCSSUnits(static_cast<int>(view->actualVisibleContentRect().width()));
-#else
- return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(ScrollableArea::IncludeScrollbars).width()));
-#endif
+ return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRectIncludingScrollbars().width()));
}
int DOMWindow::screenX() const
m_frame->document()->updateLayoutIgnorePendingStylesheets();
#if PLATFORM(IOS)
- return static_cast<int>(view->actualVisibleContentRect().x() / (m_frame->pageZoomFactor() * m_frame->frameScaleFactor()));
+ return static_cast<int>(view->actualScrollX() / (m_frame->pageZoomFactor() * m_frame->frameScaleFactor()));
#else
return view->mapFromLayoutToCSSUnits(view->scrollX());
#endif
m_frame->document()->updateLayoutIgnorePendingStylesheets();
#if PLATFORM(IOS)
- return static_cast<int>(view->actualVisibleContentRect().y() / (m_frame->pageZoomFactor() * m_frame->frameScaleFactor()));
+ return static_cast<int>(view->actualScrollY() / (m_frame->pageZoomFactor() * m_frame->frameScaleFactor()));
#else
return view->mapFromLayoutToCSSUnits(view->scrollY());
#endif
IntSize scaledOffset(view->mapFromCSSToLayoutUnits(x), view->mapFromCSSToLayoutUnits(y));
#if PLATFORM(IOS)
- view->setActualScrollPosition(view->actualVisibleContentRect().location() + scaledOffset);
+ view->setActualScrollPosition(view->actualScrollPosition() + scaledOffset);
#else
view->scrollBy(scaledOffset);
#endif
hMode = ScrollbarAuto;
// Seamless documents begin with heights of 0; we special case that here
// to correctly render documents that don't need scrollbars.
- IntSize fullVisibleSize = visibleContentRect(IncludeScrollbars).size();
+ IntSize fullVisibleSize = visibleContentRectIncludingScrollbars(LegacyIOSDocumentVisibleRect).size();
bool isSeamlessDocument = frame().document() && frame().document()->shouldDisplaySeamlesslyWithParent();
vMode = (isSeamlessDocument && !fullVisibleSize.height()) ? ScrollbarAlwaysOff : ScrollbarAuto;
} else {
if (useFixedLayout() && !fixedLayoutSize().isEmpty() && delegatesScrolling())
m_lastViewportSize = fixedLayoutSize();
else
-#if PLATFORM(IOS)
- m_lastViewportSize = actualVisibleContentRect().size();
-#else
- m_lastViewportSize = visibleContentRect(IncludeScrollbars).size();
-#endif
+ m_lastViewportSize = visibleContentRectIncludingScrollbars().size();
m_lastZoomFactor = root->style().zoom();
{
#if USE(ACCELERATED_COMPOSITING)
if (contentsInCompositedLayer()) {
- IntRect updateRect = visibleContentRect();
+ // FIXME: respect paintsEntireContents()?
+ IntRect updateRect = visibleContentRect(LegacyIOSDocumentVisibleRect);
// Make sure to "apply" the scale factor here since we're converting from frame view
// coordinates to layer backing coordinates.
if ((m_deferringRepaints || m_deferredRepaintTimer.isActive() || delay) && !immediate) {
IntRect paintRect = r;
if (clipsRepaints() && !paintsEntireContents())
- paintRect.intersect(visibleContentRect());
+ paintRect.intersect(visibleContentRect(LegacyIOSDocumentVisibleRect));
if (paintRect.isEmpty())
return;
if (m_repaintCount == cRepaintRectUnionThreshold) {
if (useFixedLayout() && !fixedLayoutSize().isEmpty() && delegatesScrolling())
currentSize = fixedLayoutSize();
else
-#if PLATFORM(IOS)
- currentSize = actualVisibleContentRect().size();
-#else
- currentSize = visibleContentRect(IncludeScrollbars).size();
-#endif
+ currentSize = visibleContentRectIncludingScrollbars().size();
float currentZoomFactor = renderView->style().zoom();
bool shouldSendResizeEvent = !m_firstLayout && (currentSize != m_lastViewportSize || currentZoomFactor != m_lastZoomFactor);
return IntRect(IntPoint(), totalContentsSize());
// Set our clip rect to be our contents.
- IntRect clipRect = contentsToWindow(visibleContentRect(clipToContents ? ExcludeScrollbars : IncludeScrollbars));
+ IntRect clipRect;
+ if (clipToContents)
+ clipRect = contentsToWindow(visibleContentRect(LegacyIOSDocumentVisibleRect));
+ else
+ clipRect = contentsToWindow(visibleContentRectIncludingScrollbars(LegacyIOSDocumentVisibleRect));
if (!frame().ownerElement())
return clipRect;
// Covers #1
IntSize totalContentsSize = this->totalContentsSize();
- IntSize visibleContentSize = visibleContentRect().size();
+ IntSize visibleContentSize = visibleContentRect(LegacyIOSDocumentVisibleRect).size();
if ((totalContentsSize.height() <= visibleContentSize.height() && totalContentsSize.width() <= visibleContentSize.width()))
return false;
PlatformGraphicsContext* const noContext = 0;
GraphicsContext context(noContext);
context.setUpdatingControlTints(true);
- if (platformWidget())
- paintContents(&context, visibleContentRect());
- else
+ if (platformWidget()) {
+ // FIXME: consult paintsEntireContents().
+ paintContents(&context, visibleContentRect(LegacyIOSDocumentVisibleRect));
+ } else
paint(&context, frameRect());
}
return false;
LayoutSize size = frame->view()->totalContentsSize();
LayoutSize offset = frame->view()->scrollOffset();
- LayoutRect rect = frame->view()->visibleContentRect(ScrollableArea::IncludeScrollbars);
+ LayoutRect rect = frame->view()->visibleContentRectIncludingScrollbars();
switch (direction) {
case FocusDirectionLeft:
horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horizontalBar->height() : 0;
}
- return IntSize(std::max(0, width() - verticalScrollbarWidth),
- std::max(0, height() - horizontalScrollbarHeight));
+ return IntSize(width() - verticalScrollbarWidth, height() - horizontalScrollbarHeight).expandedTo(IntSize());
}
#if !PLATFORM(GTK)
-IntRect ScrollView::visibleContentRect(VisibleContentRectIncludesScrollbars scollbarInclusion) const
+IntRect ScrollView::visibleContentRectInternal(VisibleContentRectIncludesScrollbars scollbarInclusion, VisibleContentRectBehavior visibleContentRectBehavior) const
{
+#if PLATFORM(IOS)
+ if (visibleContentRectBehavior == LegacyIOSDocumentViewRect) {
+ if (platformWidget())
+ return platformVisibleContentRect(true /* include scrollbars */);
+ }
+
+ if (platformWidget())
+ return actualVisibleContentRect();
+#else
+ UNUSED_PARAM(visibleContentRectBehavior);
+#endif
+
if (platformWidget())
return platformVisibleContentRect(scollbarInclusion == IncludeScrollbars);
bool sendContentResizedNotification = false;
IntSize docSize = totalContentsSize();
- IntSize fullVisibleSize = visibleContentRect(IncludeScrollbars).size();
+ IntSize fullVisibleSize = visibleContentRectIncludingScrollbars().size();
if (hScroll == ScrollbarAuto)
newHasHorizontalScrollbar = docSize.width() > visibleWidth();
if (!m_scrollbarsSuppressed && (m_horizontalScrollbar || m_verticalScrollbar)) {
GraphicsContextStateSaver stateSaver(*context);
IntRect scrollViewDirtyRect = rect;
- IntRect visibleAreaWithScrollbars(location(), visibleContentRect(IncludeScrollbars).size());
+ IntRect visibleAreaWithScrollbars(location(), visibleContentRectIncludingScrollbars().size());
scrollViewDirtyRect.intersect(visibleAreaWithScrollbars);
context->translate(x(), y());
scrollViewDirtyRect.moveBy(-location());
// In the situation the client is responsible for the scrolling (ie. with a tiled backing store) it is possible to use
// the setFixedVisibleContentRect instead for the mainframe, though this must be updated manually, e.g just before resuming the page
// which usually will happen when panning, pinching and rotation ends, or when scale or position are changed manually.
- virtual IntRect visibleContentRect(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const override;
- IntSize visibleSize() const { return visibleContentRect().size(); }
+ virtual IntSize visibleSize() const override { return visibleContentRect(LegacyIOSDocumentVisibleRect).size(); }
#if USE(TILED_BACKING_STORE)
virtual void setFixedVisibleContentRect(const IntRect& visibleContentRect) { m_fixedVisibleContentRect = visibleContentRect; }
void setActualScrollPosition(const IntPoint&);
TileCache* tileCache();
#endif
- virtual int visibleWidth() const override { return visibleContentRect().width(); }
- virtual int visibleHeight() const override { return visibleContentRect().height(); }
// visibleContentRect().size() is computed from unscaledVisibleContentSize() divided by the value of visibleContentScaleFactor.
// visibleContentScaleFactor is usually 1, except when the setting delegatesPageScaling is true and the
virtual void setContentsSize(const IntSize&);
// Functions for querying the current scrolled position (both as a point, a size, or as individual X and Y values).
- virtual IntPoint scrollPosition() const override { return visibleContentRect().location(); }
- IntSize scrollOffset() const { return toIntSize(visibleContentRect().location()); } // Gets the scrolled position as an IntSize. Convenient for adding to other sizes.
+ virtual IntPoint scrollPosition() const override { return visibleContentRect(LegacyIOSDocumentVisibleRect).location(); }
+ IntSize scrollOffset() const { return toIntSize(visibleContentRect(LegacyIOSDocumentVisibleRect).location()); } // Gets the scrolled position as an IntSize. Convenient for adding to other sizes.
virtual IntPoint maximumScrollPosition() const override; // The maximum position we can be scrolled to.
virtual IntPoint minimumScrollPosition() const override; // The minimum position we can be scrolled to.
// Adjust the passed in scroll position to keep it between the minimum and maximum positions.
int scrollY() const { return scrollPosition().y(); }
#if PLATFORM(IOS)
- int actualScrollX() const { return actualVisibleContentRect().x(); }
- int actualScrollY() const { return actualVisibleContentRect().y(); }
+ int actualScrollX() const { return visibleContentRect().x(); }
+ int actualScrollY() const { return visibleContentRect().y(); }
+ // FIXME: maybe fix scrollPosition() on iOS to return the actual scroll position.
+ IntPoint actualScrollPosition() const { return visibleContentRect().location(); }
#endif
// scrollOffset() anchors its (0,0) point at the top end of the header if this ScrollableArea
void updateScrollbars(const IntSize& desiredOffset);
private:
+ virtual IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const override;
+
RefPtr<Scrollbar> m_horizontalScrollbar;
RefPtr<Scrollbar> m_verticalScrollbar;
ScrollbarMode m_horizontalScrollbarMode;
return totalContentsSize;
}
-IntRect ScrollableArea::visibleContentRect(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
+IntRect ScrollableArea::visibleContentRect(VisibleContentRectBehavior visibleContentRectBehavior) const
+{
+ return visibleContentRectInternal(ExcludeScrollbars, visibleContentRectBehavior);
+}
+
+IntRect ScrollableArea::visibleContentRectIncludingScrollbars(VisibleContentRectBehavior visibleContentRectBehavior) const
+{
+ return visibleContentRectInternal(IncludeScrollbars, visibleContentRectBehavior);
+}
+
+IntRect ScrollableArea::visibleContentRectInternal(VisibleContentRectIncludesScrollbars scrollbarInclusion, VisibleContentRectBehavior) const
{
int verticalScrollbarWidth = 0;
int horizontalScrollbarHeight = 0;
virtual IntPoint maximumScrollPosition() const;
enum VisibleContentRectIncludesScrollbars { ExcludeScrollbars, IncludeScrollbars };
- virtual IntRect visibleContentRect(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
- virtual int visibleHeight() const = 0;
- virtual int visibleWidth() const = 0;
+ enum VisibleContentRectBehavior {
+ ContentsVisibleRect,
+#if PLATFORM(IOS)
+ LegacyIOSDocumentViewRect,
+ LegacyIOSDocumentVisibleRect = LegacyIOSDocumentViewRect
+#else
+ LegacyIOSDocumentVisibleRect = ContentsVisibleRect
+#endif
+ };
+
+ IntRect visibleContentRect(VisibleContentRectBehavior = ContentsVisibleRect) const;
+ IntRect visibleContentRectIncludingScrollbars(VisibleContentRectBehavior = ContentsVisibleRect) const;
+
+ int visibleWidth() const { return visibleSize().width(); }
+ int visibleHeight() const { return visibleSize().height(); }
+ virtual IntSize visibleSize() const = 0;
+
virtual IntSize contentsSize() const = 0;
virtual IntSize overhangAmount() const { return IntSize(); }
virtual IntPoint lastKnownMousePosition() const { return IntPoint(); }
bool hasLayerForScrollCorner() const;
private:
+ virtual IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const;
void scrollPositionChanged(const IntPoint&);
// NOTE: Only called from the ScrollAnimator.
IntSize expandedTo(const IntSize& other) const
{
- return IntSize(m_width > other.m_width ? m_width : other.m_width,
- m_height > other.m_height ? m_height : other.m_height);
+ return IntSize(std::max(m_width, other.m_width), std::max(m_height, other.m_height));
}
IntSize shrunkTo(const IntSize& other) const
{
- return IntSize(m_width < other.m_width ? m_width : other.m_width,
- m_height < other.m_height ? m_height : other.m_height);
+ return IntSize(std::min(m_width, other.m_width), std::min(m_height, other.m_height));
}
void clampNegativeToZero()
return Scrollbar::createNativeScrollbar(this, orientation, RegularScrollbar);
}
-IntRect ScrollView::visibleContentRect(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
+IntRect ScrollView::visibleContentRect(VisibleContentRectIncludesScrollbars scrollbarInclusion, VisibleContentRectBehavior) const
{
bool includeScrollbars = scrollbarInclusion == IncludeScrollbars;
frameElementBase = toHTMLFrameElementBase(ownerElement);
if (frameElementAndViewPermitScroll(frameElementBase, &frameView)) {
- LayoutRect viewRect = frameView.visibleContentRect();
+ LayoutRect viewRect = frameView.visibleContentRect(LegacyIOSDocumentVisibleRect);
LayoutRect exposeRect = getRectToExpose(viewRect, viewRect, rect, alignX, alignY);
int xOffset = roundToInt(exposeRect.x());
IntSize scrollOffsetRelativeToDocument = frameView.scrollOffsetRelativeToDocument();
visibleRectRelativeToDocument.setLocation(IntPoint(scrollOffsetRelativeToDocument.width(), scrollOffsetRelativeToDocument.height()));
#else
+ // FIXME: is this equivalent to the code above?
LayoutRect viewRect = frameView.actualVisibleContentRect();
LayoutRect visibleRectRelativeToDocument = viewRect;
#endif
IntPoint RenderLayer::maximumScrollPosition() const
{
// FIXME: m_scrollSize may not be up-to-date if m_scrollDimensionsDirty is true.
- return -scrollOrigin() + roundedIntSize(m_scrollSize) - visibleContentRect(IncludeScrollbars).size();
+ return -scrollOrigin() + roundedIntSize(m_scrollSize) - visibleContentRectIncludingScrollbars(ContentsVisibleRect).size();
}
-IntRect RenderLayer::visibleContentRect(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
+IntRect RenderLayer::visibleContentRectInternal(VisibleContentRectIncludesScrollbars scrollbarInclusion, VisibleContentRectBehavior) const
{
int verticalScrollbarWidth = 0;
int horizontalScrollbarHeight = 0;
return IntSize(scrollWidth(), scrollHeight());
}
-int RenderLayer::visibleHeight() const
-{
- return m_layerSize.height();
-}
-
-int RenderLayer::visibleWidth() const
-{
- return m_layerSize.width();
-}
-
bool RenderLayer::shouldSuspendScrollAnimations() const
{
return renderer().view().frameView().shouldSuspendScrollAnimations();
LayoutRect hitTestArea = isOutOfFlowRenderFlowThread() ? toRenderFlowThread(&renderer())->visualOverflowRect() : renderer().view().documentRect();
if (!request.ignoreClipping())
- hitTestArea.intersect(renderer().view().frameView().visibleContentRect());
+ hitTestArea.intersect(renderer().view().frameView().visibleContentRect(LegacyIOSDocumentVisibleRect));
RenderLayer* insideLayer = hitTestLayer(this, 0, request, result, hitTestArea, hitTestLocation, false);
if (!insideLayer) {
virtual IntPoint scrollPosition() const override;
virtual IntPoint minimumScrollPosition() const override;
virtual IntPoint maximumScrollPosition() const override;
- virtual IntRect visibleContentRect(VisibleContentRectIncludesScrollbars) const override;
- virtual int visibleHeight() const override;
- virtual int visibleWidth() const override;
+ virtual IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const override;
+ virtual IntSize visibleSize() const override { return m_layerSize; }
virtual IntSize contentsSize() const override;
virtual IntSize overhangAmount() const override;
virtual IntPoint lastKnownMousePosition() const override;
LayoutRect clippingBounds;
if (renderer().style().position() == FixedPosition && renderer().container() == &view) {
#if PLATFORM(IOS)
- clippingBounds = view.frameView().visibleContentRect();
+ clippingBounds = view.frameView().visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
#else
clippingBounds = view.frameView().viewportConstrainedVisibleContentRect();
#endif
return IntSize(scrollWidth(), scrollHeight());
}
-int RenderListBox::visibleHeight() const
-{
- return height();
-}
-
-int RenderListBox::visibleWidth() const
-{
- return width();
-}
-
IntPoint RenderListBox::lastKnownMousePosition() const
{
return view().frameView().lastKnownMousePosition();
virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const override;
virtual Scrollbar* verticalScrollbar() const override { return m_vBar.get(); }
virtual IntSize contentsSize() const override;
- virtual int visibleHeight() const override;
- virtual int visibleWidth() const override;
+ virtual IntSize visibleSize() const override { return IntSize(height(), width()); }
virtual IntPoint lastKnownMousePosition() const override;
virtual bool isHandlingWheelEvent() const override;
virtual bool shouldSuspendScrollAnimations() const override;
{
if (shouldUsePrintingLayout())
return LayoutRect(LayoutPoint(), size());
- return frameView().visibleContentRect();
+ return frameView().visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
}
IntRect RenderView::unscaledDocumentRect() const
IntSize RenderView::viewportSize() const
{
- return frameView().visibleContentRect(ScrollableArea::IncludeScrollbars).size();
+ return frameView().visibleContentRectIncludingScrollbars(ScrollableArea::LegacyIOSDocumentVisibleRect).size();
}
void RenderView::updateHitTestResult(HitTestResult& result, const LayoutPoint& point)
+2014-01-23 Simon Fraser <simon.fraser@apple.com>
+
+ Make visibleContentRect() return actualVisibleContentRect() on iOS most of the time
+ https://bugs.webkit.org/show_bug.cgi?id=127456
+
+ Reviewed by Antti Koivisto.
+
+ On iOS, visibleContentRect() returns the entire document rect for historical
+ reasons, and actualVisibleContentRect() returns what visibleContentRect()
+ returns on other platforms.
+
+ In addition, actualVisibleContentRect() was returning an empty rect in WK2.
+
+ Reduce the confusion of #ifdefs by making visibleContentRect() behave like
+ actualVisibleContentRect() by default on iOS. Where it needs the old behavior,
+ an optional parameter, LegacyIOSDocumentVisibleRect, provides this.
+
+ Achieve this by having the virtual ScrollableArea::visibleContentRectInternal(),
+ which is called by non-virtual visibleContentRect() and visibleContentRectIncludingScrollbars().
+
+ Similarly clean up visibleHeight/visibleWidth functions by having visibleSize() be virtual,
+ with non-virtual visibleHeight() and visibleWidth().
+
+ ScrollableArea subclasses override visibleContentRectInternal() and visibleSize() where necessary.
+
+ Mechanically change all the call sites of actualVisibleContentRect() to
+ use visibleContentRect(), and the call sites of visibleContentRect()
+ to visibleContentRect(..., LegacyIOSDocumentVisibleRect), adding comments
+ where this may not be appropriate.
+
+ Change callers of visibleContentRect(IncludeScrollbars...) to visibleContentRectIncludingScrollbars().
+
+ Also add actualScrollPosition(), and clean up some actualScroll* call sites.
+
+ No behavior change.
+
+ * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
+
2014-01-22 Brent Fulgham <bfulgham@apple.com>
[Win] Update project and solution files for 64-bit builds
symbolWithPointer(?vm@ScriptExecutionContext@WebCore@@QAEPAVVM@JSC@@XZ, ?vm@ScriptExecutionContext@WebCore@@QEAAPEAVVM@JSC@@XZ)
symbolWithPointer(?completeURL@Document@WebCore@@UBE?AVURL@2@ABVString@WTF@@@Z, ?completeURL@Document@WebCore@@UEBA?AVURL@2@AEBVString@WTF@@@Z)
symbolWithPointer(??1DOMWindow@WebCore@@UAE@XZ, ??1DOMWindow@WebCore@@UEAA@XZ)
- symbolWithPointer(?visibleContentRect@ScrollView@WebCore@@UBE?AVIntRect@2@W4VisibleContentRectIncludesScrollbars@ScrollableArea@2@@Z, ?visibleContentRect@ScrollView@WebCore@@UEBA?AVIntRect@2@W4VisibleContentRectIncludesScrollbars@ScrollableArea@2@@Z)
+2014-01-23 Simon Fraser <simon.fraser@apple.com>
+
+ Make visibleContentRect() return actualVisibleContentRect() on iOS most of the time
+ https://bugs.webkit.org/show_bug.cgi?id=127456
+
+ Reviewed by Antti Koivisto.
+
+ On iOS, visibleContentRect() returns the entire document rect for historical
+ reasons, and actualVisibleContentRect() returns what visibleContentRect()
+ returns on other platforms.
+
+ In addition, actualVisibleContentRect() was returning an empty rect in WK2.
+
+ Reduce the confusion of #ifdefs by making visibleContentRect() behave like
+ actualVisibleContentRect() by default on iOS. Where it needs the old behavior,
+ an optional parameter, LegacyIOSDocumentVisibleRect, provides this.
+
+ Achieve this by having the virtual ScrollableArea::visibleContentRectInternal(),
+ which is called by non-virtual visibleContentRect() and visibleContentRectIncludingScrollbars().
+
+ Similarly clean up visibleHeight/visibleWidth functions by having visibleSize() be virtual,
+ with non-virtual visibleHeight() and visibleWidth().
+
+ ScrollableArea subclasses override visibleContentRectInternal() and visibleSize() where necessary.
+
+ Mechanically change all the call sites of actualVisibleContentRect() to
+ use visibleContentRect(), and the call sites of visibleContentRect()
+ to visibleContentRect(..., LegacyIOSDocumentVisibleRect), adding comments
+ where this may not be appropriate.
+
+ Change callers of visibleContentRect(IncludeScrollbars...) to visibleContentRectIncludingScrollbars().
+
+ Also add actualScrollPosition(), and clean up some actualScroll* call sites.
+
+ No behavior change.
+
+ * WebProcess/Plugins/PDF/PDFPlugin.h:
+ * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
+ (WebKit::ViewGestureGeometryCollector::collectGeometryForMagnificationGesture):
+ (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
+ * WebProcess/WebPage/WebFrame.cpp:
+ (WebKit::WebFrame::visibleContentBounds):
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
+ (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
+
2014-01-23 Tim Horton <timothy_horton@apple.com>
[wk2] Page Overlays: Add API to clear the page overlay (and get rid of its backing store)
virtual WebCore::IntPoint scrollPosition() const override;
virtual WebCore::IntPoint minimumScrollPosition() const override;
virtual WebCore::IntPoint maximumScrollPosition() const override;
- virtual int visibleHeight() const override { return m_size.height(); }
- virtual int visibleWidth() const override { return m_size.width(); }
+ virtual WebCore::IntSize visibleSize() const override { return m_size; }
virtual WebCore::IntSize contentsSize() const override { return m_pdfDocumentSize; }
virtual WebCore::Scrollbar* horizontalScrollbar() const override { return m_horizontalScrollbar.get(); }
virtual WebCore::Scrollbar* verticalScrollbar() const override { return m_verticalScrollbar.get(); }
void ViewGestureGeometryCollector::collectGeometryForMagnificationGesture()
{
- FloatRect visibleContentRect = m_webPage.mainFrameView()->visibleContentRect(ScrollableArea::IncludeScrollbars);
+ FloatRect visibleContentRect = m_webPage.mainFrameView()->visibleContentRectIncludingScrollbars();
bool frameHandlesMagnificationGesture = m_webPage.mainWebFrame()->handlesPageScaleGesture();
m_webPage.send(Messages::ViewGestureController::DidCollectGeometryForMagnificationGesture(visibleContentRect, frameHandlesMagnificationGesture));
}
void ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture(FloatPoint origin)
{
- FloatRect visibleContentRect = m_webPage.mainFrameView()->visibleContentRect(ScrollableArea::IncludeScrollbars);
+ FloatRect visibleContentRect = m_webPage.mainFrameView()->visibleContentRectIncludingScrollbars();
bool frameHandlesMagnificationGesture = m_webPage.mainWebFrame()->handlesPageScaleGesture();
FloatPoint scrolledOrigin = origin;
if (!view)
return IntRect();
- IntRect contentRect = view->visibleContentRect(ScrollableArea::IncludeScrollbars);
+ IntRect contentRect = view->visibleContentRectIncludingScrollbars();
return IntRect(0, 0, contentRect.width(), contentRect.height());
}
RenderView* renderView = frameView->renderView();
PlatformCALayer* renderViewLayer = static_cast<GraphicsLayerCA*>(renderView->layer()->backing()->graphicsLayer())->platformCALayer();
- FloatRect visibleContentRect = frameView->visibleContentRect(ScrollableArea::IncludeScrollbars);
+ FloatRect visibleContentRect = frameView->visibleContentRectIncludingScrollbars();
FloatPoint constrainedOrigin = visibleContentRect.location();
constrainedOrigin.moveBy(-origin);
shadowLayer->setPosition(shadowLayer->bounds().center());
FloatPoint unscrolledOrigin(origin);
- FloatRect visibleContentRect = m_webPage->mainFrameView()->visibleContentRect(ScrollableArea::IncludeScrollbars);
+ FloatRect visibleContentRect = m_webPage->mainFrameView()->visibleContentRectIncludingScrollbars();
unscrolledOrigin.moveBy(-visibleContentRect.location());
m_webPage->scalePage(scale, roundedIntPoint(-unscrolledOrigin));
flushLayers();