Title: [269780] trunk
Revision
269780
Author
[email protected]
Date
2020-11-13 08:46:42 -0800 (Fri, 13 Nov 2020)

Log Message

Force wheel event listeners on the root to be passive
https://bugs.webkit.org/show_bug.cgi?id=218842
<rdar://problem/71312668>

Reviewed by Chris Dumez.

Following Blink (https://www.chromestatus.com/feature/6662647093133312) force 'wheel' and
'mousewheel' event listeners on root objects (window, document and body) to be passive if
they were not explicitly registered as non-passive.

This behavior is controlled by an experimental feature flag, and a linked-on-or-after check
to avoid changing behavior for apps that embed WebKit until they link against new SDKs.

Source/WebCore:

Tests: fast/events/wheel/wheel-event-listeners-on-body-made-passive.html
       fast/events/wheel/wheel-event-listeners-on-document-made-passive.html
       fast/events/wheel/wheel-event-listeners-on-window-left-active.html
       fast/events/wheel/wheel-event-listeners-on-window-made-passive.html

* page/Quirks.cpp:
(WebCore::Quirks::shouldMakeEventListenerPassive):
* platform/cocoa/VersionChecks.h:

Source/WebKit:

* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultCSSOMViewScrollingAPIEnabled):
(WebKit::defaultPassiveWheelListenersAsDefaultOnDocument):
* Shared/WebPreferencesDefaultValues.h:

Source/WebKitLegacy/mac:

* WebView/WebPreferencesDefaultValues.h:
* WebView/WebPreferencesDefaultValues.mm:
(WebKit::defaultPassiveTouchListenersAsDefaultOnDocument):
(WebKit::defaultPassiveWheelListenersAsDefaultOnDocument):

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

* fast/events/wheel/wheel-event-listeners-on-body-made-passive-expected.txt: Added.
* fast/events/wheel/wheel-event-listeners-on-body-made-passive.html: Added.
* fast/events/wheel/wheel-event-listeners-on-document-made-passive-expected.txt: Added.
* fast/events/wheel/wheel-event-listeners-on-document-made-passive.html: Added.
* fast/events/wheel/wheel-event-listeners-on-window-left-active-expected.txt: Added.
* fast/events/wheel/wheel-event-listeners-on-window-left-active.html: Added.
* fast/events/wheel/wheel-event-listeners-on-window-made-passive-expected.txt: Added.
* fast/events/wheel/wheel-event-listeners-on-window-made-passive.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (269779 => 269780)


--- trunk/LayoutTests/ChangeLog	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/LayoutTests/ChangeLog	2020-11-13 16:46:42 UTC (rev 269780)
@@ -1,3 +1,27 @@
+2020-11-12  Simon Fraser  <[email protected]>
+
+        Force wheel event listeners on the root to be passive
+        https://bugs.webkit.org/show_bug.cgi?id=218842
+        <rdar://problem/71312668>
+
+        Reviewed by Chris Dumez.
+
+        Following Blink (https://www.chromestatus.com/feature/6662647093133312) force 'wheel' and
+        'mousewheel' event listeners on root objects (window, document and body) to be passive if
+        they were not explicitly registered as non-passive.
+
+        This behavior is controlled by an experimental feature flag, and a linked-on-or-after check
+        to avoid changing behavior for apps that embed WebKit until they link against new SDKs.
+
+        * fast/events/wheel/wheel-event-listeners-on-body-made-passive-expected.txt: Added.
+        * fast/events/wheel/wheel-event-listeners-on-body-made-passive.html: Added.
+        * fast/events/wheel/wheel-event-listeners-on-document-made-passive-expected.txt: Added.
+        * fast/events/wheel/wheel-event-listeners-on-document-made-passive.html: Added.
+        * fast/events/wheel/wheel-event-listeners-on-window-left-active-expected.txt: Added.
+        * fast/events/wheel/wheel-event-listeners-on-window-left-active.html: Added.
+        * fast/events/wheel/wheel-event-listeners-on-window-made-passive-expected.txt: Added.
+        * fast/events/wheel/wheel-event-listeners-on-window-made-passive.html: Added.
+
 2020-11-13  Julian Gonzalez  <[email protected]>
 
         Crash in ReplaceSelectionCommand::moveNodeOutOfAncestor

Added: trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-body-made-passive-expected.txt (0 => 269780)


--- trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-body-made-passive-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-body-made-passive-expected.txt	2020-11-13 16:46:42 UTC (rev 269780)
@@ -0,0 +1,7 @@
+Tests that a wheel event handler on the body is passive (cannot prevent scrolling)
+PASS windowScrollEventCount > 0 is true
+PASS defaultPrevented is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-body-made-passive.html (0 => 269780)


--- trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-body-made-passive.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-body-made-passive.html	2020-11-13 16:46:42 UTC (rev 269780)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        body {
+            height: 5000px;
+        }
+    </style>
+    <script src=""
+    <script src=""
+    <script>
+        var jsTestIsAsync = true;
+
+        let windowScrollEventCount = 0;
+        let defaultPrevented;
+
+        async function testScroll()
+        {
+            await UIHelper.mouseWheelScrollAt(100, 100);
+            shouldBeTrue('windowScrollEventCount > 0');
+            shouldBeFalse('defaultPrevented');
+            finishJSTest();
+        }
+
+        window.addEventListener('load', () => {
+            debug('Tests that a wheel event handler on the body is passive (cannot prevent scrolling)')
+            document.body.addEventListener('wheel', (event) => {
+                event.preventDefault();
+                defaultPrevented = event.defaultPrevented;
+            });
+
+            window.addEventListener('scroll', () => {
+                ++windowScrollEventCount;
+            }, false);
+
+            setTimeout(testScroll, 0);
+        }, false);
+    </script>
+</head>
+<body>
+    <script src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-document-made-passive-expected.txt (0 => 269780)


--- trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-document-made-passive-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-document-made-passive-expected.txt	2020-11-13 16:46:42 UTC (rev 269780)
@@ -0,0 +1,7 @@
+Tests that a wheel event handler on the document is passive (cannot prevent scrolling)
+PASS windowScrollEventCount > 0 is true
+PASS defaultPrevented is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-document-made-passive.html (0 => 269780)


--- trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-document-made-passive.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-document-made-passive.html	2020-11-13 16:46:42 UTC (rev 269780)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        body {
+            height: 5000px;
+        }
+    </style>
+    <script src=""
+    <script src=""
+    <script>
+        var jsTestIsAsync = true;
+
+        let windowScrollEventCount = 0;
+        let defaultPrevented;
+
+        async function testScroll()
+        {
+            await UIHelper.mouseWheelScrollAt(100, 100);
+            shouldBeTrue('windowScrollEventCount > 0');
+            shouldBeFalse('defaultPrevented');
+            finishJSTest();
+        }
+
+        window.addEventListener('load', () => {
+            debug('Tests that a wheel event handler on the document is passive (cannot prevent scrolling)')
+            document.addEventListener('wheel', (event) => {
+                event.preventDefault();
+                defaultPrevented = event.defaultPrevented;
+            });
+
+            window.addEventListener('scroll', () => {
+                ++windowScrollEventCount;
+            }, false);
+
+            setTimeout(testScroll, 0);
+        }, false);
+    </script>
+</head>
+<body>
+    <script src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-window-left-active-expected.txt (0 => 269780)


--- trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-window-left-active-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-window-left-active-expected.txt	2020-11-13 16:46:42 UTC (rev 269780)
@@ -0,0 +1,7 @@
+Tests that an active wheel event handler on the window remains active.
+PASS windowScrollEventCount is 0
+PASS defaultPrevented is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-window-left-active.html (0 => 269780)


--- trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-window-left-active.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-window-left-active.html	2020-11-13 16:46:42 UTC (rev 269780)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        body {
+            height: 5000px;
+        }
+    </style>
+    <script src=""
+    <script src=""
+    <script>
+        var jsTestIsAsync = true;
+
+        let windowScrollEventCount = 0;
+        let defaultPrevented;
+
+        async function testScroll()
+        {
+            await UIHelper.mouseWheelScrollAt(100, 100);
+            shouldBe('windowScrollEventCount', '0');
+            shouldBeTrue('defaultPrevented');
+            finishJSTest();
+        }
+
+        window.addEventListener('load', () => {
+            debug('Tests that an active wheel event handler on the window remains active.')
+            window.addEventListener('wheel', (event) => {
+                event.preventDefault();
+                defaultPrevented = event.defaultPrevented;
+            }, { passive: false });
+
+            window.addEventListener('scroll', () => {
+                ++windowScrollEventCount;
+            }, false);
+
+            setTimeout(testScroll, 0);
+        }, false);
+    </script>
+</head>
+<body>
+    <script src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-window-made-passive-expected.txt (0 => 269780)


--- trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-window-made-passive-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-window-made-passive-expected.txt	2020-11-13 16:46:42 UTC (rev 269780)
@@ -0,0 +1,7 @@
+Tests that a wheel event handler on the window is passive (cannot prevent scrolling)
+PASS windowScrollEventCount > 0 is true
+PASS defaultPrevented is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-window-made-passive.html (0 => 269780)


--- trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-window-made-passive.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/wheel/wheel-event-listeners-on-window-made-passive.html	2020-11-13 16:46:42 UTC (rev 269780)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        body {
+            height: 5000px;
+        }
+    </style>
+    <script src=""
+    <script src=""
+    <script>
+        var jsTestIsAsync = true;
+
+        let windowScrollEventCount = 0;
+        let defaultPrevented;
+
+        async function testScroll()
+        {
+            await UIHelper.mouseWheelScrollAt(100, 100);
+            shouldBeTrue('windowScrollEventCount > 0');
+            shouldBeFalse('defaultPrevented');
+            finishJSTest();
+        }
+
+        window.addEventListener('load', () => {
+            debug('Tests that a wheel event handler on the window is passive (cannot prevent scrolling)')
+            window.addEventListener('wheel', (event) => {
+                event.preventDefault();
+                defaultPrevented = event.defaultPrevented;
+            });
+
+            window.addEventListener('scroll', () => {
+                ++windowScrollEventCount;
+            }, false);
+
+            setTimeout(testScroll, 0);
+        }, false);
+    </script>
+</head>
+<body>
+    <script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-root-invalidation-expected.txt (269779 => 269780)


--- trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-root-invalidation-expected.txt	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-root-invalidation-expected.txt	2020-11-13 16:46:42 UTC (rev 269780)
@@ -11,9 +11,6 @@
         (rect (0,0) width=800 height=600)
       (wheel event listener region
         (rect (0,0) width=800 height=600)
-        (non-passive
-          (rect (0,0) width=800 height=600)
-        )
       )
       )
     )

Modified: trunk/LayoutTests/platform/win/TestExpectations (269779 => 269780)


--- trunk/LayoutTests/platform/win/TestExpectations	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/LayoutTests/platform/win/TestExpectations	2020-11-13 16:46:42 UTC (rev 269780)
@@ -275,6 +275,11 @@
 fast/events/wheel/platform-wheelevent-in-scrolling-div.html [ Failure Timeout ]
 fast/events/wheel/wheelevent-in-horizontal-scrollbar-in-rtl.html [ Failure ]
 fast/events/wheel/wheelevent-in-vertical-scrollbar-in-rtl.html [ Failure ]
+fast/events/wheel/wheel-event-listeners-on-body-made-passive.html [ Skip ]
+fast/events/wheel/wheel-event-listeners-on-document-made-passive.html [ Skip ]
+fast/events/wheel/wheel-event-listeners-on-window-left-active.html [ Skip ]
+fast/events/wheel/wheel-event-listeners-on-window-made-passive.html [ Skip ]
+
 scrollbars/scroll-rtl-or-bt-layer.html [ Timeout ]
 webkit.org/b/208559 fast/scrolling/arrow-key-scroll-in-rtl-document.html [ Skip ]
 webkit.org/b/208559 fast/scrolling/programmatic-scroll-to-zero-zero.html [ Skip ]

Modified: trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-document-expected.txt (269779 => 269780)


--- trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-document-expected.txt	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-document-expected.txt	2020-11-13 16:46:42 UTC (rev 269780)
@@ -12,9 +12,6 @@
         (rect (0,0) width=800 height=600)
       (wheel event listener region
         (rect (0,0) width=800 height=600)
-        (non-passive
-          (rect (0,0) width=800 height=600)
-        )
       )
       )
     )

Modified: trunk/Source/WTF/ChangeLog (269779 => 269780)


--- trunk/Source/WTF/ChangeLog	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/Source/WTF/ChangeLog	2020-11-13 16:46:42 UTC (rev 269780)
@@ -1,3 +1,20 @@
+2020-11-12  Simon Fraser  <[email protected]>
+
+        Force wheel event listeners on the root to be passive
+        https://bugs.webkit.org/show_bug.cgi?id=218842
+        <rdar://problem/71312668>
+
+        Reviewed by Chris Dumez.
+
+        Following Blink (https://www.chromestatus.com/feature/6662647093133312) force 'wheel' and
+        'mousewheel' event listeners on root objects (window, document and body) to be passive if
+        they were not explicitly registered as non-passive.
+
+        This behavior is controlled by an experimental feature flag, and a linked-on-or-after check
+        to avoid changing behavior for apps that embed WebKit until they link against new SDKs.
+
+        * Scripts/Preferences/WebPreferencesExperimental.yaml:
+
 2020-11-13  Aditya Keerthi  <[email protected]>
 
         [iOS][FCR] Add an internal feature flag to enable the new appearance

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml (269779 => 269780)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2020-11-13 16:46:42 UTC (rev 269780)
@@ -601,6 +601,20 @@
     WebKit:
       default: true
 
+PassiveWheelListenersAsDefaultOnDocument:
+  type: bool
+  humanReadableName: "Wheel Event listeners on the root made passive"
+  humanReadableDescription: "Force wheel event listeners registered on the window, document or body to be passive"
+  defaultValue:
+    WebKitLegacy:
+      "PLATFORM(MAC)": WebKit::defaultPassiveWheelListenersAsDefaultOnDocument()
+      default: true
+    WebKit:
+      "PLATFORM(MAC)": WebKit::defaultPassiveWheelListenersAsDefaultOnDocument()
+      default: true
+    WebCore:
+      default: true
+
 # FIXME: Is this implemented for WebKitLegacy? If not, this should be excluded from WebKitLegacy entirely.
 PerElementSpeakerSelectionEnabled:
   type: bool

Modified: trunk/Source/WebCore/ChangeLog (269779 => 269780)


--- trunk/Source/WebCore/ChangeLog	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/Source/WebCore/ChangeLog	2020-11-13 16:46:42 UTC (rev 269780)
@@ -1,3 +1,27 @@
+2020-11-12  Simon Fraser  <[email protected]>
+
+        Force wheel event listeners on the root to be passive
+        https://bugs.webkit.org/show_bug.cgi?id=218842
+        <rdar://problem/71312668>
+
+        Reviewed by Chris Dumez.
+
+        Following Blink (https://www.chromestatus.com/feature/6662647093133312) force 'wheel' and
+        'mousewheel' event listeners on root objects (window, document and body) to be passive if
+        they were not explicitly registered as non-passive.
+
+        This behavior is controlled by an experimental feature flag, and a linked-on-or-after check
+        to avoid changing behavior for apps that embed WebKit until they link against new SDKs.
+
+        Tests: fast/events/wheel/wheel-event-listeners-on-body-made-passive.html
+               fast/events/wheel/wheel-event-listeners-on-document-made-passive.html
+               fast/events/wheel/wheel-event-listeners-on-window-left-active.html
+               fast/events/wheel/wheel-event-listeners-on-window-made-passive.html
+
+        * page/Quirks.cpp:
+        (WebCore::Quirks::shouldMakeEventListenerPassive):
+        * platform/cocoa/VersionChecks.h:
+
 2020-11-13  Antti Koivisto  <[email protected]>
 
         [LFC][Integration] Tighten inline-block coverage conditions

Modified: trunk/Source/WebCore/page/Quirks.cpp (269779 => 269780)


--- trunk/Source/WebCore/page/Quirks.cpp	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/Source/WebCore/page/Quirks.cpp	2020-11-13 16:46:42 UTC (rev 269780)
@@ -803,19 +803,37 @@
 
 bool Quirks::shouldMakeEventListenerPassive(const EventTarget& eventTarget, const AtomString& eventType, const EventListener& eventListener)
 {
+    auto eventTargetIsRoot = [](const EventTarget& eventTarget) {
+        if (is<DOMWindow>(eventTarget))
+            return true;
+
+        if (is<Node>(eventTarget)) {
+            auto& node = downcast<Node>(eventTarget);
+            return is<Document>(node) || node.document().documentElement() == &node || node.document().body() == &node;
+        }
+        return false;
+    };
+
+    auto documentFromEventTarget = [](const EventTarget& eventTarget) -> Document* {
+        return downcast<Document>(eventTarget.scriptExecutionContext());
+    };
+
     if (eventNames().isTouchScrollBlockingEventType(eventType)) {
-        if (is<DOMWindow>(eventTarget)) {
-            auto& window = downcast<DOMWindow>(eventTarget);
-            if (auto* document = window.document())
+        if (eventTargetIsRoot(eventTarget)) {
+            if (auto* document = documentFromEventTarget(eventTarget))
                 return document->settings().passiveTouchListenersAsDefaultOnDocument();
-        } else if (is<Node>(eventTarget)) {
-            auto& node = downcast<Node>(eventTarget);
-            if (is<Document>(node) || node.document().documentElement() == &node || node.document().body() == &node)
-                return node.document().settings().passiveTouchListenersAsDefaultOnDocument();
         }
         return false;
     }
 
+    if (eventNames().isWheelEventType(eventType)) {
+        if (eventTargetIsRoot(eventTarget)) {
+            if (auto* document = documentFromEventTarget(eventTarget))
+                return document->settings().passiveWheelListenersAsDefaultOnDocument();
+        }
+        return false;
+    }
+
     if (eventType == eventNames().mousewheelEvent) {
         if (!is<JSEventListener>(eventListener))
             return false;

Modified: trunk/Source/WebCore/platform/cocoa/VersionChecks.h (269779 => 269780)


--- trunk/Source/WebCore/platform/cocoa/VersionChecks.h	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/Source/WebCore/platform/cocoa/VersionChecks.h	2020-11-13 16:46:42 UTC (rev 269780)
@@ -71,6 +71,7 @@
     FirstWithExceptionsForDuplicateCompletionHandlerCalls = DYLD_MACOSX_VERSION_10_13,
     FirstWithDropToNavigateDisallowedByDefault = DYLD_MACOSX_VERSION_10_13,
     FirstWithExpiredOnlyReloadBehavior = DYLD_MACOSX_VERSION_10_13,
+    FirstThatDefaultsToPassiveWheelListenersOnDocument = DYLD_MACOSX_VERSION_11_3,
     FirstWithWebIconDatabaseWarning = DYLD_MACOSX_VERSION_10_13,
     FirstWithMainThreadReleaseAssertionInWebPageProxy = DYLD_MACOSX_VERSION_10_14,
     FirstWithoutUnconditionalUniversalSandboxExtension = DYLD_MACOSX_VERSION_10_15,

Modified: trunk/Source/WebKit/ChangeLog (269779 => 269780)


--- trunk/Source/WebKit/ChangeLog	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/Source/WebKit/ChangeLog	2020-11-13 16:46:42 UTC (rev 269780)
@@ -1,3 +1,23 @@
+2020-11-12  Simon Fraser  <[email protected]>
+
+        Force wheel event listeners on the root to be passive
+        https://bugs.webkit.org/show_bug.cgi?id=218842
+        <rdar://problem/71312668>
+
+        Reviewed by Chris Dumez.
+
+        Following Blink (https://www.chromestatus.com/feature/6662647093133312) force 'wheel' and
+        'mousewheel' event listeners on root objects (window, document and body) to be passive if
+        they were not explicitly registered as non-passive.
+
+        This behavior is controlled by an experimental feature flag, and a linked-on-or-after check
+        to avoid changing behavior for apps that embed WebKit until they link against new SDKs.
+
+        * Shared/WebPreferencesDefaultValues.cpp:
+        (WebKit::defaultCSSOMViewScrollingAPIEnabled):
+        (WebKit::defaultPassiveWheelListenersAsDefaultOnDocument):
+        * Shared/WebPreferencesDefaultValues.h:
+
 2020-11-13  Eric Carlson  <[email protected]>
 
         Add _STAttributionDisplayName to macOS WebContent Info.plist

Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp (269779 => 269780)


--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2020-11-13 16:46:42 UTC (rev 269780)
@@ -52,6 +52,16 @@
 
 #endif
 
+#if PLATFORM(MAC)
+
+bool defaultPassiveWheelListenersAsDefaultOnDocument()
+{
+    static bool result = linkedOnOrAfter(WebCore::SDKVersion::FirstThatDefaultsToPassiveWheelListenersOnDocument);
+    return result;
+}
+
+#endif
+
 #if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
 
 bool defaultDisallowSyncXHRDuringPageDismissalEnabled()

Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h (269779 => 269780)


--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2020-11-13 16:46:42 UTC (rev 269780)
@@ -47,6 +47,10 @@
 #endif
 #endif
 
+#if PLATFORM(MAC)
+bool defaultPassiveWheelListenersAsDefaultOnDocument();
+#endif
+
 #if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
 bool defaultDisallowSyncXHRDuringPageDismissalEnabled();
 #endif

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (269779 => 269780)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-11-13 16:46:42 UTC (rev 269780)
@@ -1,3 +1,23 @@
+2020-11-12  Simon Fraser  <[email protected]>
+
+        Force wheel event listeners on the root to be passive
+        https://bugs.webkit.org/show_bug.cgi?id=218842
+        <rdar://problem/71312668>
+
+        Reviewed by Chris Dumez.
+
+        Following Blink (https://www.chromestatus.com/feature/6662647093133312) force 'wheel' and
+        'mousewheel' event listeners on root objects (window, document and body) to be passive if
+        they were not explicitly registered as non-passive.
+
+        This behavior is controlled by an experimental feature flag, and a linked-on-or-after check
+        to avoid changing behavior for apps that embed WebKit until they link against new SDKs.
+
+        * WebView/WebPreferencesDefaultValues.h:
+        * WebView/WebPreferencesDefaultValues.mm:
+        (WebKit::defaultPassiveTouchListenersAsDefaultOnDocument):
+        (WebKit::defaultPassiveWheelListenersAsDefaultOnDocument):
+
 2020-11-12  Sam Weinig  <[email protected]>
 
         Move more WebKitLegacy specific settings usage to WebPreferences.yaml

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h (269779 => 269780)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h	2020-11-13 16:46:42 UTC (rev 269780)
@@ -82,4 +82,8 @@
 bool defaultAllowRunningOfInsecureContent();
 bool defaultShouldConvertInvalidURLsToBlank();
 
+#if PLATFORM(MAC)
+bool defaultPassiveWheelListenersAsDefaultOnDocument();
+#endif
+
 } // namespace WebKit

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm (269779 => 269780)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm	2020-11-13 16:08:14 UTC (rev 269779)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm	2020-11-13 16:46:42 UTC (rev 269780)
@@ -132,7 +132,8 @@
 
 bool defaultPassiveTouchListenersAsDefaultOnDocument()
 {
-    return linkedOnOrAfter(WebCore::SDKVersion::FirstThatDefaultsToPassiveTouchListenersOnDocument);
+    static bool result = linkedOnOrAfter(WebCore::SDKVersion::FirstThatDefaultsToPassiveTouchListenersOnDocument);
+    return result;
 }
 
 bool defaultRequiresUserGestureToLoadVideo()
@@ -282,4 +283,14 @@
     return shouldConvertInvalidURLsToBlank;
 }
 
+#if PLATFORM(MAC)
+
+bool defaultPassiveWheelListenersAsDefaultOnDocument()
+{
+    static bool result = linkedOnOrAfter(WebCore::SDKVersion::FirstThatDefaultsToPassiveWheelListenersOnDocument);
+    return result;
+}
+
+#endif
+
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to