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

<h3>Log Message</h3>
<pre>[iOS WK2] Fix incorrect scrollPosition handling
https://bugs.webkit.org/show_bug.cgi?id=152630

Reviewed by Zalan Bujtas.
Source/WebCore:

WebPage::updateVisibleContentRects() was setting the ScrollView's scroll position
to a scrollOffset, which was counteracted by ScrollView::unobscuredContentRect()
adding the scrollOrigin to the scrollPosition, which resulted in the correct
rects, but an incorrect scrollPosition. Fix.

* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::unobscuredContentRect):

Source/WebKit2:

WebPage::updateVisibleContentRects() was setting the ScrollView's scroll position
to a scrollOffset, which was counteracted by ScrollView::unobscuredContentRect()
adding the scrollOrigin to the scrollPosition, which resulted in the correct
rects, but an incorrect scrollPosition. Fix.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):

LayoutTests:

These tests now load with a 0,0 scroll position, so don't dump out the &quot;scrolled to&quot; text,
which matches Mac behavior.

* platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-bt-expected.txt:
* platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-lr-expected.txt:
* platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-rl-expected.txt:
* platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-tb-expected.txt:
* platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-bt-expected.txt:
* platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-lr-expected.txt:
* platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-rl-dynamic-expected.txt:
* platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-rl-expected.txt:
* platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-tb-expected.txt:
* platform/ios-simulator-wk2/fast/multicol/vertical-rl/column-break-with-balancing-expected.txt:
* platform/ios-simulator-wk2/fast/multicol/vertical-rl/column-rules-expected.txt:
* platform/ios-simulator-wk2/fast/multicol/vertical-rl/float-paginate-complex-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationBottomToTopbtexpectedtxt">trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-bt-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationBottomToToplrexpectedtxt">trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-lr-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationBottomToToprlexpectedtxt">trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-rl-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationBottomToToptbexpectedtxt">trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-tb-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationRightToLeftbtexpectedtxt">trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-bt-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationRightToLeftlrexpectedtxt">trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-lr-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationRightToLeftrldynamicexpectedtxt">trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-rl-dynamic-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationRightToLeftrlexpectedtxt">trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-rl-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationRightToLefttbexpectedtxt">trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-tb-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2fastmulticolverticalrlcolumnbreakwithbalancingexpectedtxt">trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/vertical-rl/column-break-with-balancing-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2fastmulticolverticalrlcolumnrulesexpectedtxt">trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/vertical-rl/column-rules-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2fastmulticolverticalrlfloatpaginatecomplexexpectedtxt">trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/vertical-rl/float-paginate-complex-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformiosScrollViewIOSmm">trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</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="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/LayoutTests/ChangeLog        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2015-12-31  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        [iOS WK2] Fix incorrect scrollPosition handling
+        https://bugs.webkit.org/show_bug.cgi?id=152630
+
+        Reviewed by Zalan Bujtas.
+        
+        These tests now load with a 0,0 scroll position, so don't dump out the &quot;scrolled to&quot; text,
+        which matches Mac behavior.
+
+        * platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-bt-expected.txt:
+        * platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-lr-expected.txt:
+        * platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-rl-expected.txt:
+        * platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-tb-expected.txt:
+        * platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-bt-expected.txt:
+        * platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-lr-expected.txt:
+        * platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-rl-dynamic-expected.txt:
+        * platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-rl-expected.txt:
+        * platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-tb-expected.txt:
+        * platform/ios-simulator-wk2/fast/multicol/vertical-rl/column-break-with-balancing-expected.txt:
+        * platform/ios-simulator-wk2/fast/multicol/vertical-rl/column-rules-expected.txt:
+        * platform/ios-simulator-wk2/fast/multicol/vertical-rl/float-paginate-complex-expected.txt:
+
</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="trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationBottomToTopbtexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-bt-expected.txt (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-bt-expected.txt        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-bt-expected.txt        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -62,4 +62,3 @@
</span><span class="cx">           text run at (0,20) width 754: &quot;aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&quot;
</span><span class="cx">           text run at (0,40) width 780: &quot;Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat&quot;
</span><span class="cx">           text run at (0,60) width 540: &quot;cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&quot;
</span><del>-scrolled to 0,980
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationBottomToToplrexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-lr-expected.txt (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-lr-expected.txt        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-lr-expected.txt        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -198,4 +198,3 @@
</span><span class="cx">           text run at (378,0) width 163: &quot;culpa qui officia deserunt&quot;
</span><span class="cx">           text run at (398,0) width 113: &quot;mollit anim id est&quot;
</span><span class="cx">           text run at (418,0) width 58: &quot;laborum.&quot;
</span><del>-scrolled to 0,580
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationBottomToToprlexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-rl-expected.txt (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-rl-expected.txt        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-rl-expected.txt        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -198,4 +198,3 @@
</span><span class="cx">           text run at (378,0) width 163: &quot;culpa qui officia deserunt&quot;
</span><span class="cx">           text run at (398,0) width 113: &quot;mollit anim id est&quot;
</span><span class="cx">           text run at (418,0) width 58: &quot;laborum.&quot;
</span><del>-scrolled to 0,580
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationBottomToToptbexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-tb-expected.txt (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-tb-expected.txt        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/BottomToTop-tb-expected.txt        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -62,4 +62,3 @@
</span><span class="cx">           text run at (0,20) width 754: &quot;aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&quot;
</span><span class="cx">           text run at (0,40) width 780: &quot;Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat&quot;
</span><span class="cx">           text run at (0,60) width 540: &quot;cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&quot;
</span><del>-scrolled to 0,980
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationRightToLeftbtexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-bt-expected.txt (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-bt-expected.txt        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-bt-expected.txt        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -198,4 +198,3 @@
</span><span class="cx">           text run at (0,360) width 163: &quot;culpa qui officia deserunt&quot;
</span><span class="cx">           text run at (0,380) width 113: &quot;mollit anim id est&quot;
</span><span class="cx">           text run at (0,400) width 58: &quot;laborum.&quot;
</span><del>-scrolled to 580,0
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationRightToLeftlrexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-lr-expected.txt (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-lr-expected.txt        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-lr-expected.txt        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -78,4 +78,3 @@
</span><span class="cx">           text run at (78,0) width 526: &quot;dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.&quot;
</span><span class="cx">           text run at (98,0) width 560: &quot;Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit&quot;
</span><span class="cx">           text run at (118,0) width 132: &quot;anim id est laborum.&quot;
</span><del>-scrolled to 1180,0
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationRightToLeftrldynamicexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-rl-dynamic-expected.txt (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-rl-dynamic-expected.txt        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-rl-dynamic-expected.txt        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -78,4 +78,3 @@
</span><span class="cx">           text run at (78,0) width 526: &quot;dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.&quot;
</span><span class="cx">           text run at (98,0) width 560: &quot;Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit&quot;
</span><span class="cx">           text run at (118,0) width 132: &quot;anim id est laborum.&quot;
</span><del>-scrolled to 1180,0
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationRightToLeftrlexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-rl-expected.txt (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-rl-expected.txt        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-rl-expected.txt        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -78,4 +78,3 @@
</span><span class="cx">           text run at (78,0) width 526: &quot;dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.&quot;
</span><span class="cx">           text run at (98,0) width 560: &quot;Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit&quot;
</span><span class="cx">           text run at (118,0) width 132: &quot;anim id est laborum.&quot;
</span><del>-scrolled to 1180,0
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2fastmulticolpaginationRightToLefttbexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-tb-expected.txt (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-tb-expected.txt        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/pagination/RightToLeft-tb-expected.txt        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -198,4 +198,3 @@
</span><span class="cx">           text run at (0,360) width 163: &quot;culpa qui officia deserunt&quot;
</span><span class="cx">           text run at (0,380) width 113: &quot;mollit anim id est&quot;
</span><span class="cx">           text run at (0,400) width 58: &quot;laborum.&quot;
</span><del>-scrolled to 580,0
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2fastmulticolverticalrlcolumnbreakwithbalancingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/vertical-rl/column-break-with-balancing-expected.txt (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/vertical-rl/column-break-with-balancing-expected.txt        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/vertical-rl/column-break-with-balancing-expected.txt        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -167,4 +167,3 @@
</span><span class="cx">       RenderText {#text} at (400,0) size 19x113
</span><span class="cx">         text run at (400,0) width 113: &quot;This is some text.&quot;
</span><span class="cx">       RenderBR {BR} at (415,112) size 0x1
</span><del>-scrolled to 92,0
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2fastmulticolverticalrlcolumnrulesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/vertical-rl/column-rules-expected.txt (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/vertical-rl/column-rules-expected.txt        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/vertical-rl/column-rules-expected.txt        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -135,4 +135,3 @@
</span><span class="cx">       text run at (2460,0) width 130: &quot;posuere dictum, leo.&quot;
</span><span class="cx">       text run at (2480,0) width 154: &quot;Suspendisse scelerisque&quot;
</span><span class="cx">       text run at (2500,0) width 87: &quot;egestas nulla.&quot;
</span><del>-scrolled to 66,0
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2fastmulticolverticalrlfloatpaginatecomplexexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/vertical-rl/float-paginate-complex-expected.txt (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/vertical-rl/float-paginate-complex-expected.txt        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/fast/multicol/vertical-rl/float-paginate-complex-expected.txt        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -262,4 +262,3 @@
</span><span class="cx">       RenderText {#text} at (604,0) size 19x113
</span><span class="cx">         text run at (604,0) width 113: &quot;This is some text.&quot;
</span><span class="cx">       RenderBR {BR} at (619,112) size 0x1
</span><del>-scrolled to 880,0
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/Source/WebCore/ChangeLog        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-12-31  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        [iOS WK2] Fix incorrect scrollPosition handling
+        https://bugs.webkit.org/show_bug.cgi?id=152630
+
+        Reviewed by Zalan Bujtas.
+
+        WebPage::updateVisibleContentRects() was setting the ScrollView's scroll position
+        to a scrollOffset, which was counteracted by ScrollView::unobscuredContentRect()
+        adding the scrollOrigin to the scrollPosition, which resulted in the correct
+        rects, but an incorrect scrollPosition. Fix.
+
+        * platform/ios/ScrollViewIOS.mm:
+        (WebCore::ScrollView::unobscuredContentRect):
+
</ins><span class="cx"> 2015-12-31  David Kilzer  &lt;ddkilzer@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix typo in FIXME comment
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosScrollViewIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -107,10 +107,8 @@
</span><span class="cx">         return enclosingIntRect(r);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!m_unobscuredContentSize.isEmpty()) {
-        // FIXME: This seems wrong but gives the right answer, probably because m_scrollPosition is wrong.
-        return IntRect(m_scrollPosition + scrollOrigin(), roundedIntSize(m_unobscuredContentSize));
-    }
</del><ins>+    if (!m_unobscuredContentSize.isEmpty())
+        return IntRect(m_scrollPosition, roundedIntSize(m_unobscuredContentSize));
</ins><span class="cx"> 
</span><span class="cx">     return unobscuredContentRectInternal();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/Source/WebKit2/ChangeLog        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-12-31  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        [iOS WK2] Fix incorrect scrollPosition handling
+        https://bugs.webkit.org/show_bug.cgi?id=152630
+
+        Reviewed by Zalan Bujtas.
+        
+        WebPage::updateVisibleContentRects() was setting the ScrollView's scroll position
+        to a scrollOffset, which was counteracted by ScrollView::unobscuredContentRect()
+        adding the scrollOrigin to the scrollPosition, which resulted in the correct
+        rects, but an incorrect scrollPosition. Fix.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::updateVisibleContentRects):
+
</ins><span class="cx"> 2015-12-31  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, fix a log message
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (194475 => 194476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-01-01 01:25:17 UTC (rev 194475)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-01-01 03:16:11 UTC (rev 194476)
</span><span class="lines">@@ -2954,7 +2954,7 @@
</span><span class="cx">         frameView.setCustomSizeForResizeEvent(expandedIntSize(visibleContentRectUpdateInfo.unobscuredRectInScrollViewCoordinates().size()));
</span><span class="cx"> 
</span><span class="cx">     frameView.setConstrainsScrollingToContentEdge(false);
</span><del>-    frameView.setScrollOffset(scrollPosition);
</del><ins>+    frameView.setScrollOffset(frameView.scrollOffsetFromPosition(scrollPosition));
</ins><span class="cx">     frameView.setConstrainsScrollingToContentEdge(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>