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.ElementsTreeOutline.showShadowDOMForTest = true; | 9 WebInspector.ElementsTreeOutline.showShadowDOMForTest = true; |
10 | 10 |
11 WebInspector.showPanel("elements").treeOutline. | 11 WebInspector.showPanel("elements").treeOutline. |
12 addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeCha
nged, selectedNodeChanged, this); | 12 addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeCha
nged, selectedNodeChanged, this); |
13 function selectedNodeChanged(event) | 13 function selectedNodeChanged(event) |
14 { | 14 { |
15 var node = event.data; | 15 var node = event.data; |
16 if (!node) | 16 if (!node) |
17 return; | 17 return; |
18 if (node.getAttribute("id") == "shadow") { | 18 if (node.getAttribute("id") == "shadow") { |
19 InspectorTest.addResult(node.xPath(false)); | 19 InspectorTest.addResult(WebInspector.DOMPresentationUtils.xPath(node
, false)); |
20 InspectorTest.completeTest(); | 20 InspectorTest.completeTest(); |
21 } | 21 } |
22 } | 22 } |
23 InspectorTest.evaluateInConsole("inspect(host.shadowRoot.firstChild.firstChi
ld.firstChild)"); | 23 InspectorTest.evaluateInConsole("inspect(host.shadowRoot.firstChild.firstChi
ld.firstChild)"); |
24 } | 24 } |
25 | 25 |
26 </script> | 26 </script> |
27 </head> | 27 </head> |
28 | 28 |
29 <body onload="runTest()"> | 29 <body onload="runTest()"> |
30 <p> | 30 <p> |
31 Tests that inspect element action works for deep shadow elements. | 31 Tests that inspect element action works for deep shadow elements. |
32 </p> | 32 </p> |
33 | 33 |
34 <div> | 34 <div> |
35 <div> | 35 <div> |
36 <div id="host"> | 36 <div id="host"> |
37 </div> | 37 </div> |
38 </div> | 38 </div> |
39 </div> | 39 </div> |
40 | 40 |
41 <script> | 41 <script> |
42 var host = document.querySelector('#host'); | 42 var host = document.querySelector('#host'); |
43 var sr = host.createShadowRoot(); | 43 var sr = host.createShadowRoot(); |
44 sr.innerHTML = "<div><div><span id='shadow'>Shadow</span></div></div>"; | 44 sr.innerHTML = "<div><div><span id='shadow'>Shadow</span></div></div>"; |
45 </script> | 45 </script> |
46 | 46 |
47 </body> | 47 </body> |
48 </html> | 48 </html> |
OLD | NEW |