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