<!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>[174430] releases/WebKitGTK/webkit-2.6</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/174430">174430</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-10-08 04:15:51 -0700 (Wed, 08 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/173784">r173784</a> - Latching in iframes is not working as expected
https://bugs.webkit.org/show_bug.cgi?id=136729
&lt;rdar://problem/18370549&gt;

Reviewed by Simon Fraser.

Source/WebCore:

Test: platform/mac/fast/scrolling/scrolling-iframe-100pct.html

Correct latching behavior by moving the concept of latching from the event handler to the main frame.
The event handlers are per-document, and can improperly latch to the iframe element (rather than the
scrollable content of the iframe) resulting in incorrect behavior.

Also move the wheel event delta tracking to the main frame, as this is similarly &quot;top-level&quot; in nature.

* WebCore.vcxproj/WebCore.vcxproj: Add new LatchedState class.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler): Update constructor after moving some members to the new
LatchedState object.
(WebCore::EventHandler::clear): Call 'clear' on the LatchedState class.
(WebCore::EventHandler::platformRecordWheelEvent):  Update for new LatchedState class.
(WebCore::EventHandler::handleWheelEvent): Ditto.
(WebCore::EventHandler::clearLatchedState): Ditto.
(WebCore::EventHandler::defaultWheelEventHandler): Ditto.
* page/EventHandler.h:
* page/LatchedState.cpp: Added.
(WebCore::LatchedState::LatchedState):
(WebCore::LatchedState::~LatchedState):
(WebCore::LatchedState::clear):
(WebCore::LatchedState::setWheelEventElement):
(WebCore::LatchedState::setWidgetIsLatched):
(WebCore::LatchedState::setPreviousWheelScrolledElement):
(WebCore::LatchedState::setScrollableContainer):
* page/LatchedState.h: Added.
(WebCore::LatchedState::wheelEventElement):
(WebCore::LatchedState::frame):
(WebCore::LatchedState::setFrame):
(WebCore::LatchedState::widgetIsLatched):
(WebCore::LatchedState::previousWheelScrolledElement):
(WebCore::LatchedState::scrollableContainer):
(WebCore::LatchedState::startedGestureAtScrollLimit):
(WebCore::LatchedState::setStartedGestureAtScrollLimit):
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame): Update for new members (LatchedState and WheelEventDeltaTracker)
* page/MainFrame.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformPrepareForWheelEvents): Use mainFrame-located latching information.
(WebCore::EventHandler::platformRecordWheelEvent): Use mainFrame-located wheel event delta tracking.
(WebCore::EventHandler::platformCompleteWheelEvent): Make sure to use the latched frame as well as
the latched element so that events get routed properly.
(WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): Update for new mainFrame
location for latched state information.

LayoutTests:

* platform/mac/fast/scrolling/scroll-iframe-webkit1-latching-bug-expected.txt: Added.
* platform/mac/fast/scrolling/scroll-iframe-webkit1-latching-bug.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCoreCMakeListstxt">releases/WebKitGTK/webkit-2.6/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCoreWebCorevcxprojWebCorevcxproj">releases/WebKitGTK/webkit-2.6/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCoreWebCorevcxprojWebCorevcxprojfilters">releases/WebKitGTK/webkit-2.6/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCoreWebCorexcodeprojprojectpbxproj">releases/WebKitGTK/webkit-2.6/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorepageEventHandlercpp">releases/WebKitGTK/webkit-2.6/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorepageEventHandlerh">releases/WebKitGTK/webkit-2.6/Source/WebCore/page/EventHandler.h</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorepageMainFramecpp">releases/WebKitGTK/webkit-2.6/Source/WebCore/page/MainFrame.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorepageMainFrameh">releases/WebKitGTK/webkit-2.6/Source/WebCore/page/MainFrame.h</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorepagemacEventHandlerMacmm">releases/WebKitGTK/webkit-2.6/Source/WebCore/page/mac/EventHandlerMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsplatformmacfastscrollingscrolliframewebkit1latchingbugexpectedtxt">releases/WebKitGTK/webkit-2.6/LayoutTests/platform/mac/fast/scrolling/scroll-iframe-webkit1-latching-bug-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsplatformmacfastscrollingscrolliframewebkit1latchingbughtml">releases/WebKitGTK/webkit-2.6/LayoutTests/platform/mac/fast/scrolling/scroll-iframe-webkit1-latching-bug.html</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorepagescrollingScrollLatchingStatecpp">releases/WebKitGTK/webkit-2.6/Source/WebCore/page/scrolling/ScrollLatchingState.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorepagescrollingScrollLatchingStateh">releases/WebKitGTK/webkit-2.6/Source/WebCore/page/scrolling/ScrollLatchingState.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit26LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog (174429 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog        2014-10-08 11:08:38 UTC (rev 174429)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-09-19  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        Latching in iframes is not working as expected
+        https://bugs.webkit.org/show_bug.cgi?id=136729
+        &lt;rdar://problem/18370549&gt;
+
+        Reviewed by Simon Fraser.
+
+        * platform/mac/fast/scrolling/scroll-iframe-webkit1-latching-bug-expected.txt: Added.
+        * platform/mac/fast/scrolling/scroll-iframe-webkit1-latching-bug.html: Added.
+
</ins><span class="cx"> 2014-09-26  Lorenzo Tilve  &lt;ltilve@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Fix support for the initial-letter CSS property to first-letter
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestsplatformmacfastscrollingscrolliframewebkit1latchingbugexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/platform/mac/fast/scrolling/scroll-iframe-webkit1-latching-bug-expected.txt (0 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/platform/mac/fast/scrolling/scroll-iframe-webkit1-latching-bug-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/platform/mac/fast/scrolling/scroll-iframe-webkit1-latching-bug-expected.txt        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+
+Tests that iframe doesn't pass wheel events to main frame when scrolling at bottom
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+iframe display height = 150
+Mouse moved to (28, 116)
+PASS iframe received wheel events.
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestsplatformmacfastscrollingscrolliframewebkit1latchingbughtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/platform/mac/fast/scrolling/scroll-iframe-webkit1-latching-bug.html (0 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/platform/mac/fast/scrolling/scroll-iframe-webkit1-latching-bug.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/platform/mac/fast/scrolling/scroll-iframe-webkit1-latching-bug.html        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -0,0 +1,100 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;link rel=&quot;help&quot; href=&quot;http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEvent&quot;&gt;
+        &lt;script src=&quot;../../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body id=&quot;parent&quot; style=&quot;height: 2000px&quot;&gt;
+        &lt;script&gt;
+        var iframeTarget;
+        var pageScrollPositionBefore;
+        var iframeScrollPositionBefore;
+        var continueCount = 5;
+
+        function checkForScroll() {
+
+            // The iframe should have scrolled, but not the main page.
+            var pageScrollPositionAfter = document.body.scrollTop;
+            var iframeScrollPositionAfter = window.frames['target'].document.body.scrollTop;
+
+            if (iframeScrollPositionBefore != iframeScrollPositionAfter)
+                testPassed(&quot;iframe received wheel events.&quot;);
+            else
+                testFailed(&quot;iframe did not receive wheel events.&quot;);
+
+            testRunner.notifyDone();
+        }
+
+        function scrollTest() {
+            // See where our iframe lives:
+            pageScrollPositionBefore = document.body.scrollTop;
+
+            iframeTarget = document.getElementById('target');
+
+            var iframeBody = window.frames['target'].document.body;
+            iframeBody.scrollTop = iframeBody.scrollHeight - iframeTarget.clientHeight - 100;
+
+            iframeScrollPositionBefore = iframeBody.scrollTop;
+
+            // Scroll the #source until we reach the #target.
+            var startPosX = iframeTarget.offsetLeft + 20;
+            debug(&quot;iframe display height = &quot; + iframeTarget.clientHeight);
+            var startPosY = iframeTarget.offsetTop + iframeTarget.clientHeight - 42; // One wheel turn before end.
+            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iframe
+            debug(&quot;Mouse moved to (&quot; + startPosX + &quot;, &quot; + startPosY + &quot;)&quot;);
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', true);
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', true);
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
+            setTimeout(checkForScroll, 100);
+        }
+
+        function setupTopLevel() {
+            if (window.eventSender) {
+                testRunner.waitUntilDone();
+
+                setTimeout(scrollTest, 1000);
+            } else {
+                var messageLocation = document.getElementById('parent');
+                var message = document.createElement('div');
+                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;
+                    + &quot;inside the iframe, then use the mouse wheel or a two-finger swipe to scroll the iframe to the bottom (and beyond).&lt;br/&gt;&quot;
+                    + &quot;&lt;br/&gt;&lt;br/&gt;&quot;
+                    + &quot;The test passes if you scroll far enough to see the row of END labels but the main page does not scroll.&lt;/p&gt;&quot;;
+                messageLocation.appendChild(message);
+            }
+        }
+        &lt;/script&gt;
+        &lt;iframe id=&quot;target&quot; name=&quot;target&quot; style=&quot;border:solid 1px green; height: 150px; width: 300px;&quot; 
+            src= &quot;data:text/html,
+                &lt;html style='height: 100%'&gt;
+                    &lt;body style='height: 100%'&gt;
+                        &lt;div style='height: 100px; width: 200px'&gt;
+                            &lt;div style='overflow-y: auto; overflow-x: hidden;'&gt;
+                            TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP&lt;br/&gt;&lt;br/&gt;
+                            This should still be visible inside the frame after you scroll down
+                            &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
+                            &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
+                            &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
+                            This should NOT be visible inside the frame after you scroll down&lt;br/&gt;
+                            &lt;br/&gt;
+                            END END END END END END END END END END END END END
+                            &lt;/div&gt;
+                        &lt;/div&gt;
+                    &lt;/body&gt;
+                &lt;/html&gt;&quot;
+            onload=&quot;setupTopLevel();&quot;&gt;
+        &lt;/iframe&gt;
+        &lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+        &lt;script&gt;
+        description(&quot;Tests that iframe doesn't pass wheel events to main frame when scrolling at bottom&quot;);
+        &lt;/script&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="releasesWebKitGTKwebkit26SourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/CMakeLists.txt (174429 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/CMakeLists.txt        2014-10-08 11:08:38 UTC (rev 174429)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/CMakeLists.txt        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -1972,6 +1972,7 @@
</span><span class="cx">     page/animation/ImplicitAnimation.cpp
</span><span class="cx">     page/animation/KeyframeAnimation.cpp
</span><span class="cx"> 
</span><ins>+    page/scrolling/ScrollLatchingState.cpp
</ins><span class="cx">     page/scrolling/ScrollingConstraints.cpp
</span><span class="cx">     page/scrolling/ScrollingCoordinator.cpp
</span><span class="cx">     page/scrolling/ScrollingStateFixedNode.cpp
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog (174429 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog        2014-10-08 11:08:38 UTC (rev 174429)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -1,3 +1,59 @@
</span><ins>+2014-09-19  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        Latching in iframes is not working as expected
+        https://bugs.webkit.org/show_bug.cgi?id=136729
+        &lt;rdar://problem/18370549&gt;
+
+        Reviewed by Simon Fraser.
+
+        Test: platform/mac/fast/scrolling/scrolling-iframe-100pct.html
+
+        Correct latching behavior by moving the concept of latching from the event handler to the main frame.
+        The event handlers are per-document, and can improperly latch to the iframe element (rather than the
+        scrollable content of the iframe) resulting in incorrect behavior.
+
+        Also move the wheel event delta tracking to the main frame, as this is similarly &quot;top-level&quot; in nature.
+
+        * WebCore.vcxproj/WebCore.vcxproj: Add new LatchedState class.
+        * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::EventHandler): Update constructor after moving some members to the new
+        LatchedState object.
+        (WebCore::EventHandler::clear): Call 'clear' on the LatchedState class.
+        (WebCore::EventHandler::platformRecordWheelEvent):  Update for new LatchedState class.
+        (WebCore::EventHandler::handleWheelEvent): Ditto.
+        (WebCore::EventHandler::clearLatchedState): Ditto.
+        (WebCore::EventHandler::defaultWheelEventHandler): Ditto.
+        * page/EventHandler.h:
+        * page/LatchedState.cpp: Added.
+        (WebCore::LatchedState::LatchedState):
+        (WebCore::LatchedState::~LatchedState):
+        (WebCore::LatchedState::clear):
+        (WebCore::LatchedState::setWheelEventElement):
+        (WebCore::LatchedState::setWidgetIsLatched):
+        (WebCore::LatchedState::setPreviousWheelScrolledElement):
+        (WebCore::LatchedState::setScrollableContainer):
+        * page/LatchedState.h: Added.
+        (WebCore::LatchedState::wheelEventElement):
+        (WebCore::LatchedState::frame):
+        (WebCore::LatchedState::setFrame):
+        (WebCore::LatchedState::widgetIsLatched):
+        (WebCore::LatchedState::previousWheelScrolledElement):
+        (WebCore::LatchedState::scrollableContainer):
+        (WebCore::LatchedState::startedGestureAtScrollLimit):
+        (WebCore::LatchedState::setStartedGestureAtScrollLimit):
+        * page/MainFrame.cpp:
+        (WebCore::MainFrame::MainFrame): Update for new members (LatchedState and WheelEventDeltaTracker)
+        * page/MainFrame.h:
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::EventHandler::platformPrepareForWheelEvents): Use mainFrame-located latching information.
+        (WebCore::EventHandler::platformRecordWheelEvent): Use mainFrame-located wheel event delta tracking.
+        (WebCore::EventHandler::platformCompleteWheelEvent): Make sure to use the latched frame as well as
+        the latched element so that events get routed properly.
+        (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): Update for new mainFrame
+        location for latched state information.
+
</ins><span class="cx"> 2014-09-19  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Provide a default argument for the most commonly used HitTestRequest variant
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (174429 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-10-08 11:08:38 UTC (rev 174429)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -7191,6 +7191,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\PerformanceTiming.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\PrintContext.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\Screen.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\page\scrolling\ScrollLatchingState.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\page\scrolling\ScrollingConstraints.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\scrolling\ScrollingCoordinator.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\SecurityOrigin.cpp&quot; /&gt;
</span><span class="lines">@@ -19173,6 +19174,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\PrintContext.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\Screen.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\scrolling\coordinatedgraphics\ScrollingCoordinatorCoordinatedGraphics.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\page\scrolling\ScrollLatchingState.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\page\scrolling\ScrollingConstraints.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\scrolling\ScrollingCoordinator.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\scrolling\ScrollingStateFixedNode.h&quot; /&gt;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (174429 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-10-08 11:08:38 UTC (rev 174429)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -789,6 +789,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\Screen.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\page\scrolling\ScrollLatchingState.cpp&quot;&gt;
+      &lt;Filter&gt;page&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\page\scrolling\ScrollingConstraints.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -7773,6 +7776,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\Screen.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\page\scrolling\ScrollLatchingState.h&quot;&gt;
+      &lt;Filter&gt;page&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\page\scrolling\ScrollingConstraints.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/WebCore.xcodeproj/project.pbxproj (174429 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-08 11:08:38 UTC (rev 174429)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -2364,6 +2364,8 @@
</span><span class="cx">                 7AA3A6A4194B5C22001CBD24 /* TileCoverageMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA3A6A2194B5C22001CBD24 /* TileCoverageMap.h */; };
</span><span class="cx">                 7AABA25914BC613300AA9A11 /* DOMEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AABA25714BC613300AA9A11 /* DOMEditor.cpp */; };
</span><span class="cx">                 7AABA25A14BC613300AA9A11 /* DOMEditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AABA25814BC613300AA9A11 /* DOMEditor.h */; };
</span><ins>+                7AAFE8CF19CB8672000F56D8 /* ScrollLatchingState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AAFE8CD19CB8672000F56D8 /* ScrollLatchingState.cpp */; };
+                7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AAFE8CE19CB8672000F56D8 /* ScrollLatchingState.h */; };
</ins><span class="cx">                 7AB0B1C01211A62200A76940 /* InspectorDatabaseAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */; };
</span><span class="cx">                 7AB0B1C11211A62200A76940 /* InspectorDatabaseAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AB0B1BF1211A62200A76940 /* InspectorDatabaseAgent.h */; };
</span><span class="cx">                 7ACD88D314C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7ACD88D114C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp */; };
</span><span class="lines">@@ -9498,6 +9500,8 @@
</span><span class="cx">                 7AA3A6A2194B5C22001CBD24 /* TileCoverageMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TileCoverageMap.h; path = ca/TileCoverageMap.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7AABA25714BC613300AA9A11 /* DOMEditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMEditor.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7AABA25814BC613300AA9A11 /* DOMEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMEditor.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7AAFE8CD19CB8672000F56D8 /* ScrollLatchingState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollLatchingState.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7AAFE8CE19CB8672000F56D8 /* ScrollLatchingState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollLatchingState.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDatabaseAgent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7AB0B1BF1211A62200A76940 /* InspectorDatabaseAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDatabaseAgent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7ACD88D114C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorIndexedDBAgent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -15084,6 +15088,8 @@
</span><span class="cx">                                 1AF62EE214DA22A70041556C /* mac */,
</span><span class="cx">                                 0FFD4D5E18651FA300512F6E /* AsyncScrollingCoordinator.cpp */,
</span><span class="cx">                                 0FFD4D5F18651FA300512F6E /* AsyncScrollingCoordinator.h */,
</span><ins>+                                7AAFE8CD19CB8672000F56D8 /* ScrollLatchingState.cpp */,
+                                7AAFE8CE19CB8672000F56D8 /* ScrollLatchingState.h */,
</ins><span class="cx">                                 0F605AEA15F94848004DF0C0 /* ScrollingConstraints.cpp */,
</span><span class="cx">                                 0F605AEB15F94848004DF0C0 /* ScrollingConstraints.h */,
</span><span class="cx">                                 1AF62EE414DA22A70041556C /* ScrollingCoordinator.cpp */,
</span><span class="lines">@@ -24913,6 +24919,7 @@
</span><span class="cx">                                 BCEC01C30C274DDD009F4EC9 /* JSScreen.h in Headers */,
</span><span class="cx">                                 FDA15ECE12B03F61003A583A /* JSScriptProcessorNode.h in Headers */,
</span><span class="cx">                                 9FA37EFB1172FDA600C4CD55 /* JSScriptProfile.h in Headers */,
</span><ins>+                                7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */,
</ins><span class="cx">                                 9FA37EFD1172FDA600C4CD55 /* JSScriptProfileNode.h in Headers */,
</span><span class="cx">                                 41D07A7F0FF935CA0095EDCE /* JSSharedWorker.h in Headers */,
</span><span class="cx">                                 41D1690610238B66009BC827 /* JSSharedWorkerGlobalScope.h in Headers */,
</span><span class="lines">@@ -28952,6 +28959,7 @@
</span><span class="cx">                                 B27535630B053814002CE64F /* PathCG.cpp in Sources */,
</span><span class="cx">                                 A88DD4890B4629B000C02990 /* PathTraversalState.cpp in Sources */,
</span><span class="cx">                                 A8FA6E5E0E4CFDED00D5CF49 /* Pattern.cpp in Sources */,
</span><ins>+                                7AAFE8CF19CB8672000F56D8 /* ScrollLatchingState.cpp in Sources */,
</ins><span class="cx">                                 A80A38FE0E50CC8200A25EBC /* PatternCG.cpp in Sources */,
</span><span class="cx">                                 B27535640B053814002CE64F /* PDFDocumentImage.cpp in Sources */,
</span><span class="cx">                                 2D6E468417D660F500ECF8BB /* PDFDocumentImageMac.mm in Sources */,
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/page/EventHandler.cpp (174429 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/page/EventHandler.cpp        2014-10-08 11:08:38 UTC (rev 174429)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/page/EventHandler.cpp        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -83,6 +83,7 @@
</span><span class="cx"> #include &quot;SVGNames.h&quot;
</span><span class="cx"> #include &quot;SVGUseElement.h&quot;
</span><span class="cx"> #include &quot;ScrollAnimator.h&quot;
</span><ins>+#include &quot;ScrollLatchingState.h&quot;
</ins><span class="cx"> #include &quot;Scrollbar.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="cx"> #include &quot;ShadowRoot.h&quot;
</span><span class="lines">@@ -401,12 +402,9 @@
</span><span class="cx"> #endif
</span><span class="cx">     , m_mousePositionIsUnknown(true)
</span><span class="cx">     , m_mouseDownTimestamp(0)
</span><del>-    , m_recentWheelEventDeltaTracker(std::make_unique&lt;WheelEventDeltaTracker&gt;())
-    , m_widgetIsLatched(false)
</del><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     , m_mouseDownView(nil)
</span><span class="cx">     , m_sendingEventToSubview(false)
</span><del>-    , m_startedGestureAtScrollLimit(false)
</del><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     , m_activationEventNumber(-1)
</span><span class="cx"> #endif // !PLATFORM(IOS)
</span><span class="lines">@@ -490,11 +488,9 @@
</span><span class="cx">     m_mousePressed = false;
</span><span class="cx">     m_capturesDragging = false;
</span><span class="cx">     m_capturingMouseEventsElement = nullptr;
</span><del>-    m_latchedWheelEventElement = nullptr;
-#if PLATFORM(COCOA)
-    m_latchedScrollableContainer = nullptr;
</del><ins>+#if PLATFORM(MAC)
+    m_frame.mainFrame().resetLatchingState();
</ins><span class="cx"> #endif
</span><del>-    m_previousWheelScrolledElement = nullptr;
</del><span class="cx"> #if ENABLE(TOUCH_EVENTS) &amp;&amp; !ENABLE(IOS_TOUCH_EVENTS)
</span><span class="cx">     m_originatingTouchPointTargets.clear();
</span><span class="cx">     m_originatingTouchPointDocument.clear();
</span><span class="lines">@@ -2644,7 +2640,7 @@
</span><span class="cx"> 
</span><span class="cx"> void EventHandler::platformRecordWheelEvent(const PlatformWheelEvent&amp; event)
</span><span class="cx"> {
</span><del>-    m_recentWheelEventDeltaTracker-&gt;recordWheelEventDelta(event);
</del><ins>+    m_frame.mainFrame().wheelEventDeltaTracker()-&gt;recordWheelEventDelta(event);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool EventHandler::platformCompleteWheelEvent(const PlatformWheelEvent&amp; event, Element*, ContainerNode*, ScrollableArea*)
</span><span class="lines">@@ -2689,13 +2685,12 @@
</span><span class="cx">     bool isOverWidget = result.isOverWidget();
</span><span class="cx">     platformPrepareForWheelEvents(event, result, element, scrollableContainer, scrollableArea, isOverWidget);
</span><span class="cx"> 
</span><del>-#if PLATFORM(COCOA)
</del><ins>+#if PLATFORM(MAC)
</ins><span class="cx">     if (event.phase() == PlatformWheelEventPhaseNone &amp;&amp; event.momentumPhase() == PlatformWheelEventPhaseNone)
</span><del>-#endif
</del><span class="cx">     {
</span><del>-        m_latchedWheelEventElement = nullptr;
-        m_previousWheelScrolledElement = nullptr;
</del><ins>+        m_frame.mainFrame().latchingState()-&gt;clear();
</ins><span class="cx">     }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: It should not be necessary to do this mutation here.
</span><span class="cx">     // Instead, the handlers should know convert vertical scrolls appropriately.
</span><span class="lines">@@ -2740,12 +2735,10 @@
</span><span class="cx"> 
</span><span class="cx"> void EventHandler::clearLatchedState()
</span><span class="cx"> {
</span><del>-    m_latchedWheelEventElement = nullptr;
-#if PLATFORM(COCOA)
-    m_latchedScrollableContainer = nullptr;
</del><ins>+#if PLATFORM(MAC)
+    m_frame.mainFrame().latchingState()-&gt;clear();
</ins><span class="cx"> #endif
</span><del>-    m_widgetIsLatched = false;
-    m_previousWheelScrolledElement = nullptr;
</del><ins>+    m_frame.mainFrame().wheelEventDeltaTracker()-&gt;endTrackingDeltas();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEvent)
</span><span class="lines">@@ -2753,13 +2746,18 @@
</span><span class="cx">     if (!startNode || !wheelEvent)
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    Element* stopElement = m_previousWheelScrolledElement.get();
</del><span class="cx">     DominantScrollGestureDirection dominantDirection = DominantScrollGestureDirection::None;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC)
+    ScrollLatchingState* latchedState = m_frame.mainFrame().latchingState();
+    ASSERT(latchedState);
+    Element* stopElement = latchedState-&gt;previousWheelScrolledElement();
+
</ins><span class="cx">     // Workaround for scrolling issues &lt;rdar://problem/14758615&gt;.
</span><del>-#if PLATFORM(COCOA)
-    if (m_recentWheelEventDeltaTracker-&gt;isTrackingDeltas())
-        dominantDirection = m_recentWheelEventDeltaTracker-&gt;dominantScrollGestureDirection();
</del><ins>+    if (m_frame.mainFrame().wheelEventDeltaTracker()-&gt;isTrackingDeltas())
+        dominantDirection = m_frame.mainFrame().wheelEventDeltaTracker()-&gt;dominantScrollGestureDirection();
+#else
+    Element* stopElement = nullptr;
</ins><span class="cx"> #endif
</span><span class="cx">     
</span><span class="cx">     // Break up into two scrolls if we need to.  Diagonal movement on 
</span><span class="lines">@@ -2770,8 +2768,10 @@
</span><span class="cx">     if (dominantDirection != DominantScrollGestureDirection::Horizontal &amp;&amp; handleWheelEventInAppropriateEnclosingBoxForSingleAxis(startNode, wheelEvent, &amp;stopElement, ScrollEventAxis::Vertical))
</span><span class="cx">         wheelEvent-&gt;setDefaultHandled();
</span><span class="cx">     
</span><del>-    if (!m_latchedWheelEventElement)
-        m_previousWheelScrolledElement = stopElement;
</del><ins>+#if PLATFORM(MAC)
+    if (!latchedState-&gt;wheelEventElement())
+        latchedState-&gt;setPreviousWheelScrolledElement(stopElement);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorepageEventHandlerh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/page/EventHandler.h (174429 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/page/EventHandler.h        2014-10-08 11:08:38 UTC (rev 174429)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/page/EventHandler.h        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -535,15 +535,8 @@
</span><span class="cx">     double m_mouseDownTimestamp;
</span><span class="cx">     PlatformMouseEvent m_mouseDown;
</span><span class="cx"> 
</span><del>-    std::unique_ptr&lt;WheelEventDeltaTracker&gt; m_recentWheelEventDeltaTracker;
-    RefPtr&lt;Element&gt; m_latchedWheelEventElement;
-    bool m_widgetIsLatched;
-
-    RefPtr&lt;Element&gt; m_previousWheelScrolledElement;
-
</del><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     NSView *m_mouseDownView;
</span><del>-    RefPtr&lt;ContainerNode&gt; m_latchedScrollableContainer;
</del><span class="cx">     bool m_sendingEventToSubview;
</span><span class="cx">     bool m_startedGestureAtScrollLimit;
</span><span class="cx"> #if !PLATFORM(IOS)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorepageMainFramecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/page/MainFrame.cpp (174429 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/page/MainFrame.cpp        2014-10-08 11:08:38 UTC (rev 174429)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/page/MainFrame.cpp        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -1,40 +1,50 @@
</span><span class="cx"> /*
</span><ins>+ * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
</ins><span class="cx"> 
</span><del>-Copyright (C) 2013 Apple Inc. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1.  Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-2.  Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
</del><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;ScrollLatchingState.h&quot;
+#include &quot;WheelEventDeltaTracker.h&quot;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> inline MainFrame::MainFrame(Page&amp; page, FrameLoaderClient&amp; client)
</span><span class="cx">     : Frame(page, nullptr, client)
</span><span class="cx">     , m_selfOnlyRefCount(0)
</span><ins>+#if PLATFORM(MAC)
+    , m_latchingState(std::make_unique&lt;ScrollLatchingState&gt;())
+#endif
+    , m_recentWheelEventDeltaTracker(std::make_unique&lt;WheelEventDeltaTracker&gt;())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+MainFrame::~MainFrame()
+{
+}
+
</ins><span class="cx"> RefPtr&lt;MainFrame&gt; MainFrame::create(Page&amp; page, FrameLoaderClient&amp; client)
</span><span class="cx"> {
</span><span class="cx">     return adoptRef(new MainFrame(page, client));
</span><span class="lines">@@ -66,4 +76,14 @@
</span><span class="cx">         tree().removeChild(child);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC)
+void MainFrame::resetLatchingState()
+{
+    if (!m_latchingState)
+        return;
+
+    m_latchingState-&gt;clear();
</ins><span class="cx"> }
</span><ins>+#endif
+
+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorepageMainFrameh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/page/MainFrame.h (174429 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/page/MainFrame.h        2014-10-08 11:08:38 UTC (rev 174429)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/page/MainFrame.h        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -1,29 +1,28 @@
</span><span class="cx"> /*
</span><ins>+ * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
</ins><span class="cx"> 
</span><del>-Copyright (C) 2013 Apple Inc. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1.  Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-2.  Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
</del><span class="cx"> #ifndef MainFrame_h
</span><span class="cx"> #define MainFrame_h
</span><span class="cx"> 
</span><span class="lines">@@ -31,19 +30,36 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class ScrollLatchingState;
+class WheelEventDeltaTracker;
+
</ins><span class="cx"> class MainFrame final : public Frame {
</span><span class="cx"> public:
</span><span class="cx">     static RefPtr&lt;MainFrame&gt; create(Page&amp;, FrameLoaderClient&amp;);
</span><span class="cx"> 
</span><ins>+    virtual ~MainFrame();
+
</ins><span class="cx">     void selfOnlyRef();
</span><span class="cx">     void selfOnlyDeref();
</span><span class="cx"> 
</span><ins>+    WheelEventDeltaTracker* wheelEventDeltaTracker() { return m_recentWheelEventDeltaTracker.get(); }
+
+#if PLATFORM(MAC)
+    ScrollLatchingState* latchingState() { return m_latchingState.get(); }
+    void resetLatchingState();
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     MainFrame(Page&amp;, FrameLoaderClient&amp;);
</span><span class="cx"> 
</span><span class="cx">     void dropChildren();
</span><span class="cx"> 
</span><span class="cx">     unsigned m_selfOnlyRefCount;
</span><ins>+
+#if PLATFORM(MAC)
+    std::unique_ptr&lt;ScrollLatchingState&gt; m_latchingState;
+#endif
+    std::unique_ptr&lt;WheelEventDeltaTracker&gt; m_recentWheelEventDeltaTracker;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline bool Frame::isMainFrame() const
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorepagemacEventHandlerMacmm"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/page/mac/EventHandlerMac.mm (174429 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/page/mac/EventHandlerMac.mm        2014-10-08 11:08:38 UTC (rev 174429)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/page/mac/EventHandlerMac.mm        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #include &quot;RenderListBox.h&quot;
</span><span class="cx"> #include &quot;RenderWidget.h&quot;
</span><span class="cx"> #include &quot;RuntimeApplicationChecks.h&quot;
</span><ins>+#include &quot;ScrollLatchingState.h&quot;
</ins><span class="cx"> #include &quot;ScrollableArea.h&quot;
</span><span class="cx"> #include &quot;Scrollbar.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="lines">@@ -815,6 +816,18 @@
</span><span class="cx">     return widget-&gt;platformWidget();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool latchingIsLockedToPlatformFrame(const Frame&amp; frame)
+{
+    ScrollLatchingState* latchedState = frame.mainFrame().latchingState();
+    if (!latchedState)
+        return false;
+
+    if (frameHasPlatformWidget(frame) &amp;&amp; &amp;frame != latchedState-&gt;frame())
+        return true;
+
+    return false;
+}
+    
</ins><span class="cx"> void EventHandler::platformPrepareForWheelEvents(const PlatformWheelEvent&amp; wheelEvent, const HitTestResult&amp; result, RefPtr&lt;Element&gt;&amp; wheelEventTarget, RefPtr&lt;ContainerNode&gt;&amp; scrollableContainer, ScrollableArea*&amp; scrollableArea, bool&amp; isOverWidget)
</span><span class="cx"> {
</span><span class="cx">     FrameView* view = m_frame.view();
</span><span class="lines">@@ -841,56 +854,73 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><ins>+    ScrollLatchingState* latchingState = m_frame.mainFrame().latchingState();
+    ASSERT(latchingState);
</ins><span class="cx">     if (wheelEvent.shouldConsiderLatching()) {
</span><span class="cx">         if (scrollableArea &amp;&amp; scrollableContainer)
</span><del>-            m_startedGestureAtScrollLimit = scrolledToEdgeInDominantDirection(*scrollableContainer, *scrollableArea, wheelEvent.deltaX(), wheelEvent.deltaY());
</del><ins>+            latchingState-&gt;setStartedGestureAtScrollLimit(scrolledToEdgeInDominantDirection(*scrollableContainer, *scrollableArea, wheelEvent.deltaX(), wheelEvent.deltaY()));
</ins><span class="cx">         else
</span><del>-            m_startedGestureAtScrollLimit = false;
-        m_latchedWheelEventElement = wheelEventTarget;
</del><ins>+            latchingState-&gt;setStartedGestureAtScrollLimit(false);
+        latchingState-&gt;setWheelEventElement(wheelEventTarget);
+        latchingState-&gt;setFrame(&amp;m_frame);
</ins><span class="cx">         // FIXME: What prevents us from deleting this scrollable container while still holding a pointer to it?
</span><del>-        m_latchedScrollableContainer = scrollableContainer;
-        m_widgetIsLatched = result.isOverWidget();
-        isOverWidget = m_widgetIsLatched;
-        m_recentWheelEventDeltaTracker-&gt;beginTrackingDeltas();
-    } else if (wheelEvent.shouldResetLatching()) {
</del><ins>+        latchingState-&gt;setScrollableContainer(scrollableContainer);
+        latchingState-&gt;setWidgetIsLatched(result.isOverWidget());
+        isOverWidget = latchingState-&gt;widgetIsLatched();
+        m_frame.mainFrame().wheelEventDeltaTracker()-&gt;beginTrackingDeltas();
+    } else if (wheelEvent.shouldResetLatching())
</ins><span class="cx">         clearLatchedState();
</span><del>-        m_recentWheelEventDeltaTracker-&gt;endTrackingDeltas();
</del><ins>+
+    if (!wheelEvent.shouldResetLatching() &amp;&amp; latchingState-&gt;wheelEventElement()) {
+        if (latchingIsLockedToPlatformFrame(m_frame))
+            return;
+
+        wheelEventTarget = latchingState-&gt;wheelEventElement();
+        isOverWidget = latchingState-&gt;widgetIsLatched();
</ins><span class="cx">     }
</span><del>-    
-    if (!wheelEvent.shouldResetLatching() &amp;&amp; m_latchedWheelEventElement) {
-        wheelEventTarget = m_latchedWheelEventElement.get();
-        isOverWidget = m_widgetIsLatched;
-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void EventHandler::platformRecordWheelEvent(const PlatformWheelEvent&amp; wheelEvent)
</span><span class="cx"> {
</span><span class="cx">     switch (wheelEvent.phase()) {
</span><span class="cx">         case PlatformWheelEventPhaseBegan:
</span><del>-            m_recentWheelEventDeltaTracker-&gt;beginTrackingDeltas();
</del><ins>+            m_frame.mainFrame().wheelEventDeltaTracker()-&gt;beginTrackingDeltas();
</ins><span class="cx">             break;
</span><span class="cx">         case PlatformWheelEventPhaseEnded:
</span><del>-            m_recentWheelEventDeltaTracker-&gt;endTrackingDeltas();
</del><ins>+            m_frame.mainFrame().wheelEventDeltaTracker()-&gt;endTrackingDeltas();
</ins><span class="cx">             break;
</span><span class="cx">         default:
</span><span class="cx">             break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_recentWheelEventDeltaTracker-&gt;recordWheelEventDelta(wheelEvent);
</del><ins>+    m_frame.mainFrame().wheelEventDeltaTracker()-&gt;recordWheelEventDelta(wheelEvent);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static FrameView* frameViewForLatchingState(Frame&amp; frame, ScrollLatchingState* latchingState)
+{
+    if (latchingIsLockedToPlatformFrame(frame))
+        return frame.view();
+
+    return latchingState-&gt;frame() ? latchingState-&gt;frame()-&gt;view() : frame.view();
+}
+
</ins><span class="cx"> bool EventHandler::platformCompleteWheelEvent(const PlatformWheelEvent&amp; wheelEvent, Element* wheelEventTarget, ContainerNode* scrollableContainer, ScrollableArea* scrollableArea)
</span><span class="cx"> {
</span><span class="cx">     // We do another check on the frame view because the event handler can run JS which results in the frame getting destroyed.
</span><span class="cx">     FrameView* view = m_frame.view();
</span><span class="cx"> 
</span><del>-    if (wheelEvent.useLatchedEventElement() &amp;&amp; m_latchedScrollableContainer) {
</del><ins>+    ScrollLatchingState* latchingState = m_frame.mainFrame().latchingState();
+    ASSERT(latchingState);
+    if (wheelEvent.useLatchedEventElement() &amp;&amp; latchingState-&gt;scrollableContainer()) {
+        view = frameViewForLatchingState(m_frame, latchingState);
</ins><span class="cx">         if (!view || !view-&gt;frame().isMainFrame()) {
</span><span class="cx">             bool didHandleWheelEvent = view &amp;&amp; view-&gt;wheelEvent(wheelEvent);
</span><del>-            if (!didHandleWheelEvent &amp;&amp; scrollableContainer == m_latchedScrollableContainer) {
</del><ins>+            if (!didHandleWheelEvent &amp;&amp; scrollableContainer == latchingState-&gt;scrollableContainer()) {
</ins><span class="cx">                 // If we are just starting a scroll event, and have nowhere left to scroll, allow
</span><span class="cx">                 // the enclosing frame to handle the scroll.
</span><del>-                didHandleWheelEvent = !m_startedGestureAtScrollLimit;
</del><ins>+                didHandleWheelEvent = !latchingState-&gt;startedGestureAtScrollLimit();
+                if (!didHandleWheelEvent)
+                    latchingState-&gt;setFrame(nullptr);
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             // If the platform widget is handling the event, we always want to return false
</span><span class="lines">@@ -901,11 +931,11 @@
</span><span class="cx">             return didHandleWheelEvent;
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        if (scrollableArea &amp;&amp; !m_startedGestureAtScrollLimit &amp;&amp; scrollableContainer == m_latchedScrollableContainer) {
</del><ins>+        if (scrollableArea &amp;&amp; !latchingState-&gt;startedGestureAtScrollLimit() &amp;&amp; scrollableContainer == latchingState-&gt;scrollableContainer()) {
</ins><span class="cx">             m_isHandlingWheelEvent = false;
</span><span class="cx"> 
</span><span class="cx">             if (eventTargetIsPlatformWidget(wheelEventTarget))
</span><del>-                return !m_startedGestureAtScrollLimit;
</del><ins>+                return !latchingState-&gt;startedGestureAtScrollLimit();
</ins><span class="cx"> 
</span><span class="cx">             return true;
</span><span class="cx">         }
</span><span class="lines">@@ -922,8 +952,10 @@
</span><span class="cx">     if (frameHasPlatformWidget(m_frame) &amp;&amp; widget.isFrameView())
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    if (wheelEvent.useLatchedEventElement() &amp;&amp; m_latchedScrollableContainer &amp;&amp; scrollableContainer == m_latchedScrollableContainer)
-        return !m_startedGestureAtScrollLimit;
</del><ins>+    ScrollLatchingState* latchingState = m_frame.mainFrame().latchingState();
+    ASSERT(latchingState);
+    if (wheelEvent.useLatchedEventElement() &amp;&amp; latchingState-&gt;scrollableContainer() &amp;&amp; scrollableContainer == latchingState-&gt;scrollableContainer())
+        return !latchingState-&gt;startedGestureAtScrollLimit();
</ins><span class="cx"> 
</span><span class="cx">     return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorepagescrollingScrollLatchingStatecpp"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/Source/WebCore/page/scrolling/ScrollLatchingState.cpp (0 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/page/scrolling/ScrollLatchingState.cpp                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/page/scrolling/ScrollLatchingState.cpp        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ScrollLatchingState.h&quot;
+
+#include &quot;Element.h&quot;
+
+namespace WebCore {
+
+ScrollLatchingState::ScrollLatchingState()
+    : m_frame(nullptr)
+    , m_widgetIsLatched(false)
+    , m_startedGestureAtScrollLimit(false)
+{
+}
+    
+ScrollLatchingState::~ScrollLatchingState()
+{
+}
+
+void ScrollLatchingState::clear()
+{
+    m_wheelEventElement = nullptr;
+    m_frame = nullptr;
+    m_scrollableContainer = nullptr;
+    m_widgetIsLatched = false;
+    m_previousWheelScrolledElement = nullptr;
+}
+
+void ScrollLatchingState::setWheelEventElement(PassRefPtr&lt;Element&gt; element)
+{
+    m_wheelEventElement = element;
+}
+
+void ScrollLatchingState::setWidgetIsLatched(bool isOverWidget)
+{
+    m_widgetIsLatched = isOverWidget;
+}
+
+void ScrollLatchingState::setPreviousWheelScrolledElement(PassRefPtr&lt;Element&gt; element)
+{
+    m_previousWheelScrolledElement = element;
+}
+
+void ScrollLatchingState::setScrollableContainer(PassRefPtr&lt;ContainerNode&gt; node)
+{
+    m_scrollableContainer = node;
+}
+
+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorepagescrollingScrollLatchingStateh"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/Source/WebCore/page/scrolling/ScrollLatchingState.h (0 => 174430)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/page/scrolling/ScrollLatchingState.h                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/page/scrolling/ScrollLatchingState.h        2014-10-08 11:15:51 UTC (rev 174430)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollLatchingState_h
+#define ScrollLatchingState_h
+
+#include &lt;wtf/RefPtr.h&gt;
+
+namespace WebCore {
+
+class ContainerNode;
+class Element;
+class Frame;
+
+class ScrollLatchingState {
+public:
+    ScrollLatchingState();
+    virtual ~ScrollLatchingState();
+
+    void clear();
+
+    Element* wheelEventElement() { return m_wheelEventElement.get(); }
+    void setWheelEventElement(PassRefPtr&lt;Element&gt;);
+    Frame* frame() { return m_frame; }
+    void setFrame(Frame* frame) { m_frame = frame; }
+
+    bool widgetIsLatched() const { return m_widgetIsLatched; }
+    void setWidgetIsLatched(bool isOverWidget);
+
+    Element* previousWheelScrolledElement() { return m_previousWheelScrolledElement.get(); }
+    void setPreviousWheelScrolledElement(PassRefPtr&lt;Element&gt;);
+    
+    ContainerNode* scrollableContainer() { return m_scrollableContainer.get(); }
+    void setScrollableContainer(PassRefPtr&lt;ContainerNode&gt;);
+    bool startedGestureAtScrollLimit() const { return m_startedGestureAtScrollLimit; }
+    void setStartedGestureAtScrollLimit(bool startedAtLimit) { m_startedGestureAtScrollLimit = startedAtLimit; }
+
+private:
+    RefPtr&lt;Element&gt; m_wheelEventElement;
+    RefPtr&lt;Element&gt; m_previousWheelScrolledElement;
+    RefPtr&lt;ContainerNode&gt; m_scrollableContainer;
+
+    Frame* m_frame;
+    
+    bool m_widgetIsLatched;
+    bool m_startedGestureAtScrollLimit;
+};
+    
+}
+
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>