3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/timeline-test.js"></script>
14 function performActions()
16 var element = document.getElementById("invalidate1");
17 element.style.marginTop = "10px";
18 var unused = element.offsetHeight;
23 InspectorTest.evaluateInPage("var unused = document.body.offsetWidth; testRunner.display();", function() {
24 InspectorTest.evaluateWithTimeline("performActions()", onTimelineRecorded);
27 function clickValueLink(record, row)
29 var helper = record.generatePopupContent(onDetailsContentReady);
31 function onDetailsContentReady(element)
33 var rows = element.querySelectorAll(".timeline-details-view-row");
34 for (var i = 0; i < rows.length; ++i) {
35 if (rows[i].firstChild.textContent.indexOf(row) !== -1) {
36 rows[i].lastChild.firstChild.click();
43 function onTimelineRecorded(records)
45 var layoutRecord = InspectorTest.findPresentationRecord("Layout");
46 WebInspector.notifications.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, onSelectedNodeChanged);
47 clickValueLink(layoutRecord, "Layout root");
50 function onSelectedNodeChanged()
52 // avoid using WebInspector.panel("elements"), as we get first event from constructor,
53 // and this call would cause another instance to get constructed.
54 var node = WebInspector.panels.elements.selectedDOMNode();
55 // We may first get an old selected node while switching to the Elements panel.
56 if (node.nodeName() === "BODY")
58 WebInspector.notifications.removeEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, onSelectedNodeChanged);
59 InspectorTest.addResult("Layout root node id: " + node.getAttribute("id"));
60 InspectorTest.completeTest();
67 <body onload="runTest()">
69 Tests the Timeline API instrumentation of a Layout event
71 <div id="boundary" class="relayout-boundary">
73 <div id="invalidate1"><div>text</div></div>