<!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>[169650] 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/169650">169650</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-06-06 10:41:36 -0700 (Fri, 06 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Latched scrolling tests are flakey on Mavericks
https://bugs.webkit.org/show_bug.cgi?id=133578
&lt;rdar://problem/17180591&gt;

Reviewed by Brent Fulgham.

Tools:
The latched scrolling tests rely on synthetic mousewheel events whose coordinates can
be wrong on machines with more than one screen. This is because we use
[NSScreen mainScreen] when computing the global coordinates of the events, but
[NSScreen mainScreen] returns the screen with the key window, not the first screen.

So replace calls to [NSScreen mainScreen] with [[NSScreen screens] firstObject]. Also
add comments clarifying why the coordinate math works (which is not obvious given
the events have no target window).

Some scrolling tests also dispatched events outside the 800x600 test window, so
fix those tests, and add logging that will appear in test output when this happens.

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow):
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:continuously:]):
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::mouseMoveTo):
(WTR::EventSenderProxy::mouseScrollBy):
(WTR::EventSenderProxy::continuousMouseScrollBy):
(WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases):

LayoutTests:
Fix these tests to not dispatch events outside the window, and correct some of the wording
in the tests.

* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe-with-handler.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-mainframe.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe-with-handler.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingfastscrolldivlatcheddivexpectedtxt">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingfastscrolldivlatcheddivwithhandlerexpectedtxt">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingfastscrolldivlatcheddivwithhandlerhtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingfastscrolldivlatcheddivhtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingfastscrolldivlatchedmainframewithhandlerhtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe-with-handler.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingfastscrolldivlatchedmainframehtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingfastscrolliframelatchedmainframehtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-mainframe.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingfastscrollselectlatchedmainframewithhandlerhtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe-with-handler.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingfastscrollselectlatchedmainframehtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingfastscrollselectlatchedselectexpectedtxt">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingfastscrollselectlatchedselectwithhandlerexpectedtxt">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingfastscrollselectlatchedselectwithhandlerhtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingfastscrollselectlatchedselecthtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select.html</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreemacDumpRenderTreemm">trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacEventSendingControllermm">trunk/Tools/DumpRenderTree/mac/EventSendingController.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnermacEventSenderProxymm">trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/ChangeLog        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2014-06-06  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Latched scrolling tests are flakey on Mavericks
+        https://bugs.webkit.org/show_bug.cgi?id=133578
+        &lt;rdar://problem/17180591&gt;
+
+        Reviewed by Brent Fulgham.
+        
+        Fix these tests to not dispatch events outside the window, and correct some of the wording
+        in the tests.
+
+        * platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler.html:
+        * platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div.html:
+        * platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe-with-handler.html:
+        * platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe.html:
+        * platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-mainframe.html:
+        * platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe-with-handler.html:
+        * platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe.html:
+        * platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler.html:
+        * platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select.html:
+
</ins><span class="cx"> 2014-06-06  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Run passing WebGL tests on Windows.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingfastscrolldivlatcheddivexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-expected.txt (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-expected.txt        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-expected.txt        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -52,10 +52,10 @@
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span><del>-div display height = 485
-Mouse moved to (28, 610)
-Page before: 0, div before: 451
-Page after:  0, div after: 451
</del><ins>+div display height = 350
+Mouse moved to (28, 475)
+Page before: 0, div before: 586
+Page after:  0, div after: 666
</ins><span class="cx"> PASS Page did not receive wheel events.
</span><span class="cx"> (GraphicsLayer
</span><span class="cx">   (anchor 0.00 0.00)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingfastscrolldivlatcheddivwithhandlerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler-expected.txt (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler-expected.txt        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler-expected.txt        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -52,12 +52,12 @@
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span><del>-div display height = 485
-Mouse moved to (28, 610)
-Page before: 0, div before: 451
-Page after:  0, div after: 451
</del><ins>+div display height = 350
+Mouse moved to (28, 475)
+Page before: 0, div before: 586
+Page after:  0, div after: 666
</ins><span class="cx"> PASS Page did not receive wheel events.
</span><del>-Document was initial target for 0 of the wheel events.
</del><ins>+Document was initial target for 4 of the wheel events.
</ins><span class="cx"> (GraphicsLayer
</span><span class="cx">   (anchor 0.00 0.00)
</span><span class="cx">   (bounds 2008.00 2341.00)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingfastscrolldivlatcheddivwithhandlerhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler.html (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler.html        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler.html        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -71,7 +71,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function scrollTest() {
</span><del>-    // See where our IFrame lives:
</del><span class="cx">     pageScrollPositionBefore = document.body.scrollTop;
</span><span class="cx"> 
</span><span class="cx">     divTarget = document.getElementById('target');
</span><span class="lines">@@ -83,7 +82,7 @@
</span><span class="cx">     var startPosX = Math.round(divTarget.offsetLeft) + 20;
</span><span class="cx">     debug(&quot;div display height = &quot; + Math.round(divTarget.clientHeight));
</span><span class="cx">     var startPosY = Math.round(divTarget.offsetTop) + Math.round(divTarget.clientHeight) - 42; // One wheel turn before end.
</span><del>-    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
</del><ins>+    eventSender.mouseMoveTo(startPosX, startPosY);
</ins><span class="cx">     debug(&quot;Mouse moved to (&quot; + startPosX + &quot;, &quot; + startPosY + &quot;)&quot;);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
</span><span class="lines">@@ -109,9 +108,8 @@
</span><span class="cx">         var messageLocation = document.getElementById('parent');
</span><span class="cx">         var message = document.createElement('div');
</span><span class="cx">         message.innerHTML = &quot;&lt;p&gt;This test is better run under DumpRenderTree. To manually test it, place the mouse pointer&lt;br/&gt;&quot;
</span><del>-            + &quot;at the top of the page, and then use the mouse wheel or a two-finger swipe to scroll the&lt;br/&gt;&quot;
-            + &quot;down past the div.&lt;br/&gt;&lt;br/&gt;&quot;
-            + &quot;You should not see the row of END labels if this test is successful.&lt;/p&gt;&quot;;
</del><ins>+            + &quot;near the bottom of the scrollable region, and then use the mouse wheel or a two-finger swipe to scroll up.&lt;br/&gt;&lt;/br/&gt;&quot;
+            + &quot;The page should not scroll.&lt;/p&gt;&quot;;
</ins><span class="cx">         messageLocation.appendChild(message);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -123,7 +121,7 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx">     &lt;div class=&quot;scrollable_region&quot;&gt;
</span><span class="cx">         &lt;h3&gt;Scrollable Region&lt;/h3&gt;
</span><del>-        &lt;div id=&quot;target&quot; style='overflow-y: auto; overflow-x: hidden; max-height: 485px;'&gt;
</del><ins>+        &lt;div id=&quot;target&quot; style='overflow-y: auto; overflow-x: hidden; height: 350px;'&gt;
</ins><span class="cx">             &lt;table class=&quot;table&quot; style='width: 99%'&gt;
</span><span class="cx">                 &lt;tr&gt;&lt;th&gt;Count&lt;/th&gt;&lt;th&gt;DATA&lt;/th&gt;&lt;th&gt;Rev Count&lt;/th&gt;&lt;/tr&gt;
</span><span class="cx">                 &lt;tr&gt;&lt;td&gt;TOP TOP TOP TOP TOP&lt;/td&gt;&lt;td&gt;TOP TOP TOP TOP TOP&lt;/td&gt;&lt;td&gt;TOP TOP TOP TOP TOP&lt;/td&gt;&lt;/tr&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingfastscrolldivlatcheddivhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div.html (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div.html        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div.html        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -63,7 +63,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function scrollTest() {
</span><del>-    // See where our IFrame lives:
</del><span class="cx">     pageScrollPositionBefore = document.body.scrollTop;
</span><span class="cx"> 
</span><span class="cx">     divTarget = document.getElementById('target');
</span><span class="lines">@@ -75,7 +74,7 @@
</span><span class="cx">     var startPosX = Math.round(divTarget.offsetLeft) + 20;
</span><span class="cx">     debug(&quot;div display height = &quot; + Math.round(divTarget.clientHeight));
</span><span class="cx">     var startPosY = Math.round(divTarget.offsetTop) + Math.round(divTarget.clientHeight) - 42; // One wheel turn before end.
</span><del>-    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
</del><ins>+    eventSender.mouseMoveTo(startPosX, startPosY);
</ins><span class="cx">     debug(&quot;Mouse moved to (&quot; + startPosX + &quot;, &quot; + startPosY + &quot;)&quot;);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
</span><span class="lines">@@ -101,9 +100,8 @@
</span><span class="cx">         var messageLocation = document.getElementById('parent');
</span><span class="cx">         var message = document.createElement('div');
</span><span class="cx">         message.innerHTML = &quot;&lt;p&gt;This test is better run under DumpRenderTree. To manually test it, place the mouse pointer&lt;br/&gt;&quot;
</span><del>-            + &quot;at the top of the page, and then use the mouse wheel or a two-finger swipe to scroll the&lt;br/&gt;&quot;
-            + &quot;down past the div.&lt;br/&gt;&lt;br/&gt;&quot;
-            + &quot;You should not see the row of END labels if this test is successful.&lt;/p&gt;&quot;;
</del><ins>+            + &quot;near the bottom of the scrollable region and scroll up.&lt;br/&gt;&lt;br/&gt;&quot;
+            + &quot;The page should not scroll.&lt;/p&gt;&quot;;
</ins><span class="cx">         messageLocation.appendChild(message);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -115,7 +113,7 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx">     &lt;div class=&quot;scrollable_region&quot;&gt;
</span><span class="cx">         &lt;h3&gt;Scrollable Region&lt;/h3&gt;
</span><del>-        &lt;div id=&quot;target&quot; style='overflow-y: auto; overflow-x: hidden; max-height: 485px;'&gt;
</del><ins>+        &lt;div id=&quot;target&quot; style='overflow-y: auto; overflow-x: hidden; max-height: 350px;'&gt;
</ins><span class="cx">             &lt;table class=&quot;table&quot; style='width: 99%'&gt;
</span><span class="cx">                 &lt;tr&gt;&lt;th&gt;Count&lt;/th&gt;&lt;th&gt;DATA&lt;/th&gt;&lt;th&gt;Rev Count&lt;/th&gt;&lt;/tr&gt;
</span><span class="cx">                 &lt;tr&gt;&lt;td&gt;TOP TOP TOP TOP TOP&lt;/td&gt;&lt;td&gt;TOP TOP TOP TOP TOP&lt;/td&gt;&lt;td&gt;TOP TOP TOP TOP TOP&lt;/td&gt;&lt;/tr&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingfastscrolldivlatchedmainframewithhandlerhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe-with-handler.html (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe-with-handler.html        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe-with-handler.html        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -71,7 +71,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function scrollTest() {
</span><del>-    // See where our IFrame lives:
</del><span class="cx">     pageScrollPositionBefore = document.body.scrollTop;
</span><span class="cx"> 
</span><span class="cx">     divTarget = document.getElementById('target');
</span><span class="lines">@@ -80,8 +79,8 @@
</span><span class="cx"> 
</span><span class="cx">     // Scroll the #source until we reach the #target.
</span><span class="cx">     var startPosX = Math.round(divTarget.offsetLeft) + 20;
</span><del>-    var startPosY = Math.round(divTarget.offsetTop) - 42; // Slightly more than one wheel scroll away from the IFrame
-    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
</del><ins>+    var startPosY = Math.round(divTarget.offsetTop) - 42;
+    eventSender.mouseMoveTo(startPosX, startPosY);
</ins><span class="cx">     debug(&quot;Mouse moved to (&quot; + startPosX + &quot;, &quot; + startPosY + &quot;)&quot;);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
</span><span class="lines">@@ -109,7 +108,7 @@
</span><span class="cx">         message.innerHTML = &quot;&lt;p&gt;This test is better run under DumpRenderTree. To manually test it, place the mouse pointer&lt;br/&gt;&quot;
</span><span class="cx">             + &quot;at the top of the page, and then use the mouse wheel or a two-finger swipe to scroll the&lt;br/&gt;&quot;
</span><span class="cx">             + &quot;down past the div.&lt;br/&gt;&lt;br/&gt;&quot;
</span><del>-            + &quot;You should not see the row of END labels if this test is successful.&lt;/p&gt;&quot;;
</del><ins>+            + &quot;The scrollable region should not scroll.&lt;/p&gt;&quot;;
</ins><span class="cx">         messageLocation.appendChild(message);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -121,7 +120,7 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx">     &lt;div class=&quot;scrollable_region&quot;&gt;
</span><span class="cx">         &lt;h3&gt;Scrollable Region&lt;/h3&gt;
</span><del>-        &lt;div id=&quot;target&quot; style='overflow-y: auto; overflow-x: hidden; max-height: 485px;'&gt;
</del><ins>+        &lt;div id=&quot;target&quot; style='overflow-y: auto; overflow-x: hidden; height: 350px;'&gt;
</ins><span class="cx">             &lt;table class=&quot;table&quot; style='width: 99%'&gt;
</span><span class="cx">                 &lt;tr&gt;&lt;th&gt;Count&lt;/th&gt;&lt;th&gt;DATA&lt;/th&gt;&lt;th&gt;Rev Count&lt;/th&gt;&lt;/tr&gt;
</span><span class="cx">                 &lt;tr&gt;&lt;td&gt;TOP TOP TOP TOP TOP&lt;/td&gt;&lt;td&gt;TOP TOP TOP TOP TOP&lt;/td&gt;&lt;td&gt;TOP TOP TOP TOP TOP&lt;/td&gt;&lt;/tr&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingfastscrolldivlatchedmainframehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe.html (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe.html        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe.html        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -63,7 +63,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function scrollTest() {
</span><del>-    // See where our IFrame lives:
</del><span class="cx">     pageScrollPositionBefore = document.body.scrollTop;
</span><span class="cx"> 
</span><span class="cx">     divTarget = document.getElementById('target');
</span><span class="lines">@@ -72,8 +71,8 @@
</span><span class="cx"> 
</span><span class="cx">     // Scroll the #source until we reach the #target.
</span><span class="cx">     var startPosX = Math.round(divTarget.offsetLeft) + 20;
</span><del>-    var startPosY = Math.round(divTarget.offsetTop) - 42; // Slightly more than one wheel scroll away from the IFrame
-    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
</del><ins>+    var startPosY = Math.round(divTarget.offsetTop) - 42;
+    eventSender.mouseMoveTo(startPosX, startPosY);
</ins><span class="cx">     debug(&quot;Mouse moved to (&quot; + startPosX + &quot;, &quot; + startPosY + &quot;)&quot;);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
</span><span class="lines">@@ -101,7 +100,7 @@
</span><span class="cx">         message.innerHTML = &quot;&lt;p&gt;This test is better run under DumpRenderTree. To manually test it, place the mouse pointer&lt;br/&gt;&quot;
</span><span class="cx">             + &quot;at the top of the page, and then use the mouse wheel or a two-finger swipe to scroll the&lt;br/&gt;&quot;
</span><span class="cx">             + &quot;down past the div.&lt;br/&gt;&lt;br/&gt;&quot;
</span><del>-            + &quot;You should not see the row of END labels if this test is successful.&lt;/p&gt;&quot;;
</del><ins>+            + &quot;The scrollable region should not scroll.&lt;/p&gt;&quot;;
</ins><span class="cx">         messageLocation.appendChild(message);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -113,7 +112,7 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx">     &lt;div class=&quot;scrollable_region&quot;&gt;
</span><span class="cx">         &lt;h3&gt;Scrollable Region&lt;/h3&gt;
</span><del>-        &lt;div id=&quot;target&quot; style='overflow-y: auto; overflow-x: hidden; max-height: 485px;'&gt;
</del><ins>+        &lt;div id=&quot;target&quot; style='overflow-y: auto; overflow-x: hidden; height: 350px;'&gt;
</ins><span class="cx">             &lt;table class=&quot;table&quot; style='width: 99%'&gt;
</span><span class="cx">                 &lt;tr&gt;&lt;th&gt;Count&lt;/th&gt;&lt;th&gt;DATA&lt;/th&gt;&lt;th&gt;Rev Count&lt;/th&gt;&lt;/tr&gt;
</span><span class="cx">                 &lt;tr&gt;&lt;td&gt;TOP TOP TOP TOP TOP&lt;/td&gt;&lt;td&gt;TOP TOP TOP TOP TOP&lt;/td&gt;&lt;td&gt;TOP TOP TOP TOP TOP&lt;/td&gt;&lt;/tr&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingfastscrolliframelatchedmainframehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-mainframe.html (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-mainframe.html        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-mainframe.html        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function scrollTest() {
</span><del>-    // See where our IFrame lives:
</del><span class="cx">     pageScrollPositionBefore = document.body.scrollTop;
</span><span class="cx">     iFrameScrollPositionBefore = window.frames['target'].document.body.scrollTop;
</span><span class="cx"> 
</span><span class="lines">@@ -44,7 +43,7 @@
</span><span class="cx">     // Scroll the #source until we reach the #target.
</span><span class="cx">     var startPosX = iframeTarget.offsetLeft + 20;
</span><span class="cx">     var startPosY = iframeTarget.offsetTop - 42; // Slightly more than one wheel scroll away from the IFrame
</span><del>-    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
</del><ins>+    eventSender.mouseMoveTo(startPosX, startPosY);
</ins><span class="cx">     debug(&quot;Mouse moved to (&quot; + startPosX + &quot;, &quot; + startPosY + &quot;)&quot;);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
</span><span class="lines">@@ -71,8 +70,8 @@
</span><span class="cx">         var message = document.createElement('div');
</span><span class="cx">         message.innerHTML = &quot;&lt;p&gt;This test is better run under DumpRenderTree. To manually test it, place the mouse pointer&lt;br/&gt;&quot;
</span><span class="cx">             + &quot;at the top of the page, and then use the mouse wheel or a two-finger swipe to scroll the&lt;br/&gt;&quot;
</span><del>-            + &quot;down past the IFrame.&lt;br/&gt;&lt;br/&gt;&quot;
-            + &quot;You should not see the row of END labels if this test is successful.&lt;/p&gt;&quot;;
</del><ins>+            + &quot;down past the iframe.&lt;br/&gt;&lt;br/&gt;&quot;
+            + &quot;The iframe should not scroll.&lt;/p&gt;&quot;;
</ins><span class="cx">         messageLocation.appendChild(message);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -82,7 +81,7 @@
</span><span class="cx">     &lt;div id=&quot;source&quot; style=&quot;height: 100px&quot;&gt;
</span><span class="cx">         Put mouse here and flick downwards
</span><span class="cx">     &lt;/div&gt;
</span><del>-    &lt;iframe id=&quot;target&quot; name=&quot;target&quot; style=&quot;border:solid 1px green; height: 500px; width: 500px;&quot; 
</del><ins>+    &lt;iframe id=&quot;target&quot; name=&quot;target&quot; style=&quot;border:solid 1px green; height: 300px; width: 500px;&quot; 
</ins><span class="cx">      src= &quot;data:text/html,
</span><span class="cx">      &lt;div id='notToBeScrolled' style='height: 1000px; width: 1000px;'&gt;
</span><span class="cx">      TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP&lt;br/&gt;&lt;br/&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingfastscrollselectlatchedmainframewithhandlerhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe-with-handler.html (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe-with-handler.html        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe-with-handler.html        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -71,7 +71,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function scrollTest() {
</span><del>-    // See where our IFrame lives:
</del><span class="cx">     pageScrollPositionBefore = document.body.scrollTop;
</span><span class="cx"> 
</span><span class="cx">     selectTarget = document.getElementById('target');
</span><span class="lines">@@ -80,8 +79,8 @@
</span><span class="cx"> 
</span><span class="cx">     // Scroll the #source until we reach the #target.
</span><span class="cx">     var startPosX = Math.round(selectTarget.offsetLeft) + 20;
</span><del>-    var startPosY = Math.round(selectTarget.offsetTop) - 42; // Slightly more than one wheel scroll away from the IFrame
-    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
</del><ins>+    var startPosY = Math.round(selectTarget.offsetTop) - 42;
+    eventSender.mouseMoveTo(startPosX, startPosY);
</ins><span class="cx">     debug(&quot;Mouse moved to (&quot; + startPosX + &quot;, &quot; + startPosY + &quot;)&quot;);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingfastscrollselectlatchedmainframehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe.html (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe.html        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe.html        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -63,7 +63,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function scrollTest() {
</span><del>-    // See where our IFrame lives:
</del><span class="cx">     pageScrollPositionBefore = document.body.scrollTop;
</span><span class="cx"> 
</span><span class="cx">     selectTarget = document.getElementById('target');
</span><span class="lines">@@ -72,8 +71,8 @@
</span><span class="cx"> 
</span><span class="cx">     // Scroll the #source until we reach the #target.
</span><span class="cx">     var startPosX = Math.round(selectTarget.offsetLeft) + 20;
</span><del>-    var startPosY = Math.round(selectTarget.offsetTop) - 42; // Slightly more than one wheel scroll away from the IFrame
-    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
</del><ins>+    var startPosY = Math.round(selectTarget.offsetTop) - 42;
+    eventSender.mouseMoveTo(startPosX, startPosY);
</ins><span class="cx">     debug(&quot;Mouse moved to (&quot; + startPosX + &quot;, &quot; + startPosY + &quot;)&quot;);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingfastscrollselectlatchedselectexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-expected.txt (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-expected.txt        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-expected.txt        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-Put mouse here and flick downwards
</del><ins>+Put mouse near the bottom of the select and scroll downwards.
</ins><span class="cx"> Scrollable Select
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingfastscrollselectlatchedselectwithhandlerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler-expected.txt (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler-expected.txt        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler-expected.txt        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-Put mouse here and flick downwards
</del><ins>+Put mouse near the bottom of the select and scroll downwards.
</ins><span class="cx"> Scrollable Select
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingfastscrollselectlatchedselectwithhandlerhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler.html (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler.html        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler.html        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -71,7 +71,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function scrollTest() {
</span><del>-    // See where our IFrame lives:
</del><span class="cx">     pageScrollPositionBefore = document.body.scrollTop;
</span><span class="cx"> 
</span><span class="cx">     selectTarget = document.getElementById('target');
</span><span class="lines">@@ -79,11 +78,10 @@
</span><span class="cx"> 
</span><span class="cx">     selectScrollPositionBefore = selectTarget.scrollTop;
</span><span class="cx"> 
</span><del>-    // Scroll the #source until we reach the #target.
</del><span class="cx">     var startPosX = Math.round(selectTarget.offsetLeft) + 20;
</span><span class="cx">     debug(&quot;div display height = &quot; + Math.round(selectTarget.clientHeight));
</span><del>-    var startPosY = Math.round(selectTarget.offsetTop) + Math.round(selectTarget.clientHeight) - 42; // One wheel turn before end.
-    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
</del><ins>+    var startPosY = Math.round(selectTarget.offsetTop) + Math.round(selectTarget.clientHeight) - 42;
+    eventSender.mouseMoveTo(startPosX, startPosY);
</ins><span class="cx">     debug(&quot;Mouse moved to (&quot; + startPosX + &quot;, &quot; + startPosY + &quot;)&quot;);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
</span><span class="lines">@@ -119,7 +117,7 @@
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;div id=&quot;parent&quot; style=&quot;height: 2000px; width: 2000px;&quot;&gt;
</span><span class="cx">     &lt;div id=&quot;source&quot; style=&quot;height: 100px; width: 500px;&quot;&gt;
</span><del>-        Put mouse here and flick downwards
</del><ins>+        Put mouse near the bottom of the select and scroll downwards.
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx">         &lt;div class=&quot;scrollable_region&quot;&gt;
</span><span class="cx">             &lt;h3&gt;Scrollable Select&lt;/h3&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingfastscrollselectlatchedselecthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select.html (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select.html        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select.html        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -63,7 +63,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function scrollTest() {
</span><del>-    // See where our IFrame lives:
</del><span class="cx">     pageScrollPositionBefore = document.body.scrollTop;
</span><span class="cx"> 
</span><span class="cx">     selectTarget = document.getElementById('target');
</span><span class="lines">@@ -74,8 +73,8 @@
</span><span class="cx">     // Scroll the #source until we reach the #target.
</span><span class="cx">     var startPosX = Math.round(selectTarget.offsetLeft) + 20;
</span><span class="cx">     debug(&quot;div display height = &quot; + Math.round(selectTarget.clientHeight));
</span><del>-    var startPosY = Math.round(selectTarget.offsetTop) + Math.round(selectTarget.clientHeight) - 42; // One wheel turn before end.
-    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
</del><ins>+    var startPosY = Math.round(selectTarget.offsetTop) + Math.round(selectTarget.clientHeight) - 42;
+    eventSender.mouseMoveTo(startPosX, startPosY);
</ins><span class="cx">     debug(&quot;Mouse moved to (&quot; + startPosX + &quot;, &quot; + startPosY + &quot;)&quot;);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
</span><span class="cx">     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
</span><span class="lines">@@ -111,7 +110,7 @@
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;div id=&quot;parent&quot; style=&quot;height: 2000px; width: 2000px;&quot;&gt;
</span><span class="cx">     &lt;div id=&quot;source&quot; style=&quot;height: 100px; width: 500px;&quot;&gt;
</span><del>-        Put mouse here and flick downwards
</del><ins>+        Put mouse near the bottom of the select and scroll downwards.
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx">         &lt;div class=&quot;scrollable_region&quot;&gt;
</span><span class="cx">             &lt;h3&gt;Scrollable Select&lt;/h3&gt;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/Tools/ChangeLog        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2014-06-06  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Latched scrolling tests are flakey on Mavericks
+        https://bugs.webkit.org/show_bug.cgi?id=133578
+        &lt;rdar://problem/17180591&gt;
+
+        Reviewed by Brent Fulgham.
+        
+        The latched scrolling tests rely on synthetic mousewheel events whose coordinates can
+        be wrong on machines with more than one screen. This is because we use
+        [NSScreen mainScreen] when computing the global coordinates of the events, but
+        [NSScreen mainScreen] returns the screen with the key window, not the first screen.
+        
+        So replace calls to [NSScreen mainScreen] with [[NSScreen screens] firstObject]. Also
+        add comments clarifying why the coordinate math works (which is not obvious given
+        the events have no target window).
+        
+        Some scrolling tests also dispatched events outside the 800x600 test window, so
+        fix those tests, and add logging that will appear in test output when this happens.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (createWebViewAndOffscreenWindow):
+        * DumpRenderTree/mac/EventSendingController.mm:
+        (-[EventSendingController mouseScrollByX:andY:continuously:]):
+        (-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
+        * WebKitTestRunner/mac/EventSenderProxy.mm:
+        (WTR::EventSenderProxy::mouseMoveTo):
+        (WTR::EventSenderProxy::mouseScrollBy):
+        (WTR::EventSenderProxy::continuousMouseScrollBy):
+        (WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases):
+
</ins><span class="cx"> 2014-06-05  Carlos Alberto Lopez Perez  &lt;clopez@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] run-perf-tests should run the tests inside the jhbuild shell.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacDumpRenderTreemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -710,7 +710,7 @@
</span><span class="cx">     NSRect windowRect = NSOffsetRect(rect, -10000, [(NSScreen *)[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000);
</span><span class="cx">     DumpRenderTreeWindow *window = [[DumpRenderTreeWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
</span><span class="cx"> 
</span><del>-    [window setColorSpace:[[NSScreen mainScreen] colorSpace]];
</del><ins>+    [window setColorSpace:[[[NSScreen screens] firstObject] colorSpace]];
</ins><span class="cx">     [window setCollectionBehavior:NSWindowCollectionBehaviorStationary];
</span><span class="cx">     [[window contentView] addSubview:webView];
</span><span class="cx">     [window orderBack:nil];
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacEventSendingControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/EventSendingController.mm (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/EventSendingController.mm        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/Tools/DumpRenderTree/mac/EventSendingController.mm        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -667,17 +667,16 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)mouseScrollByX:(int)x andY:(int)y continuously:(BOOL)c
</del><ins>+- (void)mouseScrollByX:(int)x andY:(int)y continuously:(BOOL)continuously
</ins><span class="cx"> {
</span><span class="cx"> #if !PLATFORM(IOS)
</span><del>-    CGScrollEventUnit unit = c?kCGScrollEventUnitPixel:kCGScrollEventUnitLine;
</del><ins>+    CGScrollEventUnit unit = continuously ? kCGScrollEventUnitPixel : kCGScrollEventUnitLine;
</ins><span class="cx">     CGEventRef cgScrollEvent = CGEventCreateScrollWheelEvent(NULL, unit, 2, y, x);
</span><span class="cx">     
</span><del>-    // CGEvent locations are in global display coordinates.
-    CGPoint lastGlobalMousePosition = {
-        lastMousePosition.x,
-        [[NSScreen mainScreen] frame].size.height - lastMousePosition.y
-    };
</del><ins>+    // Set the CGEvent location in flipped coords relative to the first screen, which
+    // compensates for the behavior of +[NSEvent eventWithCGEvent:] when the event has
+    // no associated window. See &lt;rdar://problem/17180591&gt;.
+    CGPoint lastGlobalMousePosition = CGPointMake(lastMousePosition.x, [[[NSScreen screens] firstObject] frame].size.height - lastMousePosition.y);
</ins><span class="cx">     CGEventSetLocation(cgScrollEvent, lastGlobalMousePosition);
</span><span class="cx"> 
</span><span class="cx">     NSEvent *scrollEvent = [NSEvent eventWithCGEvent:cgScrollEvent];
</span><span class="lines">@@ -735,8 +734,10 @@
</span><span class="cx"> 
</span><span class="cx">     CGEventRef cgScrollEvent = CGEventCreateScrollWheelEvent(NULL, kCGScrollEventUnitLine, 2, y, x);
</span><span class="cx"> 
</span><del>-    // CGEvent locations are in global display coordinates.
-    CGPoint lastGlobalMousePosition = CGPointMake(lastMousePosition.x, [[NSScreen mainScreen] frame].size.height - lastMousePosition.y);
</del><ins>+    // Set the CGEvent location in flipped coords relative to the first screen, which
+    // compensates for the behavior of +[NSEvent eventWithCGEvent:] when the event has
+    // no associated window. See &lt;rdar://problem/17180591&gt;.
+    CGPoint lastGlobalMousePosition = CGPointMake(lastMousePosition.x, [[[NSScreen screens] firstObject] frame].size.height - lastMousePosition.y);
</ins><span class="cx">     CGEventSetLocation(cgScrollEvent, lastGlobalMousePosition);
</span><span class="cx">     CGEventSetIntegerValueField(cgScrollEvent, kCGScrollWheelEventIsContinuous, 1);
</span><span class="cx">     CGEventSetIntegerValueField(cgScrollEvent, kCGScrollWheelEventScrollPhase, phase);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnermacEventSenderProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm (169649 => 169650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm        2014-06-06 16:54:18 UTC (rev 169649)
+++ trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm        2014-06-06 17:41:36 UTC (rev 169650)
</span><span class="lines">@@ -220,6 +220,9 @@
</span><span class="cx">         [NSApp _setCurrentEvent:event];
</span><span class="cx">         [targetView mouseMoved:event];
</span><span class="cx">         [NSApp _setCurrentEvent:nil];
</span><ins>+    } else {
+        CGPoint windowLocation = [event locationInWindow];
+        WTFLogAlways(&quot;mouseMoveTo failed to find a target view at %f,%f\n&quot;, windowLocation.x, windowLocation.y);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -443,8 +446,10 @@
</span><span class="cx"> {
</span><span class="cx">     RetainPtr&lt;CGEventRef&gt; cgScrollEvent = adoptCF(CGEventCreateScrollWheelEvent(0, kCGScrollEventUnitLine, 2, y, x));
</span><span class="cx"> 
</span><del>-    // CGEvent locations are in global display coordinates.
-    CGPoint lastGlobalMousePosition = CGPointMake(m_position.x, [[NSScreen mainScreen] frame].size.height - m_position.y);
</del><ins>+    // Set the CGEvent location in flipped coords relative to the first screen, which
+    // compensates for the behavior of +[NSEvent eventWithCGEvent:] when the event has
+    // no associated window. See &lt;rdar://problem/17180591&gt;.
+    CGPoint lastGlobalMousePosition = CGPointMake(m_position.x, [[[NSScreen screens] firstObject] frame].size.height - m_position.y);
</ins><span class="cx">     CGEventSetLocation(cgScrollEvent.get(), lastGlobalMousePosition);
</span><span class="cx"> 
</span><span class="cx">     NSEvent *event = [NSEvent eventWithCGEvent:cgScrollEvent.get()];
</span><span class="lines">@@ -452,12 +457,15 @@
</span><span class="cx">         [NSApp _setCurrentEvent:event];
</span><span class="cx">         [targetView scrollWheel:event];
</span><span class="cx">         [NSApp _setCurrentEvent:nil];
</span><ins>+    } else {
+        NSPoint location = [event locationInWindow];
+        WTFLogAlways(&quot;mouseScrollByWithWheelAndMomentumPhases failed to find the target view at %f,%f\n&quot;, location.x, location.y);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void EventSenderProxy::continuousMouseScrollBy(int x, int y, bool paged)
</span><span class="cx"> {
</span><del>-    // FIXME: Implement this.
</del><ins>+    WTFLogAlways(&quot;EventSenderProxy::continuousMouseScrollBy is not implemented\n&quot;);
</ins><span class="cx">     return;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -469,21 +477,26 @@
</span><span class="cx"> {
</span><span class="cx">     RetainPtr&lt;CGEventRef&gt; cgScrollEvent = adoptCF(CGEventCreateScrollWheelEvent(0, kCGScrollEventUnitLine, 2, y, x));
</span><span class="cx"> 
</span><del>-    // CGEvent locations are in global display coordinates.
-    CGPoint lastGlobalMousePosition = CGPointMake(m_position.x, [[NSScreen mainScreen] frame].size.height - m_position.y);
</del><ins>+    // Set the CGEvent location in flipped coords relative to the first screen, which
+    // compensates for the behavior of +[NSEvent eventWithCGEvent:] when the event has
+    // no associated window. See &lt;rdar://problem/17180591&gt;.
+    CGPoint lastGlobalMousePosition = CGPointMake(m_position.x, [[[NSScreen screens] firstObject] frame].size.height - m_position.y);
</ins><span class="cx">     CGEventSetLocation(cgScrollEvent.get(), lastGlobalMousePosition);
</span><span class="cx"> 
</span><span class="cx">     CGEventSetIntegerValueField(cgScrollEvent.get(), kCGScrollWheelEventIsContinuous, 1);
</span><span class="cx">     CGEventSetIntegerValueField(cgScrollEvent.get(), kCGScrollWheelEventScrollPhase, phase);
</span><span class="cx">     CGEventSetIntegerValueField(cgScrollEvent.get(), kCGScrollWheelEventMomentumPhase, momentum);
</span><span class="cx"> 
</span><del>-    NSEvent* event = [NSEvent eventWithCGEvent: cgScrollEvent.get()];
</del><ins>+    NSEvent* event = [NSEvent eventWithCGEvent:cgScrollEvent.get()];
</ins><span class="cx"> 
</span><span class="cx">     // Our event should have the correct settings:
</span><del>-    if (NSView *targetView = [m_testController-&gt;mainWebView()-&gt;platformView() hitTest: [event locationInWindow]]) {
-        [NSApp _setCurrentEvent: event];
-        [targetView scrollWheel: event];
-        [NSApp _setCurrentEvent: nil];
</del><ins>+    if (NSView *targetView = [m_testController-&gt;mainWebView()-&gt;platformView() hitTest:[event locationInWindow]]) {
+        [NSApp _setCurrentEvent:event];
+        [targetView scrollWheel:event];
+        [NSApp _setCurrentEvent:nil];
+    } else {
+        CGPoint windowLocation = [event locationInWindow];
+        WTFLogAlways(&quot;mouseScrollByWithWheelAndMomentumPhases failed to find the target view at %f,%f\n&quot;, windowLocation.x, windowLocation.y);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>