Bug 195902 - Update event region when toggling pointer-events:none
Summary: Update event region when toggling pointer-events:none
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Scrolling (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-03-18 12:14 PDT by Antti Koivisto
Modified: 2019-04-01 12:53 PDT (History)
3 users (show)

See Also:


Attachments
patch (6.95 KB, patch)
2019-04-01 10:41 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (8.06 KB, patch)
2019-04-01 11:00 PDT, Antti Koivisto
simon.fraser: review+
Details | Formatted Diff | Diff
patch (8.05 KB, patch)
2019-04-01 11:07 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 2019-03-18 12:14:31 PDT
Simon in bug 195378:

In fact, this might break now with something like:

  <div class="composited"><div id="child"></div>

and dynamic toggle of "pointer-events" style on child. That won't issue a repaint (hopefully) and won't update event regions.
Comment 1 Radar WebKit Bug Importer 2019-03-18 12:15:35 PDT
<rdar://problem/48988384>
Comment 2 Antti Koivisto 2019-04-01 10:41:08 PDT
Created attachment 366403 [details]
patch
Comment 3 Antti Koivisto 2019-04-01 11:00:42 PDT
Created attachment 366406 [details]
patch
Comment 4 Simon Fraser (smfr) 2019-04-01 11:01:14 PDT
Comment on attachment 366403 [details]
patch

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

> Source/WebCore/ChangeLog:12
> +        Normally paint invalidation requests compositing configuration update whenever anything that would
> +        affect event region changes. However mutating 'pointer-events' property does not cause paint invalidation.

Maybe RenderStyle::diff should return an enum value that indicates that event regions are dirty?

> Source/WebCore/rendering/RenderElement.cpp:737
> +            if (layer && (layer = layer->enclosingCompositingLayerForRepaint()))
> +                layer->setNeedsCompositingConfigurationUpdate();

It's non-obvious that setNeedsCompositingConfigurationUpdate is what you call to get event regions to be recomputed. We should clean that up in future.
Comment 5 Simon Fraser (smfr) 2019-04-01 11:01:50 PDT
Comment on attachment 366406 [details]
patch

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

> Source/WebCore/rendering/RenderLayer.cpp:6669
> +void RenderLayer::invalidateEventRegion()
> +{
> +    if (auto* compositingLayer = enclosingCompositingLayerForRepaint())
> +        compositingLayer->setNeedsCompositingConfigurationUpdate();
> +}

Heh ok.
Comment 6 Antti Koivisto 2019-04-01 11:07:01 PDT
Created attachment 366407 [details]
patch
Comment 7 Antti Koivisto 2019-04-01 12:46:55 PDT
> Maybe RenderStyle::diff should return an enum value that indicates that
> event regions are dirty?

I considered it, but it wasn't obvious how it would be better than just doing this.
Comment 8 Antti Koivisto 2019-04-01 12:47:55 PDT
Maybe that's a good approach if this turns of to be more than a single property thing.
Comment 9 WebKit Commit Bot 2019-04-01 12:53:06 PDT
Comment on attachment 366407 [details]
patch

Clearing flags on attachment: 366407

Committed r243709: <https://trac.webkit.org/changeset/243709>
Comment 10 WebKit Commit Bot 2019-04-01 12:53:08 PDT
All reviewed patches have been landed.  Closing bug.