Changeset 245170 in webkit
- Timestamp:
- May 9, 2019, 10:18:02 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 39 added
- 36 edited
- 7 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt (modified) (3 diffs)
-
LayoutTests/compositing/layer-creation/overflow-scroll-overlap-expected.txt (modified) (2 diffs)
-
LayoutTests/compositing/layer-creation/overflow-scroll-overlap.html (modified) (1 diff)
-
LayoutTests/compositing/overflow/scrolling-content-clip-to-viewport.html (modified) (1 diff)
-
LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt (modified) (2 diffs)
-
LayoutTests/compositing/shared-backing (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller-expected.txt (copied) (copied from trunk/LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt ) (2 diffs)
-
LayoutTests/compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow-expected.txt (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html (copied) (copied from trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html ) (3 diffs)
-
LayoutTests/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping-expected.txt (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll-expected.txt (copied) (copied from trunk/LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt ) (2 diffs)
-
LayoutTests/compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content-expected.txt (copied) (copied from trunk/LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt ) (2 diffs)
-
LayoutTests/compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip-expected.html (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/shared-layer-clipping-expected.html (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/shared-layer-clipping.html (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds-expected.txt (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking-expected.txt (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/shared-layer-repaint-expected.txt (added)
-
LayoutTests/compositing/shared-backing/overflow-scroll/shared-layer-repaint.html (added)
-
LayoutTests/compositing/shared-backing/partial-compositing-update-expected.txt (added)
-
LayoutTests/compositing/shared-backing/partial-compositing-update.html (added)
-
LayoutTests/compositing/shared-backing/partial-compositing-update2-expected.txt (added)
-
LayoutTests/compositing/shared-backing/partial-compositing-update2.html (added)
-
LayoutTests/compositing/shared-backing/remove-sharing-layer-expected.txt (added)
-
LayoutTests/compositing/shared-backing/remove-sharing-layer.html (added)
-
LayoutTests/compositing/shared-backing/sharing-cached-clip-rects-expected.txt (added)
-
LayoutTests/compositing/shared-backing/sharing-cached-clip-rects.html (added)
-
LayoutTests/platform/ios-wk2/TestExpectations (modified) (2 diffs)
-
LayoutTests/platform/ios-wk2/compositing/shared-backing (added)
-
LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll (added)
-
LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller-expected.txt (copied) (copied from trunk/LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt ) (2 diffs)
-
LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt (added)
-
LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow-expected.txt (added)
-
LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt (added)
-
LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt (added)
-
LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping-expected.txt (added)
-
LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll-expected.txt (copied) (copied from trunk/LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt ) (2 diffs)
-
LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content-expected.txt (copied) (copied from trunk/LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt ) (2 diffs)
-
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt (modified) (3 diffs)
-
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt (modified) (5 diffs)
-
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt (modified) (10 diffs)
-
LayoutTests/platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt (modified) (3 diffs)
-
LayoutTests/platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac-wk1/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac-wk2/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt (modified) (2 diffs)
-
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt (modified) (3 diffs)
-
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html (modified) (2 diffs)
-
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt (modified) (5 diffs)
-
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html (modified) (2 diffs)
-
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt (modified) (2 diffs)
-
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html (modified) (2 diffs)
-
LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt (modified) (10 diffs)
-
LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html (modified) (8 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayer.cpp (modified) (17 diffs)
-
Source/WebCore/rendering/RenderLayer.h (modified) (4 diffs)
-
Source/WebCore/rendering/RenderLayerBacking.cpp (modified) (11 diffs)
-
Source/WebCore/rendering/RenderLayerBacking.h (modified) (2 diffs)
-
Source/WebCore/rendering/RenderLayerCompositor.cpp (modified) (26 diffs)
-
Source/WebCore/rendering/RenderLayerCompositor.h (modified) (3 diffs)
-
Source/WebCore/rendering/RenderTreeAsText.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245162 r245170 1 2019-05-09 Simon Fraser <simon.fraser@apple.com> 2 3 Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer 4 https://bugs.webkit.org/show_bug.cgi?id=197561 5 <rdar://problem/50445998> 6 7 Reviewed by Antti Koivisto. 8 9 New tests for backing sharing, and new baselines of tests whose behavior is changed. 10 11 Scrolling tree tests that would be invalidate by sharing are changed to defeat sharing by adding 12 compositing layers early in stacking order. 13 14 * TestExpectations: 15 * compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt: 16 * compositing/layer-creation/overflow-scroll-overlap-expected.txt: 17 * compositing/layer-creation/overflow-scroll-overlap.html: 18 * compositing/overflow/scrolling-content-clip-to-viewport.html: 19 * compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt: 20 * compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt. 21 * compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html: Added. 22 * compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt: Added. 23 * compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html: Added. 24 * compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow-expected.txt: Added. 25 * compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html: Copied from LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html. 26 * compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt: Added. 27 * compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html: Added. 28 * compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt: Added. 29 * compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html: Added. 30 * compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping-expected.txt: Added. 31 * compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html: Added. 32 * compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt. 33 * compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html: Added. 34 * compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt. 35 * compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html: Added. 36 * compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip-expected.html: Added. 37 * compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html: Added. 38 * compositing/shared-backing/overflow-scroll/shared-layer-clipping-expected.html: Added. 39 * compositing/shared-backing/overflow-scroll/shared-layer-clipping.html: Added. 40 * compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds-expected.txt: Added. 41 * compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html: Added. 42 * compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking-expected.txt: Added. 43 * compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html: Added. 44 * compositing/shared-backing/overflow-scroll/shared-layer-repaint-expected.txt: Added. 45 * compositing/shared-backing/overflow-scroll/shared-layer-repaint.html: Added. 46 * compositing/shared-backing/partial-compositing-update-expected.txt: Added. 47 * compositing/shared-backing/partial-compositing-update.html: Added. 48 * compositing/shared-backing/partial-compositing-update2-expected.txt: Added. 49 * compositing/shared-backing/partial-compositing-update2.html: Added. 50 * compositing/shared-backing/remove-sharing-layer-expected.txt: Added. 51 * compositing/shared-backing/remove-sharing-layer.html: Added. 52 * compositing/shared-backing/sharing-cached-clip-rects-expected.txt: Added. 53 * compositing/shared-backing/sharing-cached-clip-rects.html: Added. 54 * platform/ios-wk2/TestExpectations: 55 * platform/ios-wk2/compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt. 56 * platform/ios-wk2/compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt: Added. 57 * platform/ios-wk2/compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow-expected.txt: Added. 58 * platform/ios-wk2/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt: Added. 59 * platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt: Added. 60 * platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping-expected.txt: Added. 61 * platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt. 62 * platform/ios-wk2/compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt. 63 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt: 64 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt: 65 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt: 66 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt: 67 * platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt: 68 * platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt: 69 * platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt: 70 * platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt: 71 * platform/mac-wk1/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt: 72 * platform/mac-wk2/TestExpectations: 73 * platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt: 74 * platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt: 75 * scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt: 76 * scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html: 77 * scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt: 78 * scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html: 79 * scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt: 80 * scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html: 81 * scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt: 82 * scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html: 83 1 84 2019-05-09 Daniel Bates <dabates@apple.com> 2 85 -
trunk/LayoutTests/TestExpectations
r245085 r245170 59 59 editing/pasteboard/mac [ Skip ] 60 60 fast/media/ios [ Skip ] 61 62 # Requires async overflow scrolling 63 compositing/shared-backing/overflow-scroll [ Skip ] 61 64 62 65 # WebKit2 only. -
trunk/LayoutTests/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt
r245085 r245170 12 12 (bounds 785.00 2618.00) 13 13 (contentsOpaque 1) 14 (children 614 (children 3 15 15 (GraphicsLayer 16 16 (position 21.00 21.00) … … 24 24 (GraphicsLayer 25 25 (offsetFromRenderer width=0 height=100) 26 (position 28.00 20.00)27 (bounds 200.00 200.00)28 (children 129 (GraphicsLayer30 (offsetFromRenderer width=0 height=100)31 (bounds 110.00 200.00)32 (contentsOpaque 1)33 (drawsContent 1)34 )35 )36 )37 (GraphicsLayer38 (offsetFromRenderer width=-5 height=-145)39 (position 28.00 20.00)40 (bounds 200.00 200.00)41 (children 142 (GraphicsLayer43 (position 5.00 145.00)44 (bounds 144.00 24.00)45 (drawsContent 1)46 )47 )48 )49 (GraphicsLayer50 (offsetFromRenderer width=0 height=100)51 26 (position 28.00 250.00) 52 27 (bounds 185.00 200.00) … … 54 29 (GraphicsLayer 55 30 (offsetFromRenderer width=0 height=100) 56 (bounds 110.00 200.00) 57 (contentsOpaque 1) 58 (drawsContent 1) 59 ) 60 ) 61 ) 62 (GraphicsLayer 63 (offsetFromRenderer width=-5 height=-145) 64 (position 28.00 250.00) 65 (bounds 185.00 200.00) 66 (children 1 67 (GraphicsLayer 68 (position 5.00 145.00) 69 (bounds 144.00 24.00) 31 (bounds 149.00 200.00) 70 32 (drawsContent 1) 71 33 ) -
trunk/LayoutTests/compositing/layer-creation/overflow-scroll-overlap-expected.txt
r245085 r245170 6 6 (bounds 800.00 600.00) 7 7 (contentsOpaque 1) 8 (children 38 (children 2 9 9 (GraphicsLayer 10 10 (position 8.00 8.00) … … 16 16 (drawsContent 1) 17 17 ) 18 (GraphicsLayer19 (offsetFromRenderer width=-20 height=-45)20 (position 23.00 23.00)21 (bounds 285.00 200.00)22 (children 123 (GraphicsLayer24 (position 20.00 45.00)25 (bounds 210.00 100.00)26 (contentsOpaque 1)27 )28 )29 )30 18 ) 31 19 ) -
trunk/LayoutTests/compositing/layer-creation/overflow-scroll-overlap.html
r245085 r245170 53 53 testRunner.notifyDone(); 54 54 } 55 }, 150);55 }, 0); 56 56 } 57 57 -
trunk/LayoutTests/compositing/overflow/scrolling-content-clip-to-viewport.html
r245085 r245170 24 24 background: silver; 25 25 border: 2px solid blue; 26 z-index: 0;26 transform: translateZ(0); 27 27 } 28 28 </style> -
trunk/LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt
r245085 r245170 7 7 (bounds 800.00 600.00) 8 8 (contentsOpaque 1) 9 (children 49 (children 3 10 10 (GraphicsLayer 11 11 (position 8.00 8.00) … … 27 27 ) 28 28 ) 29 )30 )31 )32 (GraphicsLayer33 (offsetFromRenderer width=-250 height=0)34 (position 10.00 10.00)35 (bounds 400.00 204.00)36 (children 137 (GraphicsLayer38 (position 250.00 0.00)39 (bounds 150.00 200.00)40 (contentsOpaque 1)41 29 ) 42 30 ) -
trunk/LayoutTests/compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller-expected.txt
r245169 r245170 1 relativeabsolute 1 2 (GraphicsLayer 2 3 (anchor 0.00 0.00) … … 8 9 (children 1 9 10 (GraphicsLayer 10 (bounds 320.00 340.00) 11 (position 28.00 20.00) 12 (bounds 304.00 304.00) 13 (drawsContent 1) 11 14 (children 1 12 15 (GraphicsLayer 13 (bounds 320.00 340.00) 16 (offsetFromRenderer width=2 height=2) 17 (position 2.00 2.00) 18 (bounds 285.00 285.00) 14 19 (children 1 15 20 (GraphicsLayer 21 (offsetFromRenderer width=2 height=2) 16 22 (anchor 0.00 0.00) 17 (bounds 320.00 1224.00)23 (bounds 285.00 682.00) 18 24 (drawsContent 1) 19 25 ) -
trunk/LayoutTests/compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html
r245169 r245170 2 2 <html> 3 3 <head> 4 <title>Nested absolutes in stacking-context overflow: need two 'stationary' nodes</title>5 4 <style> 6 .scrollcontent {7 height: 500px;8 }9 5 .scroller { 10 6 margin: 20px; 11 overflow: scroll;7 width: 300px; 12 8 height: 300px; 13 width: 300px;9 overflow: auto; 14 10 border: 2px solid black; 15 opacity: 0. 9;11 opacity: 0.8; 16 12 } 17 13 18 14 .absolute { 19 position:absolute; 15 position: absolute; 16 width: 100px; 17 height: 100px; 18 top: 100px; 20 19 left: 50px; 20 padding: 20px; 21 background-color: silver; 22 } 23 24 .clipping { 25 overflow: hidden; 26 } 27 28 .inner { 21 29 top: 50px; 22 30 width: 100px; 23 31 height: 100px; 24 background: gray; 25 border: 2px solid green; 26 } 27 28 .inner { 29 left: 25px; 30 top: 25px; 31 width: 200px; 32 background-color: blue; 32 33 } 33 34 34 .s crollcontent{35 .spacer { 35 36 height: 500px; 36 37 background-image: repeating-linear-gradient(white, silver 200px); … … 43 44 window.addEventListener('load', () => { 44 45 if (window.internals) 45 document.getElementById(' tree').innerText = internals.scrollingStateTreeAsText();46 document.getElementById('layers').textContent = internals.layerTreeAsText(document); 46 47 }, false); 47 48 </script> … … 49 50 <body> 50 51 <div class="scroller"> 51 <div class=" absolute">abs52 <div class="inner absolute"> abs</div>52 <div class="clipping absolute"> 53 <div class="inner absolute"></div> 53 54 </div> 54 <div class="s crollcontent"></div>55 <div class="spacer"></div> 55 56 </div> 56 <pre id=" tree"></pre>57 <pre id="layers"></pre> 57 58 </body> 58 59 </html> 60 -
trunk/LayoutTests/compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll-expected.txt
r245169 r245170 1 relative 1 2 (GraphicsLayer 2 3 (anchor 0.00 0.00) … … 8 9 (children 1 9 10 (GraphicsLayer 10 (bounds 320.00 340.00) 11 (position 28.00 20.00) 12 (bounds 324.00 324.00) 13 (drawsContent 1) 11 14 (children 1 12 15 (GraphicsLayer 13 (bounds 320.00 340.00) 16 (offsetFromRenderer width=2 height=2) 17 (position 2.00 2.00) 18 (bounds 305.00 305.00) 14 19 (children 1 15 20 (GraphicsLayer 21 (offsetFromRenderer width=2 height=2) 16 22 (anchor 0.00 0.00) 17 (bounds 320.00 1224.00)23 (bounds 414.00 374.00) 18 24 (drawsContent 1) 19 25 ) -
trunk/LayoutTests/compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content-expected.txt
r245169 r245170 1 Relative foreground 1 2 (GraphicsLayer 2 3 (anchor 0.00 0.00) … … 8 9 (children 1 9 10 (GraphicsLayer 10 (bounds 320.00 340.00) 11 (position 8.00 8.00) 12 (bounds 304.00 304.00) 13 (drawsContent 1) 11 14 (children 1 12 15 (GraphicsLayer 13 (bounds 320.00 340.00) 16 (offsetFromRenderer width=2 height=2) 17 (position 2.00 2.00) 18 (bounds 285.00 285.00) 14 19 (children 1 15 20 (GraphicsLayer 21 (offsetFromRenderer width=2 height=2) 16 22 (anchor 0.00 0.00) 17 (bounds 320.00 1224.00)23 (bounds 285.00 364.00) 18 24 (drawsContent 1) 19 25 ) -
trunk/LayoutTests/platform/ios-wk2/TestExpectations
r245085 r245170 8 8 9 9 compositing/ios [ Pass ] 10 compositing/shared-backing/overflow-scroll [ Pass ] 10 11 fast/device-orientation [ Pass ] 11 12 fast/history/ios [ Pass ] … … 1076 1077 1077 1078 fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html [ Pass Failure ] 1079 webkit.org/b/197694 fast/scrolling/ios/overflow-scroll-overlap-4.html [ Failure ] 1078 1080 1079 1081 webkit.org/b/157589 fast/text-autosizing/ios/text-autosizing-after-back.html [ Pass Timeout ] -
trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller-expected.txt
r245169 r245170 1 relativeabsolute 1 2 (GraphicsLayer 2 3 (anchor 0.00 0.00) … … 8 9 (children 1 9 10 (GraphicsLayer 10 (bounds 320.00 340.00) 11 (position 28.00 20.00) 12 (bounds 304.00 304.00) 13 (drawsContent 1) 11 14 (children 1 12 15 (GraphicsLayer 13 (bounds 320.00 340.00) 16 (offsetFromRenderer width=2 height=2) 17 (position 2.00 2.00) 18 (bounds 300.00 300.00) 14 19 (children 1 15 20 (GraphicsLayer 21 (offsetFromRenderer width=2 height=2) 16 22 (anchor 0.00 0.00) 17 (bounds 3 20.00 1224.00)23 (bounds 300.00 684.00) 18 24 (drawsContent 1) 19 25 ) -
trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll-expected.txt
r245169 r245170 1 relative 1 2 (GraphicsLayer 2 3 (anchor 0.00 0.00) … … 8 9 (children 1 9 10 (GraphicsLayer 10 (bounds 320.00 340.00) 11 (position 28.00 20.00) 12 (bounds 324.00 324.00) 13 (drawsContent 1) 11 14 (children 1 12 15 (GraphicsLayer 13 (bounds 320.00 340.00) 16 (offsetFromRenderer width=2 height=2) 17 (position 2.00 2.00) 18 (bounds 320.00 320.00) 14 19 (children 1 15 20 (GraphicsLayer 21 (offsetFromRenderer width=2 height=2) 16 22 (anchor 0.00 0.00) 17 (bounds 320.00 1224.00)23 (bounds 414.00 374.00) 18 24 (drawsContent 1) 19 25 ) -
trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content-expected.txt
r245169 r245170 1 Relative foreground 1 2 (GraphicsLayer 2 3 (anchor 0.00 0.00) … … 8 9 (children 1 9 10 (GraphicsLayer 10 (bounds 320.00 340.00) 11 (position 8.00 8.00) 12 (bounds 304.00 304.00) 13 (drawsContent 1) 11 14 (children 1 12 15 (GraphicsLayer 13 (bounds 320.00 340.00) 16 (offsetFromRenderer width=2 height=2) 17 (position 2.00 2.00) 18 (bounds 300.00 300.00) 14 19 (children 1 15 20 (GraphicsLayer 21 (offsetFromRenderer width=2 height=2) 16 22 (anchor 0.00 0.00) 17 (bounds 3 20.00 1224.00)23 (bounds 300.00 364.00) 18 24 (drawsContent 1) 19 25 ) -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt
r245085 r245170 1 absabs 1 abs 2 abs 2 3 3 4 (Frame scrolling node … … 14 15 (max layout viewport origin (0,0)) 15 16 (behavior for fixed 0) 16 (children 317 (children 5 17 18 (Overflow scrolling node 18 19 (scrollable area size 300 300) 19 (contents size 381 5 00)20 (contents size 381 530) 20 21 (parent relative scrollable rect at (30,35) size 300x300) 21 22 (scrollable area parameters … … 29 30 (Positioned node 30 31 (layout constraints 32 (layer-position-at-last-layout (10,10)) 33 (positioning-behavior moves)) 34 (related overflow nodes 1) 35 ) 36 (Positioned node 37 (layout constraints 31 38 (layer-position-at-last-layout (50,50)) 39 (positioning-behavior moves)) 40 (related overflow nodes 1) 41 ) 42 (Positioned node 43 (layout constraints 44 (layer-position-at-last-layout (62,82)) 32 45 (positioning-behavior moves)) 33 46 (related overflow nodes 1) -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt
r245085 r245170 1 absabs 1 abs 2 abs 2 3 3 4 (Frame scrolling node … … 14 15 (max layout viewport origin (0,0)) 15 16 (behavior for fixed 0) 16 (children 417 (children 7 17 18 (Overflow scrolling node 18 19 (scrollable area size 300 300) 19 (contents size 300 5 26)20 (contents size 300 556) 20 21 (parent relative scrollable rect at (30,22) size 300x300) 21 22 (scrollable area parameters … … 28 29 (Positioned node 29 30 (layout constraints 30 (layer-position-at-last-layout ( 0,0))31 (layer-position-at-last-layout (10,10)) 31 32 (positioning-behavior moves)) 32 33 (related overflow nodes 1) … … 34 35 (Positioned node 35 36 (layout constraints 36 (layer-position-at-last-layout ( 53,53))37 (layer-position-at-last-layout (0,30)) 37 38 (positioning-behavior moves)) 38 39 (related overflow nodes 1) … … 40 41 (Positioned node 41 42 (layout constraints 42 (layer-position-at-last-layout (80,80)) 43 (layer-position-at-last-layout (13,43)) 44 (positioning-behavior moves)) 45 (related overflow nodes 1) 46 ) 47 (Positioned node 48 (layout constraints 49 (layer-position-at-last-layout (53,83)) 50 (positioning-behavior moves)) 51 (related overflow nodes 1) 52 ) 53 (Positioned node 54 (layout constraints 55 (layer-position-at-last-layout (65,115)) 56 (positioning-behavior moves)) 57 (related overflow nodes 1) 58 ) 59 (Positioned node 60 (layout constraints 61 (layer-position-at-last-layout (80,110)) 43 62 (positioning-behavior moves)) 44 63 (related overflow nodes 1) -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt
r245085 r245170 1 absabs 1 abs 2 abs 2 3 3 4 (Frame scrolling node … … 17 18 (Overflow scrolling node 18 19 (scrollable area size 300 300) 19 (contents size 300 5 00)20 (contents size 300 530) 20 21 (parent relative scrollable rect at (30,22) size 300x300) 21 22 (scrollable area parameters -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt
r245085 r245170 27 27 (max layout viewport origin (0,229)) 28 28 (behavior for fixed 0) 29 (children 1 229 (children 19 30 30 (Overflow scrolling node 31 31 (scrollable area size 220 170) … … 41 41 (Positioned node 42 42 (layout constraints 43 (layer-position-at-last-layout ( 10,30))43 (layer-position-at-last-layout (20,40)) 44 44 (positioning-behavior moves)) 45 45 (related overflow nodes 1) … … 47 47 (Positioned node 48 48 (layout constraints 49 (layer-position-at-last-layout (10,50)) 49 (layer-position-at-last-layout (10,60)) 50 (positioning-behavior moves)) 51 (related overflow nodes 1) 52 ) 53 (Positioned node 54 (layout constraints 55 (layer-position-at-last-layout (10,80)) 50 56 (positioning-behavior moves)) 51 57 (related overflow nodes 1) … … 64 70 (Positioned node 65 71 (layout constraints 66 (layer-position-at-last-layout (10,30)) 72 (layer-position-at-last-layout (20,40)) 73 (positioning-behavior moves)) 74 (related overflow nodes 1) 75 ) 76 (Positioned node 77 (layout constraints 78 (layer-position-at-last-layout (10,60)) 67 79 (positioning-behavior moves)) 68 80 (related overflow nodes 1) … … 79 91 (has enabled vertical scrollbar 1)) 80 92 ) 93 (Positioned node 94 (layout constraints 95 (layer-position-at-last-layout (20,40)) 96 (positioning-behavior moves)) 97 (related overflow nodes 1) 98 ) 81 99 (Overflow scrolling node 82 100 (scrollable area size 220 170) … … 89 107 (vertical scrollbar mode 0) 90 108 (has enabled vertical scrollbar 1)) 109 ) 110 (Positioned node 111 (layout constraints 112 (layer-position-at-last-layout (20,40)) 113 (positioning-behavior moves)) 114 (related overflow nodes 1) 91 115 ) 92 116 (Overflow scrolling node … … 103 127 (Positioned node 104 128 (layout constraints 105 (layer-position-at-last-layout ( 10,30))129 (layer-position-at-last-layout (20,40)) 106 130 (positioning-behavior moves)) 107 131 (related overflow nodes 1) … … 109 133 (Positioned node 110 134 (layout constraints 111 (layer-position-at-last-layout (110,50)) 135 (layer-position-at-last-layout (10,60)) 136 (positioning-behavior moves)) 137 (related overflow nodes 1) 138 ) 139 (Positioned node 140 (layout constraints 141 (layer-position-at-last-layout (20,90)) 142 (positioning-behavior moves)) 143 (related overflow nodes 1) 144 ) 145 (Positioned node 146 (layout constraints 147 (layer-position-at-last-layout (110,110)) 112 148 (positioning-behavior moves)) 113 149 (related overflow nodes 1) … … 126 162 (Positioned node 127 163 (layout constraints 128 (layer-position-at-last-layout (10,30)) 164 (layer-position-at-last-layout (20,40)) 165 (positioning-behavior moves)) 166 (related overflow nodes 1) 167 ) 168 (Positioned node 169 (layout constraints 170 (layer-position-at-last-layout (10,60)) 129 171 (positioning-behavior moves)) 130 172 (related overflow nodes 1) … … 132 174 (Positioned node 133 175 (layout constraints 134 (layer-position-at-last-layout (79, 20))176 (layer-position-at-last-layout (79,50)) 135 177 (positioning-behavior stationary)) 136 178 (related overflow nodes 1) -
trunk/LayoutTests/platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt
r245085 r245170 12 12 (bounds 800.00 2618.00) 13 13 (contentsOpaque 1) 14 (children 614 (children 3 15 15 (GraphicsLayer 16 16 (position 21.00 21.00) … … 24 24 (GraphicsLayer 25 25 (offsetFromRenderer width=0 height=100) 26 (position 28.00 20.00)27 (bounds 200.00 200.00)28 (children 129 (GraphicsLayer30 (offsetFromRenderer width=0 height=100)31 (bounds 110.00 200.00)32 (contentsOpaque 1)33 (drawsContent 1)34 )35 )36 )37 (GraphicsLayer38 (offsetFromRenderer width=-5 height=-145)39 (position 28.00 20.00)40 (bounds 200.00 200.00)41 (children 142 (GraphicsLayer43 (offsetFromRenderer width=0 height=-1)44 (position 5.00 144.00)45 (bounds 144.00 25.00)46 (drawsContent 1)47 )48 )49 )50 (GraphicsLayer51 (offsetFromRenderer width=0 height=100)52 26 (position 28.00 250.00) 53 27 (bounds 185.00 200.00) … … 55 29 (GraphicsLayer 56 30 (offsetFromRenderer width=0 height=100) 57 (bounds 110.00 200.00) 58 (contentsOpaque 1) 59 (drawsContent 1) 60 ) 61 ) 62 ) 63 (GraphicsLayer 64 (offsetFromRenderer width=-5 height=-145) 65 (position 28.00 250.00) 66 (bounds 185.00 200.00) 67 (children 1 68 (GraphicsLayer 69 (offsetFromRenderer width=0 height=-1) 70 (position 5.00 144.00) 71 (bounds 144.00 25.00) 31 (bounds 149.00 200.00) 72 32 (drawsContent 1) 73 33 ) -
trunk/LayoutTests/platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt
r245085 r245170 20 20 (intersects coverage rect 1) 21 21 (contentsScale 2.00) 22 (children 622 (children 4 23 23 (GraphicsLayer 24 24 (position 8.00 102.00) … … 49 49 ) 50 50 (GraphicsLayer 51 (position 9.00 91.00) 52 (bounds 100.00 20.00) 53 (visible rect 0.00, 0.00 100.00 x 20.00) 54 (coverage rect 0.00, 0.00 100.00 x 20.00) 55 (intersects coverage rect 1) 56 (contentsScale 2.00) 57 (children 1 58 (GraphicsLayer 59 (bounds 100.00 20.00) 60 (drawsContent 1) 61 (visible rect 0.00, 0.00 100.00 x 20.00) 62 (coverage rect 0.00, 0.00 100.00 x 20.00) 63 (intersects coverage rect 1) 64 (contentsScale 2.00) 65 ) 66 ) 67 ) 68 (GraphicsLayer 69 (position 8.00 134.00) 70 (bounds 102.00 22.00) 51 (offsetFromRenderer width=-17 height=0) 52 (position -9.00 134.00) 53 (bounds 816.00 22.00) 71 54 (drawsContent 1) 72 (visible rect 0.00, 0.00 102.00 x 22.00) 73 (coverage rect -8.00, -134.00 800.00 x 600.00) 74 (intersects coverage rect 1) 75 (contentsScale 2.00) 76 ) 77 (GraphicsLayer 78 (offsetFromRenderer width=-9 height=0) 79 (position 0.00 135.00) 80 (bounds 807.00 20.00) 81 (drawsContent 1) 82 (visible rect 0.00, 0.00 800.00 x 20.00) 83 (coverage rect 0.00, -135.00 800.00 x 600.00) 55 (visible rect 9.00, 0.00 800.00 x 22.00) 56 (coverage rect 9.00, -134.00 800.00 x 600.00) 84 57 (intersects coverage rect 1) 85 58 (contentsScale 2.00) -
trunk/LayoutTests/platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt
r245085 r245170 20 20 (intersects coverage rect 1) 21 21 (contentsScale 2.00) 22 (children 622 (children 4 23 23 (GraphicsLayer 24 24 (position 8.00 102.00) … … 49 49 ) 50 50 (GraphicsLayer 51 (position 9.00 91.00)52 (bounds 100.00 20.00)53 (visible rect 0.00, 0.00 100.00 x 20.00)54 (coverage rect 0.00, 0.00 100.00 x 20.00)55 (intersects coverage rect 1)56 (contentsScale 2.00)57 (children 158 (GraphicsLayer59 (bounds 100.00 20.00)60 (drawsContent 1)61 (visible rect 0.00, 0.00 100.00 x 20.00)62 (coverage rect 0.00, 0.00 100.00 x 20.00)63 (intersects coverage rect 1)64 (contentsScale 2.00)65 )66 )67 )68 (GraphicsLayer69 51 (position 8.00 134.00) 70 (bounds 102.00 22.00)52 (bounds 799.00 22.00) 71 53 (drawsContent 1) 72 (visible rect 0.00, 0.00 102.00 x 22.00)54 (visible rect 0.00, 0.00 792.00 x 22.00) 73 55 (coverage rect -8.00, -134.00 800.00 x 600.00) 74 (intersects coverage rect 1)75 (contentsScale 2.00)76 )77 (GraphicsLayer78 (position 9.00 135.00)79 (bounds 798.00 20.00)80 (drawsContent 1)81 (visible rect 0.00, 0.00 791.00 x 20.00)82 (coverage rect -9.00, -135.00 800.00 x 600.00)83 56 (intersects coverage rect 1) 84 57 (contentsScale 2.00) -
trunk/LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt
r245085 r245170 16 16 (anchor 0.00 0.00) 17 17 (bounds 320.00 1224.00) 18 (drawsContent 1) 18 (children 1 19 (GraphicsLayer 20 (position 10.00 10.00) 21 (bounds 284.00 1204.00) 22 (contentsOpaque 1) 23 (drawsContent 1) 24 ) 25 ) 19 26 ) 20 27 ) -
trunk/LayoutTests/platform/mac-wk1/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt
r245085 r245170 1 (GraphicsLayer 2 (anchor 0.00 0.00) 3 (bounds 800.00 600.00) 4 (children 1 5 (GraphicsLayer 6 (bounds 800.00 600.00) 7 (contentsOpaque 1) 8 (children 1 9 (GraphicsLayer 10 (offsetFromRenderer width=-10 height=-10) 11 (bounds 305.00 325.00) 12 (children 1 13 (GraphicsLayer 14 (position 10.00 10.00) 15 (bounds 284.00 1204.00) 16 (contentsOpaque 1) 17 (drawsContent 1) 18 ) 19 ) 20 ) 21 ) 22 ) 23 ) 24 ) 1 25 -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r245085 r245170 6 6 #////////////////////////////////////////////////////////////////////////////////////////// 7 7 8 compositing/shared-backing/overflow-scroll [ Pass ] 8 9 editing/find [ Pass ] 9 10 editing/undo-manager [ Pass ] -
trunk/LayoutTests/platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt
r245085 r245170 20 20 (intersects coverage rect 1) 21 21 (contentsScale 1.00) 22 (children 622 (children 4 23 23 (GraphicsLayer 24 24 (position 8.00 96.00) … … 49 49 ) 50 50 (GraphicsLayer 51 (position 9.00 87.00) 52 (bounds 100.00 18.00) 53 (visible rect 0.00, 0.00 100.00 x 18.00) 54 (coverage rect 0.00, 0.00 100.00 x 18.00) 55 (intersects coverage rect 1) 56 (contentsScale 1.00) 57 (children 1 58 (GraphicsLayer 59 (bounds 100.00 18.00) 60 (drawsContent 1) 61 (visible rect 0.00, 0.00 100.00 x 18.00) 62 (coverage rect 0.00, 0.00 100.00 x 18.00) 63 (intersects coverage rect 1) 64 (contentsScale 1.00) 65 ) 66 ) 67 ) 68 (GraphicsLayer 69 (position 8.00 128.00) 70 (bounds 102.00 20.00) 51 (offsetFromRenderer width=-16 height=0) 52 (position -8.00 128.00) 53 (bounds 815.00 20.00) 71 54 (drawsContent 1) 72 (visible rect 0.00, 0.00 102.00 x 20.00) 73 (coverage rect -8.00, -128.00 800.00 x 585.00) 74 (intersects coverage rect 1) 75 (contentsScale 1.00) 76 ) 77 (GraphicsLayer 78 (offsetFromRenderer width=-9 height=0) 79 (position 0.00 129.00) 80 (bounds 807.00 18.00) 81 (drawsContent 1) 82 (visible rect 0.00, 0.00 800.00 x 18.00) 83 (coverage rect 0.00, -129.00 800.00 x 585.00) 55 (visible rect 8.00, 0.00 800.00 x 20.00) 56 (coverage rect 8.00, -128.00 800.00 x 585.00) 84 57 (intersects coverage rect 1) 85 58 (contentsScale 1.00) -
trunk/LayoutTests/platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt
r245085 r245170 20 20 (intersects coverage rect 1) 21 21 (contentsScale 1.00) 22 (children 622 (children 4 23 23 (GraphicsLayer 24 24 (position 8.00 96.00) … … 49 49 ) 50 50 (GraphicsLayer 51 (position 9.00 87.00)52 (bounds 100.00 18.00)53 (visible rect 0.00, 0.00 100.00 x 18.00)54 (coverage rect 0.00, 0.00 100.00 x 18.00)55 (intersects coverage rect 1)56 (contentsScale 1.00)57 (children 158 (GraphicsLayer59 (bounds 100.00 18.00)60 (drawsContent 1)61 (visible rect 0.00, 0.00 100.00 x 18.00)62 (coverage rect 0.00, 0.00 100.00 x 18.00)63 (intersects coverage rect 1)64 (contentsScale 1.00)65 )66 )67 )68 (GraphicsLayer69 51 (position 8.00 128.00) 70 (bounds 102.00 20.00)52 (bounds 799.00 20.00) 71 53 (drawsContent 1) 72 (visible rect 0.00, 0.00 102.00 x 20.00)54 (visible rect 0.00, 0.00 792.00 x 20.00) 73 55 (coverage rect -8.00, -128.00 800.00 x 585.00) 74 (intersects coverage rect 1)75 (contentsScale 1.00)76 )77 (GraphicsLayer78 (position 9.00 129.00)79 (bounds 798.00 18.00)80 (drawsContent 1)81 (visible rect 0.00, 0.00 791.00 x 18.00)82 (coverage rect -9.00, -129.00 800.00 x 585.00)83 56 (intersects coverage rect 1) 84 57 (contentsScale 1.00) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt
r245085 r245170 1 absabs 1 abs 2 abs 2 3 3 4 (Frame scrolling node … … 14 15 (max layout viewport origin (0,0)) 15 16 (behavior for fixed 0) 16 (children 317 (children 5 17 18 (Overflow scrolling node 18 19 (scrollable area size 285 285) 19 (contents size 381 5 00)20 (contents size 381 530) 20 21 (parent relative scrollable rect at (30,35) size 285x285) 21 22 (scrollable area parameters … … 29 30 (Positioned node 30 31 (layout constraints 32 (layer-position-at-last-layout (10,10)) 33 (positioning-behavior moves)) 34 (related overflow nodes 1) 35 ) 36 (Positioned node 37 (layout constraints 31 38 (layer-position-at-last-layout (50,50)) 39 (positioning-behavior moves)) 40 (related overflow nodes 1) 41 ) 42 (Positioned node 43 (layout constraints 44 (layer-position-at-last-layout (62,80)) 32 45 (positioning-behavior moves)) 33 46 (related overflow nodes 1) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html
r245085 r245170 36 36 background-image: repeating-linear-gradient(white, silver 200px); 37 37 } 38 39 .sharing-preventer { 40 transform: translateZ(0); 41 margin: 10px; 42 width: 10px; 43 height: 10px; 44 } 38 45 </style> 39 46 <script> … … 49 56 <body> 50 57 <div class="scroller"> 58 <div class="sharing-preventer"></div> 51 59 <div class="absolute">abs 60 <div class="sharing-preventer"></div> 52 61 <div class="inner absolute">abs</div> 53 62 </div> -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt
r245085 r245170 1 absabs 1 abs 2 abs 2 3 3 4 (Frame scrolling node … … 14 15 (max layout viewport origin (0,0)) 15 16 (behavior for fixed 0) 16 (children 417 (children 7 17 18 (Overflow scrolling node 18 19 (scrollable area size 285 285) 19 (contents size 285 5 26)20 (contents size 285 556) 20 21 (parent relative scrollable rect at (30,22) size 285x285) 21 22 (scrollable area parameters … … 28 29 (Positioned node 29 30 (layout constraints 30 (layer-position-at-last-layout ( 0,0))31 (layer-position-at-last-layout (10,10)) 31 32 (positioning-behavior moves)) 32 33 (related overflow nodes 1) … … 34 35 (Positioned node 35 36 (layout constraints 36 (layer-position-at-last-layout ( 53,53))37 (layer-position-at-last-layout (0,30)) 37 38 (positioning-behavior moves)) 38 39 (related overflow nodes 1) … … 40 41 (Positioned node 41 42 (layout constraints 42 (layer-position-at-last-layout (80,80)) 43 (layer-position-at-last-layout (13,43)) 44 (positioning-behavior moves)) 45 (related overflow nodes 1) 46 ) 47 (Positioned node 48 (layout constraints 49 (layer-position-at-last-layout (53,83)) 50 (positioning-behavior moves)) 51 (related overflow nodes 1) 52 ) 53 (Positioned node 54 (layout constraints 55 (layer-position-at-last-layout (65,113)) 56 (positioning-behavior moves)) 57 (related overflow nodes 1) 58 ) 59 (Positioned node 60 (layout constraints 61 (layer-position-at-last-layout (80,110)) 43 62 (positioning-behavior moves)) 44 63 (related overflow nodes 1) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html
r245085 r245170 41 41 background-image: repeating-linear-gradient(white, silver 200px); 42 42 } 43 44 .sharing-preventer { 45 transform: translateZ(0); 46 margin: 10px; 47 width: 10px; 48 height: 10px; 49 } 43 50 </style> 44 51 <script> … … 55 62 56 63 <div class="scroller"> 64 <div class="sharing-preventer"></div> 57 65 <div class="relative"> 66 <div class="sharing-preventer"></div> 58 67 <div class="absolute">abs 68 <div class="sharing-preventer"></div> 59 69 <div class="inner absolute">abs</div> 60 70 </div> -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt
r245085 r245170 1 absabs 1 abs 2 abs 2 3 3 4 (Frame scrolling node … … 17 18 (Overflow scrolling node 18 19 (scrollable area size 285 285) 19 (contents size 285 5 00)20 (contents size 285 530) 20 21 (parent relative scrollable rect at (30,22) size 285x285) 21 22 (scrollable area parameters -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html
r245085 r245170 36 36 background-image: repeating-linear-gradient(white, silver 200px); 37 37 } 38 39 .sharing-preventer { 40 transform: translateZ(0); 41 margin: 10px; 42 width: 10px; 43 height: 10px; 44 } 38 45 </style> 39 46 <script> … … 49 56 <body> 50 57 <div class="scroller"> 58 <div class="sharing-preventer"></div> 51 59 <div class="absolute">abs 60 <div class="sharing-preventer"></div> 52 61 <div class="inner absolute">abs</div> 53 62 </div> -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt
r245085 r245170 28 28 (max layout viewport origin (0,229)) 29 29 (behavior for fixed 0) 30 (children 1 230 (children 19 31 31 (Overflow scrolling node 32 32 (scrollable area size 205 155) … … 43 43 (Positioned node 44 44 (layout constraints 45 (layer-position-at-last-layout ( 10,28))45 (layer-position-at-last-layout (20,38)) 46 46 (positioning-behavior moves)) 47 47 (related overflow nodes 1) … … 49 49 (Positioned node 50 50 (layout constraints 51 (layer-position-at-last-layout (10,46)) 51 (layer-position-at-last-layout (10,58)) 52 (positioning-behavior moves)) 53 (related overflow nodes 1) 54 ) 55 (Positioned node 56 (layout constraints 57 (layer-position-at-last-layout (10,76)) 52 58 (positioning-behavior moves)) 53 59 (related overflow nodes 1) … … 67 73 (Positioned node 68 74 (layout constraints 69 (layer-position-at-last-layout (10,28)) 75 (layer-position-at-last-layout (20,38)) 76 (positioning-behavior moves)) 77 (related overflow nodes 1) 78 ) 79 (Positioned node 80 (layout constraints 81 (layer-position-at-last-layout (10,58)) 70 82 (positioning-behavior moves)) 71 83 (related overflow nodes 1) … … 82 94 (has enabled vertical scrollbar 1)) 83 95 ) 96 (Positioned node 97 (layout constraints 98 (layer-position-at-last-layout (20,38)) 99 (positioning-behavior moves)) 100 (related overflow nodes 1) 101 ) 84 102 (Overflow scrolling node 85 103 (scrollable area size 205 155) … … 92 110 (vertical scrollbar mode 0) 93 111 (has enabled vertical scrollbar 1)) 112 ) 113 (Positioned node 114 (layout constraints 115 (layer-position-at-last-layout (20,38)) 116 (positioning-behavior moves)) 117 (related overflow nodes 1) 94 118 ) 95 119 (Overflow scrolling node … … 107 131 (Positioned node 108 132 (layout constraints 109 (layer-position-at-last-layout ( 10,28))133 (layer-position-at-last-layout (20,38)) 110 134 (positioning-behavior moves)) 111 135 (related overflow nodes 1) … … 113 137 (Positioned node 114 138 (layout constraints 115 (layer-position-at-last-layout (110,46)) 139 (layer-position-at-last-layout (10,58)) 140 (positioning-behavior moves)) 141 (related overflow nodes 1) 142 ) 143 (Positioned node 144 (layout constraints 145 (layer-position-at-last-layout (20,86)) 146 (positioning-behavior moves)) 147 (related overflow nodes 1) 148 ) 149 (Positioned node 150 (layout constraints 151 (layer-position-at-last-layout (110,106)) 116 152 (positioning-behavior moves)) 117 153 (related overflow nodes 1) … … 130 166 (Positioned node 131 167 (layout constraints 132 (layer-position-at-last-layout (10,28)) 168 (layer-position-at-last-layout (20,38)) 169 (positioning-behavior moves)) 170 (related overflow nodes 1) 171 ) 172 (Positioned node 173 (layout constraints 174 (layer-position-at-last-layout (10,58)) 133 175 (positioning-behavior moves)) 134 176 (related overflow nodes 1) … … 136 178 (Positioned node 137 179 (layout constraints 138 (layer-position-at-last-layout (79, 18))180 (layer-position-at-last-layout (79,48)) 139 181 (positioning-behavior stationary)) 140 182 (related overflow nodes 1) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html
r245085 r245170 48 48 position: absolute; 49 49 left: 100px; 50 transform: translateZ(0); 50 51 } 51 52 … … 57 58 .scrolling-content { 58 59 height: 1000px; 60 } 61 62 .sharing-preventer { 63 transform: translateZ(0); 64 margin: 10px; 65 width: 10px; 66 height: 10px; 59 67 } 60 68 </style> … … 77 85 <div class="scrolling-content"> 78 86 Scrolling content 87 <div class="sharing-preventer"></div> 79 88 <div class="stacking"> 80 89 Stacking 90 <div class="sharing-preventer"></div> 81 91 <div class="absolute box"></div> 82 92 </div> … … 89 99 <div class="scrolling-content"> 90 100 Scrolling content 101 <div class="sharing-preventer"></div> 91 102 <div class="containing"> 92 103 Containing 104 <div class="sharing-preventer"></div> 93 105 <div class="absolute box"></div> 94 106 </div> … … 101 113 <div class="scrolling-content"> 102 114 Scrolling content 115 <div class="sharing-preventer"></div> 103 116 <div class="absolute box"></div> 104 117 </div> … … 114 127 <div class="scrolling-content"> 115 128 Scrolling content 129 <div class="sharing-preventer"></div> 116 130 <div class="absolute box"></div> 117 131 </div> … … 124 138 <div class="scrolling-content"> 125 139 Scrolling content 140 <div class="sharing-preventer"></div> 126 141 <div class="stacking"> 127 142 Stacking 128 143 <div class="containing"> 129 144 Containing 145 <div class="sharing-preventer"></div> 130 146 <div class="absolute box"></div> 131 147 </div> … … 138 154 <div class="scrolling-content"> 139 155 Scrolling content 156 <div class="sharing-preventer"></div> 140 157 <div class="containing"> 141 158 Containing 142 159 <div class="stacking"> 143 160 Stacking 161 <div class="sharing-preventer"></div> 144 162 <div class="absolute box"></div> 145 163 </div> -
trunk/Source/WebCore/ChangeLog
r245162 r245170 1 2019-05-09 Simon Fraser <simon.fraser@apple.com> 2 3 Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer 4 https://bugs.webkit.org/show_bug.cgi?id=197561 5 <rdar://problem/50445998> 6 7 Reviewed by Antti Koivisto. 8 9 This change introduces the concept of layers that share backing store for compositing. A layer 10 which is sharing its backing store first paints itself, and then some set of layers which come 11 later in paint order in the same stacking context. This reduces the composited layer count in 12 some overflow scrolling scenarios, thereby also simplifying the scrolling tree. 13 14 A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At 15 paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the 16 painting root so that positioning and clipping just work. 17 18 Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements(). 19 We track the last layer which was composited in paint order as a shared candidate. If a later layer 20 would composite for overlap (and no other reasons), then we allow it to share with the candidate 21 if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers 22 in the same stacking context. 23 24 isComposited() returns false for sharing layers, but they are like composited layers in that 25 they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them, 26 and repaints in shared layers have to be directed to their shared layer, hence 27 changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint(). 28 29 The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that 30 all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use 31 TemporaryClipRects in that case. 32 33 Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html 34 compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html 35 compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html 36 compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html 37 compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html 38 compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html 39 compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html 40 compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html 41 compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html 42 compositing/shared-backing/overflow-scroll/shared-layer-clipping.html 43 compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html 44 compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html 45 compositing/shared-backing/overflow-scroll/shared-layer-repaint.html 46 compositing/shared-backing/partial-compositing-update.html 47 compositing/shared-backing/partial-compositing-update2.html 48 compositing/shared-backing/remove-sharing-layer.html 49 compositing/shared-backing/sharing-cached-clip-rects.html 50 51 * rendering/RenderLayer.cpp: 52 (WebCore::RenderLayer::~RenderLayer): 53 (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const): 54 (WebCore::RenderLayer::setBackingProviderLayer): 55 (WebCore::RenderLayer::disconnectFromBackingProviderLayer): 56 (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const): 57 (WebCore::RenderLayer::clippingRootForPainting const): 58 (WebCore::RenderLayer::clipToRect): 59 (WebCore::RenderLayer::paintLayer): 60 (WebCore::RenderLayer::updateClipRects): 61 (WebCore::RenderLayer::clipCrossesPaintingBoundary const): 62 (WebCore::RenderLayer::calculateClipRects const): 63 (WebCore::outputPaintOrderTreeLegend): 64 (WebCore::outputPaintOrderTreeRecursive): 65 (WebCore::inContainingBlockChain): Deleted. 66 * rendering/RenderLayer.h: 67 * rendering/RenderLayerBacking.cpp: 68 (WebCore::RenderLayerBacking::willBeDestroyed): 69 (WebCore::clearBackingSharingLayerProviders): 70 (WebCore::RenderLayerBacking::setBackingSharingLayers): 71 (WebCore::RenderLayerBacking::removeBackingSharingLayer): 72 (WebCore::RenderLayerBacking::clearBackingSharingLayers): 73 (WebCore::RenderLayerBacking::updateCompositedBounds): 74 (WebCore::RenderLayerBacking::updateDrawsContent): 75 (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const): 76 (WebCore::RenderLayerBacking::paintIntoLayer): 77 (WebCore::RenderLayerBacking::paintContents): 78 * rendering/RenderLayerBacking.h: 79 * rendering/RenderLayerCompositor.cpp: 80 (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const): 81 (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren): 82 (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree): 83 (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate): 84 (WebCore::RenderLayerCompositor::updateCompositingLayers): 85 (WebCore::backingProviderLayerCanIncludeLayer): 86 (WebCore::RenderLayerCompositor::computeCompositingRequirements): 87 (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): 88 (WebCore::RenderLayerCompositor::updateBacking): 89 (WebCore::RenderLayerCompositor::layerWillBeRemoved): 90 (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const): 91 * rendering/RenderLayerCompositor.h: 92 * rendering/RenderTreeAsText.cpp: 93 1 94 2019-05-09 Daniel Bates <dabates@apple.com> 2 95 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r245085 r245170 367 367 clearLayerFilters(); 368 368 369 if (paintsIntoProvidedBacking()) { 370 auto* backingProviderLayer = this->backingProviderLayer(); 371 if (backingProviderLayer->backing()) 372 backingProviderLayer->backing()->removeBackingSharingLayer(*this); 373 } 374 369 375 // Child layers will be deleted by their corresponding render objects, so 370 376 // we don't need to delete them ourselves. … … 1664 1670 } 1665 1671 1672 bool RenderLayer::ancestorLayerIsInContainingBlockChain(const RenderLayer& ancestor, const RenderLayer* checkLimit) const 1673 { 1674 if (&ancestor == this) 1675 return true; 1676 1677 for (const auto* currentBlock = renderer().containingBlock(); currentBlock && !is<RenderView>(*currentBlock); currentBlock = currentBlock->containingBlock()) { 1678 auto* currLayer = currentBlock->layer(); 1679 if (currLayer == &ancestor) 1680 return true; 1681 1682 if (currLayer && currLayer == checkLimit) 1683 return false; 1684 } 1685 1686 return false; 1687 } 1688 1666 1689 RenderLayer* RenderLayer::enclosingAncestorForPosition(PositionType position) const 1667 1690 { … … 1747 1770 } 1748 1771 1772 void RenderLayer::setBackingProviderLayer(RenderLayer* backingProvider) 1773 { 1774 if (backingProvider == m_backingProviderLayer) 1775 return; 1776 1777 if (!renderer().renderTreeBeingDestroyed()) 1778 clearClipRectsIncludingDescendants(); 1779 1780 m_backingProviderLayer = makeWeakPtr(backingProvider); 1781 } 1782 1783 void RenderLayer::disconnectFromBackingProviderLayer() 1784 { 1785 if (!m_backingProviderLayer) 1786 return; 1787 1788 ASSERT(m_backingProviderLayer->isComposited()); 1789 if (m_backingProviderLayer->isComposited()) 1790 m_backingProviderLayer->backing()->removeBackingSharingLayer(*this); 1791 } 1792 1749 1793 bool compositedWithOwnBackingStore(const RenderLayer& layer) 1750 1794 { … … 1767 1811 RenderLayer* RenderLayer::enclosingCompositingLayerForRepaint(IncludeSelfOrNot includeSelf) const 1768 1812 { 1769 if (includeSelf == IncludeSelf && compositedWithOwnBackingStore(*this)) 1770 return const_cast<RenderLayer*>(this); 1813 auto repaintTargetForLayer = [](const RenderLayer& layer) -> RenderLayer* { 1814 if (compositedWithOwnBackingStore(layer)) 1815 return const_cast<RenderLayer*>(&layer); 1816 1817 if (layer.paintsIntoProvidedBacking()) 1818 return layer.backingProviderLayer(); 1819 1820 return nullptr; 1821 }; 1822 1823 RenderLayer* repaintTarget = nullptr; 1824 if (includeSelf == IncludeSelf && (repaintTarget = repaintTargetForLayer(*this))) 1825 return repaintTarget; 1771 1826 1772 1827 for (const RenderLayer* curr = paintOrderParent(); curr; curr = curr->paintOrderParent()) { 1773 if ( compositedWithOwnBackingStore(*curr))1774 return const_cast<RenderLayer*>(curr);1828 if ((repaintTarget = repaintTargetForLayer(*curr))) 1829 return repaintTarget; 1775 1830 } 1776 1831 … … 1854 1909 return const_cast<RenderLayer*>(this); 1855 1910 1911 if (paintsIntoProvidedBacking()) 1912 return backingProviderLayer(); 1913 1856 1914 const RenderLayer* current = this; 1857 1915 while (current) { … … 1863 1921 if (current->transform() || compositedWithOwnBackingStore(*current)) 1864 1922 return const_cast<RenderLayer*>(current); 1923 1924 if (current->paintsIntoProvidedBacking()) 1925 return current->backingProviderLayer(); 1865 1926 } 1866 1927 … … 3929 3990 } 3930 3991 3931 static bool inContainingBlockChain(RenderLayer* startLayer, RenderLayer* endLayer)3932 {3933 if (startLayer == endLayer)3934 return true;3935 for (const auto* currentBlock = startLayer->renderer().containingBlock(); currentBlock && !is<RenderView>(*currentBlock); currentBlock = currentBlock->containingBlock()) {3936 if (currentBlock->layer() == endLayer)3937 return true;3938 }3939 3940 return false;3941 }3942 3943 3992 void RenderLayer::clipToRect(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, const ClipRect& clipRect, BorderRadiusClippingRule rule) 3944 3993 { … … 3959 4008 // containing block chain so we check that also. 3960 4009 for (RenderLayer* layer = rule == IncludeSelfForBorderRadius ? this : parent(); layer; layer = layer->parent()) { 3961 if (layer->renderer().hasOverflowClip() && layer->renderer().style().hasBorderRadius() && inContainingBlockChain(this,layer)) {4010 if (layer->renderer().hasOverflowClip() && layer->renderer().style().hasBorderRadius() && ancestorLayerIsInContainingBlockChain(*layer)) { 3962 4011 LayoutRect adjustedClipRect = LayoutRect(toLayoutPoint(layer->offsetFromAncestor(paintingInfo.rootLayer, AdjustForColumns)), layer->size()); 3963 4012 adjustedClipRect.move(paintingInfo.subpixelOffset); … … 4021 4070 void RenderLayer::paintLayer(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, OptionSet<PaintLayerFlag> paintFlags) 4022 4071 { 4023 if (isComposited()) { 4024 // The performingPaintInvalidation() painting pass goes through compositing layers, 4025 // but we need to ensure that we don't cache clip rects computed with the wrong root in this case. 4026 if (context.performingPaintInvalidation() || (paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers)) 4027 paintFlags.add(PaintLayerTemporaryClipRects); 4028 else if (!backing()->paintsIntoWindow() 4029 && !backing()->paintsIntoCompositedAncestor() 4030 && !shouldDoSoftwarePaint(this, paintFlags.contains(PaintLayerPaintingReflection)) 4031 && !paintForFixedRootBackground(this, paintFlags)) { 4032 // If this RenderLayer should paint into its backing, that will be done via RenderLayerBacking::paintIntoLayer(). 4072 auto shouldContinuePaint = [&] () { 4073 return backing()->paintsIntoWindow() 4074 || backing()->paintsIntoCompositedAncestor() 4075 || shouldDoSoftwarePaint(this, paintFlags.contains(PaintLayerPaintingReflection)) 4076 || paintForFixedRootBackground(this, paintFlags); 4077 }; 4078 4079 auto paintsIntoDifferentCompositedDestination = [&]() { 4080 if (paintsIntoProvidedBacking()) 4081 return true; 4082 4083 if (isComposited() && !shouldContinuePaint()) 4084 return true; 4085 4086 return false; 4087 }; 4088 4089 if (paintsIntoDifferentCompositedDestination()) { 4090 if (!context.performingPaintInvalidation() && !(paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers)) 4033 4091 return; 4034 } 4035 } else if (viewportConstrainedNotCompositedReason() == NotCompositedForBoundsOutOfView) { 4092 4093 paintFlags.add(PaintLayerTemporaryClipRects); 4094 } 4095 4096 if (viewportConstrainedNotCompositedReason() == NotCompositedForBoundsOutOfView) { 4036 4097 // Don't paint out-of-view viewport constrained layers (when doing prepainting) because they will never be visible 4037 4098 // unless their position or viewport size is changed. … … 5441 5502 // examine the parent. We want to cache clip rects with us as the root. 5442 5503 if (auto* parentLayer = (clipRectsContext.rootLayer != this ? parent() : nullptr)) 5443 parentClipRects = parentLayer->updateClipRects(clipRectsContext);5504 parentClipRects = this->parentClipRects(clipRectsContext); 5444 5505 5445 5506 auto clipRects = ClipRects::create(); … … 5460 5521 return nullptr; 5461 5522 return m_clipRectsCache->getClipRects(context.clipRectsType, context.respectOverflowClip); 5523 } 5524 5525 bool RenderLayer::clipCrossesPaintingBoundary() const 5526 { 5527 return parent()->enclosingPaginationLayer(IncludeCompositedPaginatedLayers) != enclosingPaginationLayer(IncludeCompositedPaginatedLayers) 5528 || parent()->enclosingCompositingLayerForRepaint() != enclosingCompositingLayerForRepaint(); 5462 5529 } 5463 5530 … … 5484 5551 ClipRectsContext parentContext(clipRectsContext); 5485 5552 parentContext.overlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize; // FIXME: why? 5553 5554 if (clipCrossesPaintingBoundary()) 5555 parentContext.clipRectsType = TemporaryClipRects; 5556 5486 5557 parentLayer->calculateClipRects(parentContext, clipRects); 5487 5558 } … … 5535 5606 ASSERT(parent()); 5536 5607 5537 if (clipRectsContext.clipRectsType == TemporaryClipRects) {5608 auto temporaryParentClipRects = [&](const ClipRectsContext& clipContext) { 5538 5609 auto parentClipRects = ClipRects::create(); 5539 parent()->calculateClipRects(clip RectsContext, parentClipRects);5610 parent()->calculateClipRects(clipContext, parentClipRects); 5540 5611 return parentClipRects; 5612 }; 5613 5614 if (clipRectsContext.clipRectsType == TemporaryClipRects) 5615 return temporaryParentClipRects(clipRectsContext); 5616 5617 if (clipCrossesPaintingBoundary()) { 5618 ClipRectsContext tempClipRectsContext(clipRectsContext); 5619 tempClipRectsContext.clipRectsType = TemporaryClipRects; 5620 return temporaryParentClipRects(tempClipRectsContext); 5541 5621 } 5542 5622 … … 5558 5638 { 5559 5639 ASSERT(parent()); 5560 auto computeParentRects = [&] { 5561 if (clipRectsContext.clipRectsType == TemporaryClipRects) 5562 return parentClipRects(clipRectsContext); 5563 // If we cross into a different composition/pagination context, then we can't rely on the cache since the root layer differs. 5564 bool crossesPaginationBoundary = parent()->enclosingPaginationLayer(IncludeCompositedPaginatedLayers) != enclosingPaginationLayer(IncludeCompositedPaginatedLayers); 5565 bool crossesCompositingBoundary = parent()->enclosingCompositingLayerForRepaint() != enclosingCompositingLayerForRepaint(); 5566 if (!crossesPaginationBoundary && !crossesCompositingBoundary) 5567 return parentClipRects(clipRectsContext); 5568 5569 ClipRectsContext tempContext(clipRectsContext); 5570 tempContext.clipRectsType = TemporaryClipRects; 5571 return parentClipRects(tempContext); 5572 }; 5573 5574 auto parentRects = computeParentRects(); 5640 auto parentRects = parentClipRects(clipRectsContext); 5575 5641 ClipRect backgroundClipRect = backgroundClipRectForPosition(parentRects, renderer().style().position()); 5576 5642 RenderView& view = renderer().view(); … … 5945 6011 5946 6012 auto computeLayersUnion = [this, &unionBounds, flags, descendantFlags] (const RenderLayer& childLayer) { 5947 if (!(flags & IncludeCompositedDescendants) && childLayer.isComposited())6013 if (!(flags & IncludeCompositedDescendants) && (childLayer.isComposited() || childLayer.paintsIntoProvidedBacking())) 5948 6014 return; 5949 6015 LayoutRect childBounds = childLayer.calculateLayerBounds(this, childLayer.offsetFromAncestor(this), descendantFlags); … … 6792 6858 { 6793 6859 stream.nextLine(); 6794 stream << "(S)tacking Context/(F)orced SC/O(P)portunistic SC, (N)ormal flow only, (O)verflow clip, (A)lpha (opacity or mask), has (B)lend mode, (I)solates blending, (T)ransform-ish, (F)ilter, Fi(X)ed position, (C)omposited, ( c)omposited descendant, (s)scrolling ancestor\n"6860 stream << "(S)tacking Context/(F)orced SC/O(P)portunistic SC, (N)ormal flow only, (O)verflow clip, (A)lpha (opacity or mask), has (B)lend mode, (I)solates blending, (T)ransform-ish, (F)ilter, Fi(X)ed position, (C)omposited, (P)rovides backing/uses (p)rovided backing, (c)omposited descendant, (s)scrolling ancestor\n" 6795 6861 "Dirty (z)-lists, Dirty (n)ormal flow lists\n" 6796 6862 "Traversal needs: requirements (t)raversal on descendants, (b)acking or hierarchy traversal on descendants, (r)equirements traversal on all descendants, requirements traversal on all (s)ubsequent layers, (h)ierarchy traversal on all descendants, update of paint (o)rder children\n" … … 6818 6884 stream << (layer.renderer().isFixedPositioned() ? "X" : "-"); 6819 6885 stream << (layer.isComposited() ? "C" : "-"); 6886 stream << ((layer.isComposited() && layer.backing()->hasBackingSharingLayers()) ? "P" : (layer.paintsIntoProvidedBacking() ? "p" : "-")); 6820 6887 stream << (layer.hasCompositingDescendant() ? "c" : "-"); 6821 6888 stream << (layer.hasCompositedScrollingAncestor() ? "s" : "-"); -
trunk/Source/WebCore/rendering/RenderLayer.h
r245085 r245170 604 604 bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerDescendant; } 605 605 606 bool ancestorLayerIsInContainingBlockChain(const RenderLayer& ancestor, const RenderLayer* checkLimit = nullptr) const; 607 606 608 // Gets the nearest enclosing positioned ancestor layer (also includes 607 609 // the <html> layer and the root layer). … … 702 704 LayoutRect localClipRect(bool& clipExceedsBounds) const; // Returns the background clip rect of the layer in the local coordinate space. 703 705 706 bool clipCrossesPaintingBoundary() const; 707 704 708 // Pass offsetFromRoot if known. 705 709 bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutSize& offsetFromRoot, const LayoutRect* cachedBoundingBox = nullptr) const; … … 813 817 bool hasCompositingDescendant() const { return m_hasCompositingDescendant; } 814 818 bool hasCompositedMask() const; 819 820 // If non-null, a non-ancestor composited layer that this layer paints into (it is sharing its backing store with this layer). 821 RenderLayer* backingProviderLayer() const { return m_backingProviderLayer.get(); } 822 void setBackingProviderLayer(RenderLayer*); 823 void disconnectFromBackingProviderLayer(); 824 825 bool paintsIntoProvidedBacking() const { return !!m_backingProviderLayer; } 815 826 816 827 RenderLayerBacking* backing() const { return m_backing.get(); } … … 1258 1269 RenderLayer* m_last { nullptr }; 1259 1270 1271 WeakPtr<RenderLayer> m_backingProviderLayer; 1272 1260 1273 // For layers that establish stacking contexts, m_posZOrderList holds a sorted list of all the 1261 1274 // descendant layers within the stacking context that have z-indices of 0 or greater -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r245085 r245170 260 260 ASSERT(m_owningLayer.backing() == this); 261 261 compositor().removeFromScrollCoordinatedLayers(m_owningLayer); 262 263 LOG(Compositing, "RenderLayer(backing) %p willBeDestroyed", &m_owningLayer); 264 265 clearBackingSharingLayers(); 262 266 } 263 267 … … 266 270 if (layer && layer->type() == GraphicsLayer::Type::Normal && layer->tiledBacking()) 267 271 compositor().layerTiledBackingUsageChanged(layer, false); 272 } 273 274 static void clearBackingSharingLayerProviders(Vector<WeakPtr<RenderLayer>>& sharingLayers) 275 { 276 for (auto& layerWeakPtr : sharingLayers) { 277 if (!layerWeakPtr) 278 continue; 279 layerWeakPtr->setBackingProviderLayer(nullptr); 280 } 281 } 282 283 void RenderLayerBacking::setBackingSharingLayers(Vector<WeakPtr<RenderLayer>>&& sharingLayers) 284 { 285 if (m_backingSharingLayers == sharingLayers) { 286 sharingLayers.clear(); 287 return; 288 } 289 290 clearBackingSharingLayerProviders(m_backingSharingLayers); 291 m_backingSharingLayers = WTFMove(sharingLayers); 292 for (auto& layerWeakPtr : m_backingSharingLayers) 293 layerWeakPtr->setBackingProviderLayer(&m_owningLayer); 294 } 295 296 void RenderLayerBacking::removeBackingSharingLayer(RenderLayer& layer) 297 { 298 LOG(Compositing, "RenderLayer %p removeBackingSharingLayer %p", &m_owningLayer, &layer); 299 300 layer.setBackingProviderLayer(nullptr); 301 m_backingSharingLayers.removeAll(&layer); 302 } 303 304 void RenderLayerBacking::clearBackingSharingLayers() 305 { 306 LOG(Compositing, "RenderLayer %p clearBackingSharingLayers", &m_owningLayer); 307 308 clearBackingSharingLayerProviders(m_backingSharingLayers); 309 m_backingSharingLayers.clear(); 268 310 } 269 311 … … 607 649 bool RenderLayerBacking::updateCompositedBounds() 608 650 { 609 LayoutRect layerBounds = m_owningLayer.calculateLayerBounds(&m_owningLayer, LayoutSize(), RenderLayer::defaultCalculateLayerBoundsFlags() | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);651 LayoutRect layerBounds = m_owningLayer.calculateLayerBounds(&m_owningLayer, { }, RenderLayer::defaultCalculateLayerBoundsFlags() | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask); 610 652 // Clip to the size of the document or enclosing overflow-scroll layer. 611 653 // If this or an ancestor is transformed, we can't currently compute the correct rect to intersect with. … … 629 671 layerBounds.intersect(clippingBounds); 630 672 } 631 673 674 for (auto& layerWeakPtr : m_backingSharingLayers) { 675 auto* boundsRootLayer = &m_owningLayer; 676 ASSERT(layerWeakPtr->isDescendantOf(m_owningLayer)); 677 auto offset = layerWeakPtr->offsetFromAncestor(&m_owningLayer); 678 auto bounds = layerWeakPtr->calculateLayerBounds(boundsRootLayer, offset, RenderLayer::defaultCalculateLayerBoundsFlags() | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask); 679 layerBounds.unite(bounds); 680 } 681 632 682 // If the element has a transform-origin that has fixed lengths, and the renderer has zero size, 633 683 // then we need to ensure that the compositing layer has non-zero size so that we can apply … … 1398 1448 m_graphicsLayer->setDrawsContent(hasNonScrollingPaintedContent); 1399 1449 1400 bool hasScrollingPaintedContent = m_owningLayer.hasVisibleContent() && (renderer().hasBackground() || contentsInfo.paintsContent());1450 bool hasScrollingPaintedContent = hasBackingSharingLayers() || (m_owningLayer.hasVisibleContent() && (renderer().hasBackground() || contentsInfo.paintsContent())); 1401 1451 m_scrolledContentsLayer->setDrawsContent(hasScrollingPaintedContent); 1402 1452 return; … … 2132 2182 { 2133 2183 if (m_owningLayer.isRenderViewLayer()) 2184 return false; 2185 2186 if (hasBackingSharingLayers()) 2134 2187 return false; 2135 2188 … … 2604 2657 #endif 2605 2658 2606 FrameView::PaintingState paintingState; 2607 if (m_owningLayer.isRenderViewLayer()) 2608 renderer().view().frameView().willPaintContents(context, paintDirtyRect, paintingState); 2609 2610 RenderLayer::LayerPaintingInfo paintingInfo(&m_owningLayer, paintDirtyRect, paintBehavior, -m_subpixelOffsetFromRenderer); 2611 2612 m_owningLayer.paintLayerContents(context, paintingInfo, paintFlags); 2613 2614 if (m_owningLayer.containsDirtyOverlayScrollbars()) 2615 m_owningLayer.paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerPaintingOverlayScrollbars); 2616 2617 if (m_owningLayer.isRenderViewLayer()) 2618 renderer().view().frameView().didPaintContents(context, paintDirtyRect, paintingState); 2659 auto paintOneLayer = [&](RenderLayer& layer, OptionSet<RenderLayer::PaintLayerFlag> paintFlags) { 2660 InspectorInstrumentation::willPaint(layer.renderer()); 2661 2662 FrameView::PaintingState paintingState; 2663 if (layer.isRenderViewLayer()) 2664 renderer().view().frameView().willPaintContents(context, paintDirtyRect, paintingState); 2665 2666 RenderLayer::LayerPaintingInfo paintingInfo(&m_owningLayer, paintDirtyRect, paintBehavior, -m_subpixelOffsetFromRenderer); 2667 2668 layer.paintLayerContents(context, paintingInfo, paintFlags); 2669 2670 if (layer.containsDirtyOverlayScrollbars()) 2671 layer.paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerPaintingOverlayScrollbars); 2672 2673 if (layer.isRenderViewLayer()) 2674 renderer().view().frameView().didPaintContents(context, paintDirtyRect, paintingState); 2675 2676 ASSERT(!m_owningLayer.m_usedTransparency); 2677 2678 InspectorInstrumentation::didPaint(layer.renderer(), paintDirtyRect); 2679 }; 2680 2681 paintOneLayer(m_owningLayer, paintFlags); 2682 2683 // FIXME: Need to check m_foregroundLayer, masking etc. webkit.org/b/197565. 2684 GraphicsLayer* destinationForSharingLayers = m_scrolledContentsLayer ? m_scrolledContentsLayer.get() : m_graphicsLayer.get(); 2685 2686 if (graphicsLayer == destinationForSharingLayers) { 2687 OptionSet<RenderLayer::PaintLayerFlag> sharingLayerPaintFlags = { 2688 RenderLayer::PaintLayerPaintingCompositingBackgroundPhase, 2689 RenderLayer::PaintLayerPaintingCompositingForegroundPhase }; 2690 2691 if (paintingPhase & GraphicsLayerPaintOverflowContents) 2692 sharingLayerPaintFlags.add(RenderLayer::PaintLayerPaintingOverflowContents); 2693 2694 for (auto& layerWeakPtr : m_backingSharingLayers) 2695 paintOneLayer(*layerWeakPtr, sharingLayerPaintFlags); 2696 } 2619 2697 2620 2698 compositor().didPaintBacking(this); 2621 2622 ASSERT(!m_owningLayer.m_usedTransparency);2623 2699 } 2624 2700 … … 2648 2724 || graphicsLayer == m_childClippingMaskLayer.get() 2649 2725 || graphicsLayer == m_scrolledContentsLayer.get()) { 2650 InspectorInstrumentation::willPaint(renderer());2651 2726 2652 2727 if (!(paintingPhase & GraphicsLayerPaintOverflowContents)) … … 2662 2737 2663 2738 paintIntoLayer(graphicsLayer, context, dirtyRect, behavior, paintingPhase); 2664 2665 InspectorInstrumentation::didPaint(renderer(), dirtyRect);2666 2739 } else if (graphicsLayer == layerForHorizontalScrollbar()) { 2667 2740 paintScrollbar(m_owningLayer.horizontalScrollbar(), context, dirtyRect); … … 2670 2743 } else if (graphicsLayer == layerForScrollCorner()) { 2671 2744 const LayoutRect& scrollCornerAndResizer = m_owningLayer.scrollCornerAndResizerRect(); 2672 context.save();2745 GraphicsContextStateSaver stateSaver(context); 2673 2746 context.translate(-scrollCornerAndResizer.location()); 2674 2747 LayoutRect transformedClip = LayoutRect(clip); … … 2676 2749 m_owningLayer.paintScrollCorner(context, IntPoint(), snappedIntRect(transformedClip)); 2677 2750 m_owningLayer.paintResizer(context, IntPoint(), transformedClip); 2678 context.restore();2679 2751 } 2680 2752 #ifndef NDEBUG -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r245085 r245170 70 70 RenderLayer& owningLayer() const { return m_owningLayer; } 71 71 72 // Included layers are non-z-order descendant layers that are painted into this backing. 73 const Vector<WeakPtr<RenderLayer>>& backingSharingLayers() const { return m_backingSharingLayers; } 74 void setBackingSharingLayers(Vector<WeakPtr<RenderLayer>>&&); 75 76 bool hasBackingSharingLayers() const { return !m_backingSharingLayers.isEmpty(); } 77 78 void removeBackingSharingLayer(RenderLayer&); 79 void clearBackingSharingLayers(); 80 72 81 void updateConfigurationAfterStyleChange(); 73 82 … … 388 397 RenderLayer& m_owningLayer; 389 398 399 // A list other layers that paint into this backing store, later than m_owningLayer in paint order. 400 Vector<WeakPtr<RenderLayer>> m_backingSharingLayers; 401 390 402 RefPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clipped by an ancestor which is not a stacking context. 391 403 RefPtr<GraphicsLayer> m_contentsContainmentLayer; // Only used if we have a background layer; takes the transform. -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r245147 r245170 233 233 } 234 234 235 CompositingState(const CompositingState& other) 236 : compositingAncestor(other.compositingAncestor) 237 , subtreeIsCompositing(other.subtreeIsCompositing) 238 , testingOverlap(other.testingOverlap) 239 , fullPaintOrderTraversalRequired(other.fullPaintOrderTraversalRequired) 240 , descendantsRequireCompositingUpdate(other.descendantsRequireCompositingUpdate) 241 , ancestorHasTransformAnimation(other.ancestorHasTransformAnimation) 235 CompositingState stateForPaintOrderChildren(RenderLayer& layer) const 236 { 237 UNUSED_PARAM(layer); 238 CompositingState childState(compositingAncestor); 239 if (layer.isStackingContext()) 240 childState.stackingContextAncestor = &layer; 241 else 242 childState.stackingContextAncestor = stackingContextAncestor; 243 244 childState.subtreeIsCompositing = false; 245 childState.testingOverlap = testingOverlap; 246 childState.fullPaintOrderTraversalRequired = fullPaintOrderTraversalRequired; 247 childState.descendantsRequireCompositingUpdate = descendantsRequireCompositingUpdate; 248 childState.ancestorHasTransformAnimation = ancestorHasTransformAnimation; 242 249 #if ENABLE(CSS_COMPOSITING) 243 , hasNotIsolatedCompositedBlendingDescendants(other.hasNotIsolatedCompositedBlendingDescendants)250 childState.hasNotIsolatedCompositedBlendingDescendants = false; // FIXME: should this only be reset for stacking contexts? 244 251 #endif 245 252 #if ENABLE(TREE_DEBUGGING) 246 , depth(other.depth + 1) 247 #endif 253 childState.depth = depth + 1; 254 #endif 255 return childState; 256 } 257 258 void propagateStateFromChildren(const CompositingState& childState) 248 259 { 249 } 250 260 // Subsequent layers in the parent stacking context also need to composite. 261 subtreeIsCompositing |= childState.subtreeIsCompositing; 262 fullPaintOrderTraversalRequired |= childState.fullPaintOrderTraversalRequired; 263 } 264 265 void propagateStateFromChildrenForUnchangedSubtree(const CompositingState& childState) 266 { 267 subtreeIsCompositing |= childState.subtreeIsCompositing; 268 } 269 251 270 RenderLayer* compositingAncestor; 271 RenderLayer* stackingContextAncestor { nullptr }; 252 272 bool subtreeIsCompositing { false }; 253 273 bool testingOverlap { true }; … … 261 281 int depth { 0 }; 262 282 #endif 283 }; 284 285 struct RenderLayerCompositor::BackingSharingState { 286 RenderLayer* backingProviderCandidate { nullptr }; 287 RenderLayer* backingProviderStackingContext { nullptr }; 288 Vector<WeakPtr<RenderLayer>> backingSharingLayers; 289 290 void resetBackingProviderCandidate(RenderLayer* candidateLayer = nullptr, RenderLayer* candidateStackingContext = nullptr) 291 { 292 if (!backingSharingLayers.isEmpty()) { 293 ASSERT(backingProviderCandidate); 294 backingProviderCandidate->backing()->setBackingSharingLayers(WTFMove(backingSharingLayers)); 295 } 296 backingProviderCandidate = candidateLayer; 297 backingProviderStackingContext = candidateLayer ? candidateStackingContext : nullptr; 298 } 263 299 }; 264 300 … … 766 802 if (updateRoot->hasDescendantNeedingCompositingRequirementsTraversal() || updateRoot->needsCompositingRequirementsTraversal()) { 767 803 CompositingState compositingState(updateRoot); 804 BackingSharingState backingSharingState; 768 805 OverlapMap overlapMap; 769 806 770 807 bool descendantHas3DTransform = false; 771 computeCompositingRequirements(nullptr, rootRenderLayer(), overlapMap, compositingState, descendantHas3DTransform);808 computeCompositingRequirements(nullptr, rootRenderLayer(), overlapMap, compositingState, backingSharingState, descendantHas3DTransform); 772 809 } 773 810 … … 822 859 } 823 860 824 void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, bool& descendantHas3DTransform) 825 { 826 if (!layer.hasDescendantNeedingCompositingRequirementsTraversal() && !layer.needsCompositingRequirementsTraversal() && !compositingState.fullPaintOrderTraversalRequired && !compositingState.descendantsRequireCompositingUpdate) { 827 traverseUnchangedSubtree(ancestorLayer, layer, overlapMap, compositingState, descendantHas3DTransform); 861 static bool backingProviderLayerCanIncludeLayer(const RenderLayer& sharedLayer, const RenderLayer& layer) 862 { 863 return layer.ancestorLayerIsInContainingBlockChain(sharedLayer); 864 } 865 866 void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, BackingSharingState& backingSharingState, bool& descendantHas3DTransform) 867 { 868 if (!layer.hasDescendantNeedingCompositingRequirementsTraversal() 869 && !layer.needsCompositingRequirementsTraversal() 870 && !compositingState.fullPaintOrderTraversalRequired 871 && !compositingState.descendantsRequireCompositingUpdate) { 872 traverseUnchangedSubtree(ancestorLayer, layer, overlapMap, compositingState, backingSharingState, descendantHas3DTransform); 828 873 return; 829 874 } 830 875 831 876 #if ENABLE(TREE_DEBUGGING) 832 LOG(Compositing, "%*p computeCompositingRequirements", 12 + compositingState.depth * 2, &layer);877 LOG(Compositing, "%*p %s computeCompositingRequirements (backing provider candidate %p)", 12 + compositingState.depth * 2, &layer, layer.isNormalFlowOnly() ? "n" : "s", backingSharingState.backingProviderCandidate); 833 878 #endif 834 879 … … 841 886 842 887 layer.setHasCompositingDescendant(false); 888 layer.setBackingProviderLayer(nullptr); 843 889 844 890 // We updated compositing for direct reasons in layerStyleChanged(). Here, check for compositing that can only be evaluated after layout. … … 862 908 863 909 RenderLayer::IndirectCompositingReason compositingReason = compositingState.subtreeIsCompositing ? RenderLayer::IndirectCompositingReason::Stacking : RenderLayer::IndirectCompositingReason::None; 910 bool layerPaintsIntoProvidedBacking = false; 864 911 865 912 // If we know for sure the layer is going to be composited, don't bother looking it up in the overlap map 866 913 if (!willBeComposited && !overlapMap.isEmpty() && compositingState.testingOverlap) { 867 914 computeExtent(overlapMap, layer, layerExtent); 915 868 916 // If we're testing for overlap, we only need to composite if we overlap something that is already composited. 869 compositingReason = overlapMap.overlapsLayers(layerExtent.bounds) ? RenderLayer::IndirectCompositingReason::Overlap : RenderLayer::IndirectCompositingReason::None; 917 if (overlapMap.overlapsLayers(layerExtent.bounds)) { 918 if (backingSharingState.backingProviderCandidate && backingProviderLayerCanIncludeLayer(*backingSharingState.backingProviderCandidate, layer)) { 919 backingSharingState.backingSharingLayers.append(makeWeakPtr(layer)); 920 LOG(Compositing, " layer %p can share with %p", &layer, backingSharingState.backingProviderCandidate); 921 compositingReason = RenderLayer::IndirectCompositingReason::None; 922 layerPaintsIntoProvidedBacking = true; 923 } else 924 compositingReason = RenderLayer::IndirectCompositingReason::Overlap; 925 } else 926 compositingReason = RenderLayer::IndirectCompositingReason::None; 870 927 } 871 928 … … 889 946 // a compositing layer among them, so start by inheriting the compositing 890 947 // ancestor with subtreeIsCompositing set to false. 891 CompositingState childState(compositingState); 892 childState.subtreeIsCompositing = false; 893 #if ENABLE(CSS_COMPOSITING) 894 childState.hasNotIsolatedCompositedBlendingDescendants = false; 895 #endif 948 CompositingState childState = compositingState.stateForPaintOrderChildren(layer); 949 950 auto layerWillComposite = [&](bool postDescendants = false) { 951 // This layer now acts as the ancestor for kids. 952 childState.compositingAncestor = &layer; 953 overlapMap.pushCompositingContainer(); 954 955 if (postDescendants) { 956 childState.subtreeIsCompositing = true; 957 addToOverlapMapRecursive(overlapMap, layer); 958 } 959 960 // This layer is going to be composited, so children can safely ignore the fact that there's an 961 // animation running behind this layer, meaning they can rely on the overlap map testing again. 962 childState.testingOverlap = true; 963 willBeComposited = true; 964 965 layerPaintsIntoProvidedBacking = false; 966 layer.disconnectFromBackingProviderLayer(); 967 backingSharingState.backingSharingLayers.removeAll(&layer); 968 }; 896 969 897 970 if (willBeComposited) { 898 971 // Tell the parent it has compositing descendants. 899 972 compositingState.subtreeIsCompositing = true; 900 // This layer now acts as the ancestor for kids. 901 childState.compositingAncestor = &layer; 902 903 overlapMap.pushCompositingContainer(); 904 // This layer is going to be composited, so children can safely ignore the fact that there's an 905 // animation running behind this layer, meaning they can rely on the overlap map testing again. 906 childState.testingOverlap = true; 973 974 layerWillComposite(); 907 975 908 976 computeExtent(overlapMap, layer, layerExtent); … … 910 978 // Too hard to compute animated bounds if both us and some ancestor is animating transform. 911 979 layerExtent.animationCausesExtentUncertainty |= layerExtent.hasTransformAnimation && compositingState.ancestorHasTransformAnimation; 980 981 // Compositing for any reason disables backing sharing. 982 LOG_WITH_STREAM(Compositing, stream << &layer << " is compositing - flushing sharing to " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers"); 983 backingSharingState.resetBackingProviderCandidate(); 912 984 } 913 985 … … 919 991 920 992 for (auto* childLayer : layer.negativeZOrderLayers()) { 921 computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);993 computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform); 922 994 923 995 // If we have to make a layer for this child, make one now so we can have a contents layer … … 926 998 // make layer compositing 927 999 layer.setIndirectCompositingReason(RenderLayer::IndirectCompositingReason::BackgroundLayer); 928 childState.compositingAncestor = &layer; 929 overlapMap.pushCompositingContainer(); 930 // This layer is going to be composited, so children can safely ignore the fact that there's an 931 // animation running behind this layer, meaning they can rely on the overlap map testing again 932 childState.testingOverlap = true; 933 willBeComposited = true; 1000 layerWillComposite(); 934 1001 } 935 1002 } 936 1003 937 1004 for (auto* childLayer : layer.normalFlowLayers()) 938 computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);1005 computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform); 939 1006 940 1007 for (auto* childLayer : layer.positiveZOrderLayers()) 941 computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);1008 computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform); 942 1009 943 1010 // If we just entered compositing mode, the root will have become composited (as long as accelerated compositing is enabled). … … 968 1035 RenderLayer::IndirectCompositingReason indirectCompositingReason; 969 1036 if (!willBeComposited && canBeComposited(layer) 970 && requiresCompositingForIndirectReason(layer .renderer(), compositingState.compositingAncestor, childState.subtreeIsCompositing, anyDescendantHas3DTransform, indirectCompositingReason)) {1037 && requiresCompositingForIndirectReason(layer, compositingState.compositingAncestor, childState.subtreeIsCompositing, anyDescendantHas3DTransform, layerPaintsIntoProvidedBacking, indirectCompositingReason)) { 971 1038 layer.setIndirectCompositingReason(indirectCompositingReason); 972 childState.compositingAncestor = &layer; 973 childState.subtreeIsCompositing = true; 974 overlapMap.pushCompositingContainer(); 975 addToOverlapMapRecursive(overlapMap, layer); 976 willBeComposited = true; 1039 layerWillComposite(true); 977 1040 } 978 1041 … … 994 1057 compositingState.testingOverlap = false; 995 1058 996 if (isCompositedClippingLayer) { 997 if (!willBeComposited) { 998 childState.compositingAncestor = &layer; 999 childState.subtreeIsCompositing = true; 1000 overlapMap.pushCompositingContainer(); 1001 addToOverlapMapRecursive(overlapMap, layer); 1002 willBeComposited = true; 1003 } 1004 } 1059 if (isCompositedClippingLayer & !willBeComposited) 1060 layerWillComposite(true); 1005 1061 1006 1062 #if ENABLE(CSS_COMPOSITING) … … 1024 1080 } 1025 1081 1026 // Subsequent layers in the parent stacking context also need to composite. 1027 compositingState.subtreeIsCompositing |= childState.subtreeIsCompositing; 1028 compositingState.fullPaintOrderTraversalRequired |= childState.fullPaintOrderTraversalRequired; 1082 compositingState.propagateStateFromChildren(childState); 1029 1083 1030 1084 ASSERT(willBeComposited == needsToBeComposited(layer, queryData)); … … 1038 1092 // The composited bounds of enclosing layers depends on which descendants are composited, so they need a geometry update. 1039 1093 layer.setNeedsCompositingGeometryUpdateOnAncestors(); 1094 } else if (layer.isComposited()) 1095 layer.backing()->clearBackingSharingLayers(); 1096 1097 if (backingSharingState.backingProviderCandidate && &layer == backingSharingState.backingProviderStackingContext) { 1098 LOG_WITH_STREAM(Compositing, stream << &layer << " popping stacking context " << backingSharingState.backingProviderStackingContext << ", flushing candidate " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers"); 1099 backingSharingState.resetBackingProviderCandidate(); 1100 } else if (!backingSharingState.backingProviderCandidate && layer.isComposited()) { 1101 LOG_WITH_STREAM(Compositing, stream << &layer << " compositing - sharing candidate " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers"); 1102 // Flush out any earlier candidate in this stacking context. This layer becomes a candidate. 1103 backingSharingState.resetBackingProviderCandidate(&layer, compositingState.stackingContextAncestor); 1040 1104 } 1041 1105 … … 1052 1116 1053 1117 #if ENABLE(TREE_DEBUGGING) 1054 LOG(Compositing, "%*p computeCompositingRequirements - willBeComposited %d ", 12 + compositingState.depth * 2, &layer, willBeComposited);1118 LOG(Compositing, "%*p computeCompositingRequirements - willBeComposited %d (backing provider candidate %p)", 12 + compositingState.depth * 2, &layer, willBeComposited, backingSharingState.backingProviderCandidate); 1055 1119 #endif 1056 1120 … … 1061 1125 1062 1126 // We have to traverse unchanged layers to fill in the overlap map. 1063 void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, bool& descendantHas3DTransform)1127 void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, BackingSharingState& backingSharingState, bool& descendantHas3DTransform) 1064 1128 { 1065 1129 ASSERT(!compositingState.fullPaintOrderTraversalRequired); … … 1087 1151 computeExtent(overlapMap, layer, layerExtent); 1088 1152 1089 CompositingState childState(compositingState); 1090 childState.subtreeIsCompositing = false; 1091 #if ENABLE(CSS_COMPOSITING) 1092 childState.hasNotIsolatedCompositedBlendingDescendants = false; 1093 #endif 1153 if (layer.paintsIntoProvidedBacking()) { 1154 ASSERT(backingSharingState.backingProviderCandidate); 1155 ASSERT(backingProviderLayerCanIncludeLayer(*backingSharingState.backingProviderCandidate, layer)); 1156 backingSharingState.backingSharingLayers.append(makeWeakPtr(layer)); 1157 } 1158 1159 CompositingState childState = compositingState.stateForPaintOrderChildren(layer); 1094 1160 1095 1161 if (layerIsComposited) { … … 1108 1174 // Too hard to compute animated bounds if both us and some ancestor is animating transform. 1109 1175 layerExtent.animationCausesExtentUncertainty |= layerExtent.hasTransformAnimation && compositingState.ancestorHasTransformAnimation; 1176 1177 // Compositing for any reason disables backing sharing. 1178 LOG_WITH_STREAM(Compositing, stream << "tus: " << &layer << " is compositing - flushing sharing to " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers"); 1179 backingSharingState.resetBackingProviderCandidate(); 1110 1180 } 1111 1181 … … 1117 1187 1118 1188 for (auto* childLayer : layer.negativeZOrderLayers()) { 1119 traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);1189 traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform); 1120 1190 if (childState.subtreeIsCompositing) 1121 1191 ASSERT(layerIsComposited); … … 1123 1193 1124 1194 for (auto* childLayer : layer.normalFlowLayers()) 1125 traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);1195 traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform); 1126 1196 1127 1197 for (auto* childLayer : layer.positiveZOrderLayers()) 1128 traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);1198 traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform); 1129 1199 1130 1200 // All layers (even ones that aren't being composited) need to get added to … … 1136 1206 addToOverlapMap(overlapMap, layer, layerExtent); 1137 1207 1138 // Subsequent layers in the parent stacking context also need to composite. 1139 if (childState.subtreeIsCompositing) 1140 compositingState.subtreeIsCompositing = true; 1208 compositingState.propagateStateFromChildrenForUnchangedSubtree(childState); 1141 1209 1142 1210 // Set the flag to say that this layer has compositing children. … … 1163 1231 if (childState.compositingAncestor == &layer && !layer.isRenderViewLayer()) 1164 1232 overlapMap.popCompositingContainer(); 1233 1234 if (layer.isComposited()) 1235 layer.backing()->clearBackingSharingLayers(); 1236 1237 if (backingSharingState.backingProviderCandidate && &layer == backingSharingState.backingProviderStackingContext) { 1238 LOG_WITH_STREAM(Compositing, stream << &layer << " tus: popping stacking context " << backingSharingState.backingProviderStackingContext << ", flushing candidate " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers"); 1239 backingSharingState.resetBackingProviderCandidate(); 1240 } else if (!backingSharingState.backingProviderCandidate && layer.isComposited()) { 1241 LOG_WITH_STREAM(Compositing, stream << &layer << " tus: compositing - sharing candidate " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers"); 1242 // Flush out any earlier candidate in this stacking context. This layer becomes a candidate. 1243 backingSharingState.resetBackingProviderCandidate(&layer, compositingState.stackingContextAncestor); 1244 } 1165 1245 1166 1246 descendantHas3DTransform |= anyDescendantHas3DTransform || layer.has3DTransform(); … … 1582 1662 1583 1663 if (backingRequired == BackingRequired::Yes) { 1664 layer.disconnectFromBackingProviderLayer(); 1665 1584 1666 enableCompositingMode(); 1585 1667 … … 1734 1816 void RenderLayerCompositor::layerWillBeRemoved(RenderLayer& parent, RenderLayer& child) 1735 1817 { 1736 if ( !child.isComposited() ||parent.renderer().renderTreeBeingDestroyed())1818 if (parent.renderer().renderTreeBeingDestroyed()) 1737 1819 return; 1738 1820 1739 repaintInCompositedAncestor(child, child.backing()->compositedBounds()); // FIXME: do via dirty bits? 1821 if (child.isComposited()) 1822 repaintInCompositedAncestor(child, child.backing()->compositedBounds()); // FIXME: do via dirty bits? 1823 else if (child.paintsIntoProvidedBacking()) { 1824 auto* backingProviderLayer = child.backingProviderLayer(); 1825 // FIXME: Optimize this repaint. 1826 backingProviderLayer->setBackingNeedsRepaint(); 1827 backingProviderLayer->backing()->removeBackingSharingLayer(child); 1828 } else 1829 return; 1740 1830 1741 1831 child.setNeedsCompositingLayerConnection(); … … 2800 2890 2801 2891 // FIXME: why doesn't this handle the clipping cases? 2802 bool RenderLayerCompositor::requiresCompositingForIndirectReason(RenderLayerModelObject& renderer, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason& reason) const 2803 { 2804 auto& layer = *renderer.layer(); 2805 2892 bool RenderLayerCompositor::requiresCompositingForIndirectReason(const RenderLayer& layer, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, bool paintsIntoProvidedBacking, RenderLayer::IndirectCompositingReason& reason) const 2893 { 2806 2894 // When a layer has composited descendants, some effects, like 2d transforms, filters, masks etc must be implemented 2807 2895 // via compositing so that they also apply to those composited descendants. 2896 auto& renderer = layer.renderer(); 2808 2897 if (hasCompositedDescendants && (layer.isolatesCompositedBlending() || layer.transform() || renderer.createsGroup() || renderer.hasReflection())) { 2809 2898 reason = RenderLayer::IndirectCompositingReason::GraphicalEffect; … … 2825 2914 } 2826 2915 2827 if ( renderer.isAbsolutelyPositioned() && compositingAncestor && layer.hasCompositedScrollingAncestor()) {2916 if (!paintsIntoProvidedBacking && renderer.isAbsolutelyPositioned() && compositingAncestor && layer.hasCompositedScrollingAncestor()) { 2828 2917 if (layerContainingBlockCrossesCoordinatedScrollingBoundary(layer, *compositingAncestor)) { 2829 2918 reason = RenderLayer::IndirectCompositingReason::OverflowScrollPositioning; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r245085 r245170 370 370 class OverlapMap; 371 371 struct CompositingState; 372 struct BackingSharingState; 372 373 struct OverlapExtent; 373 374 … … 411 412 void updateCompositingLayersTimerFired(); 412 413 413 void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap&, CompositingState&, bool& descendantHas3DTransform);414 void traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap&, CompositingState&, bool& descendantHas3DTransform);414 void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap&, CompositingState&, BackingSharingState&, bool& descendantHas3DTransform); 415 void traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap&, CompositingState&, BackingSharingState&, bool& descendantHas3DTransform); 415 416 416 417 enum class UpdateLevel { … … 477 478 bool requiresCompositingForOverflowScrolling(const RenderLayer&, RequiresCompositingData&) const; 478 479 bool requiresCompositingForEditableImage(RenderLayerModelObject&) const; 479 bool requiresCompositingForIndirectReason( RenderLayerModelObject&, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason&) const;480 bool requiresCompositingForIndirectReason(const RenderLayer&, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, bool paintsIntoProvidedBacking, RenderLayer::IndirectCompositingReason&) const; 480 481 481 482 static bool layerContainingBlockCrossesCoordinatedScrollingBoundary(const RenderLayer&, const RenderLayer& compositedAncestor); -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r245085 r245170 655 655 ts << " (composited, bounds=" << layer.backing()->compositedBounds() << ", drawsContent=" << layer.backing()->graphicsLayer()->drawsContent() 656 656 << ", paints into ancestor=" << layer.backing()->paintsIntoCompositedAncestor() << ")"; 657 } 657 } else if (layer.paintsIntoProvidedBacking()) 658 ts << " (shared backing of " << layer.backingProviderLayer() << ")"; 658 659 } 659 660
Note:
See TracChangeset
for help on using the changeset viewer.