| Index: LayoutTests/inspector-protocol/css/css-shadow-dom-inherits-styles.html
|
| diff --git a/LayoutTests/inspector-protocol/css/css-shadow-dom-inherits-styles.html b/LayoutTests/inspector-protocol/css/css-shadow-dom-inherits-styles.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b0b956ccef9c6a7e5674747c2d9a209dd6261d86
|
| --- /dev/null
|
| +++ b/LayoutTests/inspector-protocol/css/css-shadow-dom-inherits-styles.html
|
| @@ -0,0 +1,64 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/css-protocol-test.js"></script>
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/dom-protocol-test.js"></script>
|
| +<script type="text/javascript">
|
| +function test()
|
| +{
|
| + var documentNodeId;
|
| + InspectorTest.eventHandler["DOM.setChildNodes"] = onChildNodes;
|
| + InspectorTest.requestDocumentNodeId(onDocumentNodeId);
|
| +
|
| + var nodesMap = new Map();
|
| +
|
| + function onChildNodes(result)
|
| + {
|
| + for (var node of result.params.nodes)
|
| + nodesMap.set(node.nodeId, node);
|
| + }
|
| +
|
| + function onDocumentNodeId(nodeId)
|
| + {
|
| + documentNodeId = nodeId;
|
| + InspectorTest.sendCommandOrDie("CSS.enable", {});
|
| + InspectorTest.requestNodeId(nodeId, "#shadow-host", onHostReceived);
|
| + }
|
| +
|
| + function onHostReceived(hostId)
|
| + {
|
| + var host = nodesMap.get(hostId);
|
| + var root = host.shadowRoots[0];
|
| + InspectorTest.requestNodeId(root.nodeId, "#inspected", onNodeReceived);
|
| + }
|
| +
|
| + function onNodeReceived(nodeId)
|
| + {
|
| + InspectorTest.loadAndDumpMatchingRulesForNode(nodeId, InspectorTest.completeTest.bind(InspectorTest));
|
| + }
|
| +}
|
| +</script>
|
| +</head>
|
| +<style>
|
| +/** This style should be inherited by shadow DOM */
|
| +body {
|
| + color: blue;
|
| +}
|
| +</style>
|
| +<body>
|
| + <template>
|
| + <div id="inspected">Inspect me.</div>
|
| + </template>
|
| + <div id="shadow-host">
|
| + </div>
|
| + <script type="text/javascript">
|
| + var shadowRoot = document.querySelector("#shadow-host").createShadowRoot();
|
| + var template = document.querySelector("template");
|
| + var clone = document.importNode(template.content, true);
|
| + shadowRoot.appendChild(clone);
|
| + runTest();
|
| + </script>
|
| +</body>
|
| +</html>
|
| +
|
|
|