OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <style> | |
4 @font-face { | |
5 font-family: 'ahem'; | |
6 src: url(../../resources/Ahem.ttf); | |
7 } | |
8 </style> | |
9 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | |
10 <script> | |
11 | |
12 function test() | |
13 { | |
14 InspectorTest.sendCommand("DOM.enable", {}); | |
15 InspectorTest.sendCommandOrDie("DOM.getLayoutTreeNodes", {}, onLayoutTreeNod
es); | |
16 | |
17 function onLayoutTreeNodes(response) | |
18 { | |
19 InspectorTest.log("\nLayoutTreeNodes result:"); | |
20 canonicalizeBackendNodeIds(response); | |
21 InspectorTest.log(JSON.stringify(response, null, 2)); | |
22 InspectorTest.completeTest(); | |
23 } | |
24 | |
25 // While unique the backendNodeId IDs are not stable cross platform, so we c
anonicalize them. | |
26 var nextId = 1; | |
27 var nodeMap = {}; | |
28 function canonicalizeBackendNodeIds(node) { | |
29 if (node.hasOwnProperty('backendNodeId')) { | |
30 if (!nodeMap.hasOwnProperty(node.backendNodeId)) { | |
31 nodeMap[node.backendNodeId] = nextId++; | |
32 } | |
33 node.backendNodeId = nodeMap[node.backendNodeId]; | |
34 } | |
35 for (var property in node) { | |
36 if (!node.hasOwnProperty(property) || typeof node[property] === 'obj
ect') | |
37 canonicalizeBackendNodeIds(node[property]); | |
38 } | |
39 } | |
40 } | |
41 | |
42 </script> | |
43 <template id="shadow-template"> | |
44 <style> | |
45 :host { | |
46 color: red; | |
47 } | |
48 </style> | |
49 <div>Hi!</div> | |
50 </template> | |
51 </head> | |
52 <body class="body-class"> | |
53 <div style="font-family: ahem;"> | |
54 <div class="class1">Some Text</div> And More Text | |
55 <div style="display:inline-block; width: 200px"> | |
56 <p> | |
57 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque si
t amet est sem. | |
58 Aenean ut neque volutpat, posuere odio at, mollis nibh. Aenean sodales n
ulla et | |
59 ligula efficitur sollicitudin blandit sed lectus. Duis orci enim, sodale
s ac lectus sed, | |
60 hendrerit efficitur est. Quisque gravida facilisis viverra. | |
61 </p> | |
62 <ul class="class3"> | |
63 <li class="class4"></li> | |
64 <span>Lets have a span</span> | |
65 </ul> | |
66 </div> | |
67 <div style="transform: rotateZ(90deg); width: 200px">Rotated text!</div> | |
68 <iframe src="resources/simple-iframe.html" width="400" height="200"></iframe
> | |
69 <div id="shadow-host"></div> | |
70 <script type="text/javascript"> | |
71 var host = document.querySelector("#shadow-host").createShadowRoot(); | |
72 var template = document.querySelector("#shadow-template"); | |
73 host.appendChild(template.content); | |
74 template.remove(); | |
75 runTest(); | |
76 </script> | |
77 </div> | |
78 </body> | |
79 </html> | |
OLD | NEW |