OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="../../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../../http/tests/inspector/elements-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function createShadowRoot() | 7 function createShadowRoot() |
8 { | 8 { |
9 var template = document.querySelector('#tmpl'); | 9 var template = document.querySelector('#tmpl'); |
10 var root = document.querySelector('#host').webkitCreateShadowRoot(); | 10 var root = document.querySelector('#host').webkitCreateShadowRoot(); |
11 root.appendChild(template.content.cloneNode(true)); | 11 root.appendChild(template.content.cloneNode(true)); |
12 } | 12 } |
13 | 13 |
14 function test() | 14 function test() |
15 { | 15 { |
16 InspectorTest.runTestSuite([ | 16 InspectorTest.runTestSuite([ |
17 function testInit(next) | 17 function testInit(next) |
18 { | 18 { |
19 WebInspector.settings.showShadowDOM.set(true); | |
20 InspectorTest.evaluateInPage("createShadowRoot()", callback); | 19 InspectorTest.evaluateInPage("createShadowRoot()", callback); |
21 function callback() | 20 function callback() |
22 { | 21 { |
23 InspectorTest.selectNodeAndWaitForStyles("inner", next); | 22 InspectorTest.selectNodeAndWaitForStyles("inner", next); |
24 } | 23 } |
25 }, | 24 }, |
26 | 25 |
27 function testDumpStyles(next) | 26 function testDumpStyles(next) |
28 { | 27 { |
29 InspectorTest.dumpSelectedElementStyles(true); | 28 InspectorTest.dumpSelectedElementStyles(true); |
30 next(); | 29 next(); |
31 } | 30 } |
32 ]); | 31 ]); |
33 } | 32 } |
34 </script> | 33 </script> |
35 </head> | 34 </head> |
36 | 35 |
37 <body onload="runTest()"> | 36 <body onload="runTest()"> |
38 <p> | 37 <p> |
39 This test checks that style sheets hosted inside shadow roots | 38 This test checks that style sheets hosted inside shadow roots |
40 could be inspected. | 39 could be inspected. |
41 </p> | 40 </p> |
42 <div id="host"></div> | 41 <div id="host"></div> |
43 <template id="tmpl"> | 42 <template id="tmpl"> |
44 <style> .red { color: red; } </style> | 43 <style> .red { color: red; } </style> |
45 <div id="inner" class="red">hi!</div> | 44 <div id="inner" class="red">hi!</div> |
46 </template> | 45 </template> |
47 </body> | 46 </body> |
48 </html> | 47 </html> |
OLD | NEW |