| 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>
|
|
|