5 function clickOn(element
)
7 if (!window
.eventSender
)
12 for (var parentNode
= element
; parentNode
; parentNode
= parentNode
.offsetParent
) {
13 absoluteLeft
+= parentNode
.offsetLeft
;
14 absoluteTop
+= parentNode
.offsetTop
;
17 var x
= absoluteLeft
+ element
.offsetWidth
/ 2;
18 var y
= absoluteTop
+ element
.offsetHeight
/ 2;
19 eventSender
.mouseMoveTo(x
, y
);
20 eventSender
.mouseDown();
21 eventSender
.mouseUp();
26 if (window
.testRunner
)
27 testRunner
.dumpAsText();
29 document
.querySelector('dialog').showModal();
30 clickOn(document
.querySelector('label'));
31 document
.querySelector('div').textContent
= document
.getElementById('target').checked
? 'PASS' : 'FAIL';
35 <body onload=
"runTest()">
36 <p>Ensure that simulated click is still dispatched to an inert node.
37 To test manually, click the CLICK ME label and verify it does change the value of the checkbox.
</p>
40 <input type=
"checkbox" id=
"target">
41 <dialog><label for=
"target">CLICK ME
</label></dialog>