Title: [254497] trunk
Revision
254497
Author
[email protected]
Date
2020-01-13 23:18:15 -0800 (Mon, 13 Jan 2020)

Log Message

REGRESSION (Catalina) non-scrolling iframe prevents document scrolling
https://bugs.webkit.org/show_bug.cgi?id=202687

Reviewed by Tim Horton.

Source/WebCore:

Latching code in EventHandlerMac would consider <iframe scrolling=no> to be a latching
candidate, which would cause mousewheel scrolling in a <iframe scrolling=no> nested inside
a scrollable frame to not scroll. This affected ads and twitch.tv.

Fix by having scrolledToEdgeInDominantDirection() return true for non-scrollable iframes.

Test: tiled-drawing/scrolling/scrolling-no-iframe-latching.html

* page/mac/EventHandlerMac.mm:
(WebCore::scrolledToEdgeInDominantDirection):
* platform/ScrollView.h:
(WebCore::ScrollView::canHaveScrollbars const): Deleted.
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::canHaveScrollbars const):

LayoutTests:

* tiled-drawing/scrolling/scrolling-no-iframe-latching-expected.txt: Added.
* tiled-drawing/scrolling/scrolling-no-iframe-latching.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (254496 => 254497)


--- trunk/LayoutTests/ChangeLog	2020-01-14 07:03:31 UTC (rev 254496)
+++ trunk/LayoutTests/ChangeLog	2020-01-14 07:18:15 UTC (rev 254497)
@@ -1,5 +1,15 @@
 2020-01-13  Simon Fraser  <[email protected]>
 
+        REGRESSION (Catalina) non-scrolling iframe prevents document scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=202687
+
+        Reviewed by Tim Horton.
+
+        * tiled-drawing/scrolling/scrolling-no-iframe-latching-expected.txt: Added.
+        * tiled-drawing/scrolling/scrolling-no-iframe-latching.html: Added.
+
+2020-01-13  Simon Fraser  <[email protected]>
+
         Scrollbar hiding on iOS via ::-webkit-scrollbar { display: none } doesn't work
         https://bugs.webkit.org/show_bug.cgi?id=206197
 

Added: trunk/LayoutTests/tiled-drawing/scrolling/scrolling-no-iframe-latching-expected.txt (0 => 254497)


--- trunk/LayoutTests/tiled-drawing/scrolling/scrolling-no-iframe-latching-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/tiled-drawing/scrolling/scrolling-no-iframe-latching-expected.txt	2020-01-14 07:18:15 UTC (rev 254497)
@@ -0,0 +1,11 @@
+
+Tests that an inner frame with scrolling=no doesn't prevent scrolling a parent frame
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Outer frame scrolled.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/tiled-drawing/scrolling/scrolling-no-iframe-latching.html (0 => 254497)


--- trunk/LayoutTests/tiled-drawing/scrolling/scrolling-no-iframe-latching.html	                        (rev 0)
+++ trunk/LayoutTests/tiled-drawing/scrolling/scrolling-no-iframe-latching.html	2020-01-14 07:18:15 UTC (rev 254497)
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+    window.jsTestIsAsync = true;
+
+    function checkForScroll()
+    {
+        // The first-level iframe should have scrolled.
+        let testFrame = document.getElementById('target');
+        var frameScrollPosition = testFrame.contentDocument.scrollingElement.scrollTop;
+
+        if (!frameScrollPosition)
+            testFailed("Outer frame did not scroll.");
+        else
+            testPassed("Outer frame scrolled.");
+
+        finishJSTest();
+    }
+
+    function scrollTest()
+    {
+        // Send a scroll while over the inner iframe.
+        var startPosX = 150;
+        var startPosY = 150;
+        eventSender.monitorWheelEvents();
+        eventSender.mouseMoveTo(startPosX, startPosY);
+        eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
+        eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
+        eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
+        eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
+        eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
+        eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
+        eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
+        eventSender.callAfterScrollingCompletes(checkForScroll);
+    }
+
+    function setupTopLevel()
+    {
+        if (window.eventSender) {
+            testRunner.dumpAsText();
+            setTimeout(scrollTest, 0);
+        }
+    
+        setTimeout(checkForScroll, 1000);
+    }
+</script>
+    <iframe id="target" scrolling="yes" style="height: 400px; width: 500px;" 
+     srcdoc= "
+     <style>body { height: 1000px; }</style>
+     <p>This frame is scrollable.</p>
+     
+     <iframe scrolling='no' height=200 width=350 srcdoc='
+     <style>body { height: 1000px; }</style>
+     <p>This frame is not scrollable.</p>
+     '>
+     "
+     _onload_="setupTopLevel();"
+     >
+    </iframe>
+    <div id="console"></div>
+<script>
+description("Tests that an inner frame with scrolling=no doesn't prevent scrolling a parent frame");
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (254496 => 254497)


--- trunk/Source/WebCore/ChangeLog	2020-01-14 07:03:31 UTC (rev 254496)
+++ trunk/Source/WebCore/ChangeLog	2020-01-14 07:18:15 UTC (rev 254497)
@@ -1,5 +1,27 @@
 2020-01-13  Simon Fraser  <[email protected]>
 
+        REGRESSION (Catalina) non-scrolling iframe prevents document scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=202687
+
+        Reviewed by Tim Horton.
+
+        Latching code in EventHandlerMac would consider <iframe scrolling=no> to be a latching
+        candidate, which would cause mousewheel scrolling in a <iframe scrolling=no> nested inside
+        a scrollable frame to not scroll. This affected ads and twitch.tv.
+
+        Fix by having scrolledToEdgeInDominantDirection() return true for non-scrollable iframes.
+
+        Test: tiled-drawing/scrolling/scrolling-no-iframe-latching.html
+
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::scrolledToEdgeInDominantDirection):
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::canHaveScrollbars const): Deleted.
+        * platform/ScrollableArea.h:
+        (WebCore::ScrollableArea::canHaveScrollbars const):
+
+2020-01-13  Simon Fraser  <[email protected]>
+
         Scrollbar hiding on iOS via ::-webkit-scrollbar { display: none } doesn't work
         https://bugs.webkit.org/show_bug.cgi?id=206197
 

Modified: trunk/Source/WebCore/page/mac/EventHandlerMac.mm (254496 => 254497)


--- trunk/Source/WebCore/page/mac/EventHandlerMac.mm	2020-01-14 07:03:31 UTC (rev 254496)
+++ trunk/Source/WebCore/page/mac/EventHandlerMac.mm	2020-01-14 07:18:15 UTC (rev 254497)
@@ -817,6 +817,9 @@
     if (!container.renderer())
         return true;
 
+    if (!area.canHaveScrollbars())
+        return true;
+
     const RenderStyle& style = container.renderer()->style();
 
     if (!deltaIsPredominantlyVertical(deltaX, deltaY) && deltaX) {

Modified: trunk/Source/WebCore/platform/ScrollView.h (254496 => 254497)


--- trunk/Source/WebCore/platform/ScrollView.h	2020-01-14 07:03:31 UTC (rev 254496)
+++ trunk/Source/WebCore/platform/ScrollView.h	2020-01-14 07:18:15 UTC (rev 254497)
@@ -120,7 +120,6 @@
     void setScrollingModesLock(bool lock = true) { m_horizontalScrollbarLock = m_verticalScrollbarLock = lock; }
 
     WEBCORE_EXPORT virtual void setCanHaveScrollbars(bool);
-    bool canHaveScrollbars() const { return horizontalScrollbarMode() != ScrollbarAlwaysOff || verticalScrollbarMode() != ScrollbarAlwaysOff; }
 
     virtual bool avoidScrollbarCreation() const { return false; }
 

Modified: trunk/Source/WebCore/platform/ScrollableArea.h (254496 => 254497)


--- trunk/Source/WebCore/platform/ScrollableArea.h	2020-01-14 07:03:31 UTC (rev 254496)
+++ trunk/Source/WebCore/platform/ScrollableArea.h	2020-01-14 07:18:15 UTC (rev 254497)
@@ -120,6 +120,7 @@
 
     virtual ScrollbarMode horizontalScrollbarMode() const { return ScrollbarAuto; }
     virtual ScrollbarMode verticalScrollbarMode() const { return ScrollbarAuto; }
+    bool canHaveScrollbars() const { return horizontalScrollbarMode() != ScrollbarAlwaysOff || verticalScrollbarMode() != ScrollbarAlwaysOff; }
 
     virtual bool horizontalScrollbarHiddenByStyle() const { return false; }
     virtual bool verticalScrollbarHiddenByStyle() const { return false; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to