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