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