| <!doctype html> |
| <html> |
| <head> |
| <script type="text/javascript" src="../http/tests/inspector-protocol/inspector-protocol-test.js"></script> |
| <script type="text/javascript"> |
| function pageLoaded() |
| { |
| var template = document.querySelector("#tmpl"); |
| var root = document.querySelector("#host").webkitCreateShadowRoot(); |
| root.appendChild(template.content.cloneNode(true)); |
| runTest(); |
| } |
| |
| function test() |
| { |
| InspectorTest.eventHandler["CSS.styleSheetAdded"] = styleSheetAdded; |
| InspectorTest.sendCommand("CSS.enable", {}, null); |
| |
| function styleSheetAdded(msg) |
| { |
| var styleSheetHeader = msg.params.header; |
| InspectorTest.sendCommand("CSS.getStyleSheetText", {"styleSheetId": styleSheetHeader.styleSheetId}, onStyleSheetText); |
| } |
| |
| function onStyleSheetText(payload) |
| { |
| InspectorTest.log("Loaded style sheet text: " + payload.result.text); |
| InspectorTest.completeTest(); |
| } |
| } |
| </script> |
| </head> |
| <body onload="pageLoaded()"> |
| <p>This test checks that style sheets hosted inside shadow roots are reported in CSS.getAllStyleSheets protocol method.</p> |
| <div id="host"></div> |
| <template id="tmpl"> |
| <style> .red { color: red; } </style> |
| <div id="inner" class="red">hi!</div> |
| </template> |
| </body> |
| </html> |