| OLD | NEW |
| 1 Basic repaint test for squashed layers. The entire squashing layer should not ne
ed repainting when only a portion of it is invalidated. Test interactively by us
ing --show-paint-rects and hovering over elements to change their color. | 1 Basic repaint test for squashed layers. The entire squashing layer should not ne
ed repainting when only a portion of it is invalidated. Test interactively by us
ing --show-paint-rects and hovering over elements to change their color. |
| 2 | 2 |
| 3 CASE 1, original layer tree: | 3 CASE 1, original layer tree: |
| 4 { | 4 { |
| 5 "name": "Content Root Layer", | 5 "layers": [ |
| 6 "bounds": [800, 600], | |
| 7 "children": [ | |
| 8 { | 6 { |
| 9 "name": "LayoutView #document", | 7 "name": "LayoutView #document", |
| 10 "bounds": [800, 600], | 8 "bounds": [800, 600], |
| 11 "contentsOpaque": true, | 9 "contentsOpaque": true, |
| 10 "drawsContent": true |
| 11 }, |
| 12 { |
| 13 "name": "Squashing Containment Layer", |
| 14 "shouldFlattenTransform": false |
| 15 }, |
| 16 { |
| 17 "name": "LayoutBlockFlow (positioned) DIV class='composited'", |
| 18 "position": [60, 60], |
| 19 "bounds": [100, 100], |
| 20 "contentsOpaque": true, |
| 12 "drawsContent": true, | 21 "drawsContent": true, |
| 13 "children": [ | 22 "backgroundColor": "#808080" |
| 14 { | 23 }, |
| 15 "name": "Squashing Containment Layer", | 24 { |
| 16 "shouldFlattenTransform": false, | 25 "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (positione
d) DIV id='A' class='overlap1')", |
| 17 "children": [ | 26 "position": [140, 140], |
| 18 { | 27 "bounds": [260, 260], |
| 19 "name": "LayoutBlockFlow (positioned) DIV class='composited'", | 28 "drawsContent": true |
| 20 "position": [60, 60], | |
| 21 "bounds": [100, 100], | |
| 22 "contentsOpaque": true, | |
| 23 "drawsContent": true, | |
| 24 "backgroundColor": "#808080" | |
| 25 }, | |
| 26 { | |
| 27 "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (p
ositioned) DIV id='A' class='overlap1')", | |
| 28 "position": [140, 140], | |
| 29 "bounds": [260, 260], | |
| 30 "drawsContent": true | |
| 31 } | |
| 32 ] | |
| 33 } | |
| 34 ] | |
| 35 } | 29 } |
| 36 ] | 30 ] |
| 37 } | 31 } |
| 38 CASE 2, overlap1 changes color: | 32 CASE 2, overlap1 changes color: |
| 39 { | 33 { |
| 40 "name": "Content Root Layer", | 34 "layers": [ |
| 41 "bounds": [800, 600], | |
| 42 "children": [ | |
| 43 { | 35 { |
| 44 "name": "LayoutView #document", | 36 "name": "LayoutView #document", |
| 45 "bounds": [800, 600], | 37 "bounds": [800, 600], |
| 46 "contentsOpaque": true, | 38 "contentsOpaque": true, |
| 39 "drawsContent": true |
| 40 }, |
| 41 { |
| 42 "name": "Squashing Containment Layer", |
| 43 "shouldFlattenTransform": false |
| 44 }, |
| 45 { |
| 46 "name": "LayoutBlockFlow (positioned) DIV class='composited'", |
| 47 "position": [60, 60], |
| 48 "bounds": [100, 100], |
| 49 "contentsOpaque": true, |
| 47 "drawsContent": true, | 50 "drawsContent": true, |
| 48 "children": [ | 51 "backgroundColor": "#808080" |
| 52 }, |
| 53 { |
| 54 "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (positione
d) DIV id='A' class='overlap1')", |
| 55 "position": [140, 140], |
| 56 "bounds": [260, 260], |
| 57 "drawsContent": true, |
| 58 "paintInvalidations": [ |
| 49 { | 59 { |
| 50 "name": "Squashing Containment Layer", | 60 "object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'", |
| 51 "shouldFlattenTransform": false, | 61 "rect": [0, 0, 100, 100], |
| 52 "children": [ | 62 "reason": "style change" |
| 53 { | |
| 54 "name": "LayoutBlockFlow (positioned) DIV class='composited'", | |
| 55 "position": [60, 60], | |
| 56 "bounds": [100, 100], | |
| 57 "contentsOpaque": true, | |
| 58 "drawsContent": true, | |
| 59 "backgroundColor": "#808080" | |
| 60 }, | |
| 61 { | |
| 62 "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (p
ositioned) DIV id='A' class='overlap1')", | |
| 63 "position": [140, 140], | |
| 64 "bounds": [260, 260], | |
| 65 "drawsContent": true, | |
| 66 "paintInvalidations": [ | |
| 67 { | |
| 68 "object": "LayoutBlockFlow (positioned) DIV id='A' class='over
lap1'", | |
| 69 "rect": [0, 0, 100, 100], | |
| 70 "reason": "style change" | |
| 71 } | |
| 72 ] | |
| 73 } | |
| 74 ] | |
| 75 } | 63 } |
| 76 ] | 64 ] |
| 77 } | 65 } |
| 78 ], | 66 ], |
| 79 "objectPaintInvalidations": [ | 67 "objectPaintInvalidations": [ |
| 80 { | 68 { |
| 81 "object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'", | 69 "object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'", |
| 82 "reason": "style change" | 70 "reason": "style change" |
| 83 } | 71 } |
| 84 ] | 72 ] |
| 85 } | 73 } |
| 86 CASE 3, overlap1 and overlap2 change color: | 74 CASE 3, overlap1 and overlap2 change color: |
| 87 { | 75 { |
| 88 "name": "Content Root Layer", | 76 "layers": [ |
| 89 "bounds": [800, 600], | |
| 90 "children": [ | |
| 91 { | 77 { |
| 92 "name": "LayoutView #document", | 78 "name": "LayoutView #document", |
| 93 "bounds": [800, 600], | 79 "bounds": [800, 600], |
| 94 "contentsOpaque": true, | 80 "contentsOpaque": true, |
| 81 "drawsContent": true |
| 82 }, |
| 83 { |
| 84 "name": "Squashing Containment Layer", |
| 85 "shouldFlattenTransform": false |
| 86 }, |
| 87 { |
| 88 "name": "LayoutBlockFlow (positioned) DIV class='composited'", |
| 89 "position": [60, 60], |
| 90 "bounds": [100, 100], |
| 91 "contentsOpaque": true, |
| 95 "drawsContent": true, | 92 "drawsContent": true, |
| 96 "children": [ | 93 "backgroundColor": "#808080" |
| 94 }, |
| 95 { |
| 96 "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (positione
d) DIV id='A' class='overlap1')", |
| 97 "position": [140, 140], |
| 98 "bounds": [260, 260], |
| 99 "drawsContent": true, |
| 100 "paintInvalidations": [ |
| 97 { | 101 { |
| 98 "name": "Squashing Containment Layer", | 102 "object": "LayoutBlockFlow (positioned) DIV id='B' class='overlap2'", |
| 99 "shouldFlattenTransform": false, | 103 "rect": [80, 80, 100, 100], |
| 100 "children": [ | 104 "reason": "style change" |
| 101 { | 105 }, |
| 102 "name": "LayoutBlockFlow (positioned) DIV class='composited'", | 106 { |
| 103 "position": [60, 60], | 107 "object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'", |
| 104 "bounds": [100, 100], | 108 "rect": [0, 0, 100, 100], |
| 105 "contentsOpaque": true, | 109 "reason": "style change" |
| 106 "drawsContent": true, | |
| 107 "backgroundColor": "#808080" | |
| 108 }, | |
| 109 { | |
| 110 "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (p
ositioned) DIV id='A' class='overlap1')", | |
| 111 "position": [140, 140], | |
| 112 "bounds": [260, 260], | |
| 113 "drawsContent": true, | |
| 114 "paintInvalidations": [ | |
| 115 { | |
| 116 "object": "LayoutBlockFlow (positioned) DIV id='B' class='over
lap2'", | |
| 117 "rect": [80, 80, 100, 100], | |
| 118 "reason": "style change" | |
| 119 }, | |
| 120 { | |
| 121 "object": "LayoutBlockFlow (positioned) DIV id='A' class='over
lap1'", | |
| 122 "rect": [0, 0, 100, 100], | |
| 123 "reason": "style change" | |
| 124 } | |
| 125 ] | |
| 126 } | |
| 127 ] | |
| 128 } | 110 } |
| 129 ] | 111 ] |
| 130 } | 112 } |
| 131 ], | 113 ], |
| 132 "objectPaintInvalidations": [ | 114 "objectPaintInvalidations": [ |
| 133 { | 115 { |
| 134 "object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'", | 116 "object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'", |
| 135 "reason": "style change" | 117 "reason": "style change" |
| 136 }, | 118 }, |
| 137 { | 119 { |
| 138 "object": "LayoutBlockFlow (positioned) DIV id='B' class='overlap2'", | 120 "object": "LayoutBlockFlow (positioned) DIV id='B' class='overlap2'", |
| 139 "reason": "style change" | 121 "reason": "style change" |
| 140 } | 122 } |
| 141 ] | 123 ] |
| 142 } | 124 } |
| 143 CASE 4, overlap2 and overlap3 change color: | 125 CASE 4, overlap2 and overlap3 change color: |
| 144 { | 126 { |
| 145 "name": "Content Root Layer", | 127 "layers": [ |
| 146 "bounds": [800, 600], | |
| 147 "children": [ | |
| 148 { | 128 { |
| 149 "name": "LayoutView #document", | 129 "name": "LayoutView #document", |
| 150 "bounds": [800, 600], | 130 "bounds": [800, 600], |
| 151 "contentsOpaque": true, | 131 "contentsOpaque": true, |
| 132 "drawsContent": true |
| 133 }, |
| 134 { |
| 135 "name": "Squashing Containment Layer", |
| 136 "shouldFlattenTransform": false |
| 137 }, |
| 138 { |
| 139 "name": "LayoutBlockFlow (positioned) DIV class='composited'", |
| 140 "position": [60, 60], |
| 141 "bounds": [100, 100], |
| 142 "contentsOpaque": true, |
| 152 "drawsContent": true, | 143 "drawsContent": true, |
| 153 "children": [ | 144 "backgroundColor": "#808080" |
| 145 }, |
| 146 { |
| 147 "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (positione
d) DIV id='A' class='overlap1')", |
| 148 "position": [140, 140], |
| 149 "bounds": [260, 260], |
| 150 "drawsContent": true, |
| 151 "paintInvalidations": [ |
| 154 { | 152 { |
| 155 "name": "Squashing Containment Layer", | 153 "object": "LayoutBlockFlow (positioned) DIV id='C' class='overlap3'", |
| 156 "shouldFlattenTransform": false, | 154 "rect": [160, 160, 100, 100], |
| 157 "children": [ | 155 "reason": "style change" |
| 158 { | 156 }, |
| 159 "name": "LayoutBlockFlow (positioned) DIV class='composited'", | 157 { |
| 160 "position": [60, 60], | 158 "object": "LayoutBlockFlow (positioned) DIV id='B' class='overlap2'", |
| 161 "bounds": [100, 100], | 159 "rect": [80, 80, 100, 100], |
| 162 "contentsOpaque": true, | 160 "reason": "style change" |
| 163 "drawsContent": true, | |
| 164 "backgroundColor": "#808080" | |
| 165 }, | |
| 166 { | |
| 167 "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (p
ositioned) DIV id='A' class='overlap1')", | |
| 168 "position": [140, 140], | |
| 169 "bounds": [260, 260], | |
| 170 "drawsContent": true, | |
| 171 "paintInvalidations": [ | |
| 172 { | |
| 173 "object": "LayoutBlockFlow (positioned) DIV id='C' class='over
lap3'", | |
| 174 "rect": [160, 160, 100, 100], | |
| 175 "reason": "style change" | |
| 176 }, | |
| 177 { | |
| 178 "object": "LayoutBlockFlow (positioned) DIV id='B' class='over
lap2'", | |
| 179 "rect": [80, 80, 100, 100], | |
| 180 "reason": "style change" | |
| 181 } | |
| 182 ] | |
| 183 } | |
| 184 ] | |
| 185 } | 161 } |
| 186 ] | 162 ] |
| 187 } | 163 } |
| 188 ], | 164 ], |
| 189 "objectPaintInvalidations": [ | 165 "objectPaintInvalidations": [ |
| 190 { | 166 { |
| 191 "object": "LayoutBlockFlow (positioned) DIV id='B' class='overlap2'", | 167 "object": "LayoutBlockFlow (positioned) DIV id='B' class='overlap2'", |
| 192 "reason": "style change" | 168 "reason": "style change" |
| 193 }, | 169 }, |
| 194 { | 170 { |
| 195 "object": "LayoutBlockFlow (positioned) DIV id='C' class='overlap3'", | 171 "object": "LayoutBlockFlow (positioned) DIV id='C' class='overlap3'", |
| 196 "reason": "style change" | 172 "reason": "style change" |
| 197 } | 173 } |
| 198 ] | 174 ] |
| 199 } | 175 } |
| 200 CASE 5, overlap3 and overlap1 change color: | 176 CASE 5, overlap3 and overlap1 change color: |
| 201 { | 177 { |
| 202 "name": "Content Root Layer", | 178 "layers": [ |
| 203 "bounds": [800, 600], | |
| 204 "children": [ | |
| 205 { | 179 { |
| 206 "name": "LayoutView #document", | 180 "name": "LayoutView #document", |
| 207 "bounds": [800, 600], | 181 "bounds": [800, 600], |
| 208 "contentsOpaque": true, | 182 "contentsOpaque": true, |
| 183 "drawsContent": true |
| 184 }, |
| 185 { |
| 186 "name": "Squashing Containment Layer", |
| 187 "shouldFlattenTransform": false |
| 188 }, |
| 189 { |
| 190 "name": "LayoutBlockFlow (positioned) DIV class='composited'", |
| 191 "position": [60, 60], |
| 192 "bounds": [100, 100], |
| 193 "contentsOpaque": true, |
| 209 "drawsContent": true, | 194 "drawsContent": true, |
| 210 "children": [ | 195 "backgroundColor": "#808080" |
| 196 }, |
| 197 { |
| 198 "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (positione
d) DIV id='A' class='overlap1')", |
| 199 "position": [140, 140], |
| 200 "bounds": [260, 260], |
| 201 "drawsContent": true, |
| 202 "paintInvalidations": [ |
| 211 { | 203 { |
| 212 "name": "Squashing Containment Layer", | 204 "object": "LayoutBlockFlow (positioned) DIV id='C' class='overlap3'", |
| 213 "shouldFlattenTransform": false, | 205 "rect": [160, 160, 100, 100], |
| 214 "children": [ | 206 "reason": "style change" |
| 215 { | 207 }, |
| 216 "name": "LayoutBlockFlow (positioned) DIV class='composited'", | 208 { |
| 217 "position": [60, 60], | 209 "object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'", |
| 218 "bounds": [100, 100], | 210 "rect": [0, 0, 100, 100], |
| 219 "contentsOpaque": true, | 211 "reason": "style change" |
| 220 "drawsContent": true, | |
| 221 "backgroundColor": "#808080" | |
| 222 }, | |
| 223 { | |
| 224 "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (p
ositioned) DIV id='A' class='overlap1')", | |
| 225 "position": [140, 140], | |
| 226 "bounds": [260, 260], | |
| 227 "drawsContent": true, | |
| 228 "paintInvalidations": [ | |
| 229 { | |
| 230 "object": "LayoutBlockFlow (positioned) DIV id='C' class='over
lap3'", | |
| 231 "rect": [160, 160, 100, 100], | |
| 232 "reason": "style change" | |
| 233 }, | |
| 234 { | |
| 235 "object": "LayoutBlockFlow (positioned) DIV id='A' class='over
lap1'", | |
| 236 "rect": [0, 0, 100, 100], | |
| 237 "reason": "style change" | |
| 238 } | |
| 239 ] | |
| 240 } | |
| 241 ] | |
| 242 } | 212 } |
| 243 ] | 213 ] |
| 244 } | 214 } |
| 245 ], | 215 ], |
| 246 "objectPaintInvalidations": [ | 216 "objectPaintInvalidations": [ |
| 247 { | 217 { |
| 248 "object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'", | 218 "object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'", |
| 249 "reason": "style change" | 219 "reason": "style change" |
| 250 }, | 220 }, |
| 251 { | 221 { |
| 252 "object": "LayoutBlockFlow (positioned) DIV id='C' class='overlap3'", | 222 "object": "LayoutBlockFlow (positioned) DIV id='C' class='overlap3'", |
| 253 "reason": "style change" | 223 "reason": "style change" |
| 254 } | 224 } |
| 255 ] | 225 ] |
| 256 } | 226 } |
| 257 | 227 |
| OLD | NEW |