3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../http/tests/inspector/elements-test.js"></script>
29 function clickInner(withShift
)
31 var target
= document
.getElementById("inner");
32 var rect
= target
.getBoundingClientRect();
33 // Simulate the mouse click over the target to trigger an event dispatch.
34 if (window
.eventSender
) {
35 window
.eventSender
.mouseMoveTo(rect
.left
+ rect
.width
/ 2, rect
.top
+ rect
.height
/ 2, withShift
? "shiftKey" : "");
36 window
.eventSender
.mouseDown();
37 window
.eventSender
.mouseUp();
43 function selectedNodeId()
45 var selectedElement
= InspectorTest
.firstElementsTreeOutline().selectedTreeElement
;
47 return "<no selected node>";
48 return selectedElement
.node().getAttribute("id");
51 function expectSelectedNode(expectedId
)
53 var id
= selectedNodeId();
54 if (id
=== expectedId
)
55 InspectorTest
.addResult("PASS: selected node with id '" + id
+ "'");
57 InspectorTest
.addResult("FAIL: unexpected selection " + id
);
62 InspectorTest
.domModel
.setInspectMode(DOMAgent
.InspectMode
.SearchForNode
, step2
);
67 InspectorTest
.firstElementsTreeOutline().addEventListener(WebInspector
.ElementsTreeOutline
.Events
.SelectedNodeChanged
, step3
);
68 InspectorTest
.evaluateInPage("clickInner(true)");
73 InspectorTest
.firstElementsTreeOutline().removeEventListener(WebInspector
.ElementsTreeOutline
.Events
.SelectedNodeChanged
, step3
);
74 expectSelectedNode("inner");
75 InspectorTest
.domModel
.setInspectMode(DOMAgent
.InspectMode
.SearchForNode
, step4
);
80 InspectorTest
.firstElementsTreeOutline().addEventListener(WebInspector
.ElementsTreeOutline
.Events
.SelectedNodeChanged
, step5
);
81 InspectorTest
.evaluateInPage("clickInner(false)");
86 InspectorTest
.firstElementsTreeOutline().removeEventListener(WebInspector
.ElementsTreeOutline
.Events
.SelectedNodeChanged
, step5
);
87 expectSelectedNode("outer");
88 InspectorTest
.completeTest();
97 <body onload=
"runTest()">
98 <p>Test that Web Inspector can inspect element with
<code>pointer-events:none
</code>.
100 <div id=
"outer"><div id=
"inner"></div></div>