RESOLVED FIXED 218842
Force wheel event listeners on the root to be passive
https://bugs.webkit.org/show_bug.cgi?id=218842
Summary Force wheel event listeners on the root to be passive
Simon Fraser (smfr)
Reported 2020-11-11 21:24:44 PST
Follow Chrome: https://www.chromestatus.com/feature/6662647093133312 https://developers.google.com/web/updates/2019/02/scrolling-intervention and make wheel/mousewheel event listeners registered on the window/document/body to be passive, as we do for touch listeners.
Attachments
Patch (22.64 KB, patch)
2020-11-12 16:56 PST, Simon Fraser (smfr)
cdumez: review+
ews-feeder: commit-queue-
Patch (24.55 KB, patch)
2020-11-12 19:28 PST, Simon Fraser (smfr)
ews-feeder: commit-queue-
Patch (24.55 KB, patch)
2020-11-12 20:26 PST, Simon Fraser (smfr)
ews-feeder: commit-queue-
Radar WebKit Bug Importer
Comment 1 2020-11-11 21:25:21 PST
Simon Fraser (smfr)
Comment 2 2020-11-12 16:56:32 PST
Chris Dumez
Comment 3 2020-11-12 17:10:05 PST
Comment on attachment 413985 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=413985&action=review r=me with nits > Source/WebCore/page/Quirks.cpp:818 > + if (is<DOMWindow>(eventTarget)) I believe can can simply do: return downcast<Document>(eventTarget.scriptExecutionContext()); since we know here to EventTarget is a Window or a Node, and thus its script execution context has to be a Document. > LayoutTests/fast/events/wheel/wheel-event-listeners-on-body-made-passive.html:26 > + event.preventDefault(); In these tests, I would recommend checking event.defaultPrevented after calling preventDefault(). This is the easiest way to check if we are passive.
Simon Fraser (smfr)
Comment 4 2020-11-12 19:28:58 PST
Simon Fraser (smfr)
Comment 5 2020-11-12 20:26:52 PST
Simon Fraser (smfr)
Comment 6 2020-11-13 10:40:56 PST
Note You need to log in before you can comment on or make changes to this bug.