Title: [188082] branches/safari-601.1-branch

Diff

Modified: branches/safari-601.1-branch/LayoutTests/ChangeLog (188081 => 188082)


--- branches/safari-601.1-branch/LayoutTests/ChangeLog	2015-08-06 23:21:04 UTC (rev 188081)
+++ branches/safari-601.1-branch/LayoutTests/ChangeLog	2015-08-06 23:22:38 UTC (rev 188082)
@@ -1,5 +1,21 @@
 2015-08-06  Dana Burkart  <dburk...@apple.com>
 
+        Merge r187930. rdar://problem/21870332
+
+    2015-08-04  Brent Fulgham  <bfulg...@apple.com>
+
+            REGRESSION (r173784): [Mac] Correct latching error for non-scrollable iframe nested inside scrollable div.
+            https://bugs.webkit.org/show_bug.cgi?id=147668
+            <rdar://problem/21870332>
+
+            Reviewed by Simon Fraser.
+
+            * platform/mac/fast/scrolling/resources/background.html: Added.
+            * platform/mac/fast/scrolling/scroll-div-with-nested-nonscrollable-iframe-expected.txt: Added.
+            * platform/mac/fast/scrolling/scroll-div-with-nested-nonscrollable-iframe.html: Added.
+
+2015-08-06  Dana Burkart  <dburk...@apple.com>
+
         Merge r187886. rdar://problem/15779101
 
     2015-08-04  Alexey Proskuryakov  <a...@apple.com>

Added: branches/safari-601.1-branch/LayoutTests/platform/mac/fast/scrolling/resources/background.html (0 => 188082)


--- branches/safari-601.1-branch/LayoutTests/platform/mac/fast/scrolling/resources/background.html	                        (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac/fast/scrolling/resources/background.html	2015-08-06 23:22:38 UTC (rev 188082)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+    div {
+        position: relative;
+        width: 400px;
+        height: 2000px;
+        padding: 0;
+        background-image: repeating-linear-gradient(to bottom, white, silver 200px);
+    }
+    </style>
+</head>
+<body>
+    <div>This content is displayed in an iframe. The iframe should be sized such that it does not need to scroll.</div>
+</body>
+</html>

Added: branches/safari-601.1-branch/LayoutTests/platform/mac/fast/scrolling/scroll-div-with-nested-nonscrollable-iframe-expected.txt (0 => 188082)


--- branches/safari-601.1-branch/LayoutTests/platform/mac/fast/scrolling/scroll-div-with-nested-nonscrollable-iframe-expected.txt	                        (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac/fast/scrolling/scroll-div-with-nested-nonscrollable-iframe-expected.txt	2015-08-06 23:22:38 UTC (rev 188082)
@@ -0,0 +1,16 @@
+Put mouse inside the iframe (below) and flick downwards
+
+Tests that iframe does scroll when inner iframe is NOT scrollable.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+PASS div did scroll.
+PASS Page did NOT scroll.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: branches/safari-601.1-branch/LayoutTests/platform/mac/fast/scrolling/scroll-div-with-nested-nonscrollable-iframe.html (0 => 188082)


--- branches/safari-601.1-branch/LayoutTests/platform/mac/fast/scrolling/scroll-div-with-nested-nonscrollable-iframe.html	                        (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac/fast/scrolling/scroll-div-with-nested-nonscrollable-iframe.html	2015-08-06 23:22:38 UTC (rev 188082)
@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="help" href=""
+<script src=""
+</head>
+<body>
+<script>
+
+var divTarget;
+var pageScrollPositionBefore;
+var divScrollPositionBefore;
+
+var continueCount = 5;
+
+function locationInWindowCoordinates(element)
+{
+    var position = {};
+    position.x = element.offsetLeft;
+    position.y = element.offsetTop;
+
+    while (element.offsetParent) {
+        position.x = position.x + element.offsetParent.offsetLeft;
+        position.y = position.y + element.offsetParent.offsetTop;
+        if (element == document.getElementsByTagName("body")[0])
+            break;
+
+        element = element.offsetParent;
+    }
+
+    return position;
+}
+
+function finishTest()
+{
+    finishJSTest();
+    testRunner.notifyDone();            
+}
+
+function checkForScroll() {
+    var pageScrollPositionAfter = document.body.scrollTop;
+    var divScrollPositionAfter = divTarget.scrollTop;
+
+    if (divScrollPositionBefore != divScrollPositionAfter)
+        testPassed("div did scroll.");
+    else
+        testFailed("div did NOT scroll.");
+
+    if (pageScrollPositionBefore == pageScrollPositionAfter)
+        testPassed("Page did NOT scroll.");
+    else
+        testFailed("Page DID scroll.");
+
+    finishTest();
+}
+
+function scrollTest() {
+    pageScrollPositionBefore = document.body.scrollTop;
+
+    divTarget = document.getElementById('scrollable_div');
+
+    var windowPosition = locationInWindowCoordinates(divTarget);
+
+    var startPosX = windowPosition.x + 0.5 * divTarget.clientWidth;
+    var startPosY = windowPosition.y + 0.5 * divTarget.clientHeight;
+
+    divScrollPositionBefore = divTarget.scrollTop;
+
+    // Scroll the #source until we reach the #target.
+    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
+    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);
+    eventSender.callAfterScrollingCompletes(checkForScroll);
+}
+
+function setupTopLevel() {
+
+    if (window.eventSender) {
+        testRunner.waitUntilDone();
+
+        eventSender.monitorWheelEvents();
+        setTimeout(scrollTest, 0);
+    } else {
+        var messageLocation = document.getElementById('parent');
+        var message = document.createElement('div');
+        message.innerHTML = "<p>This test is better run under DumpRenderTree. To manually test it, place the mouse pointer<br/>"
+            + "inside the IFrame, then use the mouse wheel or a two-finger swipe to scroll the IFrame to the bottom (and beyond).<br/>"
+            + "<br/><br/>"
+            + "The test passes if you scroll far enough to see the row of END labels but the main page does not scroll.</p>";
+        messageLocation.appendChild(message);
+    }
+}
+
+</script>
+<div id="parent" style="height: 2000px">
+    <div id="source" style="height: 20px">
+        Put mouse inside the iframe (below) and flick downwards
+    </div>
+    <div id="scrollable_div" style="height: 400px; width: 430px; overflow-y:auto; padding: 0;">
+        <iframe id="non_scrollable_iframe" src="" style="height: 2100px; width:410px; overflow:hidden; scrolling: no" _onload_="setupTopLevel();">
+        </iframe>
+    </div>
+</div>
+<div id="console"></div>
+<script>
+description("Tests that iframe does scroll when inner iframe is NOT scrollable.");
+</script>
+<script src=""
+</body>
+</html>

Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (188081 => 188082)


--- branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-08-06 23:21:04 UTC (rev 188081)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-08-06 23:22:38 UTC (rev 188082)
@@ -1,5 +1,31 @@
 2015-08-06  Dana Burkart  <dburk...@apple.com>
 
+        Merge r187930. rdar://problem/21870332
+
+    2015-08-04  Brent Fulgham  <bfulg...@apple.com>
+
+            REGRESSION (r173784): [Mac] Correct latching error for non-scrollable iframe nested inside scrollable div.
+            https://bugs.webkit.org/show_bug.cgi?id=147668
+            <rdar://problem/21870332>
+
+            Reviewed by Simon Fraser.
+
+            Test: platform/mac/fast/scrolling/scroll-div-with-nested-nonscrollable-iframe.html
+
+            When we are wrapping up processing of the wheel event for a given frame, if the current latching context
+            does NOT apply to the current frame (e.g., because it's latched to an enclosing frame) we should not pass
+            wheel events directly to the latched elements scrollable container. Instead, we should just give the current
+            frame an opportunity to perform any custom wheel event handling and return, so that the enclosing (latched)
+            frame can do the rest of its event handling.
+
+            If we don't do this, we incorrectly ask the enclosing frame to process the event, then return claiming that
+            we handled the event, preventing the enclosing frame from doing its part of the processing.
+
+            * page/mac/EventHandlerMac.mm:
+            (WebCore::EventHandler::platformCompleteWheelEvent):
+
+2015-08-06  Dana Burkart  <dburk...@apple.com>
+
         Merge r187892. rdar://problem/21932187
 
     2015-08-04  Eric Carlson  <eric.carl...@apple.com>

Modified: branches/safari-601.1-branch/Source/WebCore/page/mac/EventHandlerMac.mm (188081 => 188082)


--- branches/safari-601.1-branch/Source/WebCore/page/mac/EventHandlerMac.mm	2015-08-06 23:21:04 UTC (rev 188081)
+++ branches/safari-601.1-branch/Source/WebCore/page/mac/EventHandlerMac.mm	2015-08-06 23:22:38 UTC (rev 188082)
@@ -1009,7 +1009,7 @@
     FrameView* view = m_frame.view();
 
     ScrollLatchingState* latchingState = m_frame.mainFrame().latchingState();
-    if (wheelEvent.useLatchedEventElement() && latchingState && latchingState->scrollableContainer()) {
+    if (wheelEvent.useLatchedEventElement() && !latchingIsLockedToAncestorOfThisFrame(m_frame) && latchingState && latchingState->scrollableContainer()) {
 
         m_isHandlingWheelEvent = false;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to