| 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/timeline-test.js"></script> | 4 <script src="../../http/tests/inspector/timeline-test.js"></script> |
| 5 <style> | 5 <style> |
| 6 .relayout-boundary { | 6 .relayout-boundary { |
| 7 overflow: hidden; | 7 overflow: hidden; |
| 8 width: 100px; | 8 width: 100px; |
| 9 height: 100px; | 9 height: 100px; |
| 10 } | 10 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 { | 47 { |
| 48 var layoutRecord = InspectorTest.findPresentationRecord("Layout"); | 48 var layoutRecord = InspectorTest.findPresentationRecord("Layout"); |
| 49 WebInspector.notifications.addEventListener(WebInspector.NotificationSer
vice.Events.SelectedNodeChanged, onSelectedNodeChanged); | 49 WebInspector.notifications.addEventListener(WebInspector.NotificationSer
vice.Events.SelectedNodeChanged, onSelectedNodeChanged); |
| 50 clickValueLink(layoutRecord, "Layout root"); | 50 clickValueLink(layoutRecord, "Layout root"); |
| 51 } | 51 } |
| 52 | 52 |
| 53 function onSelectedNodeChanged() | 53 function onSelectedNodeChanged() |
| 54 { | 54 { |
| 55 // avoid using WebInspector.inspectorView.panel("elements"), as we get f
irst event from constructor, | 55 // avoid using WebInspector.inspectorView.panel("elements"), as we get f
irst event from constructor, |
| 56 // and this call would cause another instance to get constructed. | 56 // and this call would cause another instance to get constructed. |
| 57 var node = WebInspector.panels.elements.selectedDOMNode(); | 57 var node = WebInspector.inspectorView.panel("elements").selectedDOMNode(
); |
| 58 // We may first get an old selected node while switching to the Elements
panel. | 58 // We may first get an old selected node while switching to the Elements
panel. |
| 59 if (node.nodeName() === "BODY") | 59 if (node.nodeName() === "BODY") |
| 60 return; | 60 return; |
| 61 WebInspector.notifications.removeEventListener(WebInspector.Notification
Service.Events.SelectedNodeChanged, onSelectedNodeChanged); | 61 WebInspector.notifications.removeEventListener(WebInspector.Notification
Service.Events.SelectedNodeChanged, onSelectedNodeChanged); |
| 62 InspectorTest.addResult("Layout root node id: " + node.getAttribute("id"
)); | 62 InspectorTest.addResult("Layout root node id: " + node.getAttribute("id"
)); |
| 63 InspectorTest.completeTest(); | 63 InspectorTest.completeTest(); |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 | 66 |
| 67 </script> | 67 </script> |
| 68 </head> | 68 </head> |
| 69 | 69 |
| 70 <body onload="runTest()"> | 70 <body onload="runTest()"> |
| 71 <p> | 71 <p> |
| 72 Tests the Timeline API instrumentation of a Layout event | 72 Tests the Timeline API instrumentation of a Layout event |
| 73 </p> | 73 </p> |
| 74 <div id="boundary" class="relayout-boundary"> | 74 <div id="boundary" class="relayout-boundary"> |
| 75 <div> | 75 <div> |
| 76 <div id="invalidate1"><div>text</div></div> | 76 <div id="invalidate1"><div>text</div></div> |
| 77 </div> | 77 </div> |
| 78 </div> | 78 </div> |
| 79 | 79 |
| 80 </body> | 80 </body> |
| 81 </html> | 81 </html> |
| OLD | NEW |