<!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>[210640] branches/safari-603-branch</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/210640">210640</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2017-01-12 08:45:07 -0800 (Thu, 12 Jan 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/210147">r210147</a>. rdar://problem/29675551</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari603branchLayoutTestsChangeLog">branches/safari-603-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari603branchLayoutTestsTestExpectations">branches/safari-603-branch/LayoutTests/TestExpectations</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasttransformsselectionboundsintransformedviewhtml">branches/safari-603-branch/LayoutTests/fast/transforms/selection-bounds-in-transformed-view.html</a></li>
<li><a href="#branchessafari603branchLayoutTestsplatformiossimulatorTestExpectations">branches/safari-603-branch/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#branchessafari603branchLayoutTestsplatformmacwk2TestExpectations">branches/safari-603-branch/LayoutTests/platform/mac-wk2/TestExpectations</a></li>
<li><a href="#branchessafari603branchSourceWebCoreChangeLog">branches/safari-603-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebCorerenderingRenderLayercpp">branches/safari-603-branch/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebCorerenderingRenderLayerh">branches/safari-603-branch/Source/WebCore/rendering/RenderLayer.h</a></li>
<li><a href="#branchessafari603branchToolsChangeLog">branches/safari-603-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari603branchToolsWebKitTestRunnermacEventSenderProxymm">branches/safari-603-branch/Tools/WebKitTestRunner/mac/EventSenderProxy.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari603branchLayoutTestsfasteventsautoscrollmaindocumentexpectedtxt">branches/safari-603-branch/LayoutTests/fast/events/autoscroll-main-document-expected.txt</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasteventsautoscrollmaindocumenthtml">branches/safari-603-branch/LayoutTests/fast/events/autoscroll-main-document.html</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasteventsautoscrollwhenzoomedexpectedtxt">branches/safari-603-branch/LayoutTests/fast/events/autoscroll-when-zoomed-expected.txt</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasteventsautoscrollwhenzoomedhtml">branches/safari-603-branch/LayoutTests/fast/events/autoscroll-when-zoomed.html</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasteventsdragselectwhenzoomedexpectedtxt">branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed-expected.txt</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasteventsdragselectwhenzoomedwithheaderexpectedtxt">branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed-with-header-expected.txt</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasteventsdragselectwhenzoomedwithheaderhtml">branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed-with-header.html</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasteventsdragselectwhenzoomedhtml">branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed.html</a></li>
<li><a href="#branchessafari603branchLayoutTestsfastscrollingscrolltoanchorzoomedheaderexpectedtxt">branches/safari-603-branch/LayoutTests/fast/scrolling/scroll-to-anchor-zoomed-header-expected.txt</a></li>
<li><a href="#branchessafari603branchLayoutTestsfastscrollingscrolltoanchorzoomedheaderhtml">branches/safari-603-branch/LayoutTests/fast/scrolling/scroll-to-anchor-zoomed-header.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari603branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/ChangeLog (210639 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/ChangeLog        2017-01-12 16:45:00 UTC (rev 210639)
+++ branches/safari-603-branch/LayoutTests/ChangeLog        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -1,5 +1,36 @@
</span><span class="cx"> 2017-01-12  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r210147. rdar://problem/29675551
+
+    2016-12-23  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+            REGRESSION (r209299): Selection is broken when you zoom in webpage using trackpad
+            https://bugs.webkit.org/show_bug.cgi?id=166472
+            rdar://problem/29675551
+
+            Reviewed by Tim Horton.
+
+            Add some test coverage for autoscroll of the main document. I could only get this
+            working in WebKitTestRunner, not DumpRenderTree.
+
+            * TestExpectations:
+            * fast/events/autoscroll-main-document-expected.txt: Added.
+            * fast/events/autoscroll-main-document.html: Added.
+            * fast/events/autoscroll-when-zoomed-expected.txt: Added.
+            * fast/events/autoscroll-when-zoomed.html: Added.
+            * fast/events/drag-select-when-zoomed-expected.txt: Added.
+            * fast/events/drag-select-when-zoomed-with-header-expected.txt: Added.
+            * fast/events/drag-select-when-zoomed-with-header.html: Added.
+            * fast/events/drag-select-when-zoomed.html: Added.
+            * fast/scrolling/scroll-to-anchor-zoomed-header-expected.txt: Added.
+            * fast/scrolling/scroll-to-anchor-zoomed-header.html: Added.
+            * fast/transforms/selection-bounds-in-transformed-view.html: Revert the target scroll position to what it was
+            before r209299, and improve the failure output.
+            * platform/ios-simulator/TestExpectations:
+            * platform/mac-wk2/TestExpectations:
+
+2017-01-12  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r210432. rdar://problem/29633667
</span><span class="cx"> 
</span><span class="cx">     2017-01-05  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/TestExpectations (210639 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/TestExpectations        2017-01-12 16:45:00 UTC (rev 210639)
+++ branches/safari-603-branch/LayoutTests/TestExpectations        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -51,6 +51,10 @@
</span><span class="cx"> fast/events/mouse-force-down.html [ Skip ]
</span><span class="cx"> fast/events/mouse-force-up.html [ Skip ]
</span><span class="cx"> 
</span><ins>+# Document autoscroll tests only work on Mac WK2
+fast/events/autoscroll-when-zoomed.html [ Skip ]
+fast/events/autoscroll-main-document.html [ Skip ]
+
</ins><span class="cx"> # Only iOS supports QuickLook
</span><span class="cx"> quicklook [ Skip ]
</span><span class="cx"> http/tests/quicklook [ Skip ]
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasteventsautoscrollmaindocumentexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/events/autoscroll-main-document-expected.txt (0 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/events/autoscroll-main-document-expected.txt                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/events/autoscroll-main-document-expected.txt        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+This test ensures that drag-selecting works correctly in the main frame.
+
+PASS firstRange.startOffset is 18
+PASS firstRange.endOffset is 425
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasteventsautoscrollmaindocumenthtml"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/events/autoscroll-main-document.html (0 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/events/autoscroll-main-document.html                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/events/autoscroll-main-document.html        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -0,0 +1,99 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        body {
+            height: 1000px;
+        }
+        #container {
+            position: relative;
+            top: -10px;
+            left: 50px;
+            width: 400px;
+            outline: 1px solid black;
+            font-family: monospace;
+        }
+    &lt;/style&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+    &lt;script&gt;
+        window.jsTestIsAsync = true;
+        
+        const eventCount = 50;
+        var scrollCount = 0;
+
+        var start;
+        var end;
+        var firstRange;
+        
+        function testComplete()
+        {
+            eventSender.mouseMoveTo(end.x, 0);
+            eventSender.mouseUp();
+
+            firstRange = window.getSelection().getRangeAt(0);
+            shouldBe('firstRange.startOffset', '18');
+            shouldBe('firstRange.endOffset', '425');
+
+            finishJSTest();
+        }
+        
+        function waitForScrolledToTop()
+        {
+            if (window.scrollY == 0) {
+                testComplete();
+                return;
+            }
+            
+            window.setTimeout(waitForScrolledToTop, 2);
+        }
+        
+        function doOneScroll()
+        {
+            if (++scrollCount == eventCount) {
+                waitForScrolledToTop();
+                return;
+            }
+
+            eventSender.mouseMoveTo(end.x, end.y - scrollCount);
+            window.setTimeout(doOneScroll, 2);
+        }
+
+        function doTest()
+        {
+            if (!window.testRunner || !window.eventSender) {
+                debug('This test requires testRunner and eventSender');
+                return;
+            }
+
+            var containerRect = document.getElementById('container').getBoundingClientRect();
+            var lineHeight = containerRect.height / 3;
+            
+            window.scrollTo(0, containerRect.bottom - lineHeight);
+
+            containerRect = document.getElementById('container').getBoundingClientRect(); // Scrolling changed it.
+
+            start = { x: containerRect.left + containerRect.width / 2, y: containerRect.bottom - lineHeight / 3 };
+            end = { x: containerRect.left + containerRect.width / 3, y: 16 };
+            
+            eventSender.mouseMoveTo(start.x, start.y);
+            eventSender.mouseDown();
+
+            doOneScroll();
+        }
+
+        window.addEventListener('load', doTest, false);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div id=&quot;container&quot;&gt;
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+&lt;/div&gt;
+
+&lt;p&gt;This test ensures that drag-selecting works correctly in the main frame.&lt;/p&gt;
+
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasteventsautoscrollwhenzoomedexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/events/autoscroll-when-zoomed-expected.txt (0 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/events/autoscroll-when-zoomed-expected.txt                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/events/autoscroll-when-zoomed-expected.txt        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+This test ensures that drag-selecting works correctly in the main frame.
+
+PASS firstRange.startOffset is 51
+PASS firstRange.endOffset is 400
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasteventsautoscrollwhenzoomedhtml"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/events/autoscroll-when-zoomed.html (0 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/events/autoscroll-when-zoomed.html                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/events/autoscroll-when-zoomed.html        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -0,0 +1,102 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        body {
+            height: 1000px;
+        }
+        #container {
+            position: relative;
+            top: -10px;
+            left: 50px;
+            width: 400px;
+            outline: 1px solid black;
+            font-family: monospace;
+        }
+    &lt;/style&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+    &lt;script&gt;
+        window.jsTestIsAsync = true;
+        
+        const pageScale = 1.5;
+        const eventCount = 50;
+        var scrollCount = 0;
+
+        var start;
+        var end;
+        var firstRange;
+        
+        function testComplete()
+        {
+            eventSender.mouseMoveTo(pageScale * end.x, 0);
+            eventSender.mouseUp();
+
+            firstRange = window.getSelection().getRangeAt(0);
+            shouldBe('firstRange.startOffset', '51');
+            shouldBe('firstRange.endOffset', '400');
+
+            finishJSTest();
+        }
+        
+        function waitForScrolledToTop()
+        {
+            if (window.scrollY == 0) {
+                testComplete();
+                return;
+            }
+            
+            window.setTimeout(waitForScrolledToTop, 2);
+        }
+        
+        function doOneScroll()
+        {
+            if (++scrollCount == eventCount) {
+                waitForScrolledToTop();
+                return;
+            }
+
+            eventSender.mouseMoveTo(pageScale * end.x, pageScale * (end.y - scrollCount));
+            window.setTimeout(doOneScroll, 2);
+        }
+
+        function doTest()
+        {
+            if (!window.testRunner || !window.eventSender) {
+                debug('This test requires testRunner and eventSender');
+                return;
+            }
+            
+            window.internals.setPageScaleFactor(pageScale, 0, 0);
+
+            var containerRect = document.getElementById('container').getBoundingClientRect();
+            var lineHeight = containerRect.height / 3;
+            
+            window.scrollTo(0, containerRect.bottom - lineHeight);
+
+            containerRect = document.getElementById('container').getBoundingClientRect(); // Scrolling changed it.
+
+            start = { x: containerRect.left + 10, y: containerRect.bottom - lineHeight / 3 };
+            end = { x: containerRect.right - 10, y: 16 };
+            
+            eventSender.mouseMoveTo(pageScale * start.x, pageScale * start.y);
+            eventSender.mouseDown();
+
+            doOneScroll();
+        }
+
+        window.addEventListener('load', doTest, false);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div id=&quot;container&quot;&gt;
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+&lt;/div&gt;
+
+&lt;p&gt;This test ensures that drag-selecting works correctly in the main frame.&lt;/p&gt;
+
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasteventsdragselectwhenzoomedexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed-expected.txt (0 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed-expected.txt                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed-expected.txt        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+This test ensures that drag-selecting works correctly in scaled pages.
+
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
+PASS firstRange.startOffset is 79
+PASS firstRange.endOffset is 103
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasteventsdragselectwhenzoomedwithheaderexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed-with-header-expected.txt (0 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed-with-header-expected.txt                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed-with-header-expected.txt        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+This test ensures that drag-selecting works correctly in scaled pages.
+
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
+PASS firstRange.startOffset is 79
+PASS firstRange.endOffset is 103
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasteventsdragselectwhenzoomedwithheaderhtml"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed-with-header.html (0 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed-with-header.html                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed-with-header.html        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        #container {
+            position: absolute;
+            top: 100px;
+            left: 10px;
+            width: 400px;
+            outline: 1px solid black;
+            font-family: monospace;
+        }
+    &lt;/style&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+    &lt;script&gt;
+        window.jsTestIsAsync = true;
+
+        const headerHeight = 32;
+        const pageScale = 1.8;
+        var mouseXStart;
+        var mouseXEnd;
+        var mouseY;
+        var currMouseX;
+        var firstRange;
+
+        if (window.internals)
+            internals.setHeaderHeight(headerHeight);
+
+        function testComplete()
+        {
+            eventSender.mouseMoveTo(mouseXEnd, mouseY);
+            eventSender.mouseUp();
+
+            firstRange = window.getSelection().getRangeAt(0);
+            shouldBe('firstRange.startOffset', '79');
+            shouldBe('firstRange.endOffset', '103');
+
+            finishJSTest();
+        }
+
+        function doOneMouseMove()
+        {
+            if (currMouseX &gt;= mouseXEnd) {
+                testComplete();
+                return;
+            }
+
+            eventSender.mouseMoveTo(currMouseX, mouseY);
+            currMouseX += 2;
+            window.setTimeout(doOneMouseMove, 2);
+        }
+
+        function doTest()
+        {
+            if (!window.testRunner || !window.eventSender) {
+                debug('This test requires testRunner and eventSender');
+                return;
+            }
+            
+            window.internals.setPageScaleFactor(pageScale, 0, 0);
+            
+            var containerRect = document.getElementById('container').getBoundingClientRect();
+            var lineHeight = containerRect.height / 3;
+
+            mouseXStart = pageScale * (containerRect.left + containerRect.width / 2);
+            mouseY = headerHeight + pageScale * (containerRect.top + lineHeight / 2);
+            mouseXEnd = pageScale * (containerRect.right - 10);
+            
+            currMouseX = mouseXStart;
+            eventSender.mouseMoveTo(currMouseX, mouseY);
+            eventSender.mouseDown();
+
+            doOneMouseMove();
+        }
+
+        window.addEventListener('load', doTest, false);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;This test ensures that drag-selecting works correctly in scaled pages.&lt;/p&gt;
+
+&lt;div id=&quot;container&quot;&gt;
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
+&lt;/div&gt;
+
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasteventsdragselectwhenzoomedhtml"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed.html (0 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed.html                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/events/drag-select-when-zoomed.html        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        #container {
+            position: absolute;
+            top: 100px;
+            left: 10px;
+            width: 400px;
+            outline: 1px solid black;
+            font-family: monospace;
+        }
+    &lt;/style&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+    &lt;script&gt;
+        window.jsTestIsAsync = true;
+
+        const pageScale = 1.8;
+        var mouseXStart;
+        var mouseXEnd;
+        var mouseY;
+        var currMouseX;
+        var firstRange;
+
+        function testComplete()
+        {
+            eventSender.mouseMoveTo(mouseXEnd, mouseY);
+            eventSender.mouseUp();
+
+            firstRange = window.getSelection().getRangeAt(0);
+            shouldBe('firstRange.startOffset', '79');
+            shouldBe('firstRange.endOffset', '103');
+
+            finishJSTest();
+        }
+
+        function doOneMouseMove()
+        {
+            if (currMouseX &gt;= mouseXEnd) {
+                testComplete();
+                return;
+            }
+
+            eventSender.mouseMoveTo(currMouseX, mouseY);
+            currMouseX += 2;
+            window.setTimeout(doOneMouseMove, 2);
+        }
+
+        function doTest()
+        {
+            if (!window.testRunner || !window.eventSender) {
+                debug('This test requires testRunner and eventSender');
+                return;
+            }
+            
+            window.internals.setPageScaleFactor(pageScale, 0, 0);
+            
+            var containerRect = document.getElementById('container').getBoundingClientRect();
+            var lineHeight = containerRect.height / 3;
+
+            mouseXStart = pageScale * (containerRect.left + containerRect.width / 2);
+            mouseY = pageScale * (containerRect.top + lineHeight / 2);
+            mouseXEnd = pageScale * (containerRect.right - 10);
+            
+            currMouseX = mouseXStart;
+            eventSender.mouseMoveTo(currMouseX, mouseY);
+            eventSender.mouseDown();
+
+            doOneMouseMove();
+        }
+
+        window.addEventListener('load', doTest, false);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;This test ensures that drag-selecting works correctly in scaled pages.&lt;/p&gt;
+
+&lt;div id=&quot;container&quot;&gt;
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
+&lt;/div&gt;
+
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfastscrollingscrolltoanchorzoomedheaderexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/scrolling/scroll-to-anchor-zoomed-header-expected.txt (0 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/scrolling/scroll-to-anchor-zoomed-header-expected.txt                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/scrolling/scroll-to-anchor-zoomed-header-expected.txt        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Tests scrolling to an anchor in a zoomed page with a header scrolls to the correct location.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.scrollingElement.scrollTop is 1019
+PASS document.scrollingElement.scrollLeft is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Anchor is here
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfastscrollingscrolltoanchorzoomedheaderhtml"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/scrolling/scroll-to-anchor-zoomed-header.html (0 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/scrolling/scroll-to-anchor-zoomed-header.html                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/scrolling/scroll-to-anchor-zoomed-header.html        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        body {
+            height: 2000px;
+            width: 2000px;
+        }
+        
+        .anchor {
+            position: absolute;
+            top: 1000px;
+            left: 40px;
+            border: 1px solid black;
+        }
+    &lt;/style&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+    &lt;script&gt;
+    description(&quot;Tests scrolling to an anchor in a zoomed page with a header scrolls to the correct location.&quot;);
+    window.jsTestIsAsync = true;
+
+    const headerHeight = 32;
+    const pageScale = 1.8;
+
+    if (window.internals) {
+        internals.setHeaderHeight(headerHeight);
+        internals.setPageScaleFactor(pageScale, 0, 0);
+    }
+
+    function runTest()
+    {
+        setTimeout(function() {
+            window.location='#anchor';
+            setTimeout(finishTest, 0);
+        }, 0);
+    }
+
+    function finishTest()
+    {
+        if (window.location.toString().indexOf(&quot;#&quot;) == -1) {
+            setTimeout(finishTest, 0);
+            return;
+        }
+        
+        shouldBe('document.scrollingElement.scrollTop', '1019');
+        shouldBe('document.scrollingElement.scrollLeft', '0');
+
+        finishJSTest();
+    }
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+
+&lt;div class=&quot;anchor&quot;&gt;
+    &lt;a name=&quot;anchor&quot;&gt;Anchor is here&lt;/a&gt;
+&lt;/div&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+
+&lt;/body&gt;&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasttransformsselectionboundsintransformedviewhtml"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/fast/transforms/selection-bounds-in-transformed-view.html (210639 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/transforms/selection-bounds-in-transformed-view.html        2017-01-12 16:45:00 UTC (rev 210639)
+++ branches/safari-603-branch/LayoutTests/fast/transforms/selection-bounds-in-transformed-view.html        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -10,6 +10,8 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         document.execCommand(&quot;FindString&quot;, false, &quot;target&quot;);
</span><del>-        document.getElementById(&quot;result&quot;).innerText = document.body.scrollTop === 937 ? &quot;PASS&quot; : &quot;FAIL&quot;;
</del><ins>+        var scrollTop = document.body.scrollTop;
+        var expectedScrollTop = 864;
+        document.getElementById(&quot;result&quot;).innerText = scrollTop === expectedScrollTop ? &quot;PASS&quot; : &quot;FAIL: document.body.scrollTop was &quot; + scrollTop + &quot;, should be &quot; + expectedScrollTop;
</ins><span class="cx">     &lt;/script&gt;
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/platform/ios-simulator/TestExpectations (210639 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/platform/ios-simulator/TestExpectations        2017-01-12 16:45:00 UTC (rev 210639)
+++ branches/safari-603-branch/LayoutTests/platform/ios-simulator/TestExpectations        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -1293,6 +1293,12 @@
</span><span class="cx"> fast/events/tab-focus-link-in-canvas.html [ Failure ]
</span><span class="cx"> fast/events/tabindex-focus-blur-all.html [ Failure ]
</span><span class="cx"> 
</span><ins>+# Tests that depend on mouse input
+fast/events/autoscroll-main-document.html [ Skip ]
+fast/events/autoscroll-when-zoomed.html [ Skip ]
+fast/events/drag-select-when-zoomed-with-header.html [ Skip ]
+fast/events/drag-select-when-zoomed.html [ Skip ]
+
</ins><span class="cx"> # Ref-test imported from W3C that is failing because type=image input elements have rounded corners on iOS.
</span><span class="cx"> imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/image01.html [ ImageOnlyFailure ]
</span><span class="cx"> # Ref-test imported form W3C that is failing because the test is off by a couple of pixels on iOS.
</span><span class="lines">@@ -2747,6 +2753,7 @@
</span><span class="cx"> fast/zooming/client-rect-in-fixed-zoomed.html [ Skip ]
</span><span class="cx"> fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html [ Skip ]
</span><span class="cx"> fast/visual-viewport/zoomed-scroll-into-view-fixed.html [ Skip ]
</span><ins>+fast/scrolling/scroll-to-anchor-zoomed-header.html [ Skip ]
</ins><span class="cx"> 
</span><span class="cx"> # This test relies on Arial being used to draw Arabic. However, on iOS,
</span><span class="cx"> # we explicitly disallow this because this font is too slow.
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestsplatformmacwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/platform/mac-wk2/TestExpectations (210639 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/platform/mac-wk2/TestExpectations        2017-01-12 16:45:00 UTC (rev 210639)
+++ branches/safari-603-branch/LayoutTests/platform/mac-wk2/TestExpectations        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -13,6 +13,8 @@
</span><span class="cx"> fast/events/force-click-link-selection-behavior.html [ Pass ]
</span><span class="cx"> fast/events/force-click-on-link-navigation.html [ Pass ]
</span><span class="cx"> fast/events/force-click-text-selection-behavior.html [ Failure ]
</span><ins>+fast/events/autoscroll-when-zoomed.html [ Pass ]
+fast/events/autoscroll-main-document.html [ Pass ]
</ins><span class="cx"> 
</span><span class="cx"> fast/media/mq-inverted-colors-live-update.html [ Pass ]
</span><span class="cx"> fast/media/mq-inverted-colors-live-update-in-subframes.html [ Pass ]
</span><span class="lines">@@ -40,7 +42,7 @@
</span><span class="cx"> ########################################
</span><span class="cx"> ### START OF (1) Classified failures with bug reports
</span><span class="cx"> 
</span><del>-# WebKitTestRunner needs an implementation of eventSender
</del><ins>+# WebKitTestRunner needs a more complete implementation of eventSender
</ins><span class="cx"> # &lt;https://bugs.webkit.org/show_bug.cgi?id=42194&gt;
</span><span class="cx"> editing/pasteboard/4947130.html
</span><span class="cx"> editing/pasteboard/cleanup-on-move.html
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (210639 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/ChangeLog        2017-01-12 16:45:00 UTC (rev 210639)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -1,5 +1,36 @@
</span><span class="cx"> 2017-01-12  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r210147. rdar://problem/29675551
+
+    2016-12-23  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+            REGRESSION (r209299): Selection is broken when you zoom in webpage using trackpad
+            https://bugs.webkit.org/show_bug.cgi?id=166472
+            rdar://problem/29675551
+
+            Reviewed by Tim Horton.
+
+            r209299 broke autoscroll in zoomed pages because it changed RenderLayer::scrollRectToVisible()
+            to shrink viewRect by page scale. This is incorrect for all callers of scrollRectToVisible, since
+            the &quot;absoluteRect&quot; passed in is actually in zoomed document coordinates for all the callers I tested.
+
+            This code is also fixed to account for headers and footers. getRectToExpose() takes rectangles
+            in &quot;scroll view contents&quot; coordinates (i.e. including header, and zoomed document), so doesn't need
+            the separate visibleRectRelativeToDocument parameter.
+
+            Tests: fast/events/autoscroll-main-document.html
+                   fast/events/autoscroll-when-zoomed.html
+                   fast/events/drag-select-when-zoomed-with-header.html
+                   fast/events/drag-select-when-zoomed.html
+                   fast/scrolling/scroll-to-anchor-zoomed-header.html
+
+            * rendering/RenderLayer.cpp:
+            (WebCore::RenderLayer::scrollRectToVisible):
+            (WebCore::RenderLayer::getRectToExpose):
+            * rendering/RenderLayer.h:
+
+2017-01-12  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r210095. rdar://problem/29912221
</span><span class="cx"> 
</span><span class="cx">     2016-12-21  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/rendering/RenderLayer.cpp (210639 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/rendering/RenderLayer.cpp        2017-01-12 16:45:00 UTC (rev 210639)
+++ branches/safari-603-branch/Source/WebCore/rendering/RenderLayer.cpp        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -2527,7 +2527,7 @@
</span><span class="cx">         ASSERT(box);
</span><span class="cx">         LayoutRect localExposeRect(box-&gt;absoluteToLocalQuad(FloatQuad(FloatRect(absoluteRect))).boundingBox());
</span><span class="cx">         LayoutRect layerBounds(0, 0, box-&gt;clientWidth(), box-&gt;clientHeight());
</span><del>-        LayoutRect revealRect = getRectToExpose(layerBounds, layerBounds, localExposeRect, insideFixed, alignX, alignY);
</del><ins>+        LayoutRect revealRect = getRectToExpose(layerBounds, localExposeRect, insideFixed, alignX, alignY);
</ins><span class="cx"> 
</span><span class="cx">         ScrollOffset clampedScrollOffset = clampScrollOffset(scrollOffset() + toIntSize(roundedIntRect(revealRect).location()));
</span><span class="cx">         if (clampedScrollOffset != scrollOffset()) {
</span><span class="lines">@@ -2551,7 +2551,7 @@
</span><span class="cx">                 NoEventDispatchAssertion assertNoEventDispatch;
</span><span class="cx"> 
</span><span class="cx">                 LayoutRect viewRect = frameView.visibleContentRect(LegacyIOSDocumentVisibleRect);
</span><del>-                LayoutRect exposeRect = getRectToExpose(viewRect, viewRect, absoluteRect, insideFixed, alignX, alignY);
</del><ins>+                LayoutRect exposeRect = getRectToExpose(viewRect, absoluteRect, insideFixed, alignX, alignY);
</ins><span class="cx"> 
</span><span class="cx">                 IntPoint scrollOffset(roundedIntPoint(exposeRect.location()));
</span><span class="cx">                 // Adjust offsets if they're outside of the allowable range.
</span><span class="lines">@@ -2572,16 +2572,15 @@
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">             LayoutRect viewRect = frameView.visibleContentRect();
</span><del>-            viewRect.scale(1 / frameView.frameScaleFactor());
-
-            LayoutRect visibleRectRelativeToDocument = viewRect;
-            visibleRectRelativeToDocument.setLocation(frameView.documentScrollPositionRelativeToScrollableAreaOrigin());
</del><span class="cx"> #else
</span><span class="cx">             LayoutRect viewRect = frameView.unobscuredContentRect();
</span><del>-            LayoutRect visibleRectRelativeToDocument = viewRect;
</del><span class="cx"> #endif
</span><del>-            LayoutRect revealRect = getRectToExpose(viewRect, visibleRectRelativeToDocument, absoluteRect, insideFixed, alignX, alignY);
-                
</del><ins>+            // Move the target rect into &quot;scrollView contents&quot; coordinates.
+            LayoutRect targetRect = absoluteRect;
+            targetRect.move(0, frameView.headerHeight());
+
+            LayoutRect revealRect = getRectToExpose(viewRect, targetRect, insideFixed, alignX, alignY);
+            
</ins><span class="cx">             frameView.setScrollPosition(roundedIntPoint(revealRect.location()));
</span><span class="cx"> 
</span><span class="cx">             // This is the outermost view of a web page, so after scrolling this view we
</span><span class="lines">@@ -2612,7 +2611,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-LayoutRect RenderLayer::getRectToExpose(const LayoutRect &amp;visibleRect, const LayoutRect &amp;visibleRectRelativeToDocument, const LayoutRect &amp;exposeRect, bool insideFixed, const ScrollAlignment&amp; alignX, const ScrollAlignment&amp; alignY)
</del><ins>+LayoutRect RenderLayer::getRectToExpose(const LayoutRect &amp;visibleRect, const LayoutRect &amp;exposeRect, bool insideFixed, const ScrollAlignment&amp; alignX, const ScrollAlignment&amp; alignY) const
</ins><span class="cx"> {
</span><span class="cx">     FrameView&amp; frameView = renderer().view().frameView();
</span><span class="cx">     if (insideFixed) {
</span><span class="lines">@@ -2624,6 +2623,8 @@
</span><span class="cx">             // exposeRect is in absolute coords, affected by page scale. Unscale it.
</span><span class="cx">             LayoutRect unscaledExposeRect = exposeRect;
</span><span class="cx">             unscaledExposeRect.scale(1 / frameView.frameScaleFactor());
</span><ins>+            unscaledExposeRect.move(0, -frameView.headerHeight());
+
</ins><span class="cx">             // These are both in unscaled coordinates.
</span><span class="cx">             LayoutRect layoutViewport = frameView.layoutViewportRect();
</span><span class="cx">             LayoutRect visualViewport = frameView.visualViewportRect();
</span><span class="lines">@@ -2634,9 +2635,10 @@
</span><span class="cx">             unscaledExposeRect.setSize(unscaledExposeRect.size().shrunkTo(visualViewport.size()));
</span><span class="cx"> 
</span><span class="cx">             // Compute how much we have to move the visualViewport to reveal the part of the layoutViewport that contains exposeRect.
</span><del>-            LayoutRect requiredVisualViewport = getRectToExpose(visualViewport, visualViewport, unscaledExposeRect, false, alignX, alignY);
</del><ins>+            LayoutRect requiredVisualViewport = getRectToExpose(visualViewport, unscaledExposeRect, false, alignX, alignY);
</ins><span class="cx">             // Scale it back up.
</span><span class="cx">             requiredVisualViewport.scale(frameView.frameScaleFactor());
</span><ins>+            requiredVisualViewport.move(0, frameView.headerHeight());
</ins><span class="cx">             return requiredVisualViewport;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2679,7 +2681,7 @@
</span><span class="cx">     // Determine the appropriate Y behavior.
</span><span class="cx">     ScrollAlignment::Behavior scrollY;
</span><span class="cx">     LayoutRect exposeRectY(visibleRect.x(), exposeRect.y(), visibleRect.width(), exposeRect.height());
</span><del>-    LayoutUnit intersectHeight = intersection(visibleRectRelativeToDocument, exposeRectY).height();
</del><ins>+    LayoutUnit intersectHeight = intersection(visibleRect, exposeRectY).height();
</ins><span class="cx">     if (intersectHeight == exposeRect.height())
</span><span class="cx">         // If the rectangle is fully visible, use the specified visible behavior.
</span><span class="cx">         scrollY = ScrollAlignment::getVisibleBehavior(alignY);
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorerenderingRenderLayerh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/rendering/RenderLayer.h (210639 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/rendering/RenderLayer.h        2017-01-12 16:45:00 UTC (rev 210639)
+++ branches/safari-603-branch/Source/WebCore/rendering/RenderLayer.h        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -204,10 +204,9 @@
</span><span class="cx"> 
</span><span class="cx">     void availableContentSizeChanged(AvailableSizeChangeReason) override;
</span><span class="cx"> 
</span><ins>+    // &quot;absoluteRect&quot; is in scaled document coordinates.
</ins><span class="cx">     void scrollRectToVisible(SelectionRevealMode, const LayoutRect&amp; absoluteRect, bool insideFixed, const ScrollAlignment&amp; alignX, const ScrollAlignment&amp; alignY);
</span><span class="cx"> 
</span><del>-    LayoutRect getRectToExpose(const LayoutRect&amp; visibleRect, const LayoutRect&amp; visibleRectRelativeToDocument, const LayoutRect&amp; exposeRect, bool insideFixed, const ScrollAlignment&amp; alignX, const ScrollAlignment&amp; alignY);
-
</del><span class="cx">     bool scrollsOverflow() const;
</span><span class="cx">     bool hasScrollbars() const { return m_hBar || m_vBar; }
</span><span class="cx">     void setHasHorizontalScrollbar(bool);
</span><span class="lines">@@ -940,6 +939,8 @@
</span><span class="cx"> 
</span><span class="cx">     RenderLayer* enclosingTransformedAncestor() const;
</span><span class="cx"> 
</span><ins>+    LayoutRect getRectToExpose(const LayoutRect&amp; visibleRect, const LayoutRect&amp; exposeRect, bool insideFixed, const ScrollAlignment&amp; alignX, const ScrollAlignment&amp; alignY) const;
+
</ins><span class="cx">     // Convert a point in absolute coords into layer coords, taking transforms into account
</span><span class="cx">     LayoutPoint absoluteToContents(const LayoutPoint&amp;) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/ChangeLog (210639 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/ChangeLog        2017-01-12 16:45:00 UTC (rev 210639)
+++ branches/safari-603-branch/Tools/ChangeLog        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2017-01-12  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
+        Merge r210147. rdar://problem/29675551
+
+    2016-12-23  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+            REGRESSION (r209299): Selection is broken when you zoom in webpage using trackpad
+            https://bugs.webkit.org/show_bug.cgi?id=166472
+            rdar://problem/29675551
+
+            Reviewed by Tim Horton.
+
+            These changes are necessary to allow the mouse to leave the WTR window while
+            drag-scrolling, to test autoscroll. Previously, we were never calling -mouseDragged
+            (which DRT does); we'd always go through mouseMoved, which hits an early return
+            in WebViewImpl::mouseMoved() when the point is outside the view.
+
+            * WebKitTestRunner/mac/EventSenderProxy.mm:
+            (WTR::EventSenderProxy::mouseMoveTo):
+
</ins><span class="cx"> 2017-01-06  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Revert the following merges as part of disabling Web Assembly. rdar://problem/29890343
</span></span></pre></div>
<a id="branchessafari603branchToolsWebKitTestRunnermacEventSenderProxymm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/WebKitTestRunner/mac/EventSenderProxy.mm (210639 => 210640)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/WebKitTestRunner/mac/EventSenderProxy.mm        2017-01-12 16:45:00 UTC (rev 210639)
+++ branches/safari-603-branch/Tools/WebKitTestRunner/mac/EventSenderProxy.mm        2017-01-12 16:45:07 UTC (rev 210640)
</span><span class="lines">@@ -603,7 +603,8 @@
</span><span class="cx">     NSPoint position = [view convertPoint:NSMakePoint(x, y) toView:nil];
</span><span class="cx">     m_position.x = position.x;
</span><span class="cx">     m_position.y = position.y;
</span><del>-    NSEvent *event = [NSEvent mouseEventWithType:(m_leftMouseButtonDown ? NSEventTypeLeftMouseDragged : NSEventTypeMouseMoved)
</del><ins>+    bool isDrag = m_leftMouseButtonDown;
+    NSEvent *event = [NSEvent mouseEventWithType:(isDrag ? NSEventTypeLeftMouseDragged : NSEventTypeMouseMoved)
</ins><span class="cx">                                         location:position
</span><span class="cx">                                    modifierFlags:0 
</span><span class="cx">                                        timestamp:absoluteTimeForEventTime(currentEventTime())
</span><span class="lines">@@ -614,10 +615,14 @@
</span><span class="cx">                                         pressure:0];
</span><span class="cx"> 
</span><span class="cx">     NSPoint windowLocation = event.locationInWindow;
</span><del>-    NSView *targetView = [m_testController-&gt;mainWebView()-&gt;platformView() hitTest:windowLocation];
</del><ins>+    // Always target drags at the WKWebView to allow for drag-scrolling outside the view.
+    NSView *targetView = isDrag ? m_testController-&gt;mainWebView()-&gt;platformView() : [m_testController-&gt;mainWebView()-&gt;platformView() hitTest:windowLocation];
</ins><span class="cx">     if (targetView) {
</span><span class="cx">         [NSApp _setCurrentEvent:event];
</span><del>-        [targetView mouseMoved:event];
</del><ins>+        if (isDrag)
+            [targetView mouseDragged:event];
+        else
+            [targetView mouseMoved:event];
</ins><span class="cx">         [NSApp _setCurrentEvent:nil];
</span><span class="cx">     } else
</span><span class="cx">         WTFLogAlways(&quot;mouseMoveTo failed to find a target view at %f,%f\n&quot;, windowLocation.x, windowLocation.y);
</span></span></pre>
</div>
</div>

</body>
</html>