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