OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd"> | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../http/tests/inspector/inspector-test.js"></script> | 4 <script src="../../http/tests/inspector/inspector-test.js"></script> |
5 <script src="../../http/tests/inspector/elements-test.js"></script> | 5 <script src="../../http/tests/inspector/elements-test.js"></script> |
6 <script> | 6 <script> |
7 | 7 |
8 function loaded() | 8 function loaded() |
9 { | 9 { |
10 var template = document.querySelector("#tmpl"); | 10 var template = document.querySelector("#tmpl"); |
11 var root = document.querySelector("#host").createShadowRoot(); | 11 var root = document.querySelector("#host").createShadowRoot(); |
12 root.appendChild(template.content.cloneNode(true)); | 12 root.appendChild(template.content.cloneNode(true)); |
13 runTest(); | 13 runTest(); |
14 } | 14 } |
15 | 15 |
16 function test() | 16 function test() |
17 { | 17 { |
18 WebInspector.settings.showUAShadowDOM.set(true); | 18 WebInspector.settings.showUAShadowDOM.set(true); |
19 InspectorTest.expandElementsTree(step0); | 19 InspectorTest.expandElementsTree(step0); |
20 | 20 |
21 function step0() | 21 function step0() |
22 { | 22 { |
23 selectNode(matchUserAgentShadowRoot, step1); | 23 selectNode(matchClosedShadowRoot, step1); |
24 } | 24 } |
25 | 25 |
26 function step1() | 26 function step1() |
27 { | 27 { |
28 InspectorTest.dumpBreadcrumb("User-agent shadow root breadcrumb"); | 28 InspectorTest.dumpBreadcrumb("User-agent shadow root breadcrumb"); |
29 selectNode(matchAuthorShadowRoot, step2); | 29 selectNode(matchOpenShadowRoot, step2); |
30 } | 30 } |
31 | 31 |
32 function step2() | 32 function step2() |
33 { | 33 { |
34 InspectorTest.dumpBreadcrumb("Author shadow root breadcrumb"); | 34 InspectorTest.dumpBreadcrumb("Author shadow root breadcrumb"); |
35 InspectorTest.completeTest(); | 35 InspectorTest.completeTest(); |
36 } | 36 } |
37 | 37 |
38 function selectNode(matchFunction, next) | 38 function selectNode(matchFunction, next) |
39 { | 39 { |
40 InspectorTest.findNode(matchFunction, callback); | 40 InspectorTest.findNode(matchFunction, callback); |
41 function callback(node) | 41 function callback(node) |
42 { | 42 { |
43 WebInspector.Revealer.revealPromise(node).then(next); | 43 WebInspector.Revealer.revealPromise(node).then(next); |
44 } | 44 } |
45 } | 45 } |
46 | 46 |
47 function matchUserAgentShadowRoot(node) | 47 function matchClosedShadowRoot(node) |
48 { | 48 { |
49 return node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.Us
erAgent; | 49 return node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.Us
erAgent; |
50 } | 50 } |
51 | 51 |
52 function matchAuthorShadowRoot(node) | 52 function matchOpenShadowRoot(node) |
53 { | 53 { |
54 return node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.Au
thor; | 54 return node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.Au
thor; |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
58 </script> | 58 </script> |
59 </head> | 59 </head> |
60 | 60 |
61 <body onload="loaded()"> | 61 <body onload="loaded()"> |
62 <p> | 62 <p> |
63 Tests that shadow roots are displayed correctly in breadcrumbs. | 63 Tests that shadow roots are displayed correctly in breadcrumbs. |
64 </p> | 64 </p> |
65 | 65 |
66 <input type="text"> | 66 <input type="text"> |
67 <div id="host"></div> | 67 <div id="host"></div> |
68 <template id="tmpl"> | 68 <template id="tmpl"> |
69 <style>.red { color: red; }</style> | 69 <style>.red { color: red; }</style> |
70 <div id="inner" class="red">inner</div> | 70 <div id="inner" class="red">inner</div> |
71 </template> | 71 </template> |
72 | 72 |
73 | 73 |
74 </body> | 74 </body> |
75 </html> | 75 </html> |
OLD | NEW |