Changeset 246725 in webkit


Ignore:
Timestamp:
Jun 23, 2019 8:09:40 PM (5 years ago)
Author:
Simon Fraser
Message:

[Async overflow scroll] Clipped composited layers inside overflow scroll jitter and get incorrectly clipped
https://bugs.webkit.org/show_bug.cgi?id=199133
rdar://problem/43614439

Reviewed by Antti Koivisto.
Source/WebCore:

Currently a composited layer with an overflow:scroll ancestor (which is not a paint-order
ancestor) gets a single "ancestor clip layer" that represents the intersection of all the
clips provided by its containing-block ancestors with non-visible overflow (both scrolling
and non-scrolling ones).

To correctly update clips with async overflow scroll, this single clip layer needs to be
broken up into multiple clipping ancestors. We need a separate layer, and scrolling tree
node for each ancestor that is an overflow scroll, and layers that represent non-moving
clips (i.e. overflow:hidden and 'clip') between them. This patch adds
LayerAncestorClippingStack to represent this stack of clipping layers. For example with the
following content:

<div style="overflow:hidden"> <--- A

<div style="overflow:scroll"> <--- B

<div style="overflow:hidden"> <--- C

<div style="overflow:hidden"> <--- D

<div style="overflow:scroll"> <--- E

<div style="overflow:hidden"> <--- F

<div style="overflow:hidden"> <--- G

<div></div> <--- H

<div>

<div>

<div>

<div>

<div>

<div>

<div>

the composited RenderLayer for H owns a LayerAncestorClippingStack with the following contents:

[clip - A]
[scroller - B]
[clip - intersection of C and D]
[scroller - E]
[clip - intersection of F and G]

Each stack entry has a 'masksToBounds' GraphicsLayer for clipping. Entries representing
overflow:scroll clips have a ScrollingNodeID for their OverflowScrollProxy scrolling tree
node (which references the actual OverflowScrollingNode). The non-scroller clips in this
stack are computed unconstrained by the enclosing overflow:scroll.

When the OverflowScrollingNode is scrolled, the boundsOrigin of related OverflowScrollProxy nodes
is adjusted to move the descendant layers (other clipping layers, or composited layers).

OverflowScrollProxy nodes thus take over the role that "Moves" ScrollingTreePositionedNode had.
With this patch, ScrollingTreePositionedNode are purely for absolute position inside non-containing-block
stacking context overflow scroll. LayoutConstraints is renamed to AbsolutePositionConstraints accordingly.

Tests: compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll.html

compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested.html
compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow.html
compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden.html
compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible.html
compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer.html
compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped.html
compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer.html
compositing/scrolling/async-overflow-scrolling/layer-in-overflow.html
scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested.html
scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow.html

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • page/scrolling/AsyncScrollingCoordinator.cpp:

(WebCore::AsyncScrollingCoordinator::setPositionedNodeConstraints):
(WebCore::AsyncScrollingCoordinator::setPositionedNodeGeometry): Deleted.

  • page/scrolling/AsyncScrollingCoordinator.h:
  • page/scrolling/ScrollingConstraints.cpp:

(WebCore::operator<<):

  • page/scrolling/ScrollingConstraints.h:

(WebCore::AbsolutePositionConstraints::operator== const):
(WebCore::AbsolutePositionConstraints::operator!= const):
(WebCore::LayoutConstraints::operator== const): Deleted.
(WebCore::LayoutConstraints::operator!= const): Deleted.
(WebCore::LayoutConstraints::alignmentOffset const): Deleted.
(WebCore::LayoutConstraints::setAlignmentOffset): Deleted.
(WebCore::LayoutConstraints::layerPositionAtLastLayout const): Deleted.
(WebCore::LayoutConstraints::setLayerPositionAtLastLayout): Deleted.
(WebCore::LayoutConstraints::scrollPositioningBehavior const): Deleted.
(WebCore::LayoutConstraints::setScrollPositioningBehavior): Deleted.

  • page/scrolling/ScrollingCoordinator.h:

(WebCore::ScrollingCoordinator::setPositionedNodeConstraints):
(WebCore::ScrollingCoordinator::setPositionedNodeGeometry): Deleted.

  • page/scrolling/ScrollingStatePositionedNode.cpp:

(WebCore::ScrollingStatePositionedNode::updateConstraints):

  • page/scrolling/ScrollingStatePositionedNode.h:
  • page/scrolling/ScrollingTree.cpp:

(WebCore::ScrollingTree::commitTreeState):

  • page/scrolling/ScrollingTree.h:

(WebCore::ScrollingTree::nodesWithRelatedOverflow):
(WebCore::ScrollingTree::positionedNodesWithRelatedOverflow): Deleted.

  • page/scrolling/cocoa/ScrollingTreeFixedNode.mm:

(WebCore::ScrollingTreeFixedNode::applyLayerPositions):

  • page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:

(WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):

  • page/scrolling/cocoa/ScrollingTreePositionedNode.h:

(WebCore::ScrollingTreePositionedNode::scrollPositioningBehavior const): Deleted.

  • page/scrolling/cocoa/ScrollingTreePositionedNode.mm:

(WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
(WebCore::ScrollingTreePositionedNode::scrollDeltaSinceLastCommit const):

  • page/scrolling/cocoa/ScrollingTreeStickyNode.mm:

(WebCore::ScrollingTreeStickyNode::computeLayerPosition const):

  • rendering/LayerAncestorClippingStack.cpp: Added.

(WebCore::LayerAncestorClippingStack::LayerAncestorClippingStack):
(WebCore::LayerAncestorClippingStack::equalToClipData const):
(WebCore::LayerAncestorClippingStack::hasAnyScrollingLayers const):
(WebCore::LayerAncestorClippingStack::clear):
(WebCore::LayerAncestorClippingStack::detachFromScrollingCoordinator):
(WebCore::LayerAncestorClippingStack::firstClippingLayer const):
(WebCore::LayerAncestorClippingStack::lastClippingLayer const):
(WebCore::LayerAncestorClippingStack::lastOverflowScrollProxyNodeID const):
(WebCore::LayerAncestorClippingStack::updateScrollingNodeLayers):
(WebCore::LayerAncestorClippingStack::updateWithClipData):
(WebCore::operator<<):

  • rendering/LayerAncestorClippingStack.h: Added.

(WebCore::CompositedClipData::CompositedClipData):
(WebCore::CompositedClipData::operator== const):
(WebCore::CompositedClipData::operator!= const):
(WebCore::LayerAncestorClippingStack::stack):
(WebCore::LayerAncestorClippingStack::stack const):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::~RenderLayerBacking):
(WebCore::RenderLayerBacking::updateDebugIndicators):
(WebCore::RenderLayerBacking::destroyGraphicsLayers):
(WebCore::RenderLayerBacking::updateTransform):
(WebCore::RenderLayerBacking::updateBlendMode):
(WebCore::RenderLayerBacking::updateAfterLayout):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::computeOffsetFromAncestorGraphicsLayer):
(WebCore::RenderLayerBacking::computePrimaryGraphicsLayerRect const):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateInternalHierarchy):
(WebCore::RenderLayerBacking::updateAncestorClippingStack):
(WebCore::RenderLayerBacking::updateAncestorClipping):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
(WebCore::RenderLayerBacking::scrollingNodeIDForChildren const):
(WebCore::RenderLayerBacking::childForSuperlayers const):
(WebCore::RenderLayerBacking::backingStoreMemoryEstimate const):
(WebCore::operator<<):
(WebCore::RenderLayerBacking::updateAncestorClippingLayer): Deleted.
(WebCore::RenderLayerBacking::coordinatedScrollingRoles const): Deleted.

  • rendering/RenderLayerBacking.h:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::layerStyleChanged): We need to run the checks for changed
clipping whether or not this layer has backing, because a non-composited layer with clipping can be
represented in the clipping stack of some other layer.
(WebCore::RenderLayerCompositor::clippedByAncestor const):
(WebCore::RenderLayerCompositor::updateAncestorClippingStack const):
(WebCore::RenderLayerCompositor::computeAncestorClippingStack const): The output of this function
is a Vector<CompositedClipData> which represents the ancestor clipping stack, but without the proxy node
and GraphicsLayer information. It's input to LayerAncestorClippingStack::updateWithClipData() which does
the merging of old and new states.
(WebCore::collectRelatedCoordinatedScrollingNodes):
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
(WebCore::scrollCoordinationRoleForNodeType):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::registerScrollingNodeID):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::coordinatedScrollingRolesForLayer const): Code moved from RenderLayerBacking.
(WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingProxyRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):

  • rendering/RenderLayerCompositor.h:

(WebCore::allScrollCoordinationRoles):

Source/WebKit:

LayoutConstraints -> AbsolutePositionConstraints rename.

  • Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:

(ArgumentCoder<ScrollingStatePositionedNode>::decode):

  • Shared/WebCoreArgumentCoders.cpp:

(IPC::ArgumentCoder<AbsolutePositionConstraints>::encode):
(IPC::ArgumentCoder<AbsolutePositionConstraints>::decode):
(IPC::ArgumentCoder<LayoutConstraints>::encode): Deleted.
(IPC::ArgumentCoder<LayoutConstraints>::decode): Deleted.

  • Shared/WebCoreArgumentCoders.h:
  • Shared/WebRenderLayer.cpp:

(WebKit::WebRenderLayer::WebRenderLayer):

  • UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:

(WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations): ScrollingTreeOverflowScrollProxyNode
have overflow scroll relations now too.

LayoutTests:

New baselines for:

  • clipping layers no longer have offsetFromRenderer(), which they didn't need.
  • positioned nodes don't print scrollBehavior (they are always "Stationary")
  • "Moves" positioned nodes are replaced with overflow scroll proxy nodes
  • compositing/backing/backing-store-attachment-empty-keyframe-expected.txt:
  • compositing/geometry/clip-expected.txt:
  • compositing/geometry/clip-inside-expected.txt:
  • compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt:
  • compositing/layer-creation/clipping-scope/nested-scroller-overlap-expected.txt:
  • compositing/layer-creation/clipping-scope/nested-scroller-overlap.html:
  • compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller-expected.txt:
  • compositing/layer-creation/clipping-scope/scroller-with-negative-z-children-expected.txt:
  • compositing/overflow/clip-descendents-expected.txt:
  • compositing/overflow/scrolling-content-clip-to-viewport-expected.txt:
  • compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
  • compositing/rtl/rtl-scrolling-with-transformed-descendants.html:
  • compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll-expected.txt: Added.
  • compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll.html: Added.
  • compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-expected.txt: Added.
  • compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested-expected.txt: Added.
  • compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested.html: Added.
  • compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow.html: Added.
  • compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden-expected.txt: Added.
  • compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden.html: Added.
  • compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible-expected.txt: Added.
  • compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible.html: Added.
  • compositing/scrolling/async-overflow-scrolling/layer-in-overflow-expected.txt: Added.
  • compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer-expected.txt: Added.
  • compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer.html: Added.
  • compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped-expected.txt: Added.
  • compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped.html: Added.
  • compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer-expected.txt: Added.
  • compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer.html: Added.
  • compositing/scrolling/async-overflow-scrolling/layer-in-overflow.html: Added.
  • compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt:
  • compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt:
  • compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html:
  • platform/ios-wk2/compositing/layer-creation/clipping-scope/nested-scroller-overlap-expected.txt:
  • platform/ios-wk2/compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller-expected.txt:
  • platform/ios-wk2/compositing/layer-creation/clipping-scope/scroller-with-negative-z-children-expected.txt:
  • platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll-expected.txt: Added.
  • platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-expected.txt: Added.
  • platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested-expected.txt: Added.
  • platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden-expected.txt: Added.
  • platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible-expected.txt: Added.
  • platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-expected.txt: Added.
  • platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer-expected.txt: Added.
  • platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped-expected.txt: Added.
  • platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer-expected.txt: Added.
  • platform/ios-wk2/compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt:
  • platform/ios-wk2/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-expected.txt: Copied from LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt.
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested-expected.txt: Copied from LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt.
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt:
  • platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt:
  • platform/ios/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
  • scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers-expected.txt:
  • scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt:
  • scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-expected.txt: Copied from LayoutTests/scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt.
  • scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested-expected.txt: Copied from LayoutTests/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt.
  • scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested.html: Added.
  • scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow.html: Added.
  • scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt:
  • scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt:
  • scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt:
  • scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
  • scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt:
  • scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt:
  • scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt:
  • scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt:
Location:
trunk
Files:
32 added
77 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r246721 r246725  
     12019-06-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [Async overflow scroll] Clipped composited layers inside overflow scroll jitter and get incorrectly clipped
     4        https://bugs.webkit.org/show_bug.cgi?id=199133
     5        rdar://problem/43614439
     6
     7        Reviewed by Antti Koivisto.
     8       
     9        New baselines for:
     10        - clipping layers no longer have offsetFromRenderer(), which they didn't need.
     11        - positioned nodes don't print scrollBehavior (they are always "Stationary")
     12        - "Moves" positioned nodes are replaced with overflow scroll proxy nodes
     13
     14        * compositing/backing/backing-store-attachment-empty-keyframe-expected.txt:
     15        * compositing/geometry/clip-expected.txt:
     16        * compositing/geometry/clip-inside-expected.txt:
     17        * compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt:
     18        * compositing/layer-creation/clipping-scope/nested-scroller-overlap-expected.txt:
     19        * compositing/layer-creation/clipping-scope/nested-scroller-overlap.html:
     20        * compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller-expected.txt:
     21        * compositing/layer-creation/clipping-scope/scroller-with-negative-z-children-expected.txt:
     22        * compositing/overflow/clip-descendents-expected.txt:
     23        * compositing/overflow/scrolling-content-clip-to-viewport-expected.txt:
     24        * compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
     25        * compositing/rtl/rtl-scrolling-with-transformed-descendants.html:
     26        * compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll-expected.txt: Added.
     27        * compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll.html: Added.
     28        * compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-expected.txt: Added.
     29        * compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested-expected.txt: Added.
     30        * compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested.html: Added.
     31        * compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow.html: Added.
     32        * compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden-expected.txt: Added.
     33        * compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden.html: Added.
     34        * compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible-expected.txt: Added.
     35        * compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible.html: Added.
     36        * compositing/scrolling/async-overflow-scrolling/layer-in-overflow-expected.txt: Added.
     37        * compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer-expected.txt: Added.
     38        * compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer.html: Added.
     39        * compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped-expected.txt: Added.
     40        * compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped.html: Added.
     41        * compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer-expected.txt: Added.
     42        * compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer.html: Added.
     43        * compositing/scrolling/async-overflow-scrolling/layer-in-overflow.html: Added.
     44        * compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt:
     45        * compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt:
     46        * compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html:
     47        * platform/ios-wk2/compositing/layer-creation/clipping-scope/nested-scroller-overlap-expected.txt:
     48        * platform/ios-wk2/compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller-expected.txt:
     49        * platform/ios-wk2/compositing/layer-creation/clipping-scope/scroller-with-negative-z-children-expected.txt:
     50        * platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll-expected.txt: Added.
     51        * platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-expected.txt: Added.
     52        * platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested-expected.txt: Added.
     53        * platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden-expected.txt: Added.
     54        * platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible-expected.txt: Added.
     55        * platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-expected.txt: Added.
     56        * platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer-expected.txt: Added.
     57        * platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped-expected.txt: Added.
     58        * platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer-expected.txt: Added.
     59        * platform/ios-wk2/compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt:
     60        * platform/ios-wk2/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt:
     61        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers-expected.txt:
     62        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt:
     63        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-expected.txt: Copied from LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt.
     64        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested-expected.txt: Copied from LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt.
     65        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt:
     66        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt:
     67        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt:
     68        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
     69        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt:
     70        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt:
     71        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt:
     72        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt:
     73        * platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt:
     74        * platform/ios/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
     75        * scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers-expected.txt:
     76        * scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt:
     77        * scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-expected.txt: Copied from LayoutTests/scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt.
     78        * scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested-expected.txt: Copied from LayoutTests/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt.
     79        * scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested.html: Added.
     80        * scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow.html: Added.
     81        * scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt:
     82        * scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt:
     83        * scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt:
     84        * scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
     85        * scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt:
     86        * scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt:
     87        * scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt:
     88        * scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt:
     89
    1902019-06-23  Antoine Quint  <graouts@apple.com>
    291
  • trunk/LayoutTests/compositing/backing/backing-store-attachment-empty-keyframe-expected.txt

    r244800 r246725  
    1010      (children 1
    1111        (GraphicsLayer
    12           (offsetFromRenderer width=-501 height=0)
    1312          (position 9.00 101.00)
    1413          (bounds 501.00 150.00)
  • trunk/LayoutTests/compositing/geometry/clip-expected.txt

    r225897 r246725  
    1717        )
    1818        (GraphicsLayer
    19           (offsetFromRenderer width=5 height=5)
    2019          (position 215.00 15.00)
    2120          (bounds 110.00 110.00)
  • trunk/LayoutTests/compositing/geometry/clip-inside-expected.txt

    r225897 r246725  
    1818        )
    1919        (GraphicsLayer
    20           (offsetFromRenderer width=15 height=25)
    2120          (position 225.00 35.00)
    2221          (bounds 90.00 80.00)
  • trunk/LayoutTests/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt

    r245170 r246725  
    2323        )
    2424        (GraphicsLayer
    25           (offsetFromRenderer width=0 height=100)
    2625          (position 28.00 250.00)
    2726          (bounds 185.00 200.00)
  • trunk/LayoutTests/compositing/layer-creation/clipping-scope/nested-scroller-overlap-expected.txt

    r245602 r246725  
    22  (anchor 0.00 0.00)
    33  (bounds 800.00 600.00)
     4  (clips 1)
    45  (children 1
    56    (GraphicsLayer
     
    1617              (position 1.00 1.00)
    1718              (bounds 385.00 350.00)
     19              (clips 1)
    1820              (children 1
    1921                (GraphicsLayer
     
    3234                          (position 1.00 1.00)
    3335                          (bounds 285.00 200.00)
     36                          (clips 1)
    3437                          (children 1
    3538                            (GraphicsLayer
     
    5053        )
    5154        (GraphicsLayer
    52           (offsetFromRenderer width=-10 height=-10)
    5355          (position 24.00 106.00)
    5456          (bounds 385.00 350.00)
     57          (clips 1)
    5558          (children 1
    5659            (GraphicsLayer
     
    6669        )
    6770        (GraphicsLayer
    68           (offsetFromRenderer width=-10 height=-10)
    69           (position 45.00 217.00)
    70           (bounds 285.00 200.00)
     71          (position 24.00 106.00)
     72          (bounds 385.00 350.00)
     73          (clips 1)
    7174          (children 1
    7275            (GraphicsLayer
    73               (position 10.00 10.00)
    74               (bounds 100.00 80.00)
    75               (contentsOpaque 1)
     76              (position 21.00 111.00)
     77              (bounds 285.00 200.00)
     78              (clips 1)
     79              (children 1
     80                (GraphicsLayer
     81                  (position 10.00 10.00)
     82                  (bounds 100.00 80.00)
     83                  (contentsOpaque 1)
     84                )
     85              )
    7686            )
    7787          )
    7888        )
    7989        (GraphicsLayer
    80           (offsetFromRenderer width=-10 height=-100)
    81           (position 45.00 217.00)
    82           (bounds 285.00 200.00)
     90          (position 24.00 106.00)
     91          (bounds 385.00 350.00)
     92          (clips 1)
    8393          (children 1
    8494            (GraphicsLayer
    85               (position 10.00 100.00)
    86               (bounds 100.00 80.00)
    87               (contentsOpaque 1)
     95              (position 21.00 111.00)
     96              (bounds 285.00 200.00)
     97              (clips 1)
     98              (children 1
     99                (GraphicsLayer
     100                  (position 10.00 100.00)
     101                  (bounds 100.00 80.00)
     102                  (contentsOpaque 1)
     103                )
     104              )
    88105            )
    89106          )
    90107        )
    91108        (GraphicsLayer
    92           (offsetFromRenderer width=-10 height=-190)
    93           (position 45.00 217.00)
    94           (bounds 285.00 200.00)
     109          (position 24.00 106.00)
     110          (bounds 385.00 350.00)
     111          (clips 1)
    95112          (children 1
    96113            (GraphicsLayer
    97               (position 10.00 190.00)
    98               (bounds 100.00 80.00)
    99               (contentsOpaque 1)
     114              (position 21.00 111.00)
     115              (bounds 285.00 200.00)
     116              (clips 1)
     117              (children 1
     118                (GraphicsLayer
     119                  (position 10.00 190.00)
     120                  (bounds 100.00 80.00)
     121                  (contentsOpaque 1)
     122                )
     123              )
    100124            )
    101125          )
  • trunk/LayoutTests/compositing/layer-creation/clipping-scope/nested-scroller-overlap.html

    r245602 r246725  
    5050                window.addEventListener('load', () => {
    5151                        if (window.testRunner)
    52                                 document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
     52                                document.getElementById('layers').innerText = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_CLIPPING);
    5353                }, false);
    5454        </script>
  • trunk/LayoutTests/compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller-expected.txt

    r245602 r246725  
    2727        )
    2828        (GraphicsLayer
    29           (offsetFromRenderer width=-10 height=-10)
    3029          (position 9.00 9.00)
    3130          (bounds 285.00 300.00)
     
    3938        )
    4039        (GraphicsLayer
    41           (offsetFromRenderer width=-40 height=-20)
    4240          (position 9.00 9.00)
    4341          (bounds 285.00 300.00)
     
    5149        )
    5250        (GraphicsLayer
    53           (offsetFromRenderer width=-40 height=-140)
    5451          (position 9.00 9.00)
    5552          (bounds 285.00 300.00)
     
    6360        )
    6461        (GraphicsLayer
    65           (offsetFromRenderer width=-40 height=-260)
    6662          (position 9.00 9.00)
    6763          (bounds 285.00 300.00)
  • trunk/LayoutTests/compositing/layer-creation/clipping-scope/scroller-with-negative-z-children-expected.txt

    r245602 r246725  
    2727        )
    2828        (GraphicsLayer
    29           (offsetFromRenderer width=-10 height=-10)
    3029          (position 9.00 9.00)
    3130          (bounds 285.00 300.00)
     
    3938        )
    4039        (GraphicsLayer
    41           (offsetFromRenderer width=-40 height=-20)
    4240          (position 9.00 9.00)
    4341          (bounds 285.00 300.00)
     
    5149        )
    5250        (GraphicsLayer
    53           (offsetFromRenderer width=-40 height=-260)
    5451          (position 9.00 9.00)
    5552          (bounds 285.00 300.00)
  • trunk/LayoutTests/compositing/overflow/clip-descendents-expected.txt

    r225897 r246725  
    88      (children 4
    99        (GraphicsLayer
    10           (offsetFromRenderer width=-2 height=-12)
    1110          (position 48.00 38.00)
    1211          (bounds 60.00 70.00)
     
    2120        )
    2221        (GraphicsLayer
    23           (offsetFromRenderer width=-2 height=-12)
    2422          (position 240.00 38.00)
    2523          (bounds 60.00 70.00)
  • trunk/LayoutTests/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt

    r243347 r246725  
    2222        )
    2323        (GraphicsLayer
    24           (offsetFromRenderer width=-10 height=-10)
    2524          (bounds 305.00 325.00)
    2625          (children 1
  • trunk/LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt

    r246538 r246725  
    33  (anchor 0.00 0.00)
    44  (bounds 800.00 600.00)
     5  (clips 1)
    56  (children 1
    67    (GraphicsLayer
     
    1819              (bounds origin 366.00 0.00)
    1920              (bounds 400.00 204.00)
     21              (clips 1)
    2022              (children 1
    2123                (GraphicsLayer
     
    3133        )
    3234        (GraphicsLayer
    33           (offsetFromRenderer width=-96 height=0)
    3435          (position 10.00 10.00)
     36          (bounds origin 366.00 0.00)
    3537          (bounds 400.00 204.00)
     38          (clips 1)
    3639          (children 1
    3740            (GraphicsLayer
    38               (position 96.00 0.00)
     41              (position 462.00 0.00)
    3942              (anchor 0.00 0.00)
    4043              (bounds 150.00 200.00)
     
    4447        )
    4548        (GraphicsLayer
    46           (offsetFromRenderer width=58 height=0)
    4749          (position 10.00 10.00)
     50          (bounds origin 366.00 0.00)
    4851          (bounds 400.00 204.00)
     52          (clips 1)
    4953          (children 1
    5054            (GraphicsLayer
    51               (position -58.00 0.00)
     55              (position 308.00 0.00)
    5256              (bounds 150.00 200.00)
    5357              (contentsOpaque 1)
  • trunk/LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants.html

    r244628 r246725  
    3131        function dumpLayers()
    3232        {
    33             document.getElementById('layertree').textContent = window.internals.layerTreeAsText(document);
     33            document.getElementById('layertree').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_CLIPPING);
    3434        }
    3535        window.addEventListener('load', dumpLayers, false);
  • trunk/LayoutTests/compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt

    r245170 r246725  
    2828        )
    2929        (GraphicsLayer
    30           (offsetFromRenderer width=-34 height=-134)
    3130          (position 10.00 10.00)
    3231          (bounds 385.00 400.00)
  • trunk/LayoutTests/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt

    r245170 r246725  
    22  (anchor 0.00 0.00)
    33  (bounds 800.00 600.00)
     4  (clips 1)
    45  (children 1
    56    (GraphicsLayer
     
    1516              (position 2.00 2.00)
    1617              (bounds 320.00 320.00)
     18              (clips 1)
    1719              (children 1
    1820                (GraphicsLayer
     
    2527                      (position 2.00 2.00)
    2628                      (bounds 281.00 296.00)
     29                      (clips 1)
    2730                      (children 1
    2831                        (GraphicsLayer
     
    4548        )
    4649        (GraphicsLayer
    47           (offsetFromRenderer width=-20 height=-20)
    48           (position 42.00 34.00)
    49           (bounds 281.00 296.00)
     50          (position 30.00 22.00)
     51          (bounds 320.00 320.00)
     52          (clips 1)
    5053          (children 1
    5154            (GraphicsLayer
    52               (position 20.00 20.00)
    53               (bounds 241.00 24.00)
    54               (drawsContent 1)
     55              (position 12.00 12.00)
     56              (bounds 281.00 296.00)
     57              (clips 1)
     58              (children 1
     59                (GraphicsLayer
     60                  (position 20.00 20.00)
     61                  (bounds 241.00 24.00)
     62                  (drawsContent 1)
     63                )
     64              )
    5565            )
    5666          )
  • trunk/LayoutTests/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html

    r245170 r246725  
    4848        window.addEventListener('load', () => {
    4949            if (window.internals)
    50                 document.getElementById('layers').textContent = internals.layerTreeAsText(document);
     50                document.getElementById('layers').textContent = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_CLIPPING);
    5151        }, false);
    5252    </script>
  • trunk/LayoutTests/legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe-expected.txt

    r244800 r246725  
    1010      (children 1
    1111        (GraphicsLayer
    12           (offsetFromRenderer width=-501 height=0)
    1312          (position 9.00 101.00)
    1413          (bounds 501.00 150.00)
  • trunk/LayoutTests/platform/ios-wk2/compositing/layer-creation/clipping-scope/nested-scroller-overlap-expected.txt

    r245602 r246725  
    22  (anchor 0.00 0.00)
    33  (bounds 800.00 600.00)
     4  (clips 1)
    45  (children 1
    56    (GraphicsLayer
     
    1617              (position 1.00 1.00)
    1718              (bounds 400.00 350.00)
     19              (clips 1)
    1820              (children 1
    1921                (GraphicsLayer
     
    3234                          (position 1.00 1.00)
    3335                          (bounds 300.00 200.00)
     36                          (clips 1)
    3437                          (children 1
    3538                            (GraphicsLayer
     
    5053        )
    5154        (GraphicsLayer
    52           (offsetFromRenderer width=-10 height=-10)
    5355          (position 24.00 106.00)
    5456          (bounds 400.00 350.00)
     57          (clips 1)
    5558          (children 1
    5659            (GraphicsLayer
     
    6669        )
    6770        (GraphicsLayer
    68           (offsetFromRenderer width=-10 height=-10)
    69           (position 45.00 217.00)
    70           (bounds 300.00 200.00)
     71          (position 24.00 106.00)
     72          (bounds 400.00 350.00)
     73          (clips 1)
    7174          (children 1
    7275            (GraphicsLayer
    73               (position 10.00 10.00)
    74               (bounds 100.00 80.00)
    75               (contentsOpaque 1)
     76              (position 21.00 111.00)
     77              (bounds 300.00 200.00)
     78              (clips 1)
     79              (children 1
     80                (GraphicsLayer
     81                  (position 10.00 10.00)
     82                  (bounds 100.00 80.00)
     83                  (contentsOpaque 1)
     84                )
     85              )
    7686            )
    7787          )
    7888        )
    7989        (GraphicsLayer
    80           (offsetFromRenderer width=-10 height=-100)
    81           (position 45.00 217.00)
    82           (bounds 300.00 200.00)
     90          (position 24.00 106.00)
     91          (bounds 400.00 350.00)
     92          (clips 1)
    8393          (children 1
    8494            (GraphicsLayer
    85               (position 10.00 100.00)
    86               (bounds 100.00 80.00)
    87               (contentsOpaque 1)
     95              (position 21.00 111.00)
     96              (bounds 300.00 200.00)
     97              (clips 1)
     98              (children 1
     99                (GraphicsLayer
     100                  (position 10.00 100.00)
     101                  (bounds 100.00 80.00)
     102                  (contentsOpaque 1)
     103                )
     104              )
    88105            )
    89106          )
    90107        )
    91108        (GraphicsLayer
    92           (offsetFromRenderer width=-10 height=-190)
    93           (position 45.00 217.00)
    94           (bounds 300.00 200.00)
     109          (position 24.00 106.00)
     110          (bounds 400.00 350.00)
     111          (clips 1)
    95112          (children 1
    96113            (GraphicsLayer
    97               (position 10.00 190.00)
    98               (bounds 100.00 80.00)
    99               (contentsOpaque 1)
     114              (position 21.00 111.00)
     115              (bounds 300.00 200.00)
     116              (clips 1)
     117              (children 1
     118                (GraphicsLayer
     119                  (position 10.00 190.00)
     120                  (bounds 100.00 80.00)
     121                  (contentsOpaque 1)
     122                )
     123              )
    100124            )
    101125          )
  • trunk/LayoutTests/platform/ios-wk2/compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller-expected.txt

    r245602 r246725  
    2727        )
    2828        (GraphicsLayer
    29           (offsetFromRenderer width=-10 height=-10)
    3029          (position 9.00 9.00)
    3130          (bounds 300.00 300.00)
     
    3938        )
    4039        (GraphicsLayer
    41           (offsetFromRenderer width=-40 height=-20)
    4240          (position 9.00 9.00)
    4341          (bounds 300.00 300.00)
     
    5149        )
    5250        (GraphicsLayer
    53           (offsetFromRenderer width=-40 height=-140)
    5451          (position 9.00 9.00)
    5552          (bounds 300.00 300.00)
     
    6360        )
    6461        (GraphicsLayer
    65           (offsetFromRenderer width=-40 height=-260)
    6662          (position 9.00 9.00)
    6763          (bounds 300.00 300.00)
  • trunk/LayoutTests/platform/ios-wk2/compositing/layer-creation/clipping-scope/scroller-with-negative-z-children-expected.txt

    r245602 r246725  
    2727        )
    2828        (GraphicsLayer
    29           (offsetFromRenderer width=-10 height=-10)
    3029          (position 9.00 9.00)
    3130          (bounds 300.00 300.00)
     
    3938        )
    4039        (GraphicsLayer
    41           (offsetFromRenderer width=-40 height=-20)
    4240          (position 9.00 9.00)
    4341          (bounds 300.00 300.00)
     
    5149        )
    5250        (GraphicsLayer
    53           (offsetFromRenderer width=-40 height=-260)
    5451          (position 9.00 9.00)
    5552          (bounds 300.00 300.00)
  • trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt

    r245170 r246725  
    2828        )
    2929        (GraphicsLayer
    30           (offsetFromRenderer width=-34 height=-134)
    3130          (position 10.00 10.00)
    3231          (bounds 400.00 400.00)
  • trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt

    r245170 r246725  
    22  (anchor 0.00 0.00)
    33  (bounds 800.00 600.00)
     4  (clips 1)
    45  (children 1
    56    (GraphicsLayer
     
    1516              (position 2.00 2.00)
    1617              (bounds 320.00 320.00)
     18              (clips 1)
    1719              (children 1
    1820                (GraphicsLayer
     
    2527                      (position 2.00 2.00)
    2628                      (bounds 296.00 296.00)
     29                      (clips 1)
    2730                      (children 1
    2831                        (GraphicsLayer
     
    4548        )
    4649        (GraphicsLayer
    47           (offsetFromRenderer width=-20 height=-20)
    48           (position 42.00 34.00)
    49           (bounds 296.00 296.00)
     50          (position 30.00 22.00)
     51          (bounds 320.00 320.00)
     52          (clips 1)
    5053          (children 1
    5154            (GraphicsLayer
    52               (position 20.00 20.00)
    53               (bounds 256.00 24.00)
    54               (drawsContent 1)
     55              (position 12.00 12.00)
     56              (bounds 296.00 296.00)
     57              (clips 1)
     58              (children 1
     59                (GraphicsLayer
     60                  (position 20.00 20.00)
     61                  (bounds 256.00 24.00)
     62                  (drawsContent 1)
     63                )
     64              )
    5565            )
    5666          )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers-expected.txt

    r245656 r246725  
    3838            (Positioned node
    3939              (layout constraints
    40                 (layer-position-at-last-layout (-2,6))
    41                 (positioning-behavior stationary))
     40                (layer-position-at-last-layout (-2,6)))
    4241              (related overflow nodes 2)
    4342            )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt

    r245772 r246725  
    2525        (has enabled vertical scrollbar 1))
    2626    )
    27     (Positioned node
    28       (layout constraints
    29         (layer-position-at-last-layout (10,10))
    30         (positioning-behavior moves))
    31       (related overflow nodes 1)
     27    (Overflow scroll proxy node
     28      (related overflow scrolling node scroll position (0,0))
    3229      (children 1
    3330        (Positioned node
    3431          (layout constraints
    35             (layer-position-at-last-layout (71,22))
    36             (positioning-behavior stationary))
     32            (layer-position-at-last-layout (71,22)))
    3733          (related overflow nodes 1)
    3834        )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-expected.txt

    r246724 r246725  
    1515  (children 2
    1616    (Overflow scrolling node
    17       (scrollable area size 220 170)
    18       (contents size 220 1020)
    19       (parent relative scrollable rect at (19,11) size 220x170)
     17      (scroll position 0 50)
     18      (scrollable area size 316 316)
     19      (contents size 316 540)
     20      (requested scroll position 0 50)
     21      (requested scroll position represents programmatic scroll 1)
     22      (parent relative scrollable rect at (41,33) size 316x316)
    2023      (scrollable area parameters
    2124        (horizontal scroll elasticity 1)
     
    2528        (has enabled vertical scrollbar 1))
    2629    )
    27     (Positioned node
    28       (layout constraints
    29         (layer-position-at-last-layout (10,10))
    30         (positioning-behavior moves))
    31       (related overflow nodes 1)
    32       (children 1
    33         (Positioned node
    34           (layout constraints
    35             (layer-position-at-last-layout (71,22))
    36             (positioning-behavior stationary))
    37           (related overflow nodes 1)
    38         )
    39       )
     30    (Overflow scroll proxy node
     31      (related overflow scrolling node scroll position (0,50))
    4032    )
    4133  )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested-expected.txt

    r246724 r246725  
    1313  (max layout viewport origin (0,0))
    1414  (behavior for fixed 0)
    15   (children 2
     15  (children 3
    1616    (Overflow scrolling node
    17       (scrollable area size 300 300)
    18       (contents size 300 464)
    19       (parent relative scrollable rect at (30,22) size 300x300)
     17      (scroll position 0 50)
     18      (scrollable area size 316 316)
     19      (contents size 316 640)
     20      (requested scroll position 0 50)
     21      (requested scroll position represents programmatic scroll 1)
     22      (parent relative scrollable rect at (41,33) size 316x316)
    2023      (scrollable area parameters
    2124        (horizontal scroll elasticity 1)
     
    2427        (vertical scrollbar mode 0)
    2528        (has enabled vertical scrollbar 1))
    26     )
    27     (Positioned node
    28       (layout constraints
    29         (layer-position-at-last-layout (20,130))
    30         (positioning-behavior moves))
    31       (related overflow nodes 1)
    3229      (children 1
    3330        (Overflow scrolling node
     31          (scroll position 0 150)
    3432          (scrollable area size 200 200)
    35           (contents size 200 520)
    36           (parent relative scrollable rect at (2,2) size 200x200)
     33          (contents size 200 554)
     34          (requested scroll position 0 150)
     35          (requested scroll position represents programmatic scroll 1)
     36          (parent relative scrollable rect at (56,206) size 200x200)
    3737          (scrollable area parameters
    3838            (horizontal scroll elasticity 1)
     
    4444      )
    4545    )
     46    (Overflow scroll proxy node
     47      (related overflow scrolling node scroll position (0,50))
     48    )
     49    (Overflow scroll proxy node
     50      (related overflow scrolling node scroll position (0,150))
     51    )
    4652  )
    4753)
    4854
     55
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt

    r245682 r246725  
    2727        (Positioned node
    2828          (layout constraints
    29             (layer-position-at-last-layout (20,28))
    30             (positioning-behavior stationary))
     29            (layer-position-at-last-layout (20,28)))
    3130          (related overflow nodes 1)
    3231        )
    3332        (Positioned node
    3433          (layout constraints
    35             (layer-position-at-last-layout (40,48))
    36             (positioning-behavior stationary))
     34            (layer-position-at-last-layout (40,48)))
    3735          (related overflow nodes 1)
    3836        )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt

    r245170 r246725  
    2828        (has enabled vertical scrollbar 1))
    2929    )
    30     (Positioned node
    31       (layout constraints
    32         (layer-position-at-last-layout (10,10))
    33         (positioning-behavior moves))
    34       (related overflow nodes 1)
     30    (Overflow scroll proxy node
     31      (related overflow scrolling node scroll position (0,0))
    3532    )
    36     (Positioned node
    37       (layout constraints
    38         (layer-position-at-last-layout (50,50))
    39         (positioning-behavior moves))
    40       (related overflow nodes 1)
     33    (Overflow scroll proxy node
     34      (related overflow scrolling node scroll position (0,0))
    4135    )
    42     (Positioned node
    43       (layout constraints
    44         (layer-position-at-last-layout (62,82))
    45         (positioning-behavior moves))
    46       (related overflow nodes 1)
     36    (Overflow scroll proxy node
     37      (related overflow scrolling node scroll position (0,0))
    4738    )
    48     (Positioned node
    49       (layout constraints
    50         (layer-position-at-last-layout (77,77))
    51         (positioning-behavior moves))
    52       (related overflow nodes 1)
     39    (Overflow scroll proxy node
     40      (related overflow scrolling node scroll position (0,0))
    5341    )
    5442  )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt

    r245170 r246725  
    2727        (has enabled vertical scrollbar 1))
    2828    )
    29     (Positioned node
    30       (layout constraints
    31         (layer-position-at-last-layout (10,10))
    32         (positioning-behavior moves))
    33       (related overflow nodes 1)
     29    (Overflow scroll proxy node
     30      (related overflow scrolling node scroll position (0,0))
    3431    )
    35     (Positioned node
    36       (layout constraints
    37         (layer-position-at-last-layout (0,30))
    38         (positioning-behavior moves))
    39       (related overflow nodes 1)
     32    (Overflow scroll proxy node
     33      (related overflow scrolling node scroll position (0,0))
    4034    )
    41     (Positioned node
    42       (layout constraints
    43         (layer-position-at-last-layout (13,43))
    44         (positioning-behavior moves))
    45       (related overflow nodes 1)
     35    (Overflow scroll proxy node
     36      (related overflow scrolling node scroll position (0,0))
    4637    )
    47     (Positioned node
    48       (layout constraints
    49         (layer-position-at-last-layout (53,83))
    50         (positioning-behavior moves))
    51       (related overflow nodes 1)
     38    (Overflow scroll proxy node
     39      (related overflow scrolling node scroll position (0,0))
    5240    )
    53     (Positioned node
    54       (layout constraints
    55         (layer-position-at-last-layout (65,115))
    56         (positioning-behavior moves))
    57       (related overflow nodes 1)
     41    (Overflow scroll proxy node
     42      (related overflow scrolling node scroll position (0,0))
    5843    )
    59     (Positioned node
    60       (layout constraints
    61         (layer-position-at-last-layout (80,110))
    62         (positioning-behavior moves))
    63       (related overflow nodes 1)
     44    (Overflow scroll proxy node
     45      (related overflow scrolling node scroll position (0,0))
    6446    )
    6547  )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt

    r245682 r246725  
    2929        (Positioned node
    3030          (layout constraints
    31             (layer-position-at-last-layout (20,28))
    32             (positioning-behavior stationary))
     31            (layer-position-at-last-layout (20,28)))
    3332          (related overflow nodes 1)
    3433        )
    3534        (Positioned node
    3635          (layout constraints
    37             (layer-position-at-last-layout (32,60))
    38             (positioning-behavior stationary))
     36            (layer-position-at-last-layout (32,60)))
    3937          (related overflow nodes 1)
    4038        )
    4139        (Positioned node
    4240          (layout constraints
    43             (layer-position-at-last-layout (47,55))
    44             (positioning-behavior stationary))
     41            (layer-position-at-last-layout (47,55)))
    4542          (related overflow nodes 1)
    4643        )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt

    r245651 r246725  
    2525        (has enabled vertical scrollbar 1))
    2626    )
    27     (Positioned node
    28       (layout constraints
    29         (layer-position-at-last-layout (20,130))
    30         (positioning-behavior moves))
    31       (related overflow nodes 1)
     27    (Overflow scroll proxy node
     28      (related overflow scrolling node scroll position (0,0))
    3229      (children 1
    3330        (Overflow scrolling node
    3431          (scrollable area size 200 200)
    3532          (contents size 200 520)
    36           (parent relative scrollable rect at (2,2) size 200x200)
     33          (parent relative scrollable rect at (0,0) size 200x200)
    3734          (scrollable area parameters
    3835            (horizontal scroll elasticity 1)
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt

    r245170 r246725  
    3939        (has enabled vertical scrollbar 1))
    4040    )
    41     (Positioned node
    42       (layout constraints
    43         (layer-position-at-last-layout (20,40))
    44         (positioning-behavior moves))
    45       (related overflow nodes 1)
     41    (Overflow scroll proxy node
     42      (related overflow scrolling node scroll position (0,0))
    4643    )
    47     (Positioned node
    48       (layout constraints
    49         (layer-position-at-last-layout (10,60))
    50         (positioning-behavior moves))
    51       (related overflow nodes 1)
     44    (Overflow scroll proxy node
     45      (related overflow scrolling node scroll position (0,0))
    5246    )
    53     (Positioned node
    54       (layout constraints
    55         (layer-position-at-last-layout (10,80))
    56         (positioning-behavior moves))
    57       (related overflow nodes 1)
     47    (Overflow scroll proxy node
     48      (related overflow scrolling node scroll position (0,0))
    5849    )
    5950    (Overflow scrolling node
     
    6859        (has enabled vertical scrollbar 1))
    6960    )
    70     (Positioned node
    71       (layout constraints
    72         (layer-position-at-last-layout (20,40))
    73         (positioning-behavior moves))
    74       (related overflow nodes 1)
     61    (Overflow scroll proxy node
     62      (related overflow scrolling node scroll position (0,0))
    7563    )
    76     (Positioned node
    77       (layout constraints
    78         (layer-position-at-last-layout (10,60))
    79         (positioning-behavior moves))
    80       (related overflow nodes 1)
     64    (Overflow scroll proxy node
     65      (related overflow scrolling node scroll position (0,0))
    8166    )
    8267    (Overflow scrolling node
     
    9176        (has enabled vertical scrollbar 1))
    9277    )
    93     (Positioned node
    94       (layout constraints
    95         (layer-position-at-last-layout (20,40))
    96         (positioning-behavior moves))
    97       (related overflow nodes 1)
     78    (Overflow scroll proxy node
     79      (related overflow scrolling node scroll position (0,0))
    9880    )
    9981    (Overflow scrolling node
     
    10890        (has enabled vertical scrollbar 1))
    10991    )
    110     (Positioned node
    111       (layout constraints
    112         (layer-position-at-last-layout (20,40))
    113         (positioning-behavior moves))
    114       (related overflow nodes 1)
     92    (Overflow scroll proxy node
     93      (related overflow scrolling node scroll position (0,0))
    11594    )
    11695    (Overflow scrolling node
     
    125104        (has enabled vertical scrollbar 1))
    126105    )
    127     (Positioned node
    128       (layout constraints
    129         (layer-position-at-last-layout (20,40))
    130         (positioning-behavior moves))
    131       (related overflow nodes 1)
     106    (Overflow scroll proxy node
     107      (related overflow scrolling node scroll position (0,0))
    132108    )
    133     (Positioned node
    134       (layout constraints
    135         (layer-position-at-last-layout (10,60))
    136         (positioning-behavior moves))
    137       (related overflow nodes 1)
     109    (Overflow scroll proxy node
     110      (related overflow scrolling node scroll position (0,0))
    138111    )
    139     (Positioned node
    140       (layout constraints
    141         (layer-position-at-last-layout (20,90))
    142         (positioning-behavior moves))
    143       (related overflow nodes 1)
     112    (Overflow scroll proxy node
     113      (related overflow scrolling node scroll position (0,0))
    144114    )
    145     (Positioned node
    146       (layout constraints
    147         (layer-position-at-last-layout (110,110))
    148         (positioning-behavior moves))
    149       (related overflow nodes 1)
     115    (Overflow scroll proxy node
     116      (related overflow scrolling node scroll position (0,0))
    150117    )
    151118    (Overflow scrolling node
     
    160127        (has enabled vertical scrollbar 1))
    161128    )
    162     (Positioned node
    163       (layout constraints
    164         (layer-position-at-last-layout (20,40))
    165         (positioning-behavior moves))
    166       (related overflow nodes 1)
     129    (Overflow scroll proxy node
     130      (related overflow scrolling node scroll position (0,0))
    167131    )
    168     (Positioned node
    169       (layout constraints
    170         (layer-position-at-last-layout (10,60))
    171         (positioning-behavior moves))
    172       (related overflow nodes 1)
     132    (Overflow scroll proxy node
     133      (related overflow scrolling node scroll position (0,0))
    173134      (children 1
    174135        (Positioned node
    175136          (layout constraints
    176             (layer-position-at-last-layout (79,50))
    177             (positioning-behavior stationary))
     137            (layer-position-at-last-layout (79,50)))
    178138          (related overflow nodes 1)
    179139        )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt

    r243209 r246725  
    5555      )
    5656    )
    57     (Positioned node
    58       (layout constraints
    59         (layer-position-at-last-layout (10,30))
    60         (positioning-behavior moves))
    61       (related overflow nodes 1)
     57    (Overflow scroll proxy node
     58      (related overflow scrolling node scroll position (0,0))
    6259    )
    6360    (Overflow scrolling node
     
    8582        (Positioned node
    8683          (layout constraints
    87             (layer-position-at-last-layout (81,30))
    88             (positioning-behavior stationary))
     84            (layer-position-at-last-layout (81,30)))
    8985          (related overflow nodes 1)
    9086        )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt

    r245854 r246725  
    2626        (has enabled vertical scrollbar 1))
    2727    )
    28     (Positioned node
    29       (layout constraints
    30         (layer-position-at-last-layout (50,50))
    31         (positioning-behavior moves))
    32       (related overflow nodes 1)
     28    (Overflow scroll proxy node
     29      (related overflow scrolling node scroll position (0,0))
    3330      (children 1
    3431        (Sticky node
  • trunk/LayoutTests/platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt

    r245170 r246725  
    2323        )
    2424        (GraphicsLayer
    25           (offsetFromRenderer width=0 height=100)
    2625          (position 28.00 250.00)
    2726          (bounds 185.00 200.00)
  • trunk/LayoutTests/platform/ios/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt

    r240941 r246725  
    33  (anchor 0.00 0.00)
    44  (bounds 800.00 600.00)
     5  (clips 1)
    56  (children 1
    67    (GraphicsLayer
     
    1819              (bounds origin 366.00 0.00)
    1920              (bounds 400.00 205.00)
     21              (clips 1)
    2022              (children 1
    2123                (GraphicsLayer
  • trunk/LayoutTests/platform/ios/media/video-play-glyph-composited-outside-overflow-scrolling-touch-container-expected.txt

    r240713 r246725  
    2121                  (children 1
    2222                    (GraphicsLayer
    23                       (offsetFromRenderer width=-114 height=-300)
    2423                      (bounds 300.00 672.00)
    2524                      (children 1
  • trunk/LayoutTests/platform/mac-wk1/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt

    r245170 r246725  
    88      (children 1
    99        (GraphicsLayer
    10           (offsetFromRenderer width=-10 height=-10)
    1110          (bounds 305.00 325.00)
    1211          (children 1
  • trunk/LayoutTests/platform/mac-wk1/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt

    r244628 r246725  
    33  (anchor 0.00 0.00)
    44  (bounds 800.00 600.00)
     5  (clips 1)
    56  (children 1
    67    (GraphicsLayer
     
    910      (children 1
    1011        (GraphicsLayer
    11           (offsetFromRenderer width=-96 height=0)
    1212          (position 10.00 10.00)
    1313          (bounds 400.00 204.00)
     14          (clips 1)
    1415          (children 1
    1516            (GraphicsLayer
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers-expected.txt

    r245656 r246725  
    3838            (Positioned node
    3939              (layout constraints
    40                 (layer-position-at-last-layout (-2,6))
    41                 (positioning-behavior stationary))
     40                (layer-position-at-last-layout (-2,6)))
    4241              (related overflow nodes 2)
    4342            )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt

    r245772 r246725  
    2525        (has enabled vertical scrollbar 1))
    2626    )
    27     (Positioned node
    28       (layout constraints
    29         (layer-position-at-last-layout (10,10))
    30         (positioning-behavior moves))
    31       (related overflow nodes 1)
     27    (Overflow scroll proxy node
     28      (related overflow scrolling node scroll position (0,0))
    3229      (children 1
    3330        (Positioned node
    3431          (layout constraints
    35             (layer-position-at-last-layout (71,22))
    36             (positioning-behavior stationary))
     32            (layer-position-at-last-layout (71,22)))
    3733          (related overflow nodes 1)
    3834        )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-expected.txt

    r246724 r246725  
    1515  (children 2
    1616    (Overflow scrolling node
    17       (scrollable area size 205 155)
    18       (contents size 205 1020)
    19       (parent relative scrollable rect at (19,11) size 205x155)
     17      (scroll position 0 50)
     18      (scrollable area size 301 316)
     19      (contents size 301 540)
     20      (requested scroll position 0 50)
     21      (requested scroll position represents programmatic scroll 1)
     22      (parent relative scrollable rect at (41,33) size 301x316)
    2023      (scrollable area parameters
    21         (horizontal scroll elasticity 0)
     24        (horizontal scroll elasticity 1)
    2225        (vertical scroll elasticity 0)
    2326        (horizontal scrollbar mode 0)
     
    2528        (has enabled vertical scrollbar 1))
    2629    )
    27     (Positioned node
    28       (layout constraints
    29         (layer-position-at-last-layout (10,10))
    30         (positioning-behavior moves))
    31       (related overflow nodes 1)
    32       (children 1
    33         (Positioned node
    34           (layout constraints
    35             (layer-position-at-last-layout (71,22))
    36             (positioning-behavior stationary))
    37           (related overflow nodes 1)
    38         )
    39       )
     30    (Overflow scroll proxy node
     31      (related overflow scrolling node scroll position (0,50))
    4032    )
    4133  )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested-expected.txt

    r246724 r246725  
    1313  (max layout viewport origin (0,0))
    1414  (behavior for fixed 0)
    15   (children 2
     15  (children 3
    1616    (Overflow scrolling node
    17       (scrollable area size 285 285)
    18       (contents size 285 464)
    19       (parent relative scrollable rect at (30,22) size 285x285)
     17      (scroll position 0 50)
     18      (scrollable area size 301 316)
     19      (contents size 301 640)
     20      (requested scroll position 0 50)
     21      (requested scroll position represents programmatic scroll 1)
     22      (parent relative scrollable rect at (41,33) size 301x316)
    2023      (scrollable area parameters
    21         (horizontal scroll elasticity 0)
     24        (horizontal scroll elasticity 1)
    2225        (vertical scroll elasticity 0)
    2326        (horizontal scrollbar mode 0)
    2427        (vertical scrollbar mode 0)
    2528        (has enabled vertical scrollbar 1))
    26     )
    27     (Positioned node
    28       (layout constraints
    29         (layer-position-at-last-layout (20,130))
    30         (positioning-behavior moves))
    31       (related overflow nodes 1)
    3229      (children 1
    3330        (Overflow scrolling node
    34           (scrollable area size 185 185)
    35           (contents size 185 520)
    36           (parent relative scrollable rect at (2,2) size 185x185)
     31          (scroll position 0 150)
     32          (scrollable area size 185 200)
     33          (contents size 185 554)
     34          (requested scroll position 0 150)
     35          (requested scroll position represents programmatic scroll 1)
     36          (parent relative scrollable rect at (56,206) size 185x200)
    3737          (scrollable area parameters
    38             (horizontal scroll elasticity 0)
     38            (horizontal scroll elasticity 1)
    3939            (vertical scroll elasticity 0)
    4040            (horizontal scrollbar mode 0)
     
    4444      )
    4545    )
     46    (Overflow scroll proxy node
     47      (related overflow scrolling node scroll position (0,50))
     48    )
     49    (Overflow scroll proxy node
     50      (related overflow scrolling node scroll position (0,150))
     51    )
    4652  )
    4753)
    4854
     55
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt

    r245682 r246725  
    2727        (Positioned node
    2828          (layout constraints
    29             (layer-position-at-last-layout (20,28))
    30             (positioning-behavior stationary))
     29            (layer-position-at-last-layout (20,28)))
    3130          (related overflow nodes 1)
    3231        )
    3332        (Positioned node
    3433          (layout constraints
    35             (layer-position-at-last-layout (40,48))
    36             (positioning-behavior stationary))
     34            (layer-position-at-last-layout (40,48)))
    3735          (related overflow nodes 1)
    3836        )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt

    r245170 r246725  
    2828        (has enabled vertical scrollbar 1))
    2929    )
    30     (Positioned node
    31       (layout constraints
    32         (layer-position-at-last-layout (10,10))
    33         (positioning-behavior moves))
    34       (related overflow nodes 1)
     30    (Overflow scroll proxy node
     31      (related overflow scrolling node scroll position (0,0))
    3532    )
    36     (Positioned node
    37       (layout constraints
    38         (layer-position-at-last-layout (50,50))
    39         (positioning-behavior moves))
    40       (related overflow nodes 1)
     33    (Overflow scroll proxy node
     34      (related overflow scrolling node scroll position (0,0))
    4135    )
    42     (Positioned node
    43       (layout constraints
    44         (layer-position-at-last-layout (62,80))
    45         (positioning-behavior moves))
    46       (related overflow nodes 1)
     36    (Overflow scroll proxy node
     37      (related overflow scrolling node scroll position (0,0))
    4738    )
    48     (Positioned node
    49       (layout constraints
    50         (layer-position-at-last-layout (77,77))
    51         (positioning-behavior moves))
    52       (related overflow nodes 1)
     39    (Overflow scroll proxy node
     40      (related overflow scrolling node scroll position (0,0))
    5341    )
    5442  )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt

    r245170 r246725  
    2727        (has enabled vertical scrollbar 1))
    2828    )
    29     (Positioned node
    30       (layout constraints
    31         (layer-position-at-last-layout (10,10))
    32         (positioning-behavior moves))
    33       (related overflow nodes 1)
     29    (Overflow scroll proxy node
     30      (related overflow scrolling node scroll position (0,0))
    3431    )
    35     (Positioned node
    36       (layout constraints
    37         (layer-position-at-last-layout (0,30))
    38         (positioning-behavior moves))
    39       (related overflow nodes 1)
     32    (Overflow scroll proxy node
     33      (related overflow scrolling node scroll position (0,0))
    4034    )
    41     (Positioned node
    42       (layout constraints
    43         (layer-position-at-last-layout (13,43))
    44         (positioning-behavior moves))
    45       (related overflow nodes 1)
     35    (Overflow scroll proxy node
     36      (related overflow scrolling node scroll position (0,0))
    4637    )
    47     (Positioned node
    48       (layout constraints
    49         (layer-position-at-last-layout (53,83))
    50         (positioning-behavior moves))
    51       (related overflow nodes 1)
     38    (Overflow scroll proxy node
     39      (related overflow scrolling node scroll position (0,0))
    5240    )
    53     (Positioned node
    54       (layout constraints
    55         (layer-position-at-last-layout (65,113))
    56         (positioning-behavior moves))
    57       (related overflow nodes 1)
     41    (Overflow scroll proxy node
     42      (related overflow scrolling node scroll position (0,0))
    5843    )
    59     (Positioned node
    60       (layout constraints
    61         (layer-position-at-last-layout (80,110))
    62         (positioning-behavior moves))
    63       (related overflow nodes 1)
     44    (Overflow scroll proxy node
     45      (related overflow scrolling node scroll position (0,0))
    6446    )
    6547  )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt

    r245682 r246725  
    2929        (Positioned node
    3030          (layout constraints
    31             (layer-position-at-last-layout (20,28))
    32             (positioning-behavior stationary))
     31            (layer-position-at-last-layout (20,28)))
    3332          (related overflow nodes 1)
    3433        )
    3534        (Positioned node
    3635          (layout constraints
    37             (layer-position-at-last-layout (32,58))
    38             (positioning-behavior stationary))
     36            (layer-position-at-last-layout (32,58)))
    3937          (related overflow nodes 1)
    4038        )
    4139        (Positioned node
    4240          (layout constraints
    43             (layer-position-at-last-layout (47,55))
    44             (positioning-behavior stationary))
     41            (layer-position-at-last-layout (47,55)))
    4542          (related overflow nodes 1)
    4643        )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt

    r245651 r246725  
    2525        (has enabled vertical scrollbar 1))
    2626    )
    27     (Positioned node
    28       (layout constraints
    29         (layer-position-at-last-layout (20,130))
    30         (positioning-behavior moves))
    31       (related overflow nodes 1)
     27    (Overflow scroll proxy node
     28      (related overflow scrolling node scroll position (0,0))
    3229      (children 1
    3330        (Overflow scrolling node
    3431          (scrollable area size 185 185)
    3532          (contents size 185 520)
    36           (parent relative scrollable rect at (2,2) size 185x185)
     33          (parent relative scrollable rect at (0,0) size 185x185)
    3734          (scrollable area parameters
    3835            (horizontal scroll elasticity 0)
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt

    r245170 r246725  
    4141        (has enabled vertical scrollbar 1))
    4242    )
    43     (Positioned node
    44       (layout constraints
    45         (layer-position-at-last-layout (20,38))
    46         (positioning-behavior moves))
    47       (related overflow nodes 1)
     43    (Overflow scroll proxy node
     44      (related overflow scrolling node scroll position (0,0))
    4845    )
    49     (Positioned node
    50       (layout constraints
    51         (layer-position-at-last-layout (10,58))
    52         (positioning-behavior moves))
    53       (related overflow nodes 1)
     46    (Overflow scroll proxy node
     47      (related overflow scrolling node scroll position (0,0))
    5448    )
    55     (Positioned node
    56       (layout constraints
    57         (layer-position-at-last-layout (10,76))
    58         (positioning-behavior moves))
    59       (related overflow nodes 1)
     49    (Overflow scroll proxy node
     50      (related overflow scrolling node scroll position (0,0))
    6051    )
    6152    (Overflow scrolling node
     
    7162        (has enabled vertical scrollbar 1))
    7263    )
    73     (Positioned node
    74       (layout constraints
    75         (layer-position-at-last-layout (20,38))
    76         (positioning-behavior moves))
    77       (related overflow nodes 1)
     64    (Overflow scroll proxy node
     65      (related overflow scrolling node scroll position (0,0))
    7866    )
    79     (Positioned node
    80       (layout constraints
    81         (layer-position-at-last-layout (10,58))
    82         (positioning-behavior moves))
    83       (related overflow nodes 1)
     67    (Overflow scroll proxy node
     68      (related overflow scrolling node scroll position (0,0))
    8469    )
    8570    (Overflow scrolling node
     
    9479        (has enabled vertical scrollbar 1))
    9580    )
    96     (Positioned node
    97       (layout constraints
    98         (layer-position-at-last-layout (20,38))
    99         (positioning-behavior moves))
    100       (related overflow nodes 1)
     81    (Overflow scroll proxy node
     82      (related overflow scrolling node scroll position (0,0))
    10183    )
    10284    (Overflow scrolling node
     
    11193        (has enabled vertical scrollbar 1))
    11294    )
    113     (Positioned node
    114       (layout constraints
    115         (layer-position-at-last-layout (20,38))
    116         (positioning-behavior moves))
    117       (related overflow nodes 1)
     95    (Overflow scroll proxy node
     96      (related overflow scrolling node scroll position (0,0))
    11897    )
    11998    (Overflow scrolling node
     
    129108        (has enabled vertical scrollbar 1))
    130109    )
    131     (Positioned node
    132       (layout constraints
    133         (layer-position-at-last-layout (20,38))
    134         (positioning-behavior moves))
    135       (related overflow nodes 1)
     110    (Overflow scroll proxy node
     111      (related overflow scrolling node scroll position (0,0))
    136112    )
    137     (Positioned node
    138       (layout constraints
    139         (layer-position-at-last-layout (10,58))
    140         (positioning-behavior moves))
    141       (related overflow nodes 1)
     113    (Overflow scroll proxy node
     114      (related overflow scrolling node scroll position (0,0))
    142115    )
    143     (Positioned node
    144       (layout constraints
    145         (layer-position-at-last-layout (20,86))
    146         (positioning-behavior moves))
    147       (related overflow nodes 1)
     116    (Overflow scroll proxy node
     117      (related overflow scrolling node scroll position (0,0))
    148118    )
    149     (Positioned node
    150       (layout constraints
    151         (layer-position-at-last-layout (110,106))
    152         (positioning-behavior moves))
    153       (related overflow nodes 1)
     119    (Overflow scroll proxy node
     120      (related overflow scrolling node scroll position (0,0))
    154121    )
    155122    (Overflow scrolling node
     
    164131        (has enabled vertical scrollbar 1))
    165132    )
    166     (Positioned node
    167       (layout constraints
    168         (layer-position-at-last-layout (20,38))
    169         (positioning-behavior moves))
    170       (related overflow nodes 1)
     133    (Overflow scroll proxy node
     134      (related overflow scrolling node scroll position (0,0))
    171135    )
    172     (Positioned node
    173       (layout constraints
    174         (layer-position-at-last-layout (10,58))
    175         (positioning-behavior moves))
    176       (related overflow nodes 1)
     136    (Overflow scroll proxy node
     137      (related overflow scrolling node scroll position (0,0))
    177138      (children 1
    178139        (Positioned node
    179140          (layout constraints
    180             (layer-position-at-last-layout (79,48))
    181             (positioning-behavior stationary))
     141            (layer-position-at-last-layout (79,48)))
    182142          (related overflow nodes 1)
    183143        )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt

    r243209 r246725  
    5656      )
    5757    )
    58     (Positioned node
    59       (layout constraints
    60         (layer-position-at-last-layout (10,28))
    61         (positioning-behavior moves))
    62       (related overflow nodes 1)
     58    (Overflow scroll proxy node
     59      (related overflow scrolling node scroll position (0,0))
    6360    )
    6461    (Overflow scrolling node
     
    8683        (Positioned node
    8784          (layout constraints
    88             (layer-position-at-last-layout (81,28))
    89             (positioning-behavior stationary))
     85            (layer-position-at-last-layout (81,28)))
    9086          (related overflow nodes 1)
    9187        )
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt

    r245854 r246725  
    2626        (has enabled vertical scrollbar 1))
    2727    )
    28     (Positioned node
    29       (layout constraints
    30         (layer-position-at-last-layout (50,50))
    31         (positioning-behavior moves))
    32       (related overflow nodes 1)
     28    (Overflow scroll proxy node
     29      (related overflow scrolling node scroll position (0,0))
    3330      (children 1
    3431        (Sticky node
  • trunk/Source/WebCore/ChangeLog

    r246723 r246725  
     12019-06-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [Async overflow scroll] Clipped composited layers inside overflow scroll jitter and get incorrectly clipped
     4        https://bugs.webkit.org/show_bug.cgi?id=199133
     5        rdar://problem/43614439
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Currently a composited layer with an overflow:scroll ancestor (which is not a paint-order
     10        ancestor) gets a single "ancestor clip layer" that represents the intersection of all the
     11        clips provided by its containing-block ancestors with non-visible overflow (both scrolling
     12        and non-scrolling ones).
     13
     14        To correctly update clips with async overflow scroll, this single clip layer needs to be
     15        broken up into multiple clipping ancestors. We need a separate layer, and scrolling tree
     16        node for each ancestor that is an overflow scroll, and layers that represent non-moving
     17        clips (i.e. overflow:hidden and 'clip') between them. This patch adds
     18        LayerAncestorClippingStack to represent this stack of clipping layers. For example with the
     19        following content:
     20       
     21        <div style="overflow:hidden"> <--- A
     22            <div style="overflow:scroll"> <--- B
     23                <div style="overflow:hidden"> <--- C
     24                    <div style="overflow:hidden"> <--- D
     25                        <div style="overflow:scroll">  <--- E
     26                            <div style="overflow:hidden"> <--- F
     27                                <div style="overflow:hidden"> <--- G
     28                                    <div></div> <--- H
     29                                <div>
     30                            <div>
     31                        <div>
     32                    <div>
     33                <div>
     34            <div>
     35        <div>
     36       
     37        the composited RenderLayer for H owns a LayerAncestorClippingStack with the following contents:
     38            [clip - A]
     39            [scroller - B]
     40            [clip - intersection of C and D]
     41            [scroller - E]
     42            [clip - intersection of F and G]
     43
     44        Each stack entry has a 'masksToBounds' GraphicsLayer for clipping. Entries representing
     45        overflow:scroll clips have a ScrollingNodeID for their OverflowScrollProxy scrolling tree
     46        node (which references the actual OverflowScrollingNode). The non-scroller clips in this
     47        stack are computed unconstrained by the enclosing overflow:scroll.
     48
     49        When the OverflowScrollingNode is scrolled, the boundsOrigin of related OverflowScrollProxy nodes
     50        is adjusted to move the descendant layers (other clipping layers, or composited layers).
     51
     52        OverflowScrollProxy nodes thus take over the role that "Moves" ScrollingTreePositionedNode had.
     53        With this patch, ScrollingTreePositionedNode are purely for absolute position inside non-containing-block
     54        stacking context overflow scroll. LayoutConstraints is renamed to AbsolutePositionConstraints accordingly.
     55
     56        Tests: compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll.html
     57               compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested.html
     58               compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow.html
     59               compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden.html
     60               compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible.html
     61               compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer.html
     62               compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped.html
     63               compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer.html
     64               compositing/scrolling/async-overflow-scrolling/layer-in-overflow.html
     65               scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested.html
     66               scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow.html
     67
     68        * Sources.txt:
     69        * WebCore.xcodeproj/project.pbxproj:
     70        * page/scrolling/AsyncScrollingCoordinator.cpp:
     71        (WebCore::AsyncScrollingCoordinator::setPositionedNodeConstraints):
     72        (WebCore::AsyncScrollingCoordinator::setPositionedNodeGeometry): Deleted.
     73        * page/scrolling/AsyncScrollingCoordinator.h:
     74        * page/scrolling/ScrollingConstraints.cpp:
     75        (WebCore::operator<<):
     76        * page/scrolling/ScrollingConstraints.h:
     77        (WebCore::AbsolutePositionConstraints::operator== const):
     78        (WebCore::AbsolutePositionConstraints::operator!= const):
     79        (WebCore::LayoutConstraints::operator== const): Deleted.
     80        (WebCore::LayoutConstraints::operator!= const): Deleted.
     81        (WebCore::LayoutConstraints::alignmentOffset const): Deleted.
     82        (WebCore::LayoutConstraints::setAlignmentOffset): Deleted.
     83        (WebCore::LayoutConstraints::layerPositionAtLastLayout const): Deleted.
     84        (WebCore::LayoutConstraints::setLayerPositionAtLastLayout): Deleted.
     85        (WebCore::LayoutConstraints::scrollPositioningBehavior const): Deleted.
     86        (WebCore::LayoutConstraints::setScrollPositioningBehavior): Deleted.
     87        * page/scrolling/ScrollingCoordinator.h:
     88        (WebCore::ScrollingCoordinator::setPositionedNodeConstraints):
     89        (WebCore::ScrollingCoordinator::setPositionedNodeGeometry): Deleted.
     90        * page/scrolling/ScrollingStatePositionedNode.cpp:
     91        (WebCore::ScrollingStatePositionedNode::updateConstraints):
     92        * page/scrolling/ScrollingStatePositionedNode.h:
     93        * page/scrolling/ScrollingTree.cpp:
     94        (WebCore::ScrollingTree::commitTreeState):
     95        * page/scrolling/ScrollingTree.h:
     96        (WebCore::ScrollingTree::nodesWithRelatedOverflow):
     97        (WebCore::ScrollingTree::positionedNodesWithRelatedOverflow): Deleted.
     98        * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
     99        (WebCore::ScrollingTreeFixedNode::applyLayerPositions):
     100        * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
     101        (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
     102        * page/scrolling/cocoa/ScrollingTreePositionedNode.h:
     103        (WebCore::ScrollingTreePositionedNode::scrollPositioningBehavior const): Deleted.
     104        * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
     105        (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
     106        (WebCore::ScrollingTreePositionedNode::scrollDeltaSinceLastCommit const):
     107        * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
     108        (WebCore::ScrollingTreeStickyNode::computeLayerPosition const):
     109        * rendering/LayerAncestorClippingStack.cpp: Added.
     110        (WebCore::LayerAncestorClippingStack::LayerAncestorClippingStack):
     111        (WebCore::LayerAncestorClippingStack::equalToClipData const):
     112        (WebCore::LayerAncestorClippingStack::hasAnyScrollingLayers const):
     113        (WebCore::LayerAncestorClippingStack::clear):
     114        (WebCore::LayerAncestorClippingStack::detachFromScrollingCoordinator):
     115        (WebCore::LayerAncestorClippingStack::firstClippingLayer const):
     116        (WebCore::LayerAncestorClippingStack::lastClippingLayer const):
     117        (WebCore::LayerAncestorClippingStack::lastOverflowScrollProxyNodeID const):
     118        (WebCore::LayerAncestorClippingStack::updateScrollingNodeLayers):
     119        (WebCore::LayerAncestorClippingStack::updateWithClipData):
     120        (WebCore::operator<<):
     121        * rendering/LayerAncestorClippingStack.h: Added.
     122        (WebCore::CompositedClipData::CompositedClipData):
     123        (WebCore::CompositedClipData::operator== const):
     124        (WebCore::CompositedClipData::operator!= const):
     125        (WebCore::LayerAncestorClippingStack::stack):
     126        (WebCore::LayerAncestorClippingStack::stack const):
     127        * rendering/RenderLayerBacking.cpp:
     128        (WebCore::RenderLayerBacking::~RenderLayerBacking):
     129        (WebCore::RenderLayerBacking::updateDebugIndicators):
     130        (WebCore::RenderLayerBacking::destroyGraphicsLayers):
     131        (WebCore::RenderLayerBacking::updateTransform):
     132        (WebCore::RenderLayerBacking::updateBlendMode):
     133        (WebCore::RenderLayerBacking::updateAfterLayout):
     134        (WebCore::RenderLayerBacking::updateConfiguration):
     135        (WebCore::computeOffsetFromAncestorGraphicsLayer):
     136        (WebCore::RenderLayerBacking::computePrimaryGraphicsLayerRect const):
     137        (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
     138        (WebCore::RenderLayerBacking::updateGeometry):
     139        (WebCore::RenderLayerBacking::updateInternalHierarchy):
     140        (WebCore::RenderLayerBacking::updateAncestorClippingStack):
     141        (WebCore::RenderLayerBacking::updateAncestorClipping):
     142        (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
     143        (WebCore::RenderLayerBacking::scrollingNodeIDForChildren const):
     144        (WebCore::RenderLayerBacking::childForSuperlayers const):
     145        (WebCore::RenderLayerBacking::backingStoreMemoryEstimate const):
     146        (WebCore::operator<<):
     147        (WebCore::RenderLayerBacking::updateAncestorClippingLayer): Deleted.
     148        (WebCore::RenderLayerBacking::coordinatedScrollingRoles const): Deleted.
     149        * rendering/RenderLayerBacking.h:
     150        * rendering/RenderLayerCompositor.cpp:
     151        (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
     152        (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
     153        (WebCore::RenderLayerCompositor::layerStyleChanged): We need to run the checks for changed
     154        clipping whether or not this layer has backing, because a non-composited layer with clipping can be
     155        represented in the clipping stack of some other layer.
     156        (WebCore::RenderLayerCompositor::clippedByAncestor const):
     157        (WebCore::RenderLayerCompositor::updateAncestorClippingStack const):
     158        (WebCore::RenderLayerCompositor::computeAncestorClippingStack const): The output of this function
     159        is a Vector<CompositedClipData> which represents the ancestor clipping stack, but without the proxy node
     160        and GraphicsLayer information. It's input to LayerAncestorClippingStack::updateWithClipData() which does
     161        the merging of old and new states.
     162        (WebCore::collectRelatedCoordinatedScrollingNodes):
     163        (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
     164        (WebCore::scrollCoordinationRoleForNodeType):
     165        (WebCore::RenderLayerCompositor::attachScrollingNode):
     166        (WebCore::RenderLayerCompositor::registerScrollingNodeID):
     167        (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
     168        (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
     169        (WebCore::RenderLayerCompositor::coordinatedScrollingRolesForLayer const): Code moved from RenderLayerBacking.
     170        (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
     171        (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingProxyRole):
     172        (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
     173        * rendering/RenderLayerCompositor.h:
     174        (WebCore::allScrollCoordinationRoles):
     175
    11762019-06-23  Simon Fraser  <simon.fraser@apple.com>
    2177
  • trunk/Source/WebCore/Headers.cmake

    r246644 r246725  
    12441244    rendering/InlineBox.h
    12451245    rendering/InlineFlowBox.h
     1246    rendering/LayerAncestorClippingStack.h
    12461247    rendering/LayerFragment.h
    12471248    rendering/MarkedText.h
  • trunk/Source/WebCore/Sources.txt

    r246723 r246725  
    19871987rendering/InlineIterator.cpp
    19881988rendering/InlineTextBox.cpp
     1989rendering/LayerAncestorClippingStack.cpp
    19891990rendering/LayerOverlapMap.cpp
    19901991rendering/LayoutDisallowedScope.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r246723 r246725  
    368368                0FEA3E84191B31BF000F1B55 /* ScrollingStateOverflowScrollingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA3E82191B31BF000F1B55 /* ScrollingStateOverflowScrollingNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
    369369                0FEA3E88191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA3E86191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
     370                0FEC120C22BF2CD2004E9D35 /* LayerAncestorClippingStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEC120922BF2CC7004E9D35 /* LayerAncestorClippingStack.h */; settings = {ATTRIBUTES = (Private, ); }; };
    370371                0FF3B9291EE3B6DE00B84144 /* JSDOMQuad.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF3B9251EE3B6DE00B84144 /* JSDOMQuad.h */; };
    371372                0FF3B92B1EE3B6DE00B84144 /* JSDOMQuadInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF3B9271EE3B6DE00B84144 /* JSDOMQuadInit.h */; };
     
    58165817                0FEA3E85191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeFrameScrollingNode.cpp; sourceTree = "<group>"; };
    58175818                0FEA3E86191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeFrameScrollingNode.h; sourceTree = "<group>"; };
     5819                0FEC120922BF2CC7004E9D35 /* LayerAncestorClippingStack.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayerAncestorClippingStack.h; sourceTree = "<group>"; };
     5820                0FEC120B22BF2CC7004E9D35 /* LayerAncestorClippingStack.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayerAncestorClippingStack.cpp; sourceTree = "<group>"; };
    58185821                0FEF20CD1BD4A24100128E5D /* LengthSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthSize.cpp; sourceTree = "<group>"; };
    58195822                0FEF20CF1BD4A64F00128E5D /* RenderStyleConstants.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderStyleConstants.cpp; sourceTree = "<group>"; };
     
    2699827001                                BCEA481A097D93020094C9E4 /* InlineTextBox.cpp */,
    2699927002                                BCEA481B097D93020094C9E4 /* InlineTextBox.h */,
     27003                                0FEC120B22BF2CC7004E9D35 /* LayerAncestorClippingStack.cpp */,
     27004                                0FEC120922BF2CC7004E9D35 /* LayerAncestorClippingStack.h */,
    2700027005                                580371631A66F1D300BAF519 /* LayerFragment.h */,
    2700127006                                0F69F2B7228B98FF008D3565 /* LayerOverlapMap.cpp */,
     
    3051130516                                450CEBF115073BBE002BB149 /* LabelableElement.h in Headers */,
    3051230517                                A456FA2711AD4A830020B420 /* LabelsNodeList.h in Headers */,
     30518                                0FEC120C22BF2CD2004E9D35 /* LayerAncestorClippingStack.h in Headers */,
    3051330519                                E4916FF7195DF6A0005AB349 /* LayerFlushThrottleState.h in Headers */,
    3051430520                                580371641A66F1D300BAF519 /* LayerFragment.h in Headers */,
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r246723 r246725  
    695695}
    696696
    697 void AsyncScrollingCoordinator::setPositionedNodeGeometry(ScrollingNodeID nodeID, const LayoutConstraints& constraints)
     697void AsyncScrollingCoordinator::setPositionedNodeConstraints(ScrollingNodeID nodeID, const AbsolutePositionConstraints& constraints)
    698698{
    699699    auto* node = m_scrollingStateTree->stateNodeForID(nodeID);
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h

    r243926 r246725  
    116116    WEBCORE_EXPORT void setFrameScrollingNodeState(ScrollingNodeID, const FrameView&) override;
    117117    WEBCORE_EXPORT void setViewportConstraintedNodeConstraints(ScrollingNodeID, const ViewportConstraints&) override;
    118     WEBCORE_EXPORT void setPositionedNodeGeometry(ScrollingNodeID, const LayoutConstraints&) override;
     118    WEBCORE_EXPORT void setPositionedNodeConstraints(ScrollingNodeID, const AbsolutePositionConstraints&) override;
    119119    WEBCORE_EXPORT void setRelatedOverflowScrollingNodes(ScrollingNodeID, Vector<ScrollingNodeID>&&) override;
    120120
  • trunk/Source/WebCore/page/scrolling/ScrollingConstraints.cpp

    r242913 r246725  
    111111}
    112112
    113 TextStream& operator<<(TextStream& ts, const LayoutConstraints& constraints)
     113TextStream& operator<<(TextStream& ts, const AbsolutePositionConstraints& constraints)
    114114{
    115115    ts.dumpProperty("layer-position-at-last-layout", constraints.layerPositionAtLastLayout());
    116     ts.dumpProperty("positioning-behavior", constraints.scrollPositioningBehavior());
    117116
    118117    return ts;
  • trunk/Source/WebCore/page/scrolling/ScrollingConstraints.h

    r243163 r246725  
    3131namespace WebCore {
    3232
    33 // LayoutConstraints classes encapsulate data and logic required to reposition elements whose layout
    34 // depends on the scroll position of ancestor elements.
    35 class LayoutConstraints {
     33class AbsolutePositionConstraints {
    3634    WTF_MAKE_FAST_ALLOCATED;
    3735public:
    38     LayoutConstraints() = default;
    39 
    40     bool operator==(const LayoutConstraints& other) const
     36    AbsolutePositionConstraints() = default;
     37
     38    bool operator==(const AbsolutePositionConstraints& other) const
    4139    {
    4240        return alignmentOffset() == other.alignmentOffset()
    43             && layerPositionAtLastLayout() == other.layerPositionAtLastLayout()
    44             && scrollPositioningBehavior() == other.scrollPositioningBehavior();
     41            && layerPositionAtLastLayout() == other.layerPositionAtLastLayout();
    4542    }
    4643
    47     bool operator!=(const LayoutConstraints& other) const { return !(*this == other); }
     44    bool operator!=(const AbsolutePositionConstraints& other) const { return !(*this == other); }
    4845   
    4946    FloatSize alignmentOffset() const { return m_alignmentOffset; }
     
    5350    void setLayerPositionAtLastLayout(FloatPoint position) { m_layerPositionAtLastLayout = position; }
    5451   
    55     ScrollPositioningBehavior scrollPositioningBehavior() const { return m_scrollPositioningBehavior; }
    56     void setScrollPositioningBehavior(ScrollPositioningBehavior behavior) { m_scrollPositioningBehavior = behavior; }
    57 
    5852private:
    5953    FloatSize m_alignmentOffset;
    6054    FloatPoint m_layerPositionAtLastLayout;
    61     ScrollPositioningBehavior m_scrollPositioningBehavior { ScrollPositioningBehavior::None };
    6255};
    6356
     
    206199
    207200WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, ScrollPositioningBehavior);
    208 WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, const LayoutConstraints&);
     201WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, const AbsolutePositionConstraints&);
    209202WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, const FixedPositionViewportConstraints&);
    210203WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, const StickyPositionViewportConstraints&);
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h

    r243926 r246725  
    5353namespace WebCore {
    5454
     55class AbsolutePositionConstraints;
    5556class Document;
    5657class Frame;
    5758class FrameView;
    5859class GraphicsLayer;
    59 class LayoutConstraints;
    6060class Page;
    6161class Region;
     
    150150    virtual void setFrameScrollingNodeState(ScrollingNodeID, const FrameView&) { }
    151151    virtual void setViewportConstraintedNodeConstraints(ScrollingNodeID, const ViewportConstraints&) { }
    152     virtual void setPositionedNodeGeometry(ScrollingNodeID, const LayoutConstraints&) { }
     152    virtual void setPositionedNodeConstraints(ScrollingNodeID, const AbsolutePositionConstraints&) { }
    153153    virtual void setRelatedOverflowScrollingNodes(ScrollingNodeID, Vector<ScrollingNodeID>&&) { }
    154154
  • trunk/Source/WebCore/page/scrolling/ScrollingStatePositionedNode.cpp

    r246593 r246725  
    7676}
    7777
    78 void ScrollingStatePositionedNode::updateConstraints(const LayoutConstraints& constraints)
     78void ScrollingStatePositionedNode::updateConstraints(const AbsolutePositionConstraints& constraints)
    7979{
    8080    if (m_constraints == constraints)
  • trunk/Source/WebCore/page/scrolling/ScrollingStatePositionedNode.h

    r246593 r246725  
    3636
    3737// ScrollingStatePositionedNode is used to manage the layers for z-order composited descendants of overflow:scroll
    38 // which are not containing block descendants. These layers must have their position inside their ancestor clipping
     38// which are not containing block descendants (i.e. position:absolute). These layers must have their position inside their ancestor clipping
    3939// layer adjusted on the scrolling thread.
    4040class ScrollingStatePositionedNode final : public ScrollingStateNode {
     
    5555    WEBCORE_EXPORT void setRelatedOverflowScrollingNodes(Vector<ScrollingNodeID>&&);
    5656
    57     WEBCORE_EXPORT void updateConstraints(const LayoutConstraints&);
    58     const LayoutConstraints& layoutConstraints() const { return m_constraints; }
     57    WEBCORE_EXPORT void updateConstraints(const AbsolutePositionConstraints&);
     58    const AbsolutePositionConstraints& layoutConstraints() const { return m_constraints; }
    5959
    6060private:
     
    6767
    6868    Vector<ScrollingNodeID> m_relatedOverflowScrollingNodes;
    69     LayoutConstraints m_constraints;
     69    AbsolutePositionConstraints m_constraints;
    7070};
    7171
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp

    r246490 r246725  
    170170
    171171    m_overflowRelatedNodesMap.clear();
    172     m_positionedNodesWithRelatedOverflow.clear();
     172    m_nodesWithRelatedOverflow.clear();
    173173
    174174    // orphanNodes keeps child nodes alive while we rebuild child lists.
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.h

    r246490 r246725  
    155155    RelatedNodesMap& overflowRelatedNodes() { return m_overflowRelatedNodesMap; }
    156156
    157     HashSet<ScrollingNodeID>& positionedNodesWithRelatedOverflow() { return m_positionedNodesWithRelatedOverflow; }
     157    HashSet<ScrollingNodeID>& nodesWithRelatedOverflow() { return m_nodesWithRelatedOverflow; }
    158158
    159159    WEBCORE_EXPORT String scrollingTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal);
     
    180180
    181181    RelatedNodesMap m_overflowRelatedNodesMap;
    182     HashSet<ScrollingNodeID> m_positionedNodesWithRelatedOverflow;
     182    HashSet<ScrollingNodeID> m_nodesWithRelatedOverflow;
    183183
    184184    struct TreeState {
  • trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreeFixedNode.mm

    r246367 r246725  
    3333#import "ScrollingTree.h"
    3434#import "ScrollingTreeFrameScrollingNode.h"
     35#import "ScrollingTreeOverflowScrollProxyNode.h"
    3536#import "ScrollingTreeOverflowScrollingNode.h"
    3637#import "ScrollingTreePositionedNode.h"
     
    8485                // To keep the layer still during async scrolling we adjust by how much the position has changed since layout.
    8586                auto& overflowNode = downcast<ScrollingTreeOverflowScrollingNode>(*ancestor);
     87                overflowScrollDelta -= overflowNode.scrollDeltaSinceLastCommit();
     88                continue;
     89            }
     90
     91            if (is<ScrollingTreeOverflowScrollProxyNode>(*ancestor)) {
     92                // To keep the layer still during async scrolling we adjust by how much the position has changed since layout.
     93                auto& overflowNode = downcast<ScrollingTreeOverflowScrollProxyNode>(*ancestor);
    8694                overflowScrollDelta -= overflowNode.scrollDeltaSinceLastCommit();
    8795                continue;
  • trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm

    r246723 r246725  
    6363    }).iterator->value.append(scrollingNodeID());
    6464
    65     scrollingTree().positionedNodesWithRelatedOverflow().add(scrollingNodeID());
     65    scrollingTree().nodesWithRelatedOverflow().add(scrollingNodeID());
    6666}
    6767
  • trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreePositionedNode.h

    r246197 r246725  
    4444    CALayer *layer() const { return m_layer.get(); }
    4545
    46     ScrollPositioningBehavior scrollPositioningBehavior() const { return m_constraints.scrollPositioningBehavior(); }
    4746    const Vector<ScrollingNodeID>& relatedOverflowScrollingNodes() const { return m_relatedOverflowScrollingNodes; }
    4847
     
    5958
    6059    Vector<ScrollingNodeID> m_relatedOverflowScrollingNodes;
    61     LayoutConstraints m_constraints;
     60    AbsolutePositionConstraints m_constraints;
    6261    RetainPtr<CALayer> m_layer;
    6362};
  • trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreePositionedNode.mm

    r246723 r246725  
    6464        m_constraints = positionedStateNode.layoutConstraints();
    6565
    66     // Tell the ScrollingTree about non-ancestor overflow nodes which affect this node.
    67     if (m_constraints.scrollPositioningBehavior() == ScrollPositioningBehavior::Moves) {
    68         auto& relatedNodes = scrollingTree().overflowRelatedNodes();
    69         for (auto overflowNodeID : m_relatedOverflowScrollingNodes) {
    70             relatedNodes.ensure(overflowNodeID, [] {
    71                 return Vector<ScrollingNodeID>();
    72             }).iterator->value.append(scrollingNodeID());
    73         }
    74     }
    75     if (!m_relatedOverflowScrollingNodes.isEmpty() && m_constraints.scrollPositioningBehavior() != ScrollPositioningBehavior::None)
    76         scrollingTree().positionedNodesWithRelatedOverflow().add(scrollingNodeID());
     66    if (!m_relatedOverflowScrollingNodes.isEmpty())
     67        scrollingTree().nodesWithRelatedOverflow().add(scrollingNodeID());
    7768}
    7869
     
    8879        }
    8980    }
    90     if (m_constraints.scrollPositioningBehavior() == ScrollPositioningBehavior::Stationary) {
    91         // Stationary nodes move in the opposite direction.
    92         return -delta;
    93     }
    94 
    95     return delta;
     81   
     82    // Positioned nodes compensate for scrolling, so negate the scroll delta.
     83    return -delta;
    9684}
    9785
  • trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.mm

    r246367 r246725  
    3434#import "ScrollingTreeFixedNode.h"
    3535#import "ScrollingTreeFrameScrollingNode.h"
     36#import "ScrollingTreeOverflowScrollProxyNode.h"
    3637#import "ScrollingTreeOverflowScrollingNode.h"
    3738#import "WebCoreCALayerExtras.h"
     
    8283
    8384    for (auto* ancestor = parent(); ancestor; ancestor = ancestor->parent()) {
    84         if (is<ScrollingTreePositionedNode>(*ancestor)) {
    85             auto& positioningAncestor = downcast<ScrollingTreePositionedNode>(*ancestor);
     85        if (is<ScrollingTreeOverflowScrollProxyNode>(*ancestor)) {
     86            auto& overflowProxyNode = downcast<ScrollingTreeOverflowScrollProxyNode>(*ancestor);
     87            auto overflowNode = scrollingTree().nodeForID(overflowProxyNode.overflowScrollingNodeID());
     88            if (!overflowNode)
     89                break;
    8690
    87             // FIXME: Do we need to do anything for ScrollPositioningBehavior::Stationary?
    88             if (positioningAncestor.scrollPositioningBehavior() == ScrollPositioningBehavior::Moves) {
    89                 if (positioningAncestor.relatedOverflowScrollingNodes().isEmpty())
    90                     break;
    91                 auto overflowNode = scrollingTree().nodeForID(positioningAncestor.relatedOverflowScrollingNodes()[0]);
    92                 if (!overflowNode)
    93                     break;
     91            return computeLayerPositionForScrollingNode(*overflowNode);
     92        }
    9493
    95                 auto position = computeLayerPositionForScrollingNode(*overflowNode);
    96 
    97                 if (positioningAncestor.layer() == m_layer) {
    98                     // We'll also do the adjustment the positioning node would do.
    99                     position -= positioningAncestor.scrollDeltaSinceLastCommit();
    100                 }
    101 
    102                 return position;
    103             }
    104         }
    10594        if (is<ScrollingTreeScrollingNode>(*ancestor))
    10695            return computeLayerPositionForScrollingNode(*ancestor);
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.h

    r246490 r246725  
    355355    WEBCORE_EXPORT void save();
    356356    WEBCORE_EXPORT void restore();
     357   
     358    unsigned stackSize() const { return m_stack.size(); }
    357359
    358360    // These draw methods will do both stroking and filling.
     
    698700};
    699701
     702
     703class GraphicsContextStateStackChecker {
     704public:
     705    GraphicsContextStateStackChecker(GraphicsContext& context)
     706        : m_context(context)
     707        , m_stackSize(context.stackSize())
     708    { }
     709   
     710    ~GraphicsContextStateStackChecker()
     711    {
     712        if (m_context.stackSize() != m_stackSize)
     713            WTFLogAlways("GraphicsContext %p stack changed by %d", this, (int)m_context.stackSize() - (int)m_stackSize);
     714    }
     715
     716private:
     717    GraphicsContext& m_context;
     718    unsigned m_stackSize;
     719};
     720
     721
     722
    700723class InterpolationQualityMaintainer {
    701724public:
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r246488 r246725  
    43904390        return;
    43914391
     4392    GraphicsContextStateStackChecker checker(context);
     4393
    43924394    updateLayerListsIfNeeded();
    43934395
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r246538 r246725  
    4848#include "InspectorInstrumentation.h"
    4949#include "KeyframeList.h"
     50#include "LayerAncestorClippingStack.h"
    5051#include "Logging.h"
    5152#include "Page.h"
     
    239240{
    240241    // Note that m_owningLayer->backing() is null here.
    241     updateAncestorClippingLayer(false);
     242    updateAncestorClipping(false, nullptr);
    242243    updateChildClippingStrategy(false);
    243244    updateDescendantClippingLayer(false);
     
    425426    m_graphicsLayer->setShowRepaintCounter(showRepaintCounter);
    426427   
    427     if (m_ancestorClippingLayer)
    428         m_ancestorClippingLayer->setShowDebugBorder(showBorder);
     428    if (m_ancestorClippingStack) {
     429        for (auto& entry : m_ancestorClippingStack->stack())
     430            entry.clippingLayer->setShowDebugBorder(showBorder);
     431    }
    429432
    430433    if (m_foregroundLayer) {
     
    540543    GraphicsLayer::clear(m_maskLayer);
    541544
    542     GraphicsLayer::unparentAndClear(m_ancestorClippingLayer);
     545    if (m_ancestorClippingStack) {
     546        for (auto& entry : m_ancestorClippingStack->stack())
     547            GraphicsLayer::unparentAndClear(entry.clippingLayer);
     548    }
     549
    543550    GraphicsLayer::unparentAndClear(m_contentsContainmentLayer);
    544551    GraphicsLayer::unparentAndClear(m_foregroundLayer);
     
    569576    if (m_contentsContainmentLayer) {
    570577        m_contentsContainmentLayer->setTransform(t);
    571         m_graphicsLayer->setTransform(TransformationMatrix());
     578        m_graphicsLayer->setTransform({ });
    572579    } else
    573580        m_graphicsLayer->setTransform(t);
     
    612619void RenderLayerBacking::updateBlendMode(const RenderStyle& style)
    613620{
    614     // FIXME: where is the blend mode updated when m_ancestorClippingLayers come and go?
    615     if (m_ancestorClippingLayer) {
    616         m_ancestorClippingLayer->setBlendMode(style.blendMode());
     621    // FIXME: where is the blend mode updated when m_ancestorClippingStacks come and go?
     622    if (m_ancestorClippingStack) {
     623        m_ancestorClippingStack->stack().first().clippingLayer->setBlendMode(style.blendMode());
    617624        m_graphicsLayer->setBlendMode(BlendMode::Normal);
    618625    } else
     
    737744        // This layer's geometry affects those of its children.
    738745        m_owningLayer.setChildrenNeedCompositingGeometryUpdate();
    739     } else if (needsClippingUpdate)
     746    } else if (needsClippingUpdate) {
     747        m_owningLayer.setNeedsCompositingConfigurationUpdate();
    740748        m_owningLayer.setNeedsCompositingGeometryUpdate();
     749    }
    741750   
    742751    if (needsFullRepaint && canIssueSetNeedsDisplay())
     
    805814        layerConfigChanged = true;
    806815
    807     // clippedByAncestor() does a tree walk.
    808     if (updateAncestorClippingLayer(compositor.clippedByAncestor(m_owningLayer)))
     816    auto* compositingAncestor = m_owningLayer.ancestorCompositingLayer();
     817    if (updateAncestorClipping(compositor.clippedByAncestor(m_owningLayer, compositingAncestor), compositingAncestor))
    809818        layerConfigChanged = true;
    810819
     
    950959}
    951960
    952 static LayoutSize computeOffsetFromAncestorGraphicsLayer(RenderLayer* compositedAncestor, const LayoutPoint& location, float deviceScaleFactor)
     961static LayoutSize computeOffsetFromAncestorGraphicsLayer(const RenderLayer* compositedAncestor, const LayoutPoint& location, float deviceScaleFactor)
    953962{
    954963    if (!compositedAncestor)
     
    10141023LayoutRect RenderLayerBacking::computePrimaryGraphicsLayerRect(const LayoutRect& parentGraphicsLayerRect) const
    10151024{
    1016     ComputedOffsets compositedBoundsOffset(m_owningLayer, compositedBounds(), parentGraphicsLayerRect, LayoutRect());
     1025    ComputedOffsets compositedBoundsOffset(m_owningLayer, compositedBounds(), parentGraphicsLayerRect, { });
    10171026    return LayoutRect(encloseRectToDevicePixels(LayoutRect(toLayoutPoint(compositedBoundsOffset.fromParentGraphicsLayer()), compositedBounds().size()),
    10181027        deviceScaleFactor()));
     
    10201029
    10211030// FIXME: See if we need this now that updateGeometry() is always called in post-order traversal.
    1022 LayoutRect RenderLayerBacking::computeParentGraphicsLayerRect(RenderLayer* compositedAncestor, LayoutSize& ancestorClippingLayerOffset) const
     1031LayoutRect RenderLayerBacking::computeParentGraphicsLayerRect(const RenderLayer* compositedAncestor) const
    10231032{
    10241033    if (!compositedAncestor || !compositedAncestor->backing())
     
    10491058    }
    10501059
    1051     if (m_ancestorClippingLayer) {
    1052         // Call calculateRects to get the backgroundRect which is what is used to clip the contents of this
    1053         // layer. Note that we call it with temporaryClipRects = true because normally when computing clip rects
    1054         // for a compositing layer, rootLayer is the layer itself.
    1055         ShouldRespectOverflowClip shouldRespectOverflowClip = compositedAncestor->isolatesCompositedBlending() ? RespectOverflowClip : IgnoreOverflowClip;
    1056         RenderLayer::ClipRectsContext clipRectsContext(compositedAncestor, TemporaryClipRects, IgnoreOverlayScrollbarSize, shouldRespectOverflowClip);
    1057         LayoutRect parentClipRect = m_owningLayer.backgroundClipRect(clipRectsContext).rect(); // FIXME: Incorrect for CSS regions.
    1058         ASSERT(!parentClipRect.isInfinite());
    1059         LayoutSize clippingOffset = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, parentClipRect.location(), deviceScaleFactor());
    1060         LayoutRect snappedClippingLayerRect = snappedGraphicsLayer(clippingOffset, parentClipRect.size(), deviceScaleFactor()).m_snappedRect;
    1061         // The primary layer is then parented in, and positioned relative to this clipping layer.
    1062         ancestorClippingLayerOffset = snappedClippingLayerRect.location() - parentGraphicsLayerRect.location();
    1063         parentGraphicsLayerRect = snappedClippingLayerRect;
    1064     }
    10651060    return parentGraphicsLayerRect;
    10661061}
     
    10921087#endif
    10931088
     1089    auto* compositedAncestor = m_owningLayer.ancestorCompositingLayer();
     1090    LayoutRect parentGraphicsLayerRect = computeParentGraphicsLayerRect(compositedAncestor);
     1091
     1092    if (m_ancestorClippingStack) {
     1093        // All clipRects in the stack are computed relative to m_owningLayer, so convert them back to compositedAncestor.
     1094        auto offsetFromCompositedAncestor = toLayoutSize(m_owningLayer.convertToLayerCoords(compositedAncestor, { }, RenderLayer::AdjustForColumns));
     1095        LayoutRect lastClipLayerRect = parentGraphicsLayerRect;
     1096
     1097        for (auto& entry : m_ancestorClippingStack->stack()) {
     1098            auto clipRect = entry.clipData.clipRect;
     1099            LayoutSize clippingOffset = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, clipRect.location() + offsetFromCompositedAncestor, deviceScaleFactor());
     1100            LayoutRect snappedClippingLayerRect = snappedGraphicsLayer(clippingOffset, clipRect.size(), deviceScaleFactor()).m_snappedRect;
     1101
     1102            entry.clippingLayer->setPosition(toLayoutPoint(snappedClippingLayerRect.location() - lastClipLayerRect.location()));
     1103            lastClipLayerRect = snappedClippingLayerRect;
     1104
     1105            entry.clippingLayer->setSize(snappedClippingLayerRect.size());
     1106
     1107            if (entry.clipData.isOverflowScroll) {
     1108                ScrollOffset scrollOffset = entry.clipData.clippingLayer->scrollOffset();
     1109
     1110                entry.clippingLayer->setBoundsOrigin(scrollOffset);
     1111                lastClipLayerRect.moveBy(-scrollOffset);
     1112            }
     1113        }
     1114
     1115        parentGraphicsLayerRect = lastClipLayerRect;
     1116    }
     1117
     1118    LayoutRect primaryGraphicsLayerRect = computePrimaryGraphicsLayerRect(parentGraphicsLayerRect);
     1119
     1120    ComputedOffsets compositedBoundsOffset(m_owningLayer, compositedBounds(), parentGraphicsLayerRect, primaryGraphicsLayerRect);
     1121    ComputedOffsets rendererOffset(m_owningLayer, { }, parentGraphicsLayerRect, primaryGraphicsLayerRect);
     1122
     1123    m_compositedBoundsOffsetFromGraphicsLayer = compositedBoundsOffset.fromPrimaryGraphicsLayer();
     1124
     1125    auto primaryLayerPosition = primaryGraphicsLayerRect.location();
     1126
    10941127    // FIXME: reflections should force transform-style to be flat in the style: https://bugs.webkit.org/show_bug.cgi?id=106959
    10951128    bool preserves3D = style.transformStyle3D() == TransformStyle3D::Preserve3D && !renderer().hasReflection();
    1096     m_graphicsLayer->setPreserves3D(preserves3D);
    1097     m_graphicsLayer->setBackfaceVisibility(style.backfaceVisibility() == BackfaceVisibility::Visible);
    1098 
    1099     auto* compositedAncestor = m_owningLayer.ancestorCompositingLayer();
    1100     LayoutSize ancestorClippingLayerOffset;
    1101     LayoutRect parentGraphicsLayerRect = computeParentGraphicsLayerRect(compositedAncestor, ancestorClippingLayerOffset);
    1102     LayoutRect primaryGraphicsLayerRect = computePrimaryGraphicsLayerRect(parentGraphicsLayerRect);
    1103 
    1104     ComputedOffsets compositedBoundsOffset(m_owningLayer, compositedBounds(), parentGraphicsLayerRect, primaryGraphicsLayerRect);
    1105     m_compositedBoundsOffsetFromGraphicsLayer = compositedBoundsOffset.fromPrimaryGraphicsLayer();
    1106     m_graphicsLayer->setPosition(primaryGraphicsLayerRect.location());
    1107     m_graphicsLayer->setSize(primaryGraphicsLayerRect.size());
     1129    if (m_contentsContainmentLayer) {
     1130        m_contentsContainmentLayer->setPreserves3D(preserves3D);
     1131        m_contentsContainmentLayer->setPosition(primaryLayerPosition);
     1132        primaryLayerPosition = { };
     1133        // Use the same size as m_graphicsLayer so transforms behave correctly.
     1134        m_contentsContainmentLayer->setSize(primaryGraphicsLayerRect.size());
     1135    }
    11081136
    11091137    auto computeAnimationExtent = [&] () -> Optional<FloatRect> {
     
    11141142    };
    11151143    m_graphicsLayer->setAnimationExtent(computeAnimationExtent());
    1116 
    1117     ComputedOffsets rendererOffset(m_owningLayer, LayoutRect(), parentGraphicsLayerRect, primaryGraphicsLayerRect);
    1118     if (m_ancestorClippingLayer) {
    1119         // Clipping layer is parented in the ancestor layer.
    1120         m_ancestorClippingLayer->setPosition(toLayoutPoint(ancestorClippingLayerOffset));
    1121         m_ancestorClippingLayer->setSize(parentGraphicsLayerRect.size());
    1122         m_ancestorClippingLayer->setOffsetFromRenderer(-rendererOffset.fromParentGraphicsLayer());
    1123     }
    1124 
    1125     if (m_contentsContainmentLayer) {
    1126         m_contentsContainmentLayer->setPreserves3D(preserves3D);
    1127         m_contentsContainmentLayer->setPosition(primaryGraphicsLayerRect.location());
    1128         m_graphicsLayer->setPosition(FloatPoint());
    1129         // Use the same size as m_graphicsLayer so transforms behave correctly.
    1130         m_contentsContainmentLayer->setSize(primaryGraphicsLayerRect.size());
    1131     }
     1144    m_graphicsLayer->setPreserves3D(preserves3D);
     1145    m_graphicsLayer->setBackfaceVisibility(style.backfaceVisibility() == BackfaceVisibility::Visible);
     1146
     1147    m_graphicsLayer->setPosition(primaryLayerPosition);
     1148    m_graphicsLayer->setSize(primaryGraphicsLayerRect.size());
    11321149
    11331150    // Compute renderer offset from primary graphics layer. Note that primaryGraphicsLayerRect is in parentGraphicsLayer's coordinate system which is not necessarily
     
    13961413    // m_foregroundLayer has to be inserted in the correct order with child layers,
    13971414    // so it's not inserted here.
    1398     if (m_ancestorClippingLayer)
    1399         m_ancestorClippingLayer->removeAllChildren();
     1415    GraphicsLayer* lastClippingLayer = nullptr;
     1416    if (m_ancestorClippingStack) {
     1417        auto& clippingStack = m_ancestorClippingStack->stack();
     1418        for (unsigned i = 0; i < clippingStack.size() - 1; ++i) {
     1419            auto& entry = clippingStack.at(i);
     1420            Vector<Ref<GraphicsLayer>> children;
     1421            children.append(*clippingStack.at(i + 1).clippingLayer);
     1422            entry.clippingLayer->setChildren(WTFMove(children));
     1423        }
     1424       
     1425        lastClippingLayer = clippingStack.last().clippingLayer.get();
     1426        lastClippingLayer->removeAllChildren();
     1427    }
    14001428   
    14011429    if (m_contentsContainmentLayer) {
    14021430        m_contentsContainmentLayer->removeAllChildren();
    1403         if (m_ancestorClippingLayer)
    1404             m_ancestorClippingLayer->addChild(*m_contentsContainmentLayer);
     1431        if (lastClippingLayer)
     1432            lastClippingLayer->addChild(*m_contentsContainmentLayer);
    14051433    }
    14061434   
     
    14101438    if (m_contentsContainmentLayer)
    14111439        m_contentsContainmentLayer->addChild(*m_graphicsLayer);
    1412     else if (m_ancestorClippingLayer)
    1413         m_ancestorClippingLayer->addChild(*m_graphicsLayer);
     1440    else if (lastClippingLayer)
     1441        lastClippingLayer->addChild(*m_graphicsLayer);
    14141442
    14151443    if (m_childContainmentLayer)
     
    15261554}
    15271555
     1556bool RenderLayerBacking::updateAncestorClippingStack(Vector<CompositedClipData>&& clippingData)
     1557{
     1558    if (!m_ancestorClippingStack && clippingData.isEmpty())
     1559        return false;
     1560
     1561    auto* scrollingCoordinator = m_owningLayer.page().scrollingCoordinator();
     1562
     1563    if (m_ancestorClippingStack && clippingData.isEmpty()) {
     1564        m_ancestorClippingStack->clear(scrollingCoordinator);
     1565        m_ancestorClippingStack = nullptr;
     1566        return true;
     1567    }
     1568   
     1569    if (!m_ancestorClippingStack) {
     1570        m_ancestorClippingStack = std::make_unique<LayerAncestorClippingStack>(WTFMove(clippingData));
     1571        LOG_WITH_STREAM(Compositing, stream << "layer " << &m_owningLayer << "  ancestorClippingStack " << *m_ancestorClippingStack);
     1572        return true;
     1573    }
     1574   
     1575    if (m_ancestorClippingStack->equalToClipData(clippingData)) {
     1576        LOG_WITH_STREAM(Compositing, stream << "layer " << &m_owningLayer << "  ancestorClippingStack " << *m_ancestorClippingStack);
     1577        return false;
     1578    }
     1579   
     1580    m_ancestorClippingStack->updateWithClipData(scrollingCoordinator, WTFMove(clippingData));
     1581    LOG_WITH_STREAM(Compositing, stream << "layer " << &m_owningLayer << "  ancestorClippingStack " << *m_ancestorClippingStack);
     1582    return true;
     1583}
     1584
    15281585// Return true if the layer changed.
    1529 bool RenderLayerBacking::updateAncestorClippingLayer(bool needsAncestorClip)
     1586bool RenderLayerBacking::updateAncestorClipping(bool needsAncestorClip, const RenderLayer* compositingAncestor)
    15301587{
    15311588    bool layersChanged = false;
    15321589
    15331590    if (needsAncestorClip) {
    1534         if (!m_ancestorClippingLayer) {
    1535             m_ancestorClippingLayer = createGraphicsLayer("ancestor clipping");
    1536             m_ancestorClippingLayer->setMasksToBounds(true);
     1591        if (compositor().updateAncestorClippingStack(m_owningLayer, compositingAncestor)) {
     1592            // Make any layers we don't have.
     1593            if (m_ancestorClippingStack) {
     1594                for (auto& entry : m_ancestorClippingStack->stack()) {
     1595                    if (!entry.clippingLayer) {
     1596                        entry.clippingLayer = createGraphicsLayer(entry.clipData.isOverflowScroll ? "clip for scroller" : "ancestor clipping");
     1597                        entry.clippingLayer->setMasksToBounds(true);
     1598                        entry.clippingLayer->setPaintingPhase({ });
     1599                    }
     1600                }
     1601            }
     1602
    15371603            layersChanged = true;
    15381604        }
    1539     } else if (hasAncestorClippingLayer()) {
    1540         willDestroyLayer(m_ancestorClippingLayer.get());
    1541         GraphicsLayer::unparentAndClear(m_ancestorClippingLayer);
     1605    } else if (m_ancestorClippingStack) {
     1606        for (auto& entry : m_ancestorClippingStack->stack())
     1607            GraphicsLayer::unparentAndClear(entry.clippingLayer);
     1608
     1609        m_ancestorClippingStack = nullptr;
    15421610        layersChanged = true;
    15431611    }
     
    18611929}
    18621930
    1863 OptionSet<ScrollCoordinationRole> RenderLayerBacking::coordinatedScrollingRoles() const
    1864 {
    1865     auto& compositor = this->compositor();
    1866 
    1867     OptionSet<ScrollCoordinationRole> coordinationRoles;
    1868     if (compositor.isViewportConstrainedFixedOrStickyLayer(m_owningLayer))
    1869         coordinationRoles.add(ScrollCoordinationRole::ViewportConstrained);
    1870 
    1871     if (compositor.useCoordinatedScrollingForLayer(m_owningLayer))
    1872         coordinationRoles.add(ScrollCoordinationRole::Scrolling);
    1873 
    1874     if (compositor.isLayerForIFrameWithScrollCoordinatedContents(m_owningLayer))
    1875         coordinationRoles.add(ScrollCoordinationRole::FrameHosting);
    1876 
    1877     if (compositor.computeCoordinatedPositioningForLayer(m_owningLayer) != ScrollPositioningBehavior::None)
    1878         coordinationRoles.add(ScrollCoordinationRole::Positioning);
    1879 
    1880     return coordinationRoles;
    1881 }
    1882 
    18831931void RenderLayerBacking::detachFromScrollingCoordinator(OptionSet<ScrollCoordinationRole> roles)
    18841932{
    1885     if (!m_scrollingNodeID && !m_frameHostingNodeID && !m_viewportConstrainedNodeID && !m_positioningNodeID)
     1933    if (!m_scrollingNodeID && !m_ancestorClippingStack && !m_frameHostingNodeID && !m_viewportConstrainedNodeID && !m_positioningNodeID)
    18861934        return;
    18871935
     
    18911939
    18921940    if (roles.contains(ScrollCoordinationRole::Scrolling) && m_scrollingNodeID) {
    1893         LOG(Compositing, "Detaching Scrolling node %" PRIu64, m_scrollingNodeID);
     1941        LOG_WITH_STREAM(Compositing, stream << "Detaching Scrolling node " << m_scrollingNodeID);
    18941942        scrollingCoordinator->unparentChildrenAndDestroyNode(m_scrollingNodeID);
    18951943        m_scrollingNodeID = 0;
    18961944    }
    18971945
     1946    if (roles.contains(ScrollCoordinationRole::ScrollingProxy) && m_ancestorClippingStack) {
     1947        m_ancestorClippingStack->detachFromScrollingCoordinator(*scrollingCoordinator);
     1948        LOG_WITH_STREAM(Compositing, stream << "Detaching nodes in ancestor clipping stack");
     1949    }
     1950
    18981951    if (roles.contains(ScrollCoordinationRole::FrameHosting) && m_frameHostingNodeID) {
    1899         LOG(Compositing, "Detaching FrameHosting node %" PRIu64, m_frameHostingNodeID);
     1952        LOG_WITH_STREAM(Compositing, stream << "Detaching FrameHosting node " << m_frameHostingNodeID);
    19001953        scrollingCoordinator->unparentChildrenAndDestroyNode(m_frameHostingNodeID);
    19011954        m_frameHostingNodeID = 0;
     
    19031956
    19041957    if (roles.contains(ScrollCoordinationRole::ViewportConstrained) && m_viewportConstrainedNodeID) {
    1905         LOG(Compositing, "Detaching ViewportConstrained node %" PRIu64, m_viewportConstrainedNodeID);
     1958        LOG_WITH_STREAM(Compositing, stream << "Detaching ViewportConstrained node " << m_viewportConstrainedNodeID);
    19061959        scrollingCoordinator->unparentChildrenAndDestroyNode(m_viewportConstrainedNodeID);
    19071960        m_viewportConstrainedNodeID = 0;
     
    19091962
    19101963    if (roles.contains(ScrollCoordinationRole::Positioning) && m_positioningNodeID) {
    1911         LOG(Compositing, "Detaching Positioned node %" PRIu64, m_positioningNodeID);
     1964        LOG_WITH_STREAM(Compositing, stream << "Detaching Positioned node " << m_positioningNodeID);
    19121965        scrollingCoordinator->unparentChildrenAndDestroyNode(m_positioningNodeID);
    19131966        m_positioningNodeID = 0;
    19141967    }
     1968}
     1969
     1970ScrollingNodeID RenderLayerBacking::scrollingNodeIDForChildren() const
     1971{
     1972    if (m_frameHostingNodeID)
     1973        return m_frameHostingNodeID;
     1974
     1975    if (m_scrollingNodeID)
     1976        return m_scrollingNodeID;
     1977
     1978    if (m_viewportConstrainedNodeID)
     1979        return m_viewportConstrainedNodeID;
     1980
     1981    if (m_ancestorClippingStack) {
     1982        if (auto lastOverflowScrollProxyNode = m_ancestorClippingStack->lastOverflowScrollProxyNodeID())
     1983            return lastOverflowScrollProxyNode;
     1984    }
     1985
     1986    return m_positioningNodeID;
    19151987}
    19161988
     
    24992571GraphicsLayer* RenderLayerBacking::childForSuperlayers() const
    25002572{
    2501     if (m_ancestorClippingLayer)
    2502         return m_ancestorClippingLayer.get();
     2573    if (m_ancestorClippingStack)
     2574        return m_ancestorClippingStack->firstClippingLayer();
    25032575
    25042576    if (m_contentsContainmentLayer)
     
    26552727        return;
    26562728    }
     2729
     2730    GraphicsContextStateStackChecker checker(context);
    26572731
    26582732    OptionSet<RenderLayer::PaintLayerFlag> paintFlags;
     
    33123386    double backingMemory;
    33133387   
    3314     // m_ancestorClippingLayer, m_contentsContainmentLayer and m_childContainmentLayer are just used for masking or containment, so have no backing.
     3388    // Layers in m_ancestorClippingStack, m_contentsContainmentLayer and m_childContainmentLayer are just used for masking or containment, so have no backing.
    33153389    backingMemory = m_graphicsLayer->backingStoreMemoryEstimate();
    33163390    if (m_foregroundLayer)
     
    33543428    if (auto nodeID = backing.scrollingNodeIDForRole(ScrollCoordinationRole::Scrolling))
    33553429        ts << " scrolling node " << nodeID;
     3430
     3431    if (backing.ancestorClippingStack())
     3432        ts << " ancestor clip stack " << *backing.ancestorClippingStack();
     3433
    33563434    if (auto nodeID = backing.scrollingNodeIDForRole(ScrollCoordinationRole::FrameHosting))
    33573435        ts << " frame hosting node " << nodeID;
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r246301 r246725  
    4545    NormalCompositingLayer, // non-tiled layer with backing store
    4646    TiledCompositingLayer, // tiled layer (always has backing store)
    47     MediaCompositingLayer, // layer that contains an image, video, webGL or plugin
     47    MediaCompositingLayer, // layer that contains an image, video, WebGL or plugin
    4848    ContainerCompositingLayer // layer with no backing store
    4949};
     
    101101    GraphicsLayer* clippingLayer() const { return !m_isFrameLayerWithTiledBacking ? m_childContainmentLayer.get() : nullptr; }
    102102
    103     // Layer to get clipped by ancestor
    104     bool hasAncestorClippingLayer() const { return m_ancestorClippingLayer != nullptr; }
    105     GraphicsLayer* ancestorClippingLayer() const { return m_ancestorClippingLayer.get(); }
     103    bool hasAncestorClippingLayers() const { return !!m_ancestorClippingStack; }
     104    LayerAncestorClippingStack* ancestorClippingStack() const { return m_ancestorClippingStack.get(); }
     105    bool updateAncestorClippingStack(Vector<CompositedClipData>&&);
    106106
    107107    GraphicsLayer* contentsContainmentLayer() const { return m_contentsContainmentLayer.get(); }
     
    117117    GraphicsLayer* scrollContainerLayer() const { return m_scrollContainerLayer.get(); }
    118118    GraphicsLayer* scrolledContentsLayer() const { return m_scrolledContentsLayer.get(); }
    119 
    120     OptionSet<ScrollCoordinationRole> coordinatedScrollingRoles() const;
    121119
    122120    void detachFromScrollingCoordinator(OptionSet<ScrollCoordinationRole>);
     
    127125        case ScrollCoordinationRole::Scrolling:
    128126            return m_scrollingNodeID;
     127        case ScrollCoordinationRole::ScrollingProxy:
     128            // These nodeIDs are stored in m_ancestorClippingStack.
     129            ASSERT_NOT_REACHED();
     130            return 0;
    129131        case ScrollCoordinationRole::FrameHosting:
    130132            return m_frameHostingNodeID;
     
    142144        case ScrollCoordinationRole::Scrolling:
    143145            m_scrollingNodeID = nodeID;
     146            break;
     147        case ScrollCoordinationRole::ScrollingProxy:
     148            // These nodeIDs are stored in m_ancestorClippingStack.
     149            ASSERT_NOT_REACHED();
    144150            break;
    145151        case ScrollCoordinationRole::FrameHosting:
     
    156162    }
    157163
    158     ScrollingNodeID scrollingNodeIDForChildren() const
    159     {
    160         if (m_frameHostingNodeID)
    161             return m_frameHostingNodeID;
    162 
    163         if (m_scrollingNodeID)
    164             return m_scrollingNodeID;
    165 
    166         if (m_viewportConstrainedNodeID)
    167             return m_viewportConstrainedNodeID;
    168 
    169         return m_positioningNodeID;
    170     }
    171 
     164    ScrollingNodeID scrollingNodeIDForChildren() const;
    172165    void setIsScrollCoordinatedWithViewportConstrainedRole(bool);
    173166
     
    314307
    315308    void updateInternalHierarchy();
    316     bool updateAncestorClippingLayer(bool needsAncestorClip);
     309    bool updateAncestorClipping(bool needsAncestorClip, const RenderLayer* compositingAncestor);
    317310    bool updateDescendantClippingLayer(bool needsDescendantClip);
    318311    bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer);
     
    392385
    393386    bool canIssueSetNeedsDisplay() const { return !paintsIntoWindow() && !paintsIntoCompositedAncestor(); }
    394     LayoutRect computeParentGraphicsLayerRect(RenderLayer* compositedAncestor, LayoutSize& ancestorClippingLayerOffset) const;
     387    LayoutRect computeParentGraphicsLayerRect(const RenderLayer* compositedAncestor) const;
    395388    LayoutRect computePrimaryGraphicsLayerRect(const LayoutRect& parentGraphicsLayerRect) const;
    396389
    397390    RenderLayer& m_owningLayer;
    398 
     391   
    399392    // A list other layers that paint into this backing store, later than m_owningLayer in paint order.
    400393    Vector<WeakPtr<RenderLayer>> m_backingSharingLayers;
    401394
    402     RefPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clipped by an ancestor which is not a stacking context.
     395    std::unique_ptr<LayerAncestorClippingStack> m_ancestorClippingStack; // Only used if we are clipped by an ancestor which is not a stacking context.
     396
    403397    RefPtr<GraphicsLayer> m_contentsContainmentLayer; // Only used if we have a background layer; takes the transform.
    404398    RefPtr<GraphicsLayer> m_graphicsLayer;
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r246723 r246725  
    4343#include "HitTestResult.h"
    4444#include "InspectorInstrumentation.h"
     45#include "LayerAncestorClippingStack.h"
    4546#include "LayerOverlapMap.h"
    4647#include "Logging.h"
     
    577578        updateScrollingNodeLayers(nodeID, layer, *scrollingCoordinator);
    578579
     580    if (auto* clippingStack = layer.backing()->ancestorClippingStack())
     581        clippingStack->updateScrollingNodeLayers(*scrollingCoordinator);
     582
    579583    if (auto nodeID = backing->scrollingNodeIDForRole(ScrollCoordinationRole::ViewportConstrained))
    580584        scrollingCoordinator->setNodeLayers(nodeID, { backing->graphicsLayer() });
     
    12291233        // FIXME: do based on dirty flags. Need to do this for changes of geometry, configuration and hierarchy.
    12301234        // Need to be careful to do the right thing when a scroll-coordinated layer loses a scroll-coordinated ancestor.
    1231         stateForDescendants.parentNodeID = updateScrollCoordinationForLayer(layer, scrollingTreeState, layerBacking->coordinatedScrollingRoles(), scrollingNodeChanges);
     1235        stateForDescendants.parentNodeID = updateScrollCoordinationForLayer(layer, scrollingTreeState, scrollingNodeChanges);
    12321236        stateForDescendants.nextChildIndex = 0;
    12331237
     
    14701474        layer.setNeedsPostLayoutCompositingUpdate();
    14711475
    1472     if (diff >= StyleDifference::LayoutPositionedMovementOnly && hasContentCompositingLayers()) {
    1473         layer.setNeedsPostLayoutCompositingUpdate();
    1474         layer.setNeedsCompositingGeometryUpdate();
     1476    const auto& newStyle = layer.renderer().style();
     1477
     1478    if (hasContentCompositingLayers()) {
     1479        if (diff >= StyleDifference::LayoutPositionedMovementOnly) {
     1480            layer.setNeedsPostLayoutCompositingUpdate();
     1481            layer.setNeedsCompositingGeometryUpdate();
     1482        }
     1483
     1484        if (diff >= StyleDifference::Layout) {
     1485            // FIXME: only set flags here if we know we have a composited descendant, but we might not know at this point.
     1486            if (oldStyle && clippingChanged(*oldStyle, newStyle)) {
     1487                if (layer.isStackingContext()) {
     1488                    layer.setNeedsPostLayoutCompositingUpdate(); // Layer needs to become composited if it has composited descendants.
     1489                    layer.setNeedsCompositingConfigurationUpdate(); // If already composited, layer needs to create/destroy clipping layer.
     1490                } else {
     1491                    // Descendant (in containing block order) compositing layers need to re-evaluate their clipping,
     1492                    // but they might be siblings in z-order so go up to our stacking context.
     1493                    if (auto* stackingContext = layer.stackingContext())
     1494                        stackingContext->setDescendantsNeedUpdateBackingAndHierarchyTraversal();
     1495                }
     1496            }
     1497
     1498            // These properties trigger compositing if some descendant is composited.
     1499            if (oldStyle && styleChangeMayAffectIndirectCompositingReasons(*oldStyle, newStyle))
     1500                layer.setNeedsPostLayoutCompositingUpdate();
     1501
     1502            layer.setNeedsCompositingGeometryUpdate();
     1503        }
    14751504    }
    14761505
     
    14801509
    14811510    backing->updateConfigurationAfterStyleChange();
    1482 
    1483     const auto& newStyle = layer.renderer().style();
    14841511
    14851512    if (diff >= StyleDifference::Repaint) {
     
    15021529        // FIXME: transform changes really need to trigger layout. See RenderElement::adjustStyleDifference().
    15031530        layer.setNeedsPostLayoutCompositingUpdate();
    1504         layer.setNeedsCompositingGeometryUpdate();
    1505     }
    1506 
    1507     if (diff >= StyleDifference::Layout) {
    1508         // FIXME: only set flags here if we know we have a composited descendant, but we might not know at this point.
    1509         if (oldStyle && clippingChanged(*oldStyle, newStyle)) {
    1510             if (layer.isStackingContext()) {
    1511                 layer.setNeedsPostLayoutCompositingUpdate(); // Layer needs to become composited if it has composited descendants.
    1512                 layer.setNeedsCompositingConfigurationUpdate(); // If already composited, layer needs to create/destroy clipping layer.
    1513             } else {
    1514                 // Descendant (in containing block order) compositing layers need to re-evaluate their clipping,
    1515                 // but they might be siblings in z-order so go up to our stacking context.
    1516                 if (auto* stackingContext = layer.stackingContext())
    1517                     stackingContext->setDescendantsNeedUpdateBackingAndHierarchyTraversal();
    1518             }
    1519         }
    1520 
    1521         // These properties trigger compositing if some descendant is composited.
    1522         if (oldStyle && styleChangeMayAffectIndirectCompositingReasons(*oldStyle, newStyle))
    1523             layer.setNeedsPostLayoutCompositingUpdate();
    1524 
    15251531        layer.setNeedsCompositingGeometryUpdate();
    15261532    }
     
    25872593// but a sibling in the z-order hierarchy.
    25882594// FIXME: can we do this without a tree walk?
    2589 bool RenderLayerCompositor::clippedByAncestor(RenderLayer& layer) const
     2595bool RenderLayerCompositor::clippedByAncestor(RenderLayer& layer, const RenderLayer* compositingAncestor) const
    25902596{
    25912597    ASSERT(layer.isComposited());
    2592     if (!layer.parent())
    2593         return false;
    2594 
    2595     // On first pass in WK1, the root may not have become composited yet.
    2596     auto* compositingAncestor = layer.ancestorCompositingLayer();
    25972598    if (!compositingAncestor)
    25982599        return false;
     
    26232624}
    26242625
     2626bool RenderLayerCompositor::updateAncestorClippingStack(const RenderLayer& layer, const RenderLayer* compositingAncestor) const
     2627{
     2628    ASSERT(layer.isComposited());
     2629
     2630    auto clippingStack = computeAncestorClippingStack(layer, compositingAncestor);
     2631    return layer.backing()->updateAncestorClippingStack(WTFMove(clippingStack));
     2632}
     2633
     2634Vector<CompositedClipData> RenderLayerCompositor::computeAncestorClippingStack(const RenderLayer& layer, const RenderLayer* compositingAncestor) const
     2635{
     2636    // On first pass in WK1, the root may not have become composited yet.
     2637    if (!compositingAncestor)
     2638        return { };
     2639
     2640    // We'll start by building a child-to-ancestors stack.
     2641    Vector<CompositedClipData> newStack;
     2642
     2643    // Walk up the containing block chain to composited ancestor, prepending an entry to the clip stack for:
     2644    // * each composited scrolling layer
     2645    // * each set of RenderLayers which contribute a clip.
     2646    bool haveNonScrollableClippingIntermediateLayer = false;
     2647    const RenderLayer* currentClippedLayer = &layer;
     2648   
     2649    auto pushNonScrollableClip = [&](const RenderLayer& clippedLayer, const RenderLayer& clippingRoot, ShouldRespectOverflowClip respectClip = IgnoreOverflowClip) {
     2650        // Pass IgnoreOverflowClip to ignore overflow contributed by clippingRoot (which may be a scroller).
     2651        auto clipRect = clippedLayer.backgroundClipRect(RenderLayer::ClipRectsContext(&clippingRoot, TemporaryClipRects, IgnoreOverlayScrollbarSize, respectClip)).rect();
     2652        auto offset = layer.convertToLayerCoords(&clippingRoot, { }, RenderLayer::AdjustForColumns);
     2653        clipRect.moveBy(-offset);
     2654
     2655        CompositedClipData clipData { const_cast<RenderLayer*>(&clippedLayer), clipRect, false };
     2656        newStack.insert(0, WTFMove(clipData));
     2657    };
     2658
     2659    traverseAncestorLayers(layer, [&](const RenderLayer& ancestorLayer, bool isContainingBlockChain, bool /*isPaintOrderAncestor*/) {
     2660        if (&ancestorLayer == compositingAncestor) {
     2661       
     2662            if (haveNonScrollableClippingIntermediateLayer)
     2663                pushNonScrollableClip(*currentClippedLayer, ancestorLayer, ancestorLayer.isolatesCompositedBlending() ? RespectOverflowClip : IgnoreOverflowClip);
     2664            else if (ancestorLayer.isolatesCompositedBlending() && newStack.isEmpty())
     2665                pushNonScrollableClip(*currentClippedLayer, ancestorLayer, RespectOverflowClip);
     2666
     2667            return AncestorTraversal::Stop;
     2668        }
     2669
     2670        if (isContainingBlockChain && ancestorLayer.renderer().hasClipOrOverflowClip()) {
     2671            if (ancestorLayer.hasCompositedScrollableOverflow()) {
     2672                if (haveNonScrollableClippingIntermediateLayer) {
     2673                    pushNonScrollableClip(*currentClippedLayer, ancestorLayer);
     2674                    haveNonScrollableClippingIntermediateLayer = false;
     2675                }
     2676
     2677                auto clipRect = parentRelativeScrollableRect(ancestorLayer, &ancestorLayer);
     2678                auto offset = layer.convertToLayerCoords(&ancestorLayer, { }, RenderLayer::AdjustForColumns);
     2679                clipRect.moveBy(-offset);
     2680
     2681                CompositedClipData clipData { const_cast<RenderLayer*>(&ancestorLayer), clipRect, true };
     2682                newStack.insert(0, WTFMove(clipData));
     2683                currentClippedLayer = &ancestorLayer;
     2684            } else
     2685                haveNonScrollableClippingIntermediateLayer = true;
     2686        }
     2687
     2688        return AncestorTraversal::Continue;
     2689    });
     2690   
     2691    return newStack;
     2692}
     2693
    26252694// Return true if the given layer is a stacking context and has compositing child
    26262695// layers that it needs to clip. In this case we insert a clipping GraphicsLayer
     
    31843253static Vector<ScrollingNodeID> collectRelatedCoordinatedScrollingNodes(const RenderLayer& layer, ScrollPositioningBehavior positioningBehavior)
    31853254{
    3186     Vector<ScrollingNodeID> overflowNodeData;
     3255    Vector<ScrollingNodeID> overflowNodeIDs;
    31873256
    31883257    switch (positioningBehavior) {
    3189     case ScrollPositioningBehavior::Moves: {
    3190         // Collect all the composited scrollers between this layer and its composited ancestor.
    3191         auto* compositedAncestor = layer.ancestorCompositingLayer();
    3192         for (const auto* currLayer = layer.parent(); currLayer != compositedAncestor; currLayer = currLayer->parent()) {
    3193             if (currLayer->hasCompositedScrollableOverflow()) {
    3194                 auto scrollingNodeID = currLayer->isComposited() ? currLayer->backing()->scrollingNodeIDForRole(ScrollCoordinationRole::Scrolling) : 0;
    3195                 if (scrollingNodeID)
    3196                     overflowNodeData.append(scrollingNodeID);
    3197                 else
    3198                     LOG(Scrolling, "Layer %p isn't composited or doesn't have scrolling node ID yet", &layer);
    3199             }
    3200         }
    3201         break;
    3202     }
    32033258    case ScrollPositioningBehavior::Stationary: {
    32043259        auto* compositedAncestor = layer.ancestorCompositingLayer();
    32053260        if (!compositedAncestor)
    3206             return overflowNodeData;
    3207         collectStationaryLayerRelatedOverflowNodes(layer, *compositedAncestor, overflowNodeData);
     3261            return overflowNodeIDs;
     3262        collectStationaryLayerRelatedOverflowNodes(layer, *compositedAncestor, overflowNodeIDs);
    32083263        break;
    32093264    }
     3265    case ScrollPositioningBehavior::Moves:
    32103266    case ScrollPositioningBehavior::None:
    32113267        ASSERT_NOT_REACHED();
     
    32133269    }
    32143270
    3215     return overflowNodeData;
     3271    return overflowNodeIDs;
    32163272}
    32173273
     
    40484104#endif
    40494105
    4050     detachScrollCoordinatedLayer(layer, { ScrollCoordinationRole::Scrolling, ScrollCoordinationRole::ViewportConstrained, ScrollCoordinationRole::FrameHosting, ScrollCoordinationRole::Positioning });
     4106    detachScrollCoordinatedLayer(layer, allScrollCoordinationRoles());
    40514107}
    40524108
     
    41104166    case ScrollingNodeType::Overflow:
    41114167        return ScrollCoordinationRole::Scrolling;
     4168    case ScrollingNodeType::OverflowProxy:
     4169        return ScrollCoordinationRole::ScrollingProxy;
    41124170    case ScrollingNodeType::FrameHosting:
    41134171        return ScrollCoordinationRole::FrameHosting;
     
    41174175    case ScrollingNodeType::Positioned:
    41184176        return ScrollCoordinationRole::Positioning;
    4119     case ScrollingNodeType::OverflowProxy:
    4120         break;
    41214177    }
    41224178    ASSERT_NOT_REACHED();
     
    41384194    ScrollCoordinationRole role = scrollCoordinationRoleForNodeType(nodeType);
    41394195    ScrollingNodeID nodeID = backing->scrollingNodeIDForRole(role);
     4196   
     4197    nodeID = registerScrollingNodeID(*scrollingCoordinator, nodeID, nodeType, treeState);
     4198
     4199    LOG_WITH_STREAM(Scrolling, stream << "RenderLayerCompositor " << this << " attachScrollingNode " << nodeID << " (layer " << backing->graphicsLayer()->primaryLayerID() << ") type " << nodeType << " parent " << treeState.parentNodeID.valueOr(0));
     4200
    41404201    if (!nodeID)
    4141         nodeID = scrollingCoordinator->uniqueScrollingNodeID();
    4142 
    4143     LOG_WITH_STREAM(Scrolling, stream << "RenderLayerCompositor " << this << " attachScrollingNode " << nodeID << " (layer " << backing->graphicsLayer()->primaryLayerID() << ") type " << nodeType << " parent " << treeState.parentNodeID.valueOr(0));
     4202        return 0;
     4203   
     4204    backing->setScrollingNodeIDForRole(nodeID, role);
     4205    m_scrollingNodeToLayerMap.add(nodeID, &layer);
     4206   
     4207    return nodeID;
     4208}
     4209
     4210ScrollingNodeID RenderLayerCompositor::registerScrollingNodeID(ScrollingCoordinator& scrollingCoordinator, ScrollingNodeID nodeID, ScrollingNodeType nodeType, struct ScrollingTreeState& treeState)
     4211{
     4212    if (!nodeID)
     4213        nodeID = scrollingCoordinator.uniqueScrollingNodeID();
    41444214
    41454215    if (nodeType == ScrollingNodeType::Subframe && !treeState.parentNodeID)
    4146         nodeID = scrollingCoordinator->createNode(nodeType, nodeID);
     4216        nodeID = scrollingCoordinator.createNode(nodeType, nodeID);
    41474217    else {
    4148         auto newNodeID = scrollingCoordinator->insertNode(nodeType, nodeID, treeState.parentNodeID.valueOr(0), treeState.nextChildIndex);
     4218        auto newNodeID = scrollingCoordinator.insertNode(nodeType, nodeID, treeState.parentNodeID.valueOr(0), treeState.nextChildIndex);
    41494219        if (newNodeID != nodeID) {
    41504220            // We'll get a new nodeID if the type changed (and not if the node is new).
    4151             scrollingCoordinator->unparentChildrenAndDestroyNode(nodeID);
     4221            scrollingCoordinator.unparentChildrenAndDestroyNode(nodeID);
    41524222            m_scrollingNodeToLayerMap.remove(nodeID);
    41534223        }
     
    41594229        return 0;
    41604230   
    4161     backing->setScrollingNodeIDForRole(nodeID, role);
    4162     m_scrollingNodeToLayerMap.add(nodeID, &layer);
    4163    
    41644231    ++treeState.nextChildIndex;
    41654232    return nodeID;
     
    41684235void RenderLayerCompositor::detachScrollCoordinatedLayerWithRole(RenderLayer& layer, ScrollingCoordinator& scrollingCoordinator, ScrollCoordinationRole role)
    41694236{
     4237    auto unregisterNode = [&](ScrollingNodeID nodeID) {
     4238        auto childNodes = scrollingCoordinator.childrenOfNode(nodeID);
     4239        for (auto childNodeID : childNodes) {
     4240            if (auto* layer = m_scrollingNodeToLayerMap.get(childNodeID))
     4241                layer->setNeedsScrollingTreeUpdate();
     4242        }
     4243
     4244        m_scrollingNodeToLayerMap.remove(nodeID);
     4245    };
     4246
     4247    if (role == ScrollCoordinationRole::ScrollingProxy) {
     4248        ASSERT(layer.isComposited());
     4249        auto* clippingStack = layer.backing()->ancestorClippingStack();
     4250        if (!clippingStack)
     4251            return;
     4252       
     4253        auto& stack = clippingStack->stack();
     4254        for (auto& entry : stack) {
     4255            if (entry.overflowScrollProxyNodeID)
     4256                unregisterNode(entry.overflowScrollProxyNodeID);
     4257        }
     4258        return;
     4259    }
     4260
    41704261    auto nodeID = layer.backing()->scrollingNodeIDForRole(role);
    41714262    if (!nodeID)
    41724263        return;
    41734264
    4174     auto childNodes = scrollingCoordinator.childrenOfNode(nodeID);
    4175     for (auto childNodeID : childNodes) {
    4176         // FIXME: The child might be in a child frame. Need to do something that crosses frame boundaries.
    4177         if (auto* layer = m_scrollingNodeToLayerMap.get(childNodeID))
    4178             layer->setNeedsScrollingTreeUpdate();
    4179     }
    4180 
    4181     m_scrollingNodeToLayerMap.remove(nodeID);
     4265    unregisterNode(nodeID);
    41824266}
    41834267
     
    41934277        detachScrollCoordinatedLayerWithRole(layer, *scrollingCoordinator, ScrollCoordinationRole::Scrolling);
    41944278
     4279    if (roles.contains(ScrollCoordinationRole::ScrollingProxy))
     4280        detachScrollCoordinatedLayerWithRole(layer, *scrollingCoordinator, ScrollCoordinationRole::ScrollingProxy);
     4281
    41954282    if (roles.contains(ScrollCoordinationRole::FrameHosting))
    41964283        detachScrollCoordinatedLayerWithRole(layer, *scrollingCoordinator, ScrollCoordinationRole::FrameHosting);
     
    42054292}
    42064293
    4207 ScrollingNodeID RenderLayerCompositor::updateScrollCoordinationForLayer(RenderLayer& layer, ScrollingTreeState& treeState, OptionSet<ScrollCoordinationRole> roles, OptionSet<ScrollingNodeChangeFlags> changes)
    4208 {
     4294OptionSet<ScrollCoordinationRole> RenderLayerCompositor::coordinatedScrollingRolesForLayer(const RenderLayer& layer) const
     4295{
     4296    OptionSet<ScrollCoordinationRole> coordinationRoles;
     4297    if (isViewportConstrainedFixedOrStickyLayer(layer))
     4298        coordinationRoles.add(ScrollCoordinationRole::ViewportConstrained);
     4299
     4300    if (useCoordinatedScrollingForLayer(layer))
     4301        coordinationRoles.add(ScrollCoordinationRole::Scrolling);
     4302
     4303    auto coordinatedPositioning = computeCoordinatedPositioningForLayer(layer);
     4304    switch (coordinatedPositioning) {
     4305    case ScrollPositioningBehavior::Moves:
     4306        coordinationRoles.add(ScrollCoordinationRole::ScrollingProxy);
     4307        break;
     4308    case ScrollPositioningBehavior::Stationary:
     4309        coordinationRoles.add(ScrollCoordinationRole::Positioning);
     4310        break;
     4311    case ScrollPositioningBehavior::None:
     4312        break;
     4313    }
     4314
     4315    if (isLayerForIFrameWithScrollCoordinatedContents(layer))
     4316        coordinationRoles.add(ScrollCoordinationRole::FrameHosting);
     4317
     4318    return coordinationRoles;
     4319}
     4320
     4321ScrollingNodeID RenderLayerCompositor::updateScrollCoordinationForLayer(RenderLayer& layer, ScrollingTreeState& treeState, OptionSet<ScrollingNodeChangeFlags> changes)
     4322{
     4323    auto roles = coordinatedScrollingRolesForLayer(layer);
     4324
    42094325    bool isViewportConstrained = roles.contains(ScrollCoordinationRole::ViewportConstrained);
    42104326#if PLATFORM(IOS_FAMILY)
     
    42374353    } else
    42384354        detachScrollCoordinatedLayer(layer, ScrollCoordinationRole::Positioning);
     4355
     4356    // If there's a scrolling proxy node, it's the parent scrolling node for fixed/sticky/scrolling/frame hosting.
     4357    if (roles.contains(ScrollCoordinationRole::ScrollingProxy)) {
     4358        newNodeID = updateScrollingNodeForScrollingProxyRole(layer, *currentTreeState, changes);
     4359        childTreeState.parentNodeID = newNodeID;
     4360        currentTreeState = &childTreeState;
     4361    } else
     4362        detachScrollCoordinatedLayer(layer, ScrollCoordinationRole::ScrollingProxy);
    42394363
    42404364    // If is fixed or sticky, it's the parent scrolling node for scrolling/frame hosting.
     
    43844508}
    43854509
     4510ScrollingNodeID RenderLayerCompositor::updateScrollingNodeForScrollingProxyRole(RenderLayer& layer, ScrollingTreeState& treeState, OptionSet<ScrollingNodeChangeFlags> changes)
     4511{
     4512    auto* scrollingCoordinator = this->scrollingCoordinator();
     4513    auto* clippingStack = layer.backing()->ancestorClippingStack();
     4514    if (!clippingStack)
     4515        return 0;
     4516
     4517    ScrollingNodeID nodeID = 0;
     4518    for (auto& entry : clippingStack->stack()) {
     4519        if (!entry.clipData.isOverflowScroll)
     4520            continue;
     4521
     4522        nodeID = registerScrollingNodeID(*scrollingCoordinator, entry.overflowScrollProxyNodeID, ScrollingNodeType::OverflowProxy, treeState);
     4523        if (!nodeID) {
     4524            ASSERT_NOT_REACHED();
     4525            return treeState.parentNodeID.valueOr(0);
     4526        }
     4527        entry.overflowScrollProxyNodeID = nodeID;
     4528
     4529        if (changes & ScrollingNodeChangeFlags::Layer)
     4530            scrollingCoordinator->setNodeLayers(entry.overflowScrollProxyNodeID, { entry.clippingLayer.get() });
     4531
     4532        if (changes & ScrollingNodeChangeFlags::LayerGeometry) {
     4533            ASSERT(entry.clipData.clippingLayer);
     4534            ASSERT(entry.clipData.clippingLayer->isComposited());
     4535
     4536            auto overflowScrollNodeID = 0;
     4537            if (auto* backing = entry.clipData.clippingLayer->backing())
     4538                overflowScrollNodeID = backing->scrollingNodeIDForRole(ScrollCoordinationRole::Scrolling);
     4539       
     4540            Vector<ScrollingNodeID> scrollingNodeIDs;
     4541            if (overflowScrollNodeID)
     4542                scrollingNodeIDs.append(overflowScrollNodeID);
     4543            scrollingCoordinator->setRelatedOverflowScrollingNodes(entry.overflowScrollProxyNodeID, WTFMove(scrollingNodeIDs));
     4544        }
     4545    }
     4546
     4547    return nodeID;
     4548}
     4549
    43864550ScrollingNodeID RenderLayerCompositor::updateScrollingNodeForFrameHostingRole(RenderLayer& layer, ScrollingTreeState& treeState, OptionSet<ScrollingNodeChangeFlags> changes)
    43874551{
     
    44274591
    44284592        auto* graphicsLayer = layer.backing()->graphicsLayer();
    4429         LayoutConstraints constraints;
     4593        AbsolutePositionConstraints constraints;
    44304594        constraints.setAlignmentOffset(graphicsLayer->pixelAlignmentOffset());
    44314595        constraints.setLayerPositionAtLastLayout(graphicsLayer->position());
    4432         constraints.setScrollPositioningBehavior(positioningBehavior);
    4433         scrollingCoordinator->setPositionedNodeGeometry(newNodeID, constraints);
     4596        scrollingCoordinator->setPositionedNodeConstraints(newNodeID, constraints);
    44344597    }
    44354598
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r246612 r246725  
    2929#include "GraphicsLayerClient.h"
    3030#include "GraphicsLayerUpdater.h"
     31#include "LayerAncestorClippingStack.h"
    3132#include "RenderLayer.h"
    3233#include <wtf/HashMap.h>
     
    8990    ViewportConstrained = 1 << 0,
    9091    Scrolling           = 1 << 1,
    91     FrameHosting        = 1 << 2,
    92     Positioning         = 1 << 3,
     92    ScrollingProxy      = 1 << 2,
     93    FrameHosting        = 1 << 3,
     94    Positioning         = 1 << 4,
    9395};
     96
     97static constexpr OptionSet<ScrollCoordinationRole> allScrollCoordinationRoles()
     98{
     99    return {
     100        ScrollCoordinationRole::Scrolling,
     101        ScrollCoordinationRole::ScrollingProxy,
     102        ScrollCoordinationRole::ViewportConstrained,
     103        ScrollCoordinationRole::FrameHosting,
     104        ScrollCoordinationRole::Positioning
     105    };
     106}
    94107
    95108#if PLATFORM(IOS_FAMILY)
     
    202215
    203216    // Whether layer's backing needs a graphics layer to do clipping by an ancestor (non-stacking-context parent with overflow).
    204     bool clippedByAncestor(RenderLayer&) const;
     217    bool clippedByAncestor(RenderLayer&, const RenderLayer* compositingAncestor) const;
     218
     219    bool updateAncestorClippingStack(const RenderLayer&, const RenderLayer* compositingAncestor) const;
     220
    205221    // Whether layer's backing needs a graphics layer to clip z-order children of the given layer.
    206222    static bool clipsCompositingDescendants(const RenderLayer&);
     
    492508
    493509    ScrollingNodeID attachScrollingNode(RenderLayer&, ScrollingNodeType, struct ScrollingTreeState&);
     510    ScrollingNodeID registerScrollingNodeID(ScrollingCoordinator&, ScrollingNodeID, ScrollingNodeType, struct ScrollingTreeState&);
     511
     512    OptionSet<ScrollCoordinationRole> coordinatedScrollingRolesForLayer(const RenderLayer&) const;
    494513
    495514    // Returns the ScrollingNodeID which acts as the parent for children.
    496     ScrollingNodeID updateScrollCoordinationForLayer(RenderLayer&, struct ScrollingTreeState&, OptionSet<ScrollCoordinationRole>, OptionSet<ScrollingNodeChangeFlags>);
     515    ScrollingNodeID updateScrollCoordinationForLayer(RenderLayer&, struct ScrollingTreeState&, OptionSet<ScrollingNodeChangeFlags>);
    497516
    498517    // These return the ScrollingNodeID which acts as the parent for children.
    499518    ScrollingNodeID updateScrollingNodeForViewportConstrainedRole(RenderLayer&, struct ScrollingTreeState&, OptionSet<ScrollingNodeChangeFlags>);
    500519    ScrollingNodeID updateScrollingNodeForScrollingRole(RenderLayer&, struct ScrollingTreeState&, OptionSet<ScrollingNodeChangeFlags>);
     520    ScrollingNodeID updateScrollingNodeForScrollingProxyRole(RenderLayer&, struct ScrollingTreeState&, OptionSet<ScrollingNodeChangeFlags>);
    501521    ScrollingNodeID updateScrollingNodeForFrameHostingRole(RenderLayer&, struct ScrollingTreeState&, OptionSet<ScrollingNodeChangeFlags>);
    502522    ScrollingNodeID updateScrollingNodeForPositioningRole(RenderLayer&, struct ScrollingTreeState&, OptionSet<ScrollingNodeChangeFlags>);
     
    512532    LayoutRect rootParentRelativeScrollableRect() const;
    513533    LayoutRect parentRelativeScrollableRect(const RenderLayer&, const RenderLayer* ancestorLayer) const;
     534
     535    // Returns list of layers and their clip rects required to clip the given layer, which include clips in the
     536    // containing block chain between the given layer and its composited ancestor.
     537    Vector<CompositedClipData> computeAncestorClippingStack(const RenderLayer&, const RenderLayer* compositingAncestor) const;
    514538
    515539    bool requiresScrollLayer(RootLayerAttachment) const;
  • trunk/Source/WebKit/ChangeLog

    r246723 r246725  
     12019-06-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [Async overflow scroll] Clipped composited layers inside overflow scroll jitter and get incorrectly clipped
     4        https://bugs.webkit.org/show_bug.cgi?id=199133
     5        rdar://problem/43614439
     6
     7        Reviewed by Antti Koivisto.
     8       
     9        LayoutConstraints -> AbsolutePositionConstraints rename.
     10
     11        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
     12        (ArgumentCoder<ScrollingStatePositionedNode>::decode):
     13        * Shared/WebCoreArgumentCoders.cpp:
     14        (IPC::ArgumentCoder<AbsolutePositionConstraints>::encode):
     15        (IPC::ArgumentCoder<AbsolutePositionConstraints>::decode):
     16        (IPC::ArgumentCoder<LayoutConstraints>::encode): Deleted.
     17        (IPC::ArgumentCoder<LayoutConstraints>::decode): Deleted.
     18        * Shared/WebCoreArgumentCoders.h:
     19        * Shared/WebRenderLayer.cpp:
     20        (WebKit::WebRenderLayer::WebRenderLayer):
     21        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
     22        (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations): ScrollingTreeOverflowScrollProxyNode
     23        have overflow scroll relations now too.
     24
    1252019-06-23  Simon Fraser  <simon.fraser@apple.com>
    226
  • trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp

    r246723 r246725  
    437437
    438438    if (node.hasChangedProperty(ScrollingStatePositionedNode::LayoutConstraintData)) {
    439         LayoutConstraints decodedValue;
     439        AbsolutePositionConstraints decodedValue;
    440440        if (!decoder.decode(decodedValue))
    441441            return false;
  • trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp

    r245787 r246725  
    22022202}
    22032203
    2204 void ArgumentCoder<LayoutConstraints>::encode(Encoder& encoder, const LayoutConstraints& layoutConstraints)
     2204void ArgumentCoder<AbsolutePositionConstraints>::encode(Encoder& encoder, const AbsolutePositionConstraints& layoutConstraints)
    22052205{
    22062206    encoder << layoutConstraints.alignmentOffset();
    22072207    encoder << layoutConstraints.layerPositionAtLastLayout();
    2208     encoder.encodeEnum(layoutConstraints.scrollPositioningBehavior());
    2209 }
    2210 
    2211 bool ArgumentCoder<LayoutConstraints>::decode(Decoder& decoder, LayoutConstraints& layoutConstraints)
     2208}
     2209
     2210bool ArgumentCoder<AbsolutePositionConstraints>::decode(Decoder& decoder, AbsolutePositionConstraints& layoutConstraints)
    22122211{
    22132212    FloatSize alignmentOffset;
     
    22172216    FloatPoint layerPosition;
    22182217    if (!decoder.decode(layerPosition))
    2219         return false;
    2220 
    2221     ScrollPositioningBehavior positioningBehavior;
    2222     if (!decoder.decodeEnum(positioningBehavior))
    22232218        return false;
    22242219
     
    22262221    layoutConstraints.setAlignmentOffset(alignmentOffset);
    22272222    layoutConstraints.setLayerPositionAtLastLayout(layerPosition);
    2228     layoutConstraints.setScrollPositioningBehavior(positioningBehavior);
    22292223    return true;
    22302224}
  • trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h

    r245787 r246725  
    5858
    5959namespace WebCore {
     60class AbsolutePositionConstraints;
    6061class AffineTransform;
    6162class AuthenticationChallenge;
     
    8384class LayoutSize;
    8485class LayoutPoint;
    85 class LayoutConstraints;
    8686class LinearTimingFunction;
    8787class Notification;
     
    545545};
    546546
    547 template<> struct ArgumentCoder<WebCore::LayoutConstraints> {
    548     static void encode(Encoder&, const WebCore::LayoutConstraints&);
    549     static bool decode(Decoder&, WebCore::LayoutConstraints&);
     547template<> struct ArgumentCoder<WebCore::AbsolutePositionConstraints> {
     548    static void encode(Encoder&, const WebCore::AbsolutePositionConstraints&);
     549    static bool decode(Decoder&, WebCore::AbsolutePositionConstraints&);
    550550};
    551551
  • trunk/Source/WebKit/Shared/WebRenderLayer.cpp

    r237058 r246725  
    7474        WebCore::RenderLayerBacking* backing = layer->backing();
    7575        m_isClipping = backing->hasClippingLayer();
    76         m_isClipped = backing->hasAncestorClippingLayer();
     76        m_isClipped = backing->hasAncestorClippingLayers();
    7777        switch (backing->compositingLayerType()) {
    7878        case WebCore::NormalCompositingLayer:
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm

    r246723 r246725  
    133133    // Usually a scroll view scrolls its descendant layers. In some positioning cases it also controls non-descendants, or doesn't control a descendant.
    134134    // To do overlap hit testing correctly we tell layers about such relations.
    135     for (auto positionedNodeID : m_scrollingTree->positionedNodesWithRelatedOverflow()) {
    136         auto* positionedNode = downcast<ScrollingTreePositionedNode>(m_scrollingTree->nodeForID(positionedNodeID));
    137         if (!positionedNode) {
     135   
     136    for (auto nodeID : m_scrollingTree->nodesWithRelatedOverflow()) {
     137        auto* node = m_scrollingTree->nodeForID(nodeID);
     138        if (!node) {
    138139            ASSERT_NOT_REACHED();
    139140            continue;
    140141        }
     142
    141143        Vector<GraphicsLayer::PlatformLayerID> scrollContainerLayerIDs;
    142 
    143         for (auto overflowNodeID : positionedNode->relatedOverflowScrollingNodes()) {
    144             auto* overflowNode = downcast<ScrollingTreeOverflowScrollingNode>(m_scrollingTree->nodeForID(overflowNodeID));
     144        RemoteLayerTreeNode* layerNode = nullptr;
     145        ScrollPositioningBehavior behavior = ScrollPositioningBehavior::None;
     146
     147        if (is<ScrollingTreePositionedNode>(*node)) {
     148            auto& positionedNode = downcast<ScrollingTreePositionedNode>(*node);
     149            for (auto overflowNodeID : positionedNode.relatedOverflowScrollingNodes()) {
     150                auto* overflowNode = downcast<ScrollingTreeOverflowScrollingNode>(m_scrollingTree->nodeForID(overflowNodeID));
     151                if (!overflowNode) {
     152                    ASSERT_NOT_REACHED();
     153                    continue;
     154                }
     155                scrollContainerLayerIDs.append(RemoteLayerTreeNode::layerID(overflowNode->scrollContainerLayer()));
     156            }
     157            layerNode = RemoteLayerTreeNode::forCALayer(positionedNode.layer());
     158            behavior = ScrollPositioningBehavior::Stationary;
     159        } else if (is<ScrollingTreeOverflowScrollProxyNode>(*node)) {
     160            auto& scrollProxyNode = downcast<ScrollingTreeOverflowScrollProxyNode>(*node);
     161            auto* overflowNode = downcast<ScrollingTreeOverflowScrollingNode>(m_scrollingTree->nodeForID(scrollProxyNode.overflowScrollingNodeID()));
    145162            if (!overflowNode) {
    146163                ASSERT_NOT_REACHED();
     
    148165            }
    149166            scrollContainerLayerIDs.append(RemoteLayerTreeNode::layerID(overflowNode->scrollContainerLayer()));
    150         }
    151 
    152         auto* positionedLayerNode = RemoteLayerTreeNode::forCALayer(positionedNode->layer());
    153         if (!positionedLayerNode) {
     167            layerNode = RemoteLayerTreeNode::forCALayer(scrollProxyNode.layer());
     168            behavior = ScrollPositioningBehavior::Moves;
     169        }
     170
     171        if (!layerNode) {
    154172            ASSERT_NOT_REACHED();
    155173            continue;
    156174        }
    157         positionedLayerNode->setRelatedScrollContainerBehaviorAndIDs(positionedNode->scrollPositioningBehavior(), WTFMove(scrollContainerLayerIDs));
    158 
    159         m_layersWithScrollingRelations.add(positionedLayerNode->layerID());
     175        layerNode->setRelatedScrollContainerBehaviorAndIDs(behavior, WTFMove(scrollContainerLayerIDs));
     176
     177        m_layersWithScrollingRelations.add(layerNode->layerID());
    160178    }
    161179}
Note: See TracChangeset for help on using the changeset viewer.