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

Unified Diff: LayoutTests/compositing/animation/hidden-composited.html

Issue 1161093004: Allow compositing of hidden layers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: added test. Created 5 years, 7 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/animation/hidden-composited-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/compositing/animation/hidden-composited.html
diff --git a/LayoutTests/compositing/animation/hidden-composited.html b/LayoutTests/compositing/animation/hidden-composited.html
new file mode 100644
index 0000000000000000000000000000000000000000..e2f2b5789330505d34038f6da8aa98957c568319
--- /dev/null
+++ b/LayoutTests/compositing/animation/hidden-composited.html
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML>
+<style>
+@keyframes slide {
+ 0% { transform: translate3d(0px, 0px, 0px); }
+ 100% { transform: translate3d(100px, 0px, 1px); }
+}
+
+div {
+ width: 100px;
+ height: 100px;
+ background: green;
+ animation-duration: 2s;
+ animation-name: slide;
+ animation-iteration-count: infinite;
+ animation-direction: alternate;
+}
+</style>
+<div id="animated"></div>
+<script src='../../resources/js-test.js'></script>
+
+<script>
+description('Verifies hidden, compositor-animated layers still get composited');
+
+if (window.internals)
+ internals.settings.setPreferCompositingToLCDTextEnabled(true);
+
+function hiddenLayerIsComposited(layer) {
+ if (layer.children) {
+ for (var i = 0; i < layer.children.length; i++) {
+ var child = layer.children[i];
+ if (child.bounds[0] == 100 && child.bounds[1] == 100) {
+ for (var j = 0; j < child.compositingReasons.length; j++) {
+ if (child.compositingReasons[j] === 'activeAnimation')
+ return true;
+ }
+ }
+ if (hiddenLayerIsComposited(child))
+ return true;
+ }
+ }
+ return false;
+}
+
+onload = function() {
+ if (!window.internals)
+ return;
+
+ document.getElementById('animated').style.visibility = 'hidden';
+ window.internals.forceCompositingUpdate(document);
+
+ documentLayerTree = JSON.parse(window.internals.layerTreeAsText(
+ document, window.internals.LAYER_TREE_INCLUDES_COMPOSITING_REASONS));
+
+ shouldBe('hiddenLayerIsComposited(documentLayerTree)', 'true');
+};
+</script>
« no previous file with comments | « no previous file | LayoutTests/compositing/animation/hidden-composited-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698