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

Side by Side 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, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/compositing/animation/hidden-composited-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <style>
3 @keyframes slide {
4 0% { transform: translate3d(0px, 0px, 0px); }
5 100% { transform: translate3d(100px, 0px, 1px); }
6 }
7
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;
16 }
17 </style>
18 <div id="animated"></div>
19 <script src='../../resources/js-test.js'></script>
20
21 <script>
22 description('Verifies hidden, compositor-animated layers still get composited');
23
24 if (window.internals)
25 internals.settings.setPreferCompositingToLCDTextEnabled(true);
26
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;
35 }
36 }
37 if (hiddenLayerIsComposited(child))
38 return true;
39 }
40 }
41 return false;
42 }
43
44 onload = function() {
45 if (!window.internals)
46 return;
47
48 document.getElementById('animated').style.visibility = 'hidden';
49 window.internals.forceCompositingUpdate(document);
50
51 documentLayerTree = JSON.parse(window.internals.layerTreeAsText(
52 document, window.internals.LAYER_TREE_INCLUDES_COMPOSITING_REASONS));
53
54 shouldBe('hiddenLayerIsComposited(documentLayerTree)', 'true');
55 };
56 </script>
OLDNEW
« 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