Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: LayoutTests/compositing/layer-creation/should-invoke-deferred-compositing.html

Issue 139103009: If a compositing update is declared as needed, scheduleAnimation should be triggered. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: patch for landing, added crbug to fixme comment Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/compositing/layer-creation/should-invoke-deferred-compositing-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/compositing/layer-creation/should-invoke-deferred-compositing.html
diff --git a/LayoutTests/compositing/layer-creation/should-invoke-deferred-compositing.html b/LayoutTests/compositing/layer-creation/should-invoke-deferred-compositing.html
new file mode 100644
index 0000000000000000000000000000000000000000..75225eac11aaa791befa55fb3f5e26b59b56af76
--- /dev/null
+++ b/LayoutTests/compositing/layer-creation/should-invoke-deferred-compositing.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+
+<!-- crbug.com/336676 - layer creation should not accidentally skip requesting
+ the compositor for a frame to be produced. When there were no other
+ repaints or layout/style changes, the simple act of adding a layer was not
+ triggering compositing updates by itself. To recreate this scenario, an
+ out-of-flow canvas element is added to an empty composited layer. The
+ actual container layer does not get added to the tree until it realizes
+ that it receives the canvas content. -->
+
+
+<html>
+<head>
+<style>
+
+.composited {
+ -webkit-transform: translatez(0);
+}
+
+.box {
+ position: absolute;
+ z-index: 1;
+ width: 300px;
+ height: 300px;
+ top: 0px;
+ left: 0px;
+}
+
+canvas {
+ position: absolute;
+ z-index: 1;
+ top: 0px;
+ left: 0px;
+}
+
+</style>
+
+<script>
+
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+
+ var canvasElement;
+
+ function addCanvasToTree() {
+ document.getElementById("container").appendChild(canvasElement);
+ }
+
+ function runTest() {
+ canvasElement = document.createElement("canvas");
+ canvasElement.width = 200;
+ canvasElement.height = 200;
+ var context = canvasElement.getContext("2d");
+ context.fillStyle = "green";
+ context.fillRect(80, 80, 50, 50);
+
+ if (!window.testRunner) {
+ // If the test is being run interactively, then
+ // the canvas should correctly appear after 1 second.
+ setTimeout(addCanvasToTree, 1000);
+ return;
+ }
+
+ testRunner.display();
+
+ // This should initiate a compositor frame via scheduleAnimation().
+ addCanvasToTree();
+
+ if (window.internals.isCompositorFramePending(document))
+ document.getElementById("result").innerHTML = "PASS - did schedule animation";
+ else
+ document.getElementById("result").innerHTML = "FAIL - did not schedule animation";
+ }
+
+</script>
+</head>
+
+<body onload="runTest()">
+ <div id="container" class="composited box"></div>
+ <div id="result">The green box should appear after 1 second when running this test interactively.</div>
+</body>
+
+</html>
« no previous file with comments | « no previous file | LayoutTests/compositing/layer-creation/should-invoke-deferred-compositing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698