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

Side by Side Diff: LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html

Issue 1060973003: compositor-worker: Force elements to grow a layer when a CompositorProxy is created. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tot-merge Created 5 years, 8 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 | « LayoutTests/fast/compositorworker/resources/proxy-idle.js ('k') | Source/core/dom/Element.cpp » ('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 <div id="container"></div>
3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script>
5 <script>
6 async_test(function(test) {
7 if (!window.internals)
8 return;
9 window.addEventListener('load', function() {
10 // The container should not have a layer.
11 var container = document.getElementById('container');
12 var docLayer = JSON.parse(window.internals.layerTreeAsText(document));
13 assert_equals(1, docLayer.children.length);
14 assert_equals('undefined', typeof docLayer.children[0].children);
15
16 // Creating a proxy should force the container to have a layer.
17 var proxy = new CompositorProxy(container, ['opacity']);
18 docLayer = JSON.parse(window.internals.layerTreeAsText(document));
19 assert_equals(1, docLayer.children.length);
20 assert_equals(1, docLayer.children[0].children.length);
21
22 // Detach the element from the document. The corresponding layer should be removed.
23 container.parentNode.removeChild(container);
24 docLayer = JSON.parse(window.internals.layerTreeAsText(document));
25 assert_equals(1, docLayer.children.length);
26 assert_equals('undefined', typeof docLayer.children[0].children);
27
28 // Add the element back to the document. The corresponding layer should reappear.
29 document.body.appendChild(container);
30 docLayer = JSON.parse(window.internals.layerTreeAsText(document));
31 assert_equals(1, docLayer.children.length);
32 assert_equals(1, docLayer.children[0].children.length);
33
34 // Disconnecting the proxy should also remove the layer.
35 proxy.disconnect();
36 docLayer = JSON.parse(window.internals.layerTreeAsText(document));
37 assert_equals(1, docLayer.children.length);
38 assert_equals('undefined', typeof docLayer.children[0].children);
39
40 test.done();
41 });
42 }, "This test checks that creating a CompositorProxy forces the element to have a layer");
43 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/compositorworker/resources/proxy-idle.js ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698