[webkit-reviews] review granted: [Bug 218842] Force wheel event listeners on the root to be passive : [Attachment 413985] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 12 17:10:05 PST 2020


Chris Dumez <cdumez at apple.com> has granted Simon Fraser (smfr)
<simon.fraser at apple.com>'s request for review:
Bug 218842: Force wheel event listeners on the root to be passive
https://bugs.webkit.org/show_bug.cgi?id=218842

Attachment 413985: Patch

https://bugs.webkit.org/attachment.cgi?id=413985&action=review




--- Comment #3 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 413985
  --> https://bugs.webkit.org/attachment.cgi?id=413985
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:2
6
> +		   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.


More information about the webkit-reviews mailing list