Bug 211895 - [Wheel event region] Invalidation when changing listeners on elements
Summary: [Wheel event region] Invalidation when changing listeners on elements
Alias: None
Product: WebKit
Classification: Unclassified
Component: Compositing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2020-05-14 07:47 PDT by Antti Koivisto
Modified: 2020-05-15 07:00 PDT (History)
13 users (show)

See Also:

patch (12.68 KB, patch)
2020-05-14 08:48 PDT, Antti Koivisto
simon.fraser: review+
Details | Formatted Diff | Diff
patch (13.43 KB, patch)
2020-05-15 06:32 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2020-05-14 07:47:08 PDT
Listener changes should update the region.
Comment 1 Antti Koivisto 2020-05-14 08:48:18 PDT
Created attachment 399362 [details]
Comment 2 Simon Fraser (smfr) 2020-05-14 10:57:39 PDT
Comment on attachment 399362 [details]

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

> LayoutTests/fast/scrolling/mac/wheel-event-listener-region-element-invalidation.html:20
> +

extra line

> LayoutTests/fast/scrolling/mac/wheel-event-listener-region-element-invalidation.html:29
> +    function listener() {
> +        results.textContent += 'wheel\n';
> +    }

This is never called, right? It could be an empty function.

> LayoutTests/fast/scrolling/mac/wheel-event-listener-region-element-invalidation.html:33
> +    if (window.internals)
> +        results.textContent += internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION | internals.LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES);

Beware of setting element contents here then fetching layers again later; layout will change making the two trees hard to compare.

I prefer to store the first layer tree in a variable then set textContent once at the end.

> LayoutTests/fast/scrolling/mac/wheel-event-listener-region-element-invalidation.html:36
> +    passive.addEventListener('wheel', () => { results.textContent += 'passive wheel\n' }, { passive: true });


> Source/WebCore/rendering/RenderLayer.cpp:-6973
> -    // FIXME: This should not be conditioned on PLATFORM(IOS_FAMILY). See <https://webkit.org/b/210216>.

Can https://webkit.org/b/210216 be closed after this?

> Source/WebCore/rendering/RenderLayer.cpp:6973

This doesn't feel like quite the right #ifdef; isn't it also if we have touch events or editable regions?
Comment 3 Antti Koivisto 2020-05-15 04:23:57 PDT
> This doesn't feel like quite the right #ifdef; isn't it also if we have
> touch events or editable regions?

It doesn't, but it is the #ifdef currently used for RenderLayerBacking::updateEventRegion and this should match.
Comment 4 Antti Koivisto 2020-05-15 06:32:09 PDT
Created attachment 399474 [details]
Comment 5 EWS 2020-05-15 06:59:20 PDT
Committed r261742: <https://trac.webkit.org/changeset/261742>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 399474 [details].
Comment 6 Radar WebKit Bug Importer 2020-05-15 07:00:18 PDT