Bug 216031 - EventRegion paint should respect layer's foreground and background painting phases
Summary: EventRegion paint should respect layer's foreground and background painting p...
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: 2020-09-01 03:19 PDT by Antti Koivisto
Modified: 2020-09-01 10:48 PDT (History)
8 users (show)

See Also:


Attachments
patch (15.16 KB, patch)
2020-09-01 03:31 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-09-01 03:19:00 PDT
We are currently painting event region for the box background to the foreground layer.
Comment 1 Antti Koivisto 2020-09-01 03:19:26 PDT
<rdar://problem/67282372>
Comment 2 Antti Koivisto 2020-09-01 03:31:25 PDT
Created attachment 407668 [details]
patch
Comment 3 Simon Fraser (smfr) 2020-09-01 09:35:14 PDT
Comment on attachment 407668 [details]
patch

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

> Source/WebCore/rendering/RenderBlock.cpp:1140
> +        if (paintInfo.eventRegionContext)
> +            paintInfoForChild.paintBehavior.add(PaintBehavior::EventRegionIncludeBackground);

This is pretty weird. I wish event region painting followed normal painting more closely.

> Source/WebCore/rendering/RenderLayer.cpp:4654
> +            paintBehavior = paintBehavior & PaintBehavior::CompositedOverflowScrollContent;

I know you moved this and I added it in r262337 but I don't understand it.
Comment 4 Simon Fraser (smfr) 2020-09-01 09:37:56 PDT
Comment on attachment 407668 [details]
patch

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

>> Source/WebCore/rendering/RenderBlock.cpp:1140
>> +            paintInfoForChild.paintBehavior.add(PaintBehavior::EventRegionIncludeBackground);
> 
> This is pretty weird. I wish event region painting followed normal painting more closely.

Maybe leave it alone so I can decipher it without too many history jumps.
Comment 5 Antti Koivisto 2020-09-01 09:41:31 PDT
> > Source/WebCore/rendering/RenderBlock.cpp:1140
> > +        if (paintInfo.eventRegionContext)
> > +            paintInfoForChild.paintBehavior.add(PaintBehavior::EventRegionIncludeBackground);
> 
> This is pretty weird. I wish event region painting followed normal painting
> more closely.

It basically just does the same thing the code next to it does with paint phases:

newPhase = (newPhase == PaintPhase::ChildBlockBackgrounds) ? PaintPhase::ChildBlockBackground : newPhase;

(ChildBlockBackgrounds vs ChildBlockBackground is bit subtle)

> I know you moved this and I added it in r262337 but I don't understand it.

I suppose the other flags are not relevant for event regions?
Comment 6 EWS 2020-09-01 10:48:42 PDT
Committed r266403: <https://trac.webkit.org/changeset/266403>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407668 [details].