Bug 208654

Summary: When using the scrolling thread, push ScrollingNodeIDs onto PlatformCALayers
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: ScrollingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarcelo, esprehn+autocc, ews-watchlist, fred.wang, glenn, jamesr, koivisto, kondapallykalyan, luiz, pdr, sergio, simon.fraser, tonikitoo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch koivisto: review+

Description Simon Fraser (smfr) 2020-03-05 10:39:29 PST
When using the scrolling thread, push ScrollingNodeIDs onto PlatformCALayers
Comment 1 Simon Fraser (smfr) 2020-03-05 10:43:19 PST
Created attachment 392597 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2020-03-05 10:43:57 PST
<rdar://problem/60090331>
Comment 3 Antti Koivisto 2020-03-05 11:09:24 PST
Comment on attachment 392597 [details]
Patch

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

Still r+ to keep things moving.

> Source/WebCore/ChangeLog:12
> +        We only need one ScrollingNodeID per platform layer, since a given platform layer only
> +        ever has one scrolling role.

I don't think this is true. Specifically a single layer can meaningfully have both ViewportConstrained and Positioning roles and the scrolling tree code deals with this.
Comment 4 Antti Koivisto 2020-03-05 11:13:49 PST
We create a ScrollingTreePositionedNode with a ScrollingTreeFixedNode as its child in this case, both pointing to the same layer.

See this code in ScrollingTreeFixedNode::applyLayerPositions() dealing with it:

            if (is<ScrollingTreePositionedNode>(*ancestor)) {
                auto& positioningAncestor = downcast<ScrollingTreePositionedNode>(*ancestor);
                // See if sticky node already handled this positioning node.
                // FIXME: Include positioning node information to sticky/fixed node to avoid these tests.
                if (lastStickyNode && lastStickyNode->layer() == positioningAncestor.layer())
                    continue;
                if (positioningAncestor.layer() != m_layer)
                    overflowScrollDelta -= positioningAncestor.scrollDeltaSinceLastCommit();
                continue;
            }
Comment 5 Simon Fraser (smfr) 2020-03-05 14:38:04 PST
(In reply to Antti Koivisto from comment #4)
> We create a ScrollingTreePositionedNode with a ScrollingTreeFixedNode as its
> child in this case, both pointing to the same layer.
> 
> See this code in ScrollingTreeFixedNode::applyLayerPositions() dealing with
> it:
> 
>             if (is<ScrollingTreePositionedNode>(*ancestor)) {
>                 auto& positioningAncestor =
> downcast<ScrollingTreePositionedNode>(*ancestor);
>                 // See if sticky node already handled this positioning node.
>                 // FIXME: Include positioning node information to
> sticky/fixed node to avoid these tests.
>                 if (lastStickyNode && lastStickyNode->layer() ==
> positioningAncestor.layer())
>                     continue;
>                 if (positioningAncestor.layer() != m_layer)
>                     overflowScrollDelta -=
> positioningAncestor.scrollDeltaSinceLastCommit();
>                 continue;
>             }

True, but for the purposes of overflow scroll hit-testing I don't care about fixed and positioned nodes.
Comment 6 Simon Fraser (smfr) 2020-03-05 14:59:13 PST
https://trac.webkit.org/changeset/257949/webkit