<!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>[194466] trunk/Source/WebCore</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/194466">194466</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-12-31 12:07:15 -0800 (Thu, 31 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>More scrollOffset/scrollPosition disambiguation, in RenderLayer
https://bugs.webkit.org/show_bug.cgi?id=152617

Reviewed by Zalan Bujtas.

Change RenderLayer's m_scrollOffset to be m_scrollPosition, since it stores
scroll positions (negative in RTL overflow). scrollOffset() was accurately
named already, but fix the return type, and remove the unnecessary scrollXOffset()/
scrollYOffset() variants, fixing callers to use .x() and .y().

scrollToOffset() was also accurately named, but fix its argument.

Fix functions related to saving scroll positions on Element to refer to scroll positions.

No behavior change.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::scrollTo):
* dom/Element.cpp:
(WebCore::Element::removedFrom):
(WebCore::Element::savedLayerScrollPosition):
(WebCore::Element::setSavedLayerScrollPosition):
(WebCore::Element::savedLayerScrollOffset): Deleted.
(WebCore::Element::setSavedLayerScrollOffset): Deleted.
* dom/Element.h:
* dom/ElementRareData.h:
(WebCore::ElementRareData::savedLayerScrollPosition):
(WebCore::ElementRareData::setSavedLayerScrollPosition):
(WebCore::ElementRareData::savedLayerScrollOffset): Deleted.
(WebCore::ElementRareData::setSavedLayerScrollOffset): Deleted.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::forwardEvent):
* platform/graphics/IntPoint.h:
(WebCore::IntPoint::isZero):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::baselinePosition):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):
(WebCore::RenderBox::scrollLeft):
(WebCore::RenderBox::scrollTop):
(WebCore::RenderBox::scrolledContentOffset):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::~RenderLayer):
(WebCore::RenderLayer::scrollByRecursively):
(WebCore::RenderLayer::clampScrollOffset):
(WebCore::RenderLayer::scrollToOffset):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::scrollPosition):
(WebCore::RenderLayer::maximumScrollPosition):
(WebCore::RenderLayer::updateScrollInfoAfterLayout):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::start):
(WebCore::RenderMarquee::timerFired):
* rendering/RenderTreeAsText.cpp:
(WebCore::write):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMHTMLmm">trunk/Source/WebCore/bindings/objc/DOMHTML.mm</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCoredomElementRareDatah">trunk/Source/WebCore/dom/ElementRareData.h</a></li>
<li><a href="#trunkSourceWebCorehtmlTextFieldInputTypecpp">trunk/Source/WebCore/html/TextFieldInputType.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFramecpp">trunk/Source/WebCore/page/Frame.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsIntPointh">trunk/Source/WebCore/platform/graphics/IntPoint.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockcpp">trunk/Source/WebCore/rendering/RenderBlock.cpp</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="#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/Source/WebCore/rendering/RenderLayerBacking.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMarqueecpp">trunk/Source/WebCore/rendering/RenderMarquee.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTreeAsTextcpp">trunk/Source/WebCore/rendering/RenderTreeAsText.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/ChangeLog        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -1,3 +1,66 @@
</span><ins>+2015-12-31  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        More scrollOffset/scrollPosition disambiguation, in RenderLayer
+        https://bugs.webkit.org/show_bug.cgi?id=152617
+
+        Reviewed by Zalan Bujtas.
+        
+        Change RenderLayer's m_scrollOffset to be m_scrollPosition, since it stores
+        scroll positions (negative in RTL overflow). scrollOffset() was accurately
+        named already, but fix the return type, and remove the unnecessary scrollXOffset()/
+        scrollYOffset() variants, fixing callers to use .x() and .y().
+        
+        scrollToOffset() was also accurately named, but fix its argument.
+        
+        Fix functions related to saving scroll positions on Element to refer to scroll positions.
+
+        No behavior change.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::scrollTo):
+        * dom/Element.cpp:
+        (WebCore::Element::removedFrom):
+        (WebCore::Element::savedLayerScrollPosition):
+        (WebCore::Element::setSavedLayerScrollPosition):
+        (WebCore::Element::savedLayerScrollOffset): Deleted.
+        (WebCore::Element::setSavedLayerScrollOffset): Deleted.
+        * dom/Element.h:
+        * dom/ElementRareData.h:
+        (WebCore::ElementRareData::savedLayerScrollPosition):
+        (WebCore::ElementRareData::setSavedLayerScrollPosition):
+        (WebCore::ElementRareData::savedLayerScrollOffset): Deleted.
+        (WebCore::ElementRareData::setSavedLayerScrollOffset): Deleted.
+        * html/TextFieldInputType.cpp:
+        (WebCore::TextFieldInputType::forwardEvent):
+        * platform/graphics/IntPoint.h:
+        (WebCore::IntPoint::isZero):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::baselinePosition):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::styleDidChange):
+        (WebCore::RenderBox::scrollLeft):
+        (WebCore::RenderBox::scrollTop):
+        (WebCore::RenderBox::scrolledContentOffset):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::RenderLayer):
+        (WebCore::RenderLayer::~RenderLayer):
+        (WebCore::RenderLayer::scrollByRecursively):
+        (WebCore::RenderLayer::clampScrollOffset):
+        (WebCore::RenderLayer::scrollToOffset):
+        (WebCore::RenderLayer::scrollTo):
+        (WebCore::RenderLayer::scrollRectToVisible):
+        (WebCore::RenderLayer::scrollPosition):
+        (WebCore::RenderLayer::maximumScrollPosition):
+        (WebCore::RenderLayer::updateScrollInfoAfterLayout):
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateGeometry):
+        * rendering/RenderMarquee.cpp:
+        (WebCore::RenderMarquee::start):
+        (WebCore::RenderMarquee::timerFired):
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::write):
+
</ins><span class="cx"> 2015-12-31  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         text-decoration: line-through is mispositioned when text has overline/underline too.
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -3577,7 +3577,8 @@
</span><span class="cx">     if (!box.canBeScrolledAndHasScrollableArea())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    box.layer()-&gt;scrollToOffset(toIntSize(point), RenderLayer::ScrollOffsetClamped);
</del><ins>+    // FIXME: is point a ScrollOffset or ScrollPosition? Test in RTL overflow.
+    box.layer()-&gt;scrollToOffset(point, RenderLayer::ScrollOffsetClamped);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MATHML)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMHTMLmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOMHTML.mm (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMHTML.mm        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/bindings/objc/DOMHTML.mm        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx">     if (!is&lt;RenderBox&gt;(*renderer) || !renderer-&gt;hasOverflowClip())
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return downcast&lt;RenderBox&gt;(*renderer).layer()-&gt;scrollXOffset();
</del><ins>+    return downcast&lt;RenderBox&gt;(*renderer).layer()-&gt;scrollOffset().x();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (int)scrollYOffset
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx">     if (!is&lt;RenderBox&gt;(*renderer) || !renderer-&gt;hasOverflowClip())
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return downcast&lt;RenderBox&gt;(*renderer).layer()-&gt;scrollYOffset();
</del><ins>+    return downcast&lt;RenderBox&gt;(*renderer).layer()-&gt;scrollOffset().y();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setScrollXOffset:(int)x scrollYOffset:(int)y
</span><span class="lines">@@ -113,12 +113,13 @@
</span><span class="cx">     RenderLayer* layer = downcast&lt;RenderBox&gt;(*renderer).layer();
</span><span class="cx">     if (adjustForIOSCaret)
</span><span class="cx">         layer-&gt;setAdjustForIOSCaretWhenScrolling(true);
</span><del>-    layer-&gt;scrollToOffset(IntSize(x, y));
</del><ins>+    layer-&gt;scrollToOffset(ScrollOffset(x, y));
</ins><span class="cx">     if (adjustForIOSCaret)
</span><span class="cx">         layer-&gt;setAdjustForIOSCaretWhenScrolling(false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)absolutePosition:(int *)x :(int *)y :(int *)w :(int *)h {
</del><ins>+- (void)absolutePosition:(int *)x :(int *)y :(int *)w :(int *)h
+{
</ins><span class="cx">     RenderBox *renderer = core(self)-&gt;renderBox();
</span><span class="cx">     if (renderer) {
</span><span class="cx">         if (w)
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/dom/Element.cpp        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -1575,7 +1575,7 @@
</span><span class="cx">         document().page()-&gt;pointerLockController().elementRemoved(this);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    setSavedLayerScrollOffset(IntSize());
</del><ins>+    setSavedLayerScrollPosition(ScrollPosition());
</ins><span class="cx"> 
</span><span class="cx">     if (insertionPoint.isInTreeScope()) {
</span><span class="cx">         TreeScope* oldScope = &amp;insertionPoint.treeScope();
</span><span class="lines">@@ -3152,16 +3152,16 @@
</span><span class="cx">     dispatchSubtreeModifiedEvent();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntSize Element::savedLayerScrollOffset() const
</del><ins>+IntPoint Element::savedLayerScrollPosition() const
</ins><span class="cx"> {
</span><del>-    return hasRareData() ? elementRareData()-&gt;savedLayerScrollOffset() : IntSize();
</del><ins>+    return hasRareData() ? elementRareData()-&gt;savedLayerScrollPosition() : IntPoint();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Element::setSavedLayerScrollOffset(const IntSize&amp; size)
</del><ins>+void Element::setSavedLayerScrollPosition(const IntPoint&amp; position)
</ins><span class="cx"> {
</span><del>-    if (size.isZero() &amp;&amp; !hasRareData())
</del><ins>+    if (position.isZero() &amp;&amp; !hasRareData())
</ins><span class="cx">         return;
</span><del>-    ensureElementRareData().setSavedLayerScrollOffset(size);
</del><ins>+    ensureElementRareData().setSavedLayerScrollPosition(position);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;Attr&gt; Element::attrIfExists(const AtomicString&amp; localName, bool shouldIgnoreAttributeCase)
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/dom/Element.h        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -452,8 +452,8 @@
</span><span class="cx">     bool hasName() const;
</span><span class="cx">     const SpaceSplitString&amp; classNames() const;
</span><span class="cx"> 
</span><del>-    IntSize savedLayerScrollOffset() const;
-    void setSavedLayerScrollOffset(const IntSize&amp;);
</del><ins>+    IntPoint savedLayerScrollPosition() const;
+    void setSavedLayerScrollPosition(const IntPoint&amp;);
</ins><span class="cx"> 
</span><span class="cx">     bool dispatchMouseEvent(const PlatformMouseEvent&amp;, const AtomicString&amp; eventType, int clickCount = 0, Element* relatedTarget = nullptr);
</span><span class="cx">     bool dispatchWheelEvent(const PlatformWheelEvent&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementRareDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ElementRareData.h (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ElementRareData.h        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/dom/ElementRareData.h        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -101,8 +101,8 @@
</span><span class="cx">     LayoutSize minimumSizeForResizing() const { return m_minimumSizeForResizing; }
</span><span class="cx">     void setMinimumSizeForResizing(LayoutSize size) { m_minimumSizeForResizing = size; }
</span><span class="cx"> 
</span><del>-    IntSize savedLayerScrollOffset() const { return m_savedLayerScrollOffset; }
-    void setSavedLayerScrollOffset(IntSize size) { m_savedLayerScrollOffset = size; }
</del><ins>+    IntPoint savedLayerScrollPosition() const { return m_savedLayerScrollPosition; }
+    void setSavedLayerScrollPosition(IntPoint position) { m_savedLayerScrollPosition = position; }
</ins><span class="cx"> 
</span><span class="cx">     bool hasPendingResources() const { return m_hasPendingResources; }
</span><span class="cx">     void setHasPendingResources(bool has) { m_hasPendingResources = has; }
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx">     RegionOversetState m_regionOversetState;
</span><span class="cx"> 
</span><span class="cx">     LayoutSize m_minimumSizeForResizing;
</span><del>-    IntSize m_savedLayerScrollOffset;
</del><ins>+    IntPoint m_savedLayerScrollPosition;
</ins><span class="cx">     RefPtr&lt;RenderStyle&gt; m_computedStyle;
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;DatasetDOMStringMap&gt; m_dataset;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlTextFieldInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/TextFieldInputType.cpp (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/TextFieldInputType.cpp        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/html/TextFieldInputType.cpp        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx">             if (event-&gt;type() == eventNames().blurEvent) {
</span><span class="cx">                 if (RenderTextControlInnerBlock* innerTextRenderer = innerTextElement()-&gt;renderer()) {
</span><span class="cx">                     if (RenderLayer* innerLayer = innerTextRenderer-&gt;layer()) {
</span><del>-                        IntSize scrollOffset(!renderTextControl.style().isLeftToRightDirection() ? innerLayer-&gt;scrollWidth() : 0, 0);
</del><ins>+                        ScrollOffset scrollOffset(!renderTextControl.style().isLeftToRightDirection() ? innerLayer-&gt;scrollWidth() : 0, 0);
</ins><span class="cx">                         innerLayer-&gt;scrollToOffset(scrollOffset, RenderLayer::ScrollOffsetClamped);
</span><span class="cx">                     }
</span><span class="cx">                 }
</span></span></pre></div>
<a id="trunkSourceWebCorepageFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Frame.cpp (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Frame.cpp        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/page/Frame.cpp        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -490,25 +490,25 @@
</span><span class="cx">     if (visibleRect.intersects(exposeRect))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    int x = layer-&gt;scrollXOffset();
</del><ins>+    // FIXME: Why isn't this just calling RenderLayer::scrollRectToVisible()?
+    ScrollOffset scrollOffset = layer-&gt;scrollOffset();
</ins><span class="cx">     int exposeLeft = exposeRect.x();
</span><span class="cx">     int exposeRight = exposeLeft + exposeRect.width();
</span><span class="cx">     int clientWidth = roundToInt(box-&gt;clientWidth());
</span><span class="cx">     if (exposeLeft &lt;= 0)
</span><del>-        x = std::max(0, x + exposeLeft - clientWidth / 2);
</del><ins>+        scrollOffset.setX(std::max(0, scrollOffset.x() + exposeLeft - clientWidth / 2));
</ins><span class="cx">     else if (exposeRight &gt;= clientWidth)
</span><del>-        x = std::min(box-&gt;scrollWidth() - clientWidth, x + clientWidth / 2);
</del><ins>+        scrollOffset.setX(std::min(box-&gt;scrollWidth() - clientWidth, scrollOffset.x() + clientWidth / 2));
</ins><span class="cx"> 
</span><del>-    int y = layer-&gt;scrollYOffset();
</del><span class="cx">     int exposeTop = exposeRect.y();
</span><span class="cx">     int exposeBottom = exposeTop + exposeRect.height();
</span><span class="cx">     int clientHeight = roundToInt(box-&gt;clientHeight());
</span><span class="cx">     if (exposeTop &lt;= 0)
</span><del>-        y = std::max(0, y + exposeTop - clientHeight / 2);
</del><ins>+        scrollOffset.setY(std::max(0, scrollOffset.y() + exposeTop - clientHeight / 2));
</ins><span class="cx">     else if (exposeBottom &gt;= clientHeight)
</span><del>-        y = std::min(box-&gt;scrollHeight() - clientHeight, y + clientHeight / 2);
</del><ins>+        scrollOffset.setY(std::min(box-&gt;scrollHeight() - clientHeight, scrollOffset.y() + clientHeight / 2));
</ins><span class="cx"> 
</span><del>-    layer-&gt;scrollToOffset(IntSize(x, y));
</del><ins>+    layer-&gt;scrollToOffset(scrollOffset);
</ins><span class="cx">     selection().setCaretRectNeedsUpdate();
</span><span class="cx">     selection().updateAppearance();
</span><span class="cx"> }
</span><span class="lines">@@ -602,7 +602,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (action == PerformOverflowScroll &amp;&amp; (deltaX || deltaY)) {
</span><del>-        layer-&gt;scrollToOffset(IntSize(layer-&gt;scrollXOffset() + deltaX, layer-&gt;scrollYOffset() + deltaY));
</del><ins>+        layer-&gt;scrollToOffset(layer-&gt;scrollOffset() + IntSize(deltaX, deltaY));
</ins><span class="cx"> 
</span><span class="cx">         // Handle making selection.
</span><span class="cx">         VisiblePosition visiblePosition(renderer-&gt;positionForPoint(selectionPosition, nullptr));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsIntPointh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/IntPoint.h (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/IntPoint.h        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/platform/graphics/IntPoint.h        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx">     explicit IntPoint(const FloatPoint&amp;); // don't do this implicitly since it's lossy
</span><span class="cx"> 
</span><span class="cx">     static IntPoint zero() { return IntPoint(); }
</span><ins>+    bool isZero() const { return !m_x &amp;&amp; !m_y; }
</ins><span class="cx"> 
</span><span class="cx">     int x() const { return m_x; }
</span><span class="cx">     int y() const { return m_y; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.cpp        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -2874,8 +2874,8 @@
</span><span class="cx">         // (the content inside them moves).  This matches WinIE as well, which just bottom-aligns them.
</span><span class="cx">         // We also give up on finding a baseline if we have a vertical scrollbar, or if we are scrolled
</span><span class="cx">         // vertically (e.g., an overflow:hidden block that has had scrollTop moved).
</span><del>-        bool ignoreBaseline = (layer() &amp;&amp; (layer()-&gt;marquee() || (direction == HorizontalLine ? (layer()-&gt;verticalScrollbar() || layer()-&gt;scrollYOffset() != 0)
-            : (layer()-&gt;horizontalScrollbar() || layer()-&gt;scrollXOffset() != 0)))) || (isWritingModeRoot() &amp;&amp; !isRubyRun());
</del><ins>+        bool ignoreBaseline = (layer() &amp;&amp; (layer()-&gt;marquee() || (direction == HorizontalLine ? (layer()-&gt;verticalScrollbar() || layer()-&gt;scrollOffset().y() != 0)
+            : (layer()-&gt;horizontalScrollbar() || layer()-&gt;scrollOffset().x() != 0)))) || (isWritingModeRoot() &amp;&amp; !isRubyRun());
</ins><span class="cx">         
</span><span class="cx">         Optional&lt;int&gt; baselinePos = ignoreBaseline ? Optional&lt;int&gt;() : inlineBlockBaseline(direction);
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -356,11 +356,11 @@
</span><span class="cx">     // If our zoom factor changes and we have a defined scrollLeft/Top, we need to adjust that value into the
</span><span class="cx">     // new zoomed coordinate space.
</span><span class="cx">     if (hasOverflowClip() &amp;&amp; layer() &amp;&amp; oldStyle &amp;&amp; oldStyle-&gt;effectiveZoom() != newStyle.effectiveZoom()) {
</span><del>-        if (int left = layer()-&gt;scrollXOffset()) {
</del><ins>+        if (int left = layer()-&gt;scrollOffset().x()) {
</ins><span class="cx">             left = (left / oldStyle-&gt;effectiveZoom()) * newStyle.effectiveZoom();
</span><span class="cx">             layer()-&gt;scrollToXOffset(left);
</span><span class="cx">         }
</span><del>-        if (int top = layer()-&gt;scrollYOffset()) {
</del><ins>+        if (int top = layer()-&gt;scrollOffset().y()) {
</ins><span class="cx">             top = (top / oldStyle-&gt;effectiveZoom()) * newStyle.effectiveZoom();
</span><span class="cx">             layer()-&gt;scrollToYOffset(top);
</span><span class="cx">         }
</span><span class="lines">@@ -578,12 +578,12 @@
</span><span class="cx"> 
</span><span class="cx"> int RenderBox::scrollLeft() const
</span><span class="cx"> {
</span><del>-    return hasOverflowClip() &amp;&amp; layer() ? layer()-&gt;scrollXOffset() : 0;
</del><ins>+    return hasOverflowClip() &amp;&amp; layer() ? layer()-&gt;scrollOffset().x() : 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int RenderBox::scrollTop() const
</span><span class="cx"> {
</span><del>-    return hasOverflowClip() &amp;&amp; layer() ? layer()-&gt;scrollYOffset() : 0;
</del><ins>+    return hasOverflowClip() &amp;&amp; layer() ? layer()-&gt;scrollOffset().y() : 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void setupWheelEventTestTrigger(RenderLayer&amp; layer, Frame* frame)
</span><span class="lines">@@ -978,6 +978,7 @@
</span><span class="cx">         return IntSize();
</span><span class="cx"> 
</span><span class="cx">     ASSERT(hasLayer());
</span><ins>+    // FIXME: Renderer code needs scrollOffset/scrollPosition disambiguation.
</ins><span class="cx">     return layer()-&gt;scrolledContentOffset();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -333,10 +333,10 @@
</span><span class="cx"> 
</span><span class="cx">     if (Element* element = renderer().element()) {
</span><span class="cx">         // We save and restore only the scrollOffset as the other scroll values are recalculated.
</span><del>-        m_scrollOffset = element-&gt;savedLayerScrollOffset();
-        if (!m_scrollOffset.isZero())
-            scrollAnimator().setCurrentPosition(FloatPoint(m_scrollOffset.width(), m_scrollOffset.height()));
-        element-&gt;setSavedLayerScrollOffset(IntSize());
</del><ins>+        m_scrollPosition = element-&gt;savedLayerScrollPosition();
+        if (!m_scrollPosition.isZero())
+            scrollAnimator().setCurrentPosition(m_scrollPosition);
+        element-&gt;setSavedLayerScrollPosition(IntPoint());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -352,7 +352,7 @@
</span><span class="cx">         unregisterAsTouchEventListenerForScrolling();
</span><span class="cx"> #endif
</span><span class="cx">         if (Element* element = renderer().element())
</span><del>-            element-&gt;setSavedLayerScrollOffset(m_scrollOffset);
</del><ins>+            element-&gt;setSavedLayerScrollPosition(m_scrollPosition);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     destroyScrollbar(HorizontalScrollbar);
</span><span class="lines">@@ -2289,7 +2289,7 @@
</span><span class="cx">         restrictedByLineClamp = !renderer().parent()-&gt;style().lineClamp().isNone();
</span><span class="cx"> 
</span><span class="cx">     if (renderer().hasOverflowClip() &amp;&amp; !restrictedByLineClamp) {
</span><del>-        IntSize newScrollOffset = scrollOffset() + delta;
</del><ins>+        ScrollOffset newScrollOffset = scrollOffset() + delta;
</ins><span class="cx">         scrollToOffset(newScrollOffset, clamp);
</span><span class="cx">         if (scrolledArea)
</span><span class="cx">             *scrolledArea = this;
</span><span class="lines">@@ -2314,26 +2314,20 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntSize RenderLayer::clampScrollOffset(const IntSize&amp; scrollOffset) const
</del><ins>+ScrollOffset RenderLayer::clampScrollOffset(const ScrollOffset&amp; scrollOffset) const
</ins><span class="cx"> {
</span><del>-    RenderBox* box = renderBox();
-    ASSERT(box);
-
-    int maxX = scrollWidth() - roundToInt(box-&gt;clientWidth());
-    int maxY = scrollHeight() - roundToInt(box-&gt;clientHeight());
-
-    int x = std::max(std::min(scrollOffset.width(), maxX), 0);
-    int y = std::max(std::min(scrollOffset.height(), maxY), 0);
-    return IntSize(x, y);
</del><ins>+    return scrollOffset.constrainedBetween(IntPoint(), maximumScrollOffset());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderLayer::scrollToOffset(const IntSize&amp; scrollOffset, ScrollOffsetClamping clamp)
</del><ins>+void RenderLayer::scrollToOffset(const ScrollOffset&amp; scrollOffset, ScrollOffsetClamping clamp)
</ins><span class="cx"> {
</span><del>-    IntSize newScrollOffset = clamp == ScrollOffsetClamped ? clampScrollOffset(scrollOffset) : scrollOffset;
</del><ins>+    ScrollOffset newScrollOffset = clamp == ScrollOffsetClamped ? clampScrollOffset(scrollOffset) : scrollOffset;
</ins><span class="cx">     if (newScrollOffset != this-&gt;scrollOffset())
</span><del>-        scrollToOffsetWithoutAnimation(IntPoint(newScrollOffset));
</del><ins>+        scrollToOffsetWithoutAnimation(newScrollOffset);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// x and y are scroll offset values
+// FIXME: use a ScrollOffset, or change this to take a ScrollPosition.
</ins><span class="cx"> void RenderLayer::scrollTo(int x, int y)
</span><span class="cx"> {
</span><span class="cx">     RenderBox* box = renderBox();
</span><span class="lines">@@ -2351,7 +2345,7 @@
</span><span class="cx">                 x += caretWidth;
</span><span class="cx">                 if (x &lt;= caretWidth)
</span><span class="cx">                     x = 0;
</span><del>-            } else if (x &lt; m_scrollOffset.width() - caretWidth)
</del><ins>+            } else if (x &lt; m_scrollPosition.x() - caretWidth)
</ins><span class="cx">                 x -= caretWidth;
</span><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="lines">@@ -2362,8 +2356,8 @@
</span><span class="cx">     // complicated (since it will involve testing whether our layer
</span><span class="cx">     // is either occluded by another layer or clipped by an enclosing
</span><span class="cx">     // layer or contains fixed backgrounds, etc.).
</span><del>-    IntSize newScrollOffset = IntSize(x - scrollOrigin().x(), y - scrollOrigin().y());
-    if (m_scrollOffset == newScrollOffset) {
</del><ins>+    ScrollPosition newScrollPosition = scrollPositionFromOffset(ScrollOffset(x, y));
+    if (m_scrollPosition == newScrollPosition) {
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">         if (m_requiresScrollBoundsOriginUpdate)
</span><span class="cx">             updateCompositingLayersAfterScroll();
</span><span class="lines">@@ -2371,8 +2365,8 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    IntPoint oldPosition = IntPoint(m_scrollOffset);
-    m_scrollOffset = newScrollOffset;
</del><ins>+    ScrollPosition oldPosition = IntPoint(m_scrollPosition);
+    m_scrollPosition = newScrollPosition;
</ins><span class="cx"> 
</span><span class="cx">     RenderView&amp; view = renderer().view();
</span><span class="cx"> 
</span><span class="lines">@@ -2423,7 +2417,7 @@
</span><span class="cx">     // Schedule the scroll and scroll-related DOM events.
</span><span class="cx">     if (Element* element = renderer().element()) {
</span><span class="cx">         element-&gt;document().eventQueue().enqueueOrDispatchScrollEvent(*element);
</span><del>-        element-&gt;document().sendWillRevealEdgeEventsIfNeeded(oldPosition, IntPoint(newScrollOffset), visibleContentRect(), contentsSize(), element);
</del><ins>+        element-&gt;document().sendWillRevealEdgeEventsIfNeeded(oldPosition, newScrollPosition, visibleContentRect(), contentsSize(), element);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (scrollsOverflow())
</span><span class="lines">@@ -2493,9 +2487,9 @@
</span><span class="cx">         LayoutRect layerBounds(0, 0, box-&gt;clientWidth(), box-&gt;clientHeight());
</span><span class="cx">         LayoutRect r = getRectToExpose(layerBounds, layerBounds, localExposeRect, alignX, alignY);
</span><span class="cx"> 
</span><del>-        IntSize clampedScrollOffset = clampScrollOffset(scrollOffset() + toIntSize(roundedIntRect(r).location()));
</del><ins>+        ScrollOffset clampedScrollOffset = clampScrollOffset(scrollOffset() + toIntSize(roundedIntRect(r).location()));
</ins><span class="cx">         if (clampedScrollOffset != scrollOffset()) {
</span><del>-            IntSize oldScrollOffset = scrollOffset();
</del><ins>+            ScrollOffset oldScrollOffset = scrollOffset();
</ins><span class="cx">             scrollToOffset(clampedScrollOffset);
</span><span class="cx">             IntSize scrollOffsetDifference = scrollOffset() - oldScrollOffset;
</span><span class="cx">             localExposeRect.move(-scrollOffsetDifference);
</span><span class="lines">@@ -2734,21 +2728,16 @@
</span><span class="cx"> int RenderLayer::scrollPosition(Scrollbar* scrollbar) const
</span><span class="cx"> {
</span><span class="cx">     if (scrollbar-&gt;orientation() == HorizontalScrollbar)
</span><del>-        return scrollXOffset();
</del><ins>+        return scrollOffset().x();
</ins><span class="cx">     if (scrollbar-&gt;orientation() == VerticalScrollbar)
</span><del>-        return scrollYOffset();
</del><ins>+        return scrollOffset().y();
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ScrollPosition RenderLayer::scrollPosition() const
-{
-    // FIXME: This needs scrollOffset/scrollPosition disambiguation.
-    return ScrollPosition(m_scrollOffset);
-}
-
</del><span class="cx"> ScrollPosition RenderLayer::maximumScrollPosition() const
</span><span class="cx"> {
</span><span class="cx">     // FIXME: m_scrollSize may not be up-to-date if m_scrollDimensionsDirty is true.
</span><ins>+    // FIXME: should be able to use the ScrollableArea implementation.
</ins><span class="cx">     return scrollPositionFromOffset(roundedIntPoint(m_scrollSize) - visibleContentRectIncludingScrollbars(ContentsVisibleRect).size());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3476,7 +3465,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_scrollDimensionsDirty = true;
</span><del>-    IntSize originalScrollOffset = scrollOffset();
</del><ins>+    ScrollOffset originalScrollOffset = scrollOffset();
</ins><span class="cx"> 
</span><span class="cx">     computeScrollDimensions();
</span><span class="cx"> 
</span><span class="lines">@@ -3489,7 +3478,7 @@
</span><span class="cx">     if (box-&gt;style().overflowX() != OMARQUEE &amp;&amp; !isRubberBandInProgress()) {
</span><span class="cx">         // Layout may cause us to be at an invalid scroll position. In this case we need
</span><span class="cx">         // to pull our scroll offsets back to the max (or push them up to the min).
</span><del>-        IntSize clampedScrollOffset = clampScrollOffset(scrollOffset());
</del><ins>+        ScrollOffset clampedScrollOffset = clampScrollOffset(scrollOffset());
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">         // FIXME: This looks wrong. The caret adjust mode should only be enabled on editing related entry points.
</span><span class="cx">         // This code was added to fix an issue where the text insertion point would always be drawn on the right edge
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.h (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.h        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/rendering/RenderLayer.h        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -191,14 +191,13 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     // Scrolling methods for layers that can scroll their overflow.
</span><del>-    void scrollByRecursively(const IntSize&amp;, ScrollOffsetClamping = ScrollOffsetUnclamped, ScrollableArea** scrolledArea = nullptr);
-    void scrollToOffset(const IntSize&amp;, ScrollOffsetClamping = ScrollOffsetUnclamped);
-    void scrollToXOffset(int x, ScrollOffsetClamping clamp = ScrollOffsetUnclamped) { scrollToOffset(IntSize(x, scrollYOffset()), clamp); }
-    void scrollToYOffset(int y, ScrollOffsetClamping clamp = ScrollOffsetUnclamped) { scrollToOffset(IntSize(scrollXOffset(), y), clamp); }
</del><ins>+    void scrollByRecursively(const IntSize&amp; delta, ScrollOffsetClamping = ScrollOffsetUnclamped, ScrollableArea** scrolledArea = nullptr);
</ins><span class="cx"> 
</span><del>-    int scrollXOffset() const { return m_scrollOffset.width() + scrollOrigin().x(); }
-    int scrollYOffset() const { return m_scrollOffset.height() + scrollOrigin().y(); }
-    IntSize scrollOffset() const { return IntSize(scrollXOffset(), scrollYOffset()); }
</del><ins>+    void scrollToOffset(const ScrollOffset&amp;, ScrollOffsetClamping = ScrollOffsetUnclamped);
+    void scrollToXOffset(int x, ScrollOffsetClamping clamp = ScrollOffsetUnclamped) { scrollToOffset(ScrollOffset(x, scrollOffset().y()), clamp); }
+    void scrollToYOffset(int y, ScrollOffsetClamping clamp = ScrollOffsetUnclamped) { scrollToOffset(ScrollOffset(scrollOffset().x(), y), clamp); }
+
+    ScrollOffset scrollOffset() const { return scrollOffsetFromPosition(m_scrollPosition); }
</ins><span class="cx">     IntSize scrollableContentsSize() const;
</span><span class="cx"> 
</span><span class="cx">     void scrollRectToVisible(const LayoutRect&amp;, const ScrollAlignment&amp; alignX, const ScrollAlignment&amp; alignY);
</span><span class="lines">@@ -751,9 +750,10 @@
</span><span class="cx">     void updateLayerPositionsAfterScroll(RenderGeometryMap*, UpdateLayerPositionsAfterScrollFlags = NoFlag);
</span><span class="cx"> 
</span><span class="cx">     friend IntSize RenderBox::scrolledContentOffset() const;
</span><del>-    IntSize scrolledContentOffset() const { return m_scrollOffset; }
</del><ins>+    // FIXME: rename this toscrolledContentPosition(), or remove it.
+    IntSize scrolledContentOffset() const { return toIntSize(m_scrollPosition); }
</ins><span class="cx"> 
</span><del>-    IntSize clampScrollOffset(const IntSize&amp;) const;
</del><ins>+    ScrollOffset clampScrollOffset(const ScrollOffset&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     RenderLayer* enclosingPaginationLayerInSubtree(const RenderLayer* rootLayer, PaginationInclusionMode) const;
</span><span class="cx"> 
</span><span class="lines">@@ -865,7 +865,7 @@
</span><span class="cx">     virtual int scrollSize(ScrollbarOrientation) const override;
</span><span class="cx">     virtual void setScrollOffset(const IntPoint&amp;) override;
</span><span class="cx"> 
</span><del>-    virtual ScrollPosition scrollPosition() const override;
</del><ins>+    virtual ScrollPosition scrollPosition() const override { return m_scrollPosition; }
</ins><span class="cx">     virtual ScrollPosition maximumScrollPosition() const override;
</span><span class="cx"> 
</span><span class="cx">     virtual IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const override;
</span><span class="lines">@@ -1093,8 +1093,7 @@
</span><span class="cx">     // The layer's width/height
</span><span class="cx">     IntSize m_layerSize;
</span><span class="cx"> 
</span><del>-    // This is the (scroll) offset from scrollOrigin().
-    IntSize m_scrollOffset;
</del><ins>+    ScrollPosition m_scrollPosition;
</ins><span class="cx"> 
</span><span class="cx">     // The width/height of our scrolled area.
</span><span class="cx">     LayoutSize m_scrollSize;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -947,7 +947,7 @@
</span><span class="cx">         ASSERT(m_scrollingContentsLayer);
</span><span class="cx">         auto&amp; renderBox = downcast&lt;RenderBox&gt;(renderer());
</span><span class="cx">         LayoutRect paddingBox(renderBox.borderLeft(), renderBox.borderTop(), renderBox.width() - renderBox.borderLeft() - renderBox.borderRight(), renderBox.height() - renderBox.borderTop() - renderBox.borderBottom());
</span><del>-        LayoutSize scrollOffset = m_owningLayer.scrollOffset();
</del><ins>+        ScrollOffset scrollOffset = m_owningLayer.scrollOffset();
</ins><span class="cx"> 
</span><span class="cx">         // FIXME: need to do some pixel snapping here.
</span><span class="cx">         m_scrollingLayer-&gt;setPosition(FloatPoint(paddingBox.location() - localCompositingBounds.location()));
</span><span class="lines">@@ -960,11 +960,11 @@
</span><span class="cx"> 
</span><span class="cx">         if (m_owningLayer.isInUserScroll()) {
</span><span class="cx">             // If scrolling is happening externally, we don't want to touch the layer bounds origin here because that will cause jitter.
</span><del>-            m_scrollingLayer-&gt;syncBoundsOrigin(FloatPoint(scrollOffset.width(), scrollOffset.height()));
</del><ins>+            m_scrollingLayer-&gt;syncBoundsOrigin(scrollOffset);
</ins><span class="cx">             m_owningLayer.setRequiresScrollBoundsOriginUpdate(true);
</span><span class="cx">         } else {
</span><span class="cx">             // Note that we implement the contents offset via the bounds origin on this layer, rather than a position on the sublayer.
</span><del>-            m_scrollingLayer-&gt;setBoundsOrigin(FloatPoint(scrollOffset.width(), scrollOffset.height()));
</del><ins>+            m_scrollingLayer-&gt;setBoundsOrigin(scrollOffset);
</ins><span class="cx">             m_owningLayer.setRequiresScrollBoundsOriginUpdate(false);
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -978,9 +978,10 @@
</span><span class="cx">         m_scrollingContentsLayer-&gt;setSize(scrollSize);
</span><span class="cx">         // Scrolling the content layer does not need to trigger a repaint. The offset will be compensated away during painting.
</span><span class="cx">         // FIXME: The paint offset and the scroll offset should really be separate concepts.
</span><del>-        m_scrollingContentsLayer-&gt;setOffsetFromRenderer(paddingBox.location() - IntPoint() - scrollOffset, GraphicsLayer::DontSetNeedsDisplay);
</del><ins>+        LayoutSize scrollingContentsOffset = toLayoutSize(paddingBox.location() - toLayoutSize(scrollOffset));
+        m_scrollingContentsLayer-&gt;setOffsetFromRenderer(scrollingContentsOffset, GraphicsLayer::DontSetNeedsDisplay);
</ins><span class="cx"> #else
</span><del>-        m_scrollingContentsLayer-&gt;setPosition(FloatPoint(-scrollOffset.width(), -scrollOffset.height()));
</del><ins>+        m_scrollingContentsLayer-&gt;setPosition(-scrollOffset);
</ins><span class="cx"> 
</span><span class="cx">         FloatSize oldScrollingLayerOffset = m_scrollingLayer-&gt;offsetFromRenderer();
</span><span class="cx">         m_scrollingLayer-&gt;setOffsetFromRenderer(-toFloatSize(paddingBox.location()));
</span><span class="lines">@@ -997,7 +998,7 @@
</span><span class="cx">         if (scrollSize != m_scrollingContentsLayer-&gt;size() || paddingBoxOffsetChanged)
</span><span class="cx">             m_scrollingContentsLayer-&gt;setNeedsDisplay();
</span><span class="cx"> 
</span><del>-        LayoutSize scrollingContentsOffset = toLayoutSize(paddingBox.location() - scrollOffset);
</del><ins>+        LayoutSize scrollingContentsOffset = toLayoutSize(paddingBox.location() - toLayoutSize(scrollOffset));
</ins><span class="cx">         if (scrollingContentsOffset != m_scrollingContentsLayer-&gt;offsetFromRenderer() || scrollSize != m_scrollingContentsLayer-&gt;size())
</span><span class="cx">             compositor().scrollingLayerDidChange(m_owningLayer);
</span><span class="cx"> 
</span><span class="lines">@@ -2249,7 +2250,7 @@
</span><span class="cx">         layerDirtyRect.move(-m_scrollingContentsLayer-&gt;offsetFromRenderer() + m_devicePixelFractionFromRenderer);
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">         // Account for the fact that RenderLayerBacking::updateGeometry() bakes scrollOffset into offsetFromRenderer on iOS.
</span><del>-        layerDirtyRect.move(-m_owningLayer.scrollOffset() + m_devicePixelFractionFromRenderer);
</del><ins>+        layerDirtyRect.moveBy(-m_owningLayer.scrollOffset() + m_devicePixelFractionFromRenderer);
</ins><span class="cx"> #endif
</span><span class="cx">         m_scrollingContentsLayer-&gt;setNeedsDisplayInRect(layerDirtyRect, shouldClip);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMarqueecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMarquee.cpp (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMarquee.cpp        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/rendering/RenderMarquee.cpp        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -159,9 +159,9 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_suspended &amp;&amp; !m_stopped) {
</span><span class="cx">         if (isHorizontal())
</span><del>-            m_layer-&gt;scrollToOffset(IntSize(m_start, 0));
</del><ins>+            m_layer-&gt;scrollToOffset(ScrollOffset(m_start, 0));
</ins><span class="cx">         else
</span><del>-            m_layer-&gt;scrollToOffset(IntSize(0, m_start));
</del><ins>+            m_layer-&gt;scrollToOffset(ScrollOffset(0, m_start));
</ins><span class="cx">     }
</span><span class="cx">     else {
</span><span class="cx">         m_suspended = false;
</span><span class="lines">@@ -274,7 +274,7 @@
</span><span class="cx">         bool positive = range &gt; 0;
</span><span class="cx">         int clientSize = (isHorizontal() ? roundToInt(m_layer-&gt;renderBox()-&gt;clientWidth()) : roundToInt(m_layer-&gt;renderBox()-&gt;clientHeight()));
</span><span class="cx">         int increment = abs(intValueForLength(m_layer-&gt;renderer().style().marqueeIncrement(), clientSize));
</span><del>-        int currentPos = (isHorizontal() ? m_layer-&gt;scrollXOffset() : m_layer-&gt;scrollYOffset());
</del><ins>+        int currentPos = (isHorizontal() ? m_layer-&gt;scrollOffset().x() : m_layer-&gt;scrollOffset().y());
</ins><span class="cx">         newPos =  currentPos + (addIncrement ? increment : -increment);
</span><span class="cx">         if (positive)
</span><span class="cx">             newPos = std::min(newPos, endPoint);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTreeAsTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (194465 => 194466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2015-12-31 19:57:25 UTC (rev 194465)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2015-12-31 20:07:15 UTC (rev 194466)
</span><span class="lines">@@ -617,10 +617,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (l.renderer().hasOverflowClip()) {
</span><del>-        if (l.scrollXOffset())
-            ts &lt;&lt; &quot; scrollX &quot; &lt;&lt; l.scrollXOffset();
-        if (l.scrollYOffset())
-            ts &lt;&lt; &quot; scrollY &quot; &lt;&lt; l.scrollYOffset();
</del><ins>+        if (l.scrollOffset().x())
+            ts &lt;&lt; &quot; scrollX &quot; &lt;&lt; l.scrollOffset().x();
+        if (l.scrollOffset().y())
+            ts &lt;&lt; &quot; scrollY &quot; &lt;&lt; l.scrollOffset().y();
</ins><span class="cx">         if (l.renderBox() &amp;&amp; roundToInt(l.renderBox()-&gt;clientWidth()) != l.scrollWidth())
</span><span class="cx">             ts &lt;&lt; &quot; scrollWidth &quot; &lt;&lt; l.scrollWidth();
</span><span class="cx">         if (l.renderBox() &amp;&amp; roundToInt(l.renderBox()-&gt;clientHeight()) != l.scrollHeight())
</span></span></pre>
</div>
</div>

</body>
</html>