[webkit-reviews] review granted: [Bug 211512] Add basic support for generating accurate wheel event listener region : [Attachment 398614] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 6 08:11:18 PDT 2020


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Antti Koivisto
<koivisto at iki.fi>'s request for review:
Bug 211512: Add basic support for generating accurate wheel event listener
region
https://bugs.webkit.org/show_bug.cgi?id=211512

Attachment 398614: patch

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




--- Comment #3 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 398614
  --> https://bugs.webkit.org/attachment.cgi?id=398614
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398614&action=review

> Source/WebCore/rendering/style/StyleRareInheritedData.h:158
> +    unsigned eventListenerRegionTypes : 2; //
OptionSet<EventListenerRegionType>

It's going to be really easy to forgot to change this when we add more
EventListenerRegionType bits. I think maybe just eat the 8 bits right now, or
add a compile-time assert that things will fit.

> Source/WebCore/style/StyleAdjuster.cpp:219
> +    auto findListeners = [&](auto eventName, auto type, auto nonPassiveType)
{
> +	   auto* eventListenerVector =
element.eventTargetData()->eventListenerMap.find(eventName);
> +	   if (!eventListenerVector)
> +	       return;
> +
> +	   types.add(type);
> +
> +	   bool passiveOnly = true;
> +	   for (auto& listener : *eventListenerVector) {
> +	       if (!listener->isPassive())
> +		   passiveOnly = false;
> +	   }
> +
> +	   if (!passiveOnly)
> +	       types.add(nonPassiveType);
> +    };

Maybe this should be a function on Element


More information about the webkit-reviews mailing list