4 <script type=
"text/javascript" src=
"../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
5 <script type=
"text/javascript">
8 var template
= document
.querySelector("#tmpl");
9 var root
= document
.querySelector("#host").createShadowRoot();
10 root
.appendChild(template
.content
.cloneNode(true));
16 InspectorTest
.eventHandler
["CSS.styleSheetAdded"] = styleSheetAdded
;
17 InspectorTest
.sendCommandOrDie("DOM.enable", {});
18 InspectorTest
.sendCommand("CSS.enable", {}, null);
20 function styleSheetAdded(msg
)
22 var styleSheetHeader
= msg
.params
.header
;
23 InspectorTest
.sendCommand("CSS.getStyleSheetText", {"styleSheetId": styleSheetHeader
.styleSheetId
}, onStyleSheetText
);
26 function onStyleSheetText(payload
)
28 InspectorTest
.log("Loaded style sheet text: " + payload
.result
.text
);
29 InspectorTest
.completeTest();
34 <body onload=
"pageLoaded()">
35 <p>This test checks that style sheets hosted inside shadow roots are reported in CSS.getAllStyleSheets protocol method.
</p>
38 <style> .red { color: red; }
</style>
39 <div id=
"inner" class=
"red">hi!
</div>