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. -->
17 -webkit-transform: translatez(0);
40 if (window.testRunner)
41 testRunner.dumpAsText();
46 function addCanvasToTree() {
47 document.getElementById("container").appendChild(canvasElement);
51 canvasElement = document.createElement("canvas");
52 canvasElement.width = 200;
53 canvasElement.height = 200;
54 var context = canvasElement.getContext("2d");
55 context.fillStyle = "green";
56 context.fillRect(80, 80, 50, 50);
58 if (!window.testRunner) {
59 // If the test is being run interactively, then
60 // the canvas should correctly appear after 1 second.
61 setTimeout(addCanvasToTree, 1000);
67 // This should initiate a compositor frame via scheduleAnimation().
70 if (window.internals.isCompositorFramePending(document))
71 document.getElementById("result").innerHTML = "PASS - did schedule animation";
73 document.getElementById("result").innerHTML = "FAIL - did not schedule animation";
79 <body onload="runTest()">
80 <div id="container" class="composited box"></div>
81 <div id="result">The green box should appear after 1 second when running this test interactively.</div>