| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../http/tests/inspector/elements-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 WebInspector.settings.showUAShadowDOM.set(true); | 9 WebInspector.settings.showUAShadowDOM.set(true); |
| 10 InspectorTest.selectNodeWithId("shadow", step1); | 10 InspectorTest.selectNodeWithId("shadow", step1); |
| 11 | 11 |
| 12 function step1() | 12 function step1() |
| 13 { | 13 { |
| 14 InspectorTest.evaluateInConsoleAndDump("'Author shadow element: ' + $0.i
d", step3); | 14 InspectorTest.evaluateInConsoleAndDump("'Author shadow element: ' + $0.i
d", step3); |
| 15 } | 15 } |
| 16 | 16 |
| 17 function step3() | 17 function step3() |
| 18 { | 18 { |
| 19 InspectorTest.selectNodeWithId("user-agent-host", step4); | 19 InspectorTest.selectNodeWithId("user-agent-host", step4); |
| 20 } | 20 } |
| 21 | 21 |
| 22 function step4(node) | 22 function step4(node) |
| 23 { | 23 { |
| 24 WebInspector.panels.elements.revealAndSelectNode(node.shadowRoots()[0]); | 24 WebInspector.inspectorView.panel("elements").revealAndSelectNode(node.sh
adowRoots()[0]); |
| 25 InspectorTest.evaluateInConsoleAndDump("'User agent shadow host: ' + $0.
id", step5); | 25 InspectorTest.evaluateInConsoleAndDump("'User agent shadow host: ' + $0.
id", step5); |
| 26 } | 26 } |
| 27 | 27 |
| 28 function step5() | 28 function step5() |
| 29 { | 29 { |
| 30 InspectorTest.completeTest(); | 30 InspectorTest.completeTest(); |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 </script> | 33 </script> |
| 34 </head> | 34 </head> |
| 35 | 35 |
| 36 <body onload="runTest()"> | 36 <body onload="runTest()"> |
| 37 <p> | 37 <p> |
| 38 Tests that $0 works with shadow dom. | 38 Tests that $0 works with shadow dom. |
| 39 </p> | 39 </p> |
| 40 | 40 |
| 41 <div><div><div id="host"></div></div></div> | 41 <div><div><div id="host"></div></div></div> |
| 42 <script> | 42 <script> |
| 43 var host = document.querySelector('#host'); | 43 var host = document.querySelector('#host'); |
| 44 var sr = host.createShadowRoot(); | 44 var sr = host.createShadowRoot(); |
| 45 sr.innerHTML = "<div><div><div id='shadow'><input id='user-agent-host' type='r
ange'></div></div></div>"; | 45 sr.innerHTML = "<div><div><div id='shadow'><input id='user-agent-host' type='r
ange'></div></div></div>"; |
| 46 </script> | 46 </script> |
| 47 | 47 |
| 48 </body> | 48 </body> |
| 49 </html> | 49 </html> |
| OLD | NEW |