Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / compositing / animation / hidden-composited.html
blobe2f2b5789330505d34038f6da8aa98957c568319
1 <!DOCTYPE HTML>
2 <style>
3 @keyframes slide {
4 0% { transform: translate3d(0px, 0px, 0px); }
5 100% { transform: translate3d(100px, 0px, 1px); }
8 div {
9 width: 100px;
10 height: 100px;
11 background: green;
12 animation-duration: 2s;
13 animation-name: slide;
14 animation-iteration-count: infinite;
15 animation-direction: alternate;
17 </style>
18 <div id="animated"></div>
19 <script src='../../resources/js-test.js'></script>
21 <script>
22 description('Verifies hidden, compositor-animated layers still get composited');
24 if (window.internals)
25 internals.settings.setPreferCompositingToLCDTextEnabled(true);
27 function hiddenLayerIsComposited(layer) {
28 if (layer.children) {
29 for (var i = 0; i < layer.children.length; i++) {
30 var child = layer.children[i];
31 if (child.bounds[0] == 100 && child.bounds[1] == 100) {
32 for (var j = 0; j < child.compositingReasons.length; j++) {
33 if (child.compositingReasons[j] === 'activeAnimation')
34 return true;
37 if (hiddenLayerIsComposited(child))
38 return true;
41 return false;
44 onload = function() {
45 if (!window.internals)
46 return;
48 document.getElementById('animated').style.visibility = 'hidden';
49 window.internals.forceCompositingUpdate(document);
51 documentLayerTree = JSON.parse(window.internals.layerTreeAsText(
52 document, window.internals.LAYER_TREE_INCLUDES_COMPOSITING_REASONS));
54 shouldBe('hiddenLayerIsComposited(documentLayerTree)', 'true');
56 </script>