OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 | |
3 <!-- crbug.com/336676 - layer creation should not accidentally skip requesting | |
4 the compositor for a frame to be produced. When there were no other | |
5 repaints or layout/style changes, the simple act of adding a layer was not | |
6 triggering compositing updates by itself. To recreate this scenario, an | |
7 out-of-flow canvas element is added to an empty composited layer. The | |
8 actual container layer does not get added to the tree until it realizes | |
9 that it receives the canvas content. --> | |
10 | |
11 | |
12 <html> | |
13 <head> | |
14 <script src="../../fast/repaint/resources/text-based-repaint.js"></script> | |
15 <style> | |
16 | |
17 .composited { | |
18 transform: translatez(0); | |
19 } | |
20 | |
21 .box { | |
22 position: absolute; | |
23 z-index: 1; | |
24 width: 300px; | |
25 height: 300px; | |
26 top: 0px; | |
27 left: 0px; | |
28 } | |
29 | |
30 canvas { | |
31 position: absolute; | |
32 z-index: 1; | |
33 top: 0px; | |
34 left: 0px; | |
35 } | |
36 | |
37 </style> | |
38 | |
39 <script> | |
40 function repaintTest() { | |
41 var canvasElement = document.createElement("canvas"); | |
42 canvasElement.width = 200; | |
43 canvasElement.height = 200; | |
44 var context = canvasElement.getContext("2d"); | |
45 context.fillStyle = "green"; | |
46 context.fillRect(80, 80, 50, 50); | |
47 document.getElementById("container").appendChild(canvasElement); | |
48 } | |
49 </script> | |
50 </head> | |
51 | |
52 <body onload="runRepaintAndPixelTest()"> | |
53 <div id="container" class="composited box"></div> | |
54 </body> | |
55 | |
56 </html> | |
OLD | NEW |