Changeset 243209 in webkit
- Timestamp:
- Mar 20, 2019, 9:32:32 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243207 r243209 1 2019-03-20 Simon Fraser <simon.fraser@apple.com> 2 3 Explicitly trigger compositing for layers that need to be moved by ScrollingTreePositionedNodes 4 https://bugs.webkit.org/show_bug.cgi?id=195710 5 6 Reviewed by Zalan Bujtas. 7 8 * compositing/layer-creation/absolute-in-async-overflow-scroll-expected.txt: Added. 9 * compositing/layer-creation/absolute-in-async-overflow-scroll.html: Added. 10 1 11 2019-03-20 Devin Rousso <drousso@apple.com> 2 12 -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt
r242997 r243209 82 82 (vertical scrollbar mode 0) 83 83 (has enabled vertical scrollbar 1)) 84 (children 1 85 (Positioned node 86 (layout constraints 87 (layer-position-at-last-layout (81,30)) 88 (positioning-behavior stationary)) 89 (related overflow nodes 1) 90 ) 91 ) 84 92 ) 85 93 ) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt
r242997 r243209 83 83 (vertical scrollbar mode 0) 84 84 (has enabled vertical scrollbar 1)) 85 (children 1 86 (Positioned node 87 (layout constraints 88 (layer-position-at-last-layout (81,28)) 89 (positioning-behavior stationary)) 90 (related overflow nodes 1) 91 ) 92 ) 85 93 ) 86 94 ) -
trunk/Source/WebCore/ChangeLog
r243207 r243209 1 2019-03-20 Simon Fraser <simon.fraser@apple.com> 2 3 Explicitly trigger compositing for layers that need to be moved by ScrollingTreePositionedNodes 4 https://bugs.webkit.org/show_bug.cgi?id=195710 5 <rdar://problem/48867502> 6 7 Reviewed by Zalan Bujtas. 8 9 A position:absolute layer whose containing block is outside an enclosing overflow:scroll, but 10 whose compositing ancestor is the overflow or is inside it, needs to be composited so that 11 we can make a Positioning scrolling tree node for it. 12 13 Handle this case as a "OverflowScrollPositioning" indirect compositing reason. 14 15 Test: compositing/layer-creation/absolute-in-async-overflow-scroll.html 16 17 * inspector/agents/InspectorLayerTreeAgent.cpp: 18 (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer): 19 * rendering/RenderLayer.h: 20 * rendering/RenderLayerCompositor.cpp: 21 (WebCore::RenderLayerCompositor::computeCompositingRequirements): 22 (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): 23 (WebCore::RenderLayerCompositor::reasonsForCompositing const): 24 (WebCore::RenderLayerCompositor::logReasonsForCompositing): 25 (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const): 26 (WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary): 27 (WebCore::layerContainingBlockCrossesCoordinatedScrollingBoundary): Deleted. 28 * rendering/RenderLayerCompositor.h: Generalize OverflowScrollingTouch to OverflowScrolling. 29 1 30 2019-03-20 Devin Rousso <drousso@apple.com> 2 31 -
trunk/Source/WebCore/inspector/agents/InspectorLayerTreeAgent.cpp
r236777 r243209 277 277 compositingReasons->setPositionSticky(true); 278 278 279 if (reasons.contains(CompositingReason::OverflowScrolling Touch))279 if (reasons.contains(CompositingReason::OverflowScrolling)) 280 280 compositingReasons->setOverflowScrollingTouch(true); 281 282 // FIXME: handle OverflowScrollPositioning (webkit.org/b/195985). 281 283 282 284 if (reasons.contains(CompositingReason::Stacking)) -
trunk/Source/WebCore/rendering/RenderLayer.h
r243134 r243209 1124 1124 None, 1125 1125 Stacking, 1126 OverflowScrollPositioning, 1126 1127 Overlap, 1127 1128 BackgroundLayer, -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r243146 r243209 956 956 RenderLayer::IndirectCompositingReason indirectCompositingReason; 957 957 if (!willBeComposited && canBeComposited(layer) 958 && requiresCompositingForIndirectReason(layer.renderer(), c hildState.subtreeIsCompositing, anyDescendantHas3DTransform, indirectCompositingReason)) {958 && requiresCompositingForIndirectReason(layer.renderer(), compositingState.compositingAncestor, childState.subtreeIsCompositing, anyDescendantHas3DTransform, indirectCompositingReason)) { 959 959 layer.setIndirectCompositingReason(indirectCompositingReason); 960 960 childState.compositingAncestor = &layer; … … 2229 2229 RenderLayer::IndirectCompositingReason reason = layer.indirectCompositingReason(); 2230 2230 return reason == RenderLayer::IndirectCompositingReason::Overlap 2231 || reason == RenderLayer::IndirectCompositingReason::OverflowScrollPositioning 2231 2232 || reason == RenderLayer::IndirectCompositingReason::Stacking 2232 2233 || reason == RenderLayer::IndirectCompositingReason::BackgroundLayer … … 2285 2286 2286 2287 if (requiresCompositingForOverflowScrolling(*renderer.layer(), queryData)) 2287 reasons.add(CompositingReason::OverflowScrolling Touch);2288 reasons.add(CompositingReason::OverflowScrolling); 2288 2289 2289 2290 switch (renderer.layer()->indirectCompositingReason()) { … … 2292 2293 case RenderLayer::IndirectCompositingReason::Stacking: 2293 2294 reasons.add(CompositingReason::Stacking); 2295 break; 2296 case RenderLayer::IndirectCompositingReason::OverflowScrollPositioning: 2297 reasons.add(CompositingReason::OverflowScrollPositioning); 2294 2298 break; 2295 2299 case RenderLayer::IndirectCompositingReason::Overlap: … … 2375 2379 return "position: sticky"; 2376 2380 2377 if (reasons & CompositingReason::OverflowScrolling Touch)2378 return " -webkit-overflow-scrolling: touch";2381 if (reasons & CompositingReason::OverflowScrolling) 2382 return "async overflow scrolling"; 2379 2383 2380 2384 if (reasons & CompositingReason::Stacking) … … 2767 2771 2768 2772 // FIXME: why doesn't this handle the clipping cases? 2769 bool RenderLayerCompositor::requiresCompositingForIndirectReason(RenderLayerModelObject& renderer, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason& reason) const2770 { 2771 auto& layer = * downcast<RenderBoxModelObject>(renderer).layer();2773 bool RenderLayerCompositor::requiresCompositingForIndirectReason(RenderLayerModelObject& renderer, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason& reason) const 2774 { 2775 auto& layer = *renderer.layer(); 2772 2776 2773 2777 // When a layer has composited descendants, some effects, like 2d transforms, filters, masks etc must be implemented … … 2788 2792 if (renderer.style().hasPerspective()) { 2789 2793 reason = RenderLayer::IndirectCompositingReason::Perspective; 2794 return true; 2795 } 2796 } 2797 2798 if (renderer.isAbsolutelyPositioned() && compositingAncestor) { 2799 if (layerContainingBlockCrossesCoordinatedScrollingBoundary(layer, *compositingAncestor)) { 2800 reason = RenderLayer::IndirectCompositingReason::OverflowScrollPositioning; 2790 2801 return true; 2791 2802 } … … 2893 2904 2894 2905 // Is this layer's containingBlock an ancestor of scrollable overflow, and is the layer's compositing ancestor inside that overflow? 2895 static bool layerContainingBlockCrossesCoordinatedScrollingBoundary(const RenderLayer& layer, const RenderLayer& compositedAncestor) 2896 { 2897 ASSERT(layer.isComposited()); 2898 ASSERT(layer.renderer().style().position() == PositionType::Absolute); 2906 bool RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary(const RenderLayer& layer, const RenderLayer& compositedAncestor) 2907 { 2908 ASSERT(layer.renderer().isAbsolutelyPositioned()); 2899 2909 2900 2910 bool sawCompositingAncestor = false; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r243146 r243209 66 66 PositionFixed = 1 << 9, 67 67 PositionSticky = 1 << 10, 68 OverflowScrolling Touch= 1 << 11,68 OverflowScrolling = 1 << 11, 69 69 Stacking = 1 << 12, 70 70 Overlap = 1 << 13, 71 NegativeZIndexChildren = 1 << 14, 72 TransformWithCompositedDescendants = 1 << 15, 73 OpacityWithCompositedDescendants = 1 << 16, 74 MaskWithCompositedDescendants = 1 << 17, 75 ReflectionWithCompositedDescendants = 1 << 18, 76 FilterWithCompositedDescendants = 1 << 19, 77 BlendingWithCompositedDescendants = 1 << 20, 78 Perspective = 1 << 21, 79 Preserve3D = 1 << 22, 80 WillChange = 1 << 23, 81 Root = 1 << 24, 82 IsolatesCompositedBlendingDescendants = 1 << 25, 83 EmbeddedView = 1 << 26, 71 OverflowScrollPositioning = 1 << 14, 72 NegativeZIndexChildren = 1 << 15, 73 TransformWithCompositedDescendants = 1 << 16, 74 OpacityWithCompositedDescendants = 1 << 17, 75 MaskWithCompositedDescendants = 1 << 18, 76 ReflectionWithCompositedDescendants = 1 << 19, 77 FilterWithCompositedDescendants = 1 << 20, 78 BlendingWithCompositedDescendants = 1 << 21, 79 Perspective = 1 << 22, 80 Preserve3D = 1 << 23, 81 WillChange = 1 << 24, 82 Root = 1 << 25, 83 IsolatesCompositedBlendingDescendants = 1 << 26, 84 EmbeddedView = 1 << 27, 84 85 }; 85 86 … … 476 477 bool requiresCompositingForOverflowScrolling(const RenderLayer&, RequiresCompositingData&) const; 477 478 bool requiresCompositingForEditableImage(RenderLayerModelObject&) const; 478 bool requiresCompositingForIndirectReason(RenderLayerModelObject&, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason&) const; 479 bool requiresCompositingForIndirectReason(RenderLayerModelObject&, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason&) const; 480 481 static bool layerContainingBlockCrossesCoordinatedScrollingBoundary(const RenderLayer&, const RenderLayer& compositedAncestor); 479 482 480 483 static bool styleChangeMayAffectIndirectCompositingReasons(const RenderStyle& oldStyle, const RenderStyle& newStyle);
Note:
See TracChangeset
for help on using the changeset viewer.