<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[194438] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/194438">194438</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-12-29 16:29:36 -0800 (Tue, 29 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove ScrollView::scrollOffset() in preparation for scrollOffset vs. scrollPosition clarification
https://bugs.webkit.org/show_bug.cgi?id=152589

Reviewed by Sam Weinig.

Current code uses scrollOffset vs. scrollPosition interchangeably, and confusingly.
Longer term, I plan to make &quot;scrollPosition&quot; be the value that is relative to the
contents, i.e. affected by scrollOrigin, and &quot;scrollOffset&quot; be the zero-based value
that's used to set scrollbar values.

To prepare for this, remove ScrollView::scrollOffset(), which is just the
scrollPosition as an IntSize.

Add some typedefs in ScrollableArea, which will slowly propagate through the
code as position vs. offset is clarified.

Source/WebCore:

* inspector/InspectorOverlay.cpp:
(WebCore::contentsQuadToCoordinateSystem):
(WebCore::InspectorOverlay::highlightQuad):
(WebCore::localPointToRoot):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetRespectingCustomFixedPosition):
(WebCore::FrameView::topContentInsetDidChange):
(WebCore::FrameView::addTrackedRepaintRect):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
(WebCore::FrameView::setScrollPinningBehavior):
* page/FrameView.h:
* page/SpatialNavigation.cpp:
(WebCore::canScrollInDirection):
(WebCore::rectToAbsoluteCoordinates):
* platform/ScrollView.cpp:
(WebCore::ScrollView::setScrollbarModes):
(WebCore::ScrollView::availableContentSizeChanged):
(WebCore::ScrollView::setContentsSize):
(WebCore::ScrollView::maximumScrollPosition):
(WebCore::ScrollView::minimumScrollPosition):
(WebCore::ScrollView::adjustScrollPositionWithinRange):
(WebCore::ScrollView::documentScrollOffsetRelativeToViewOrigin):
(WebCore::ScrollView::documentScrollOffsetRelativeToScrollableAreaOrigin):
(WebCore::ScrollView::setScrollPosition):
(WebCore::ScrollView::updateScrollbars):
(WebCore::ScrollView::rootViewToTotalContents):
(WebCore::ScrollView::setFrameRect):
(WebCore::ScrollView::scrollbarStyleChanged):
(WebCore::ScrollView::setScrollOrigin):
* platform/ScrollView.h:
(WebCore::ScrollView::convertChildToSelf):
(WebCore::ScrollView::convertSelfToChild):
(WebCore::ScrollView::scrollOffset): Deleted.
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::scrollbarIntrusion):
(WebCore::ScrollableArea::scrollPosition):
(WebCore::ScrollableArea::minimumScrollPosition):
(WebCore::ScrollableArea::maximumScrollPosition):
* platform/ScrollableArea.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::calculateAutoscrollDirection):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollPosition):
(WebCore::RenderLayer::minimumScrollPosition):
(WebCore::RenderLayer::maximumScrollPosition):
* rendering/RenderLayer.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::nodeAtPoint):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::localCoordinateSpaceTransform):

Source/WebKit2:

* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::scrollPosition):
(WebKit::PDFPlugin::minimumScrollPosition):
(WebKit::PDFPlugin::maximumScrollPosition):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::scrollOffset):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::scrollMainFrameIfNotAtMaxScrollPosition):
(WebKit::WebPage::updateMainFrameScrollOffsetPinning):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorOverlaycpp">trunk/Source/WebCore/inspector/InspectorOverlay.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewh">trunk/Source/WebCore/page/FrameView.h</a></li>
<li><a href="#trunkSourceWebCorepageSpatialNavigationcpp">trunk/Source/WebCore/page/SpatialNavigation.cpp</a></li>
<li><a href="#trunkSourceWebCorepagewinFrameCGWincpp">trunk/Source/WebCore/page/win/FrameCGWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollViewcpp">trunk/Source/WebCore/platform/ScrollView.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollViewh">trunk/Source/WebCore/platform/ScrollView.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreacpp">trunk/Source/WebCore/platform/ScrollableArea.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreah">trunk/Source/WebCore/platform/ScrollableArea.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerh">trunk/Source/WebCore/rendering/RenderLayer.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderWidgetcpp">trunk/Source/WebCore/rendering/RenderWidget.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGSVGElementcpp">trunk/Source/WebCore/svg/SVGSVGElement.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebFramecpp">trunk/Source/WebKit/win/WebFrame.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleDOMInjectedBundleRangeHandlecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPDFDeprecatedPDFPluginh">trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPDFDeprecatedPDFPluginmm">trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebFramecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/ChangeLog        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -1,3 +1,73 @@
</span><ins>+2015-12-29  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Remove ScrollView::scrollOffset() in preparation for scrollOffset vs. scrollPosition clarification
+        https://bugs.webkit.org/show_bug.cgi?id=152589
+
+        Reviewed by Sam Weinig.
+
+        Current code uses scrollOffset vs. scrollPosition interchangeably, and confusingly.
+        Longer term, I plan to make &quot;scrollPosition&quot; be the value that is relative to the 
+        contents, i.e. affected by scrollOrigin, and &quot;scrollOffset&quot; be the zero-based value
+        that's used to set scrollbar values.
+        
+        To prepare for this, remove ScrollView::scrollOffset(), which is just the
+        scrollPosition as an IntSize.
+        
+        Add some typedefs in ScrollableArea, which will slowly propagate through the
+        code as position vs. offset is clarified.
+
+        * inspector/InspectorOverlay.cpp:
+        (WebCore::contentsQuadToCoordinateSystem):
+        (WebCore::InspectorOverlay::highlightQuad):
+        (WebCore::localPointToRoot):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollOffsetRespectingCustomFixedPosition):
+        (WebCore::FrameView::topContentInsetDidChange):
+        (WebCore::FrameView::addTrackedRepaintRect):
+        (WebCore::FrameView::scrollTo):
+        (WebCore::FrameView::wheelEvent):
+        (WebCore::FrameView::setScrollPinningBehavior):
+        * page/FrameView.h:
+        * page/SpatialNavigation.cpp:
+        (WebCore::canScrollInDirection):
+        (WebCore::rectToAbsoluteCoordinates):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::setScrollbarModes):
+        (WebCore::ScrollView::availableContentSizeChanged):
+        (WebCore::ScrollView::setContentsSize):
+        (WebCore::ScrollView::maximumScrollPosition):
+        (WebCore::ScrollView::minimumScrollPosition):
+        (WebCore::ScrollView::adjustScrollPositionWithinRange):
+        (WebCore::ScrollView::documentScrollOffsetRelativeToViewOrigin):
+        (WebCore::ScrollView::documentScrollOffsetRelativeToScrollableAreaOrigin):
+        (WebCore::ScrollView::setScrollPosition):
+        (WebCore::ScrollView::updateScrollbars):
+        (WebCore::ScrollView::rootViewToTotalContents):
+        (WebCore::ScrollView::setFrameRect):
+        (WebCore::ScrollView::scrollbarStyleChanged):
+        (WebCore::ScrollView::setScrollOrigin):
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::convertChildToSelf):
+        (WebCore::ScrollView::convertSelfToChild):
+        (WebCore::ScrollView::scrollOffset): Deleted.
+        * platform/ScrollableArea.cpp:
+        (WebCore::ScrollableArea::scrollbarIntrusion):
+        (WebCore::ScrollableArea::scrollPosition):
+        (WebCore::ScrollableArea::minimumScrollPosition):
+        (WebCore::ScrollableArea::maximumScrollPosition):
+        * platform/ScrollableArea.h:
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::calculateAutoscrollDirection):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::scrollPosition):
+        (WebCore::RenderLayer::minimumScrollPosition):
+        (WebCore::RenderLayer::maximumScrollPosition):
+        * rendering/RenderLayer.h:
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::nodeAtPoint):
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
+
</ins><span class="cx"> 2015-12-28  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix Windows build, ostensibly after r194424.
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorOverlaycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">     quad.setP4(view-&gt;contentsToRootView(roundedIntPoint(quad.p4())));
</span><span class="cx"> 
</span><span class="cx">     if (coordinateSystem == InspectorOverlay::CoordinateSystem::View)
</span><del>-        quad += mainView-&gt;scrollOffset();
</del><ins>+        quad += toIntSize(mainView-&gt;scrollPosition());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void contentsQuadToPage(const FrameView* mainView, const FrameView* view, FloatQuad&amp; quad)
</span><span class="lines">@@ -278,7 +278,7 @@
</span><span class="cx"> void InspectorOverlay::highlightQuad(std::unique_ptr&lt;FloatQuad&gt; quad, const HighlightConfig&amp; highlightConfig)
</span><span class="cx"> {
</span><span class="cx">     if (highlightConfig.usePageCoordinates)
</span><del>-        *quad -= m_page.mainFrame().view()-&gt;scrollOffset();
</del><ins>+        *quad -= toIntSize(m_page.mainFrame().view()-&gt;scrollPosition());
</ins><span class="cx"> 
</span><span class="cx">     m_quadHighlightConfig = highlightConfig;
</span><span class="cx">     m_highlightQuad = WTF::move(quad);
</span><span class="lines">@@ -594,7 +594,7 @@
</span><span class="cx"> {
</span><span class="cx">     FloatPoint result = renderer-&gt;localToAbsolute(point);
</span><span class="cx">     result = view-&gt;contentsToRootView(roundedIntPoint(result));
</span><del>-    result += mainView-&gt;scrollOffset();
</del><ins>+    result += toIntSize(mainView-&gt;scrollPosition());
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/page/FrameView.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -1089,7 +1089,7 @@
</span><span class="cx"> LayoutSize FrameView::scrollOffsetRespectingCustomFixedPosition() const
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    return useCustomFixedPositionLayoutRect() ? customFixedPositionLayoutRect().location() - LayoutPoint() : scrollOffset();
</del><ins>+    return useCustomFixedPositionLayoutRect() ? customFixedPositionLayoutRect().location() - LayoutPoint() : toLayoutSize(scrollPosition());
</ins><span class="cx"> #else
</span><span class="cx">     return scrollOffsetForFixedPosition();
</span><span class="cx"> #endif
</span><span class="lines">@@ -1138,7 +1138,7 @@
</span><span class="cx">     
</span><span class="cx">     layout();
</span><span class="cx"> 
</span><del>-    updateScrollbars(scrollOffset());
</del><ins>+    updateScrollbars(scrollPosition());
</ins><span class="cx">     if (renderView-&gt;usesCompositing())
</span><span class="cx">         renderView-&gt;compositor().frameViewDidChangeSize();
</span><span class="cx"> 
</span><span class="lines">@@ -2160,20 +2160,19 @@
</span><span class="cx">         visibleContentSizeDidChange = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    IntSize offset = scrollOffset();
</del><span class="cx">     IntPoint oldPosition = scrollPosition();
</span><span class="cx">     ScrollView::setFixedVisibleContentRect(visibleContentRect);
</span><del>-    if (offset != scrollOffset()) {
</del><ins>+    IntPoint newPosition = scrollPosition();
+    if (oldPosition != newPosition) {
</ins><span class="cx">         updateLayerPositionsAfterScrolling();
</span><span class="cx">         if (frame().settings().acceleratedCompositingForFixedPositionEnabled())
</span><span class="cx">             updateCompositingLayersAfterScrolling();
</span><del>-        IntPoint newPosition = scrollPosition();
-        scrollAnimator().setCurrentPosition(scrollPosition());
</del><ins>+        scrollAnimator().setCurrentPosition(newPosition);
</ins><span class="cx">         scrollPositionChanged(oldPosition, newPosition);
</span><span class="cx">     }
</span><span class="cx">     if (visibleContentSizeDidChange) {
</span><span class="cx">         // Update the scroll-bars to calculate new page-step size.
</span><del>-        updateScrollbars(scrollOffset());
</del><ins>+        updateScrollbars(scrollPosition());
</ins><span class="cx">     }
</span><span class="cx">     didChangeScrollOffset();
</span><span class="cx"> }
</span><span class="lines">@@ -2386,7 +2385,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     FloatRect repaintRect = r;
</span><del>-    repaintRect.move(-scrollOffset());
</del><ins>+    repaintRect.moveBy(-scrollPosition());
</ins><span class="cx">     m_trackedRepaintRects.append(repaintRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3479,10 +3478,9 @@
</span><span class="cx"> 
</span><span class="cx"> void FrameView::scrollTo(const IntSize&amp; newOffset)
</span><span class="cx"> {
</span><del>-    LayoutSize offset = scrollOffset();
</del><span class="cx">     IntPoint oldPosition = scrollPosition();
</span><span class="cx">     ScrollView::scrollTo(newOffset);
</span><del>-    if (offset != scrollOffset())
</del><ins>+    if (oldPosition != scrollPosition())
</ins><span class="cx">         scrollPositionChanged(oldPosition, scrollPosition());
</span><span class="cx">     didChangeScrollOffset();
</span><span class="cx"> }
</span><span class="lines">@@ -4587,11 +4585,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (delegatesScrolling()) {
</span><del>-        IntSize offset = scrollOffset();
-        IntPoint oldPosition = scrollPosition();
-        IntSize newOffset = IntSize(offset.width() - wheelEvent.deltaX(), offset.height() - wheelEvent.deltaY());
-        if (offset != newOffset) {
-            ScrollView::scrollTo(newOffset);
</del><ins>+        ScrollPosition oldPosition = scrollPosition();
+        ScrollPosition newPosition = oldPosition - IntSize(wheelEvent.deltaX(), wheelEvent.deltaY());
+        if (oldPosition != newPosition) {
+            ScrollView::scrollTo(toIntSize(newPosition));
</ins><span class="cx">             scrollPositionChanged(oldPosition, scrollPosition());
</span><span class="cx">             didChangeScrollOffset();
</span><span class="cx">         }
</span><span class="lines">@@ -4796,7 +4793,7 @@
</span><span class="cx">             scrollingCoordinator-&gt;setScrollPinningBehavior(pinning);
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    updateScrollbars(scrollOffset());
</del><ins>+    updateScrollbars(scrollPosition());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScrollBehaviorForFixedElements FrameView::scrollBehaviorForFixedElements() const
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/page/FrameView.h        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -242,8 +242,8 @@
</span><span class="cx">     virtual void updateCompositingLayersAfterScrolling() override;
</span><span class="cx">     virtual bool requestScrollPositionUpdate(const IntPoint&amp;) override;
</span><span class="cx">     virtual bool isRubberBandInProgress() const override;
</span><del>-    WEBCORE_EXPORT virtual IntPoint minimumScrollPosition() const override;
-    WEBCORE_EXPORT virtual IntPoint maximumScrollPosition() const override;
</del><ins>+    WEBCORE_EXPORT virtual ScrollPosition minimumScrollPosition() const override;
+    WEBCORE_EXPORT virtual ScrollPosition maximumScrollPosition() const override;
</ins><span class="cx"> 
</span><span class="cx">     void viewportContentsChanged();
</span><span class="cx">     WEBCORE_EXPORT void resumeVisibleImageAnimationsIncludingSubframes();
</span></span></pre></div>
<a id="trunkSourceWebCorepageSpatialNavigationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/SpatialNavigation.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/SpatialNavigation.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/page/SpatialNavigation.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -483,18 +483,19 @@
</span><span class="cx">     if ((direction == FocusDirectionUp || direction == FocusDirectionDown) &amp;&amp;  ScrollbarAlwaysOff == verticalMode)
</span><span class="cx">         return false;
</span><span class="cx">     LayoutSize size = frame-&gt;view()-&gt;totalContentsSize();
</span><del>-    LayoutSize offset = frame-&gt;view()-&gt;scrollOffset();
</del><ins>+    LayoutPoint scrollPosition = frame-&gt;view()-&gt;scrollPosition();
</ins><span class="cx">     LayoutRect rect = frame-&gt;view()-&gt;unobscuredContentRectIncludingScrollbars();
</span><span class="cx"> 
</span><ins>+    // FIXME: wrong in RTL documents.
</ins><span class="cx">     switch (direction) {
</span><span class="cx">     case FocusDirectionLeft:
</span><del>-        return offset.width() &gt; 0;
</del><ins>+        return scrollPosition.x() &gt; 0;
</ins><span class="cx">     case FocusDirectionUp:
</span><del>-        return offset.height() &gt; 0;
</del><ins>+        return scrollPosition.y() &gt; 0;
</ins><span class="cx">     case FocusDirectionRight:
</span><del>-        return rect.width() + offset.width() &lt; size.width();
</del><ins>+        return rect.width() + scrollPosition.x() &lt; size.width();
</ins><span class="cx">     case FocusDirectionDown:
</span><del>-        return rect.height() + offset.height() &lt; size.height();
</del><ins>+        return rect.height() + scrollPosition.y() &lt; size.height();
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">         return false;
</span><span class="lines">@@ -510,7 +511,7 @@
</span><span class="cx">             do {
</span><span class="cx">                 rect.move(element-&gt;offsetLeft(), element-&gt;offsetTop());
</span><span class="cx">             } while ((element = element-&gt;offsetParent()));
</span><del>-            rect.move((-frame-&gt;view()-&gt;scrollOffset()));
</del><ins>+            rect.moveBy((-frame-&gt;view()-&gt;scrollPosition()));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     return rect;
</span></span></pre></div>
<a id="trunkSourceWebCorepagewinFrameCGWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/win/FrameCGWin.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/win/FrameCGWin.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/page/win/FrameCGWin.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -41,8 +41,8 @@
</span><span class="cx"> 
</span><span class="cx"> static void drawRectIntoContext(IntRect rect, FrameView* view, GraphicsContext&amp; gc)
</span><span class="cx"> {
</span><del>-    IntSize offset = view-&gt;scrollOffset();
-    rect.move(-offset.width(), -offset.height());
</del><ins>+    IntSize scrollPosition = view-&gt;scrollPosition();
+    rect.move(-scrollPosition.x(), -scrollPosition.y());
</ins><span class="cx">     rect = view-&gt;convertToContainingWindow(rect);
</span><span class="cx"> 
</span><span class="cx">     gc.concatCTM(AffineTransform().translate(-rect.x(), -rect.y()));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/platform/ScrollView.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx">     if (platformWidget())
</span><span class="cx">         platformSetScrollbarModes();
</span><span class="cx">     else
</span><del>-        updateScrollbars(scrollOffset());
</del><ins>+        updateScrollbars(scrollPosition());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollView::scrollbarModes(ScrollbarMode&amp; horizontalMode, ScrollbarMode&amp; verticalMode) const
</span><span class="lines">@@ -366,7 +366,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (reason != AvailableSizeChangeReason::ScrollbarsChanged)
</span><del>-        updateScrollbars(scrollOffset());
</del><ins>+        updateScrollbars(scrollPosition());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntSize ScrollView::contentsSize() const
</span><span class="lines">@@ -382,23 +382,23 @@
</span><span class="cx">     if (platformWidget())
</span><span class="cx">         platformSetContentsSize();
</span><span class="cx">     else
</span><del>-        updateScrollbars(scrollOffset());
</del><ins>+        updateScrollbars(scrollPosition());
</ins><span class="cx">     updateOverhangAreas();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint ScrollView::maximumScrollPosition() const
</del><ins>+ScrollPosition ScrollView::maximumScrollPosition() const
</ins><span class="cx"> {
</span><span class="cx">     IntPoint maximumOffset(contentsWidth() - visibleWidth() - scrollOrigin().x(), totalContentsSize().height() - visibleHeight() - scrollOrigin().y());
</span><span class="cx">     maximumOffset.clampNegativeToZero();
</span><span class="cx">     return maximumOffset;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint ScrollView::minimumScrollPosition() const
</del><ins>+ScrollPosition ScrollView::minimumScrollPosition() const
</ins><span class="cx"> {
</span><span class="cx">     return IntPoint(-scrollOrigin().x(), -scrollOrigin().y());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint ScrollView::adjustScrollPositionWithinRange(const IntPoint&amp; scrollPoint) const
</del><ins>+ScrollPosition ScrollView::adjustScrollPositionWithinRange(const ScrollPosition&amp; scrollPoint) const
</ins><span class="cx"> {
</span><span class="cx">     if (!constrainsScrollingToContentEdge())
</span><span class="cx">         return scrollPoint;
</span><span class="lines">@@ -408,7 +408,7 @@
</span><span class="cx"> 
</span><span class="cx"> IntSize ScrollView::documentScrollOffsetRelativeToViewOrigin() const
</span><span class="cx"> {
</span><del>-    return scrollOffset() - IntSize(0, headerHeight() + topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset));
</del><ins>+    return toIntSize(scrollPosition()) - IntSize(0, headerHeight() + topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntPoint ScrollView::documentScrollPositionRelativeToViewOrigin() const
</span><span class="lines">@@ -419,7 +419,7 @@
</span><span class="cx"> 
</span><span class="cx"> IntSize ScrollView::documentScrollOffsetRelativeToScrollableAreaOrigin() const
</span><span class="cx"> {
</span><del>-    return scrollOffset() - IntSize(0, headerHeight());
</del><ins>+    return toIntSize(scrollPosition()) - IntSize(0, headerHeight());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int ScrollView::scrollSize(ScrollbarOrientation orientation) const
</span><span class="lines">@@ -529,25 +529,25 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollView::setScrollPosition(const IntPoint&amp; scrollPoint)
</del><ins>+void ScrollView::setScrollPosition(const ScrollPosition&amp; scrollPosition)
</ins><span class="cx"> {
</span><span class="cx">     if (prohibitsScrolling())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (platformWidget()) {
</span><del>-        platformSetScrollPosition(scrollPoint);
</del><ins>+        platformSetScrollPosition(scrollPosition);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    IntPoint newScrollPosition = !delegatesScrolling() ? adjustScrollPositionWithinRange(scrollPoint) : scrollPoint;
</del><ins>+    IntPoint newScrollPosition = !delegatesScrolling() ? adjustScrollPositionWithinRange(scrollPosition) : scrollPosition;
</ins><span class="cx"> 
</span><del>-    if ((!delegatesScrolling() || !inProgrammaticScroll()) &amp;&amp; newScrollPosition == scrollPosition())
</del><ins>+    if ((!delegatesScrolling() || !inProgrammaticScroll()) &amp;&amp; newScrollPosition == this-&gt;scrollPosition())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (requestScrollPositionUpdate(newScrollPosition))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    updateScrollbars(IntSize(newScrollPosition.x(), newScrollPosition.y()));
</del><ins>+    updateScrollbars(newScrollPosition);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ScrollView::scroll(ScrollDirection direction, ScrollGranularity granularity)
</span><span class="lines">@@ -582,7 +582,7 @@
</span><span class="cx">     return stretch;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollView::updateScrollbars(const IntSize&amp; desiredOffset)
</del><ins>+void ScrollView::updateScrollbars(const ScrollPosition&amp; desiredPosition)
</ins><span class="cx"> {
</span><span class="cx">     if (m_inUpdateScrollbars || prohibitsScrolling() || platformWidget() || delegatesScrolling())
</span><span class="cx">         return;
</span><span class="lines">@@ -693,7 +693,7 @@
</span><span class="cx">                 // The layout with the new scroll state had no impact on
</span><span class="cx">                 // the document's overall size, so updateScrollbars didn't get called.
</span><span class="cx">                 // Recur manually.
</span><del>-                updateScrollbars(desiredOffset);
</del><ins>+                updateScrollbars(desiredPosition);
</ins><span class="cx">             }
</span><span class="cx">             m_updateScrollbarsPass--;
</span><span class="cx">         }
</span><span class="lines">@@ -760,7 +760,7 @@
</span><span class="cx">             invalidateScrollCornerRect(oldScrollCornerRect);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    IntPoint adjustedScrollPosition = IntPoint(desiredOffset);
</del><ins>+    IntPoint adjustedScrollPosition = desiredPosition;
</ins><span class="cx">     if (!isRubberBandInProgress())
</span><span class="cx">         adjustedScrollPosition = adjustScrollPositionWithinRange(adjustedScrollPosition);
</span><span class="cx"> 
</span><span class="lines">@@ -922,7 +922,7 @@
</span><span class="cx"> 
</span><span class="cx">     IntPoint viewPoint = convertFromRootView(rootViewPoint);
</span><span class="cx">     // Like rootViewToContents(), but ignores headerHeight.
</span><del>-    return viewPoint + scrollOffset() - IntSize(0, topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset));
</del><ins>+    return viewPoint + toIntSize(scrollPosition()) - IntSize(0, topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntRect ScrollView::contentsToRootView(const IntRect&amp; contentsRect) const
</span><span class="lines">@@ -1037,7 +1037,7 @@
</span><span class="cx">     Widget::setFrameRect(newRect);
</span><span class="cx">     frameRectsChanged();
</span><span class="cx"> 
</span><del>-    updateScrollbars(scrollOffset());
</del><ins>+    updateScrollbars(scrollPosition());
</ins><span class="cx">     
</span><span class="cx">     if (!m_useFixedLayout &amp;&amp; oldRect.size() != newRect.size())
</span><span class="cx">         availableContentSizeChanged(AvailableSizeChangeReason::AreaSizeChanged);
</span><span class="lines">@@ -1155,7 +1155,7 @@
</span><span class="cx">     if (!forceUpdate)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    updateScrollbars(scrollOffset());
</del><ins>+    updateScrollbars(scrollPosition());
</ins><span class="cx">     positionScrollbarLayers();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1480,7 +1480,7 @@
</span><span class="cx">     
</span><span class="cx">     // Update if the scroll origin changes, since our position will be different if the content size did not change.
</span><span class="cx">     if (updatePositionAtAll &amp;&amp; updatePositionSynchronously)
</span><del>-        updateScrollbars(scrollOffset());
</del><ins>+        updateScrollbars(scrollPosition());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollView::styleDidChange()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.h (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.h        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/platform/ScrollView.h        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -225,12 +225,13 @@
</span><span class="cx">     virtual void setContentsSize(const IntSize&amp;);
</span><span class="cx"> 
</span><span class="cx">     // Functions for querying the current scrolled position (both as a point, a size, or as individual X and Y values).
</span><del>-    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.
</del><ins>+    virtual ScrollPosition scrollPosition() const override { return visibleContentRect(LegacyIOSDocumentVisibleRect).location(); }
+
+    virtual ScrollPosition maximumScrollPosition() const override; // The maximum position we can be scrolled to.
+    virtual ScrollPosition minimumScrollPosition() const override; // The minimum position we can be scrolled to.
+
</ins><span class="cx">     // Adjust the passed in scroll position to keep it between the minimum and maximum positions.
</span><del>-    IntPoint adjustScrollPositionWithinRange(const IntPoint&amp;) const; 
</del><ins>+    ScrollPosition adjustScrollPositionWithinRange(const ScrollPosition&amp;) const;
</ins><span class="cx">     int scrollX() const { return scrollPosition().x(); }
</span><span class="cx">     int scrollY() const { return scrollPosition().y(); }
</span><span class="cx"> 
</span><span class="lines">@@ -267,7 +268,7 @@
</span><span class="cx">     IntPoint cachedScrollPosition() const { return m_cachedScrollPosition; }
</span><span class="cx"> 
</span><span class="cx">     // Functions for scrolling the view.
</span><del>-    virtual void setScrollPosition(const IntPoint&amp;);
</del><ins>+    virtual void setScrollPosition(const ScrollPosition&amp;);
</ins><span class="cx">     void scrollBy(const IntSize&amp; s) { return setScrollPosition(scrollPosition() + s); }
</span><span class="cx"> 
</span><span class="cx">     // This function scrolls by lines, pages or pixels.
</span><span class="lines">@@ -331,7 +332,7 @@
</span><span class="cx">     {
</span><span class="cx">         IntPoint newPoint = point;
</span><span class="cx">         if (!isScrollViewScrollbar(child))
</span><del>-            newPoint = point - scrollOffset();
</del><ins>+            newPoint = point - toIntSize(scrollPosition());
</ins><span class="cx">         newPoint.moveBy(child-&gt;location());
</span><span class="cx">         return newPoint;
</span><span class="cx">     }
</span><span class="lines">@@ -340,7 +341,7 @@
</span><span class="cx">     {
</span><span class="cx">         IntPoint newPoint = point;
</span><span class="cx">         if (!isScrollViewScrollbar(child))
</span><del>-            newPoint = point + scrollOffset();
</del><ins>+            newPoint = point + toIntSize(scrollPosition());
</ins><span class="cx">         newPoint.moveBy(-child-&gt;location());
</span><span class="cx">         return newPoint;
</span><span class="cx">     }
</span><span class="lines">@@ -409,7 +410,7 @@
</span><span class="cx">     virtual bool isFlippedDocument() const { return false; }
</span><span class="cx"> 
</span><span class="cx">     // Called to update the scrollbars to accurately reflect the state of the view.
</span><del>-    void updateScrollbars(const IntSize&amp; desiredOffset);
</del><ins>+    void updateScrollbars(const ScrollPosition&amp; desiredPosition);
</ins><span class="cx"> 
</span><span class="cx">     float platformTopContentInset() const;
</span><span class="cx">     void platformSetTopContentInset(float);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -518,24 +518,26 @@
</span><span class="cx"> 
</span><span class="cx"> IntSize ScrollableArea::scrollbarIntrusion() const
</span><span class="cx"> {
</span><del>-    return IntSize(
</del><ins>+    return {
</ins><span class="cx">         verticalScrollbar() ? verticalScrollbar()-&gt;occupiedWidth() : 0,
</span><del>-        horizontalScrollbar() ? horizontalScrollbar()-&gt;occupiedHeight() : 0);
</del><ins>+        horizontalScrollbar() ? horizontalScrollbar()-&gt;occupiedHeight() : 0
+    };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint ScrollableArea::scrollPosition() const
</del><ins>+ScrollPosition ScrollableArea::scrollPosition() const
</ins><span class="cx"> {
</span><ins>+    // FIXME: This relationship seems to be inverted. Scrollbars should be 'view', not 'model', and should get their values from us.
</ins><span class="cx">     int x = horizontalScrollbar() ? horizontalScrollbar()-&gt;value() : 0;
</span><span class="cx">     int y = verticalScrollbar() ? verticalScrollbar()-&gt;value() : 0;
</span><span class="cx">     return IntPoint(x, y);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint ScrollableArea::minimumScrollPosition() const
</del><ins>+ScrollPosition ScrollableArea::minimumScrollPosition() const
</ins><span class="cx"> {
</span><span class="cx">     return IntPoint();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint ScrollableArea::maximumScrollPosition() const
</del><ins>+ScrollPosition ScrollableArea::maximumScrollPosition() const
</ins><span class="cx"> {
</span><span class="cx">     return IntPoint(totalContentsSize().width() - visibleWidth(), totalContentsSize().height() - visibleHeight());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.h (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.h        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/platform/ScrollableArea.h        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -41,6 +41,11 @@
</span><span class="cx"> class GraphicsLayer;
</span><span class="cx"> class TiledBacking;
</span><span class="cx"> 
</span><ins>+// scrollPosition is in content coordinates (0,0 is at scrollOrigin), so may have negative components.
+typedef IntPoint ScrollPosition;
+// scrollOffset() is the value used by scrollbars (min is 0,0), and should never have negative components.
+typedef IntPoint ScrollOffset;
+
</ins><span class="cx"> class ScrollableArea {
</span><span class="cx"> public:
</span><span class="cx">     WEBCORE_EXPORT bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
</span><span class="lines">@@ -179,9 +184,10 @@
</span><span class="cx">     virtual Scrollbar* horizontalScrollbar() const { return 0; }
</span><span class="cx">     virtual Scrollbar* verticalScrollbar() const { return 0; }
</span><span class="cx"> 
</span><del>-    virtual IntPoint scrollPosition() const;
-    virtual IntPoint minimumScrollPosition() const;
-    virtual IntPoint maximumScrollPosition() const;
</del><ins>+    virtual ScrollPosition scrollPosition() const;
+    virtual ScrollPosition minimumScrollPosition() const;
+    virtual ScrollPosition maximumScrollPosition() const;
+
</ins><span class="cx">     WEBCORE_EXPORT virtual bool scrolledToTop() const;
</span><span class="cx">     WEBCORE_EXPORT virtual bool scrolledToBottom() const;
</span><span class="cx">     WEBCORE_EXPORT virtual bool scrolledToLeft() const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -919,7 +919,7 @@
</span><span class="cx"> IntSize RenderBox::calculateAutoscrollDirection(const IntPoint&amp; windowPoint) const
</span><span class="cx"> {
</span><span class="cx">     IntRect box(absoluteBoundingBoxRect());
</span><del>-    box.move(view().frameView().scrollOffset());
</del><ins>+    box.moveBy(view().frameView().scrollPosition());
</ins><span class="cx">     IntRect windowBox = view().frameView().contentsToWindow(box);
</span><span class="cx"> 
</span><span class="cx">     IntPoint windowAutoscrollPoint = windowPoint;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -2740,17 +2740,17 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint RenderLayer::scrollPosition() const
</del><ins>+ScrollPosition RenderLayer::scrollPosition() const
</ins><span class="cx"> {
</span><del>-    return IntPoint(m_scrollOffset);
</del><ins>+    return ScrollPosition(m_scrollOffset);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint RenderLayer::minimumScrollPosition() const
</del><ins>+ScrollPosition RenderLayer::minimumScrollPosition() const
</ins><span class="cx"> {
</span><span class="cx">     return -scrollOrigin();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint RenderLayer::maximumScrollPosition() const
</del><ins>+ScrollPosition RenderLayer::maximumScrollPosition() const
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: m_scrollSize may not be up-to-date if m_scrollDimensionsDirty is true.
</span><span class="cx">     return -scrollOrigin() + roundedIntSize(m_scrollSize) - visibleContentRectIncludingScrollbars(ContentsVisibleRect).size();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.h (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.h        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/rendering/RenderLayer.h        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -864,9 +864,9 @@
</span><span class="cx">     virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&amp;) const override;
</span><span class="cx">     virtual int scrollSize(ScrollbarOrientation) const override;
</span><span class="cx">     virtual void setScrollOffset(const IntPoint&amp;) override;
</span><del>-    virtual IntPoint scrollPosition() const override;
-    virtual IntPoint minimumScrollPosition() const override;
-    virtual IntPoint maximumScrollPosition() const override;
</del><ins>+    virtual ScrollPosition scrollPosition() const override;
+    virtual ScrollPosition minimumScrollPosition() const override;
+    virtual ScrollPosition maximumScrollPosition() const override;
</ins><span class="cx">     virtual IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const override;
</span><span class="cx">     virtual IntSize visibleSize() const override;
</span><span class="cx">     virtual IntSize contentsSize() const override;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderWidgetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderWidget.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderWidget.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/rendering/RenderWidget.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -350,7 +350,7 @@
</span><span class="cx">         RenderView&amp; childRoot = *childFrameView.renderView();
</span><span class="cx"> 
</span><span class="cx">         LayoutPoint adjustedLocation = accumulatedOffset + location();
</span><del>-        LayoutPoint contentOffset = LayoutPoint(borderLeft() + paddingLeft(), borderTop() + paddingTop()) - childFrameView.scrollOffset();
</del><ins>+        LayoutPoint contentOffset = LayoutPoint(borderLeft() + paddingLeft(), borderTop() + paddingTop()) - toIntSize(childFrameView.scrollPosition());
</ins><span class="cx">         HitTestLocation newHitTestLocation(locationInContainer, -adjustedLocation - contentOffset);
</span><span class="cx">         HitTestRequest newHitTestRequest(request.type() | HitTestRequest::ChildFrameHitTest);
</span><span class="cx">         HitTestResult childFrameResult(newHitTestLocation);
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGSVGElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGSVGElement.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGSVGElement.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebCore/svg/SVGSVGElement.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -416,9 +416,9 @@
</span><span class="cx"> 
</span><span class="cx">             // Respect scroll offset.
</span><span class="cx">             if (FrameView* view = document().view()) {
</span><del>-                LayoutSize scrollOffset = view-&gt;scrollOffset();
-                scrollOffset.scale(zoomFactor);
-                transform.translate(-scrollOffset.width(), -scrollOffset.height());
</del><ins>+                LayoutPoint scrollPosition = view-&gt;scrollPosition();
+                scrollPosition.scale(zoomFactor, zoomFactor);
+                transform.translate(-scrollPosition.x(), -scrollPosition.y());
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebFrame.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebFrame.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebKit/win/WebFrame.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -901,7 +901,7 @@
</span><span class="cx">     if (!view)
</span><span class="cx">         return E_FAIL;
</span><span class="cx"> 
</span><del>-    *offset = view-&gt;scrollOffset();
</del><ins>+    *offset = toIntSize(view-&gt;scrollPosition());
</ins><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebKit/win/WebView.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -3789,7 +3789,7 @@
</span><span class="cx">         if (Document* document = frame-&gt;document()) {
</span><span class="cx">             IntRect visibleRect = frame-&gt;view()-&gt;visibleContentRect();
</span><span class="cx">             Vector&lt;FloatRect&gt; frameRects = document-&gt;markers().renderedRectsForMarkers(DocumentMarker::TextMatch);
</span><del>-            IntPoint frameOffset(-frame-&gt;view()-&gt;scrollOffset().width(), -frame-&gt;view()-&gt;scrollOffset().height());
</del><ins>+            IntPoint frameOffset = -frame-&gt;view()-&gt;scrollPosition();
</ins><span class="cx">             frameOffset = frame-&gt;view()-&gt;convertToContainingWindow(frameOffset);
</span><span class="cx"> 
</span><span class="cx">             Vector&lt;FloatRect&gt;::iterator end = frameRects.end();
</span><span class="lines">@@ -3835,7 +3835,7 @@
</span><span class="cx"> 
</span><span class="cx">     IntRect ir = enclosingIntRect(frame.selection().selectionBounds());
</span><span class="cx">     ir = frame.view()-&gt;convertToContainingWindow(ir);
</span><del>-    ir.move(-frame.view()-&gt;scrollOffset().width(), -frame.view()-&gt;scrollOffset().height());
</del><ins>+    ir.moveBy(-frame.view()-&gt;scrollPosition());
</ins><span class="cx"> 
</span><span class="cx">     float scaleFactor = deviceScaleFactor();
</span><span class="cx">     rc-&gt;left = ir.x() * scaleFactor;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebKit2/ChangeLog        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2015-12-29  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Remove ScrollView::scrollOffset() in preparation for scrollOffset vs. scrollPosition clarification
+        https://bugs.webkit.org/show_bug.cgi?id=152589
+
+        Reviewed by Sam Weinig.
+
+        Current code uses scrollOffset vs. scrollPosition interchangeably, and confusingly.
+        Longer term, I plan to make &quot;scrollPosition&quot; be the value that is relative to the 
+        contents, i.e. affected by scrollOrigin, and &quot;scrollOffset&quot; be the zero-based value
+        that's used to set scrollbar values.
+        
+        To prepare for this, remove ScrollView::scrollOffset(), which is just the
+        scrollPosition as an IntSize.
+        
+        Add some typedefs in ScrollableArea, which will slowly propagate through the
+        code as position vs. offset is clarified.
+
+        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
+        (WebKit::InjectedBundleRangeHandle::renderedImage):
+        * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
+        * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
+        (WebKit::PDFPlugin::scrollPosition):
+        (WebKit::PDFPlugin::minimumScrollPosition):
+        (WebKit::PDFPlugin::maximumScrollPosition):
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::scrollOffset):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::scrollMainFrameIfNotAtMaxScrollPosition):
+        (WebKit::WebPage::updateMainFrameScrollOffsetPinning):
+
</ins><span class="cx"> 2015-12-25  Andy Estes  &lt;aestes@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Stop moving local objects in return statements
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleDOMInjectedBundleRangeHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx">     graphicsContext-&gt;scale(FloatSize(scaleFactor, scaleFactor));
</span><span class="cx"> 
</span><span class="cx">     paintRect.move(frameView-&gt;frameRect().x(), frameView-&gt;frameRect().y());
</span><del>-    paintRect.move(-frameView-&gt;scrollOffset());
</del><ins>+    paintRect.moveBy(-frameView-&gt;scrollPosition());
</ins><span class="cx"> 
</span><span class="cx">     graphicsContext-&gt;translate(-paintRect.x(), -paintRect.y());
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPDFDeprecatedPDFPluginh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -197,9 +197,9 @@
</span><span class="cx">     virtual bool isActive() const override;
</span><span class="cx">     virtual bool isScrollCornerVisible() const override { return false; }
</span><span class="cx">     virtual int scrollPosition(WebCore::Scrollbar*) const override;
</span><del>-    virtual WebCore::IntPoint scrollPosition() const override;
-    virtual WebCore::IntPoint minimumScrollPosition() const override;
-    virtual WebCore::IntPoint maximumScrollPosition() const override;
</del><ins>+    virtual WebCore::ScrollPosition scrollPosition() const override;
+    virtual WebCore::ScrollPosition minimumScrollPosition() const override;
+    virtual WebCore::ScrollPosition maximumScrollPosition() const override;
</ins><span class="cx">     virtual WebCore::IntSize visibleSize() const override { return m_size; }
</span><span class="cx">     virtual WebCore::IntSize contentsSize() const override { return m_pdfDocumentSize; }
</span><span class="cx">     virtual WebCore::Scrollbar* horizontalScrollbar() const override { return m_horizontalScrollbar.get(); }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPDFDeprecatedPDFPluginmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -783,17 +783,17 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint PDFPlugin::scrollPosition() const
</del><ins>+ScrollPosition PDFPlugin::scrollPosition() const
</ins><span class="cx"> {
</span><span class="cx">     return IntPoint(m_scrollOffset.width(), m_scrollOffset.height());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint PDFPlugin::minimumScrollPosition() const
</del><ins>+ScrollPosition PDFPlugin::minimumScrollPosition() const
</ins><span class="cx"> {
</span><span class="cx">     return IntPoint();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint PDFPlugin::maximumScrollPosition() const
</del><ins>+ScrollPosition PDFPlugin::maximumScrollPosition() const
</ins><span class="cx"> {
</span><span class="cx">     IntSize scrollbarSpace = scrollbarIntrusion();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -568,7 +568,7 @@
</span><span class="cx">     if (!view)
</span><span class="cx">         return IntSize();
</span><span class="cx"> 
</span><del>-    return view-&gt;scrollOffset();
</del><ins>+    return toIntSize(view-&gt;scrollPosition());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebFrame::hasHorizontalScrollbar() const
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -1316,8 +1316,8 @@
</span><span class="cx"> {
</span><span class="cx">     FrameView* frameView = m_page-&gt;mainFrame().view();
</span><span class="cx"> 
</span><del>-    IntPoint scrollPosition = frameView-&gt;scrollPosition();
-    IntPoint maximumScrollPosition = frameView-&gt;maximumScrollPosition();
</del><ins>+    ScrollPosition scrollPosition = frameView-&gt;scrollPosition();
+    ScrollPosition maximumScrollPosition = frameView-&gt;maximumScrollPosition();
</ins><span class="cx"> 
</span><span class="cx">     // If the current scroll position in a direction is the max scroll position 
</span><span class="cx">     // we don't want to scroll at all.
</span><span class="lines">@@ -3504,9 +3504,9 @@
</span><span class="cx"> void WebPage::updateMainFrameScrollOffsetPinning()
</span><span class="cx"> {
</span><span class="cx">     Frame&amp; frame = m_page-&gt;mainFrame();
</span><del>-    IntPoint scrollPosition = frame.view()-&gt;scrollPosition();
-    IntPoint maximumScrollPosition = frame.view()-&gt;maximumScrollPosition();
-    IntPoint minimumScrollPosition = frame.view()-&gt;minimumScrollPosition();
</del><ins>+    ScrollPosition scrollPosition = frame.view()-&gt;scrollPosition();
+    ScrollPosition maximumScrollPosition = frame.view()-&gt;maximumScrollPosition();
+    ScrollPosition minimumScrollPosition = frame.view()-&gt;minimumScrollPosition();
</ins><span class="cx"> 
</span><span class="cx">     bool isPinnedToLeftSide = (scrollPosition.x() &lt;= minimumScrollPosition.x());
</span><span class="cx">     bool isPinnedToRightSide = (scrollPosition.x() &gt;= maximumScrollPosition.x());
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (194437 => 194438)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2015-12-29 18:15:45 UTC (rev 194437)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2015-12-30 00:29:36 UTC (rev 194438)
</span><span class="lines">@@ -2585,7 +2585,7 @@
</span><span class="cx">     IntSize oldContentSize = frameView.contentsSize();
</span><span class="cx">     float oldPageScaleFactor = m_page-&gt;pageScaleFactor();
</span><span class="cx"> 
</span><del>-    m_dynamicSizeUpdateHistory.add(std::make_pair(oldContentSize, oldPageScaleFactor), IntPoint(frameView.scrollOffset()));
</del><ins>+    m_dynamicSizeUpdateHistory.add(std::make_pair(oldContentSize, oldPageScaleFactor), frameView.scrollPosition());
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Node&gt; oldNodeAtCenter;
</span><span class="cx">     double visibleHorizontalFraction = 1;
</span></span></pre>
</div>
</div>

</body>
</html>