Changeset 288530 in webkit
- Timestamp:
- Jan 24, 2022, 5:56:58 PM (5 years ago)
- Location:
- branches/safari-613-branch
- Files:
-
- 1 added
- 6 edited
- 1 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/compositing/backing/no-backing-for-offscreen-children-of-position-fixed-expected.txt (copied) (copied from branches/safari-613-branch/LayoutTests/compositing/clip-child-by-non-stacking-ancestor-expected.txt ) (1 diff)
-
LayoutTests/compositing/backing/no-backing-for-offscreen-children-of-position-fixed.html (added)
-
LayoutTests/compositing/clip-child-by-non-stacking-ancestor-expected.txt (modified) (1 diff)
-
LayoutTests/compositing/geometry/limit-layer-bounds-fixed-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios-wk2/compositing/geometry/limit-layer-bounds-fixed-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayerBacking.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-613-branch/LayoutTests/ChangeLog
r288524 r288530 1 2022-01-24 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r288429. rdar://problem/86612099 4 5 Position:fixed layers shouldn't allocate a backing buffer if all children are offscreen. 6 https://bugs.webkit.org/show_bug.cgi?id=235420 7 <rdar://86612099> 8 9 Patch by Matt Woodrow <mattwoodrow@apple.com> on 2022-01-23 10 Reviewed by Simon Fraser and Darin Adler. 11 12 Source/WebCore: 13 14 Adds a bounds intersection check to isPaintDestinationForDescendantLayers, 15 so that we can exclude descendants that definitely won't draw anything into 16 the compositing layer. Uses a conservative check, which gives up if there are 17 any transforms in the ancestor chain. 18 19 Test: compositing/backing/no-backing-for-offscreen-children-of-position-fixed.html 20 21 * rendering/RenderLayerBacking.cpp: 22 (WebCore::intersectsWithAncestor): 23 (WebCore::RenderLayerBacking::isPaintDestinationForDescendantLayers const): 24 25 LayoutTests: 26 27 Adds a test that has a viewport sized position:fixed element (with compositing 28 layer), and a single child which is entirely offscreen. Tests that we correctly 29 determine that we don't need a backing store for the layer. 30 31 * compositing/backing/no-backing-for-offscreen-children-of-position-fixed-expected.txt: Added. 32 * compositing/backing/no-backing-for-offscreen-children-of-position-fixed.html: Added. 33 34 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288429 268f45cc-cd09-0410-ab3c-d52691b4dbfc 35 36 2022-01-23 Matt Woodrow <mattwoodrow@apple.com> 37 38 Position:fixed layers shouldn't allocate a backing buffer if all children are offscreen. 39 https://bugs.webkit.org/show_bug.cgi?id=235420 40 <rdar://86612099> 41 42 Reviewed by Simon Fraser and Darin Adler. 43 44 Adds a test that has a viewport sized position:fixed element (with compositing 45 layer), and a single child which is entirely offscreen. Tests that we correctly 46 determine that we don't need a backing store for the layer. 47 48 * compositing/backing/no-backing-for-offscreen-children-of-position-fixed-expected.txt: Added. 49 * compositing/backing/no-backing-for-offscreen-children-of-position-fixed.html: Added. 50 1 51 2022-01-24 Alan Coon <alancoon@apple.com> 2 52 -
branches/safari-613-branch/LayoutTests/compositing/backing/no-backing-for-offscreen-children-of-position-fixed-expected.txt
r288529 r288530 8 8 (children 1 9 9 (GraphicsLayer 10 (position 8.00 8.00) 11 (bounds 100.00 100.00) 12 (contentsOpaque 1) 13 (drawsContent 1) 10 (bounds 200.00 200.00) 14 11 ) 15 12 ) -
branches/safari-613-branch/LayoutTests/compositing/clip-child-by-non-stacking-ancestor-expected.txt
r168244 r288530 11 11 (bounds 100.00 100.00) 12 12 (contentsOpaque 1) 13 (drawsContent 1)14 13 ) 15 14 ) -
branches/safari-613-branch/LayoutTests/compositing/geometry/limit-layer-bounds-fixed-expected.txt
r225897 r288530 16 16 (position 0.00 3000.00) 17 17 (bounds 300.00 200.00) 18 (drawsContent 1)19 18 ) 20 19 ) -
branches/safari-613-branch/LayoutTests/platform/ios-wk2/compositing/geometry/limit-layer-bounds-fixed-expected.txt
r225897 r288530 16 16 (position 0.00 3000.00) 17 17 (bounds 300.00 200.00) 18 (drawsContent 1)19 18 ) 20 19 ) -
branches/safari-613-branch/Source/WebCore/ChangeLog
r288529 r288530 1 2022-01-24 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r288429. rdar://problem/86612099 4 5 Position:fixed layers shouldn't allocate a backing buffer if all children are offscreen. 6 https://bugs.webkit.org/show_bug.cgi?id=235420 7 <rdar://86612099> 8 9 Patch by Matt Woodrow <mattwoodrow@apple.com> on 2022-01-23 10 Reviewed by Simon Fraser and Darin Adler. 11 12 Source/WebCore: 13 14 Adds a bounds intersection check to isPaintDestinationForDescendantLayers, 15 so that we can exclude descendants that definitely won't draw anything into 16 the compositing layer. Uses a conservative check, which gives up if there are 17 any transforms in the ancestor chain. 18 19 Test: compositing/backing/no-backing-for-offscreen-children-of-position-fixed.html 20 21 * rendering/RenderLayerBacking.cpp: 22 (WebCore::intersectsWithAncestor): 23 (WebCore::RenderLayerBacking::isPaintDestinationForDescendantLayers const): 24 25 LayoutTests: 26 27 Adds a test that has a viewport sized position:fixed element (with compositing 28 layer), and a single child which is entirely offscreen. Tests that we correctly 29 determine that we don't need a backing store for the layer. 30 31 * compositing/backing/no-backing-for-offscreen-children-of-position-fixed-expected.txt: Added. 32 * compositing/backing/no-backing-for-offscreen-children-of-position-fixed.html: Added. 33 34 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288429 268f45cc-cd09-0410-ab3c-d52691b4dbfc 35 36 2022-01-23 Matt Woodrow <mattwoodrow@apple.com> 37 38 Position:fixed layers shouldn't allocate a backing buffer if all children are offscreen. 39 https://bugs.webkit.org/show_bug.cgi?id=235420 40 <rdar://86612099> 41 42 Reviewed by Simon Fraser and Darin Adler. 43 44 Adds a bounds intersection check to isPaintDestinationForDescendantLayers, 45 so that we can exclude descendants that definitely won't draw anything into 46 the compositing layer. Uses a conservative check, which gives up if there are 47 any transforms in the ancestor chain. 48 49 Test: compositing/backing/no-backing-for-offscreen-children-of-position-fixed.html 50 51 * rendering/RenderLayerBacking.cpp: 52 (WebCore::intersectsWithAncestor): 53 (WebCore::RenderLayerBacking::isPaintDestinationForDescendantLayers const): 54 1 55 2022-01-24 Alan Coon <alancoon@apple.com> 2 56 -
branches/safari-613-branch/Source/WebCore/rendering/RenderLayerBacking.cpp
r287757 r288530 2791 2791 } 2792 2792 2793 static std::optional<bool> intersectsWithAncestor(const RenderLayer& child, const RenderLayer& ancestor, const LayoutRect& ancestorCompositedBounds) 2794 { 2795 // If any layers between child and ancestor are transformed, then adjusting the offset is 2796 // insufficient to convert coordinates into ancestor's coordinate space. 2797 for (auto* layer = &child; layer != &ancestor; layer = layer->parent()) { 2798 if (!layer->canUseOffsetFromAncestor()) 2799 return std::nullopt; 2800 } 2801 2802 auto offset = child.convertToLayerCoords(&ancestor, { }, RenderLayer::AdjustForColumns); 2803 auto overlap = child.overlapBounds(); 2804 overlap.moveBy(offset); 2805 return overlap.intersects(ancestorCompositedBounds); 2806 } 2807 2793 2808 // Conservative test for having no rendered children. 2794 2809 bool RenderLayerBacking::isPaintDestinationForDescendantLayers(RenderLayer::PaintedContentRequest& request) const 2795 2810 { 2796 2811 bool hasPaintingDescendant = false; 2797 traverseVisibleNonCompositedDescendantLayers(m_owningLayer, [&hasPaintingDescendant, &request](const RenderLayer& layer) { 2798 hasPaintingDescendant |= layer.isVisuallyNonEmpty(&request); 2812 traverseVisibleNonCompositedDescendantLayers(m_owningLayer, [&hasPaintingDescendant, &request, this](const RenderLayer& layer) { 2813 RenderLayer::PaintedContentRequest localRequest; 2814 if (layer.isVisuallyNonEmpty(&localRequest)) { 2815 bool mayIntersect = intersectsWithAncestor(layer, m_owningLayer, compositedBounds()).value_or(true); 2816 if (mayIntersect) { 2817 hasPaintingDescendant = true; 2818 request.setHasPaintedContent(); 2819 } 2820 } 2799 2821 return (hasPaintingDescendant && request.isSatisfied()) ? LayerTraversal::Stop : LayerTraversal::Continue; 2800 2822 });
Note:
See TracChangeset
for help on using the changeset viewer.