| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | 4 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> |
| 5 <script type="text/javascript" src="css-protocol-test.js"></script> | 5 <script type="text/javascript" src="css-protocol-test.js"></script> |
| 6 <script type="text/javascript"> | 6 <script type="text/javascript"> |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 InspectorTest.sendCommandOrDie("CSS.enable", {}, onCSSEnabled); | 9 var documentNodeId; |
| 10 InspectorTest.requestDocumentNodeId(onDocumentNodeId); |
| 11 |
| 12 function onDocumentNodeId(nodeId) |
| 13 { |
| 14 documentNodeId = nodeId; |
| 15 InspectorTest.sendCommandOrDie("CSS.enable", {}, onCSSEnabled); |
| 16 } |
| 10 | 17 |
| 11 function onCSSEnabled() | 18 function onCSSEnabled() |
| 12 { | 19 { |
| 13 InspectorTest.requestNodeId("#shadow-content", onNodeReceived); | 20 InspectorTest.requestNodeId(documentNodeId, "#shadow-content", onNodeRec
eived); |
| 14 } | 21 } |
| 15 | 22 |
| 16 function onNodeReceived(nodeId) | 23 function onNodeReceived(nodeId) |
| 17 { | 24 { |
| 18 InspectorTest.loadAndDumpMatchingRulesForNode(nodeId, InspectorTest.comp
leteTest.bind(InspectorTest)); | 25 InspectorTest.loadAndDumpMatchingRulesForNode(nodeId, InspectorTest.comp
leteTest.bind(InspectorTest)); |
| 19 } | 26 } |
| 20 } | 27 } |
| 21 </script> | 28 </script> |
| 22 </head> | 29 </head> |
| 23 <body> | 30 <body> |
| 24 <div id="shadow-host"> | 31 <div id="shadow-host"> |
| 25 <p id="shadow-content">This text is bold</p> | 32 <p id="shadow-content">This text is bold</p> |
| 26 </div> | 33 </div> |
| 27 <script type="text/javascript"> | 34 <script type="text/javascript"> |
| 28 var host = document.querySelector("#shadow-host"); | 35 var host = document.querySelector("#shadow-host"); |
| 29 var root = host.createShadowRoot(); | 36 var root = host.createShadowRoot(); |
| 30 root.innerHTML = "<style>:host ::content * { font-weight: bold; }</style
><content></content>"; | 37 root.innerHTML = "<style>:host ::content * { font-weight: bold; }</style
><content></content>"; |
| 31 runTest(); | 38 runTest(); |
| 32 </script> | 39 </script> |
| 33 </body> | 40 </body> |
| 34 </html> | 41 </html> |
| 35 | 42 |
| OLD | NEW |