5 function clickOn(element
)
7 if (!window
.eventSender
)
10 var x
= element
.offsetLeft
+ element
.offsetWidth
/ 2;
11 var y
= element
.offsetTop
+ element
.offsetHeight
/ 2;
12 eventSender
.mouseMoveTo(x
, y
);
13 eventSender
.mouseDown();
14 eventSender
.mouseUp();
19 if (window
.testRunner
)
20 testRunner
.dumpAsText();
22 clickOn(document
.querySelector('label'));
23 document
.querySelector('div').textContent
= document
.getElementById('target').checked
? 'FAIL' : 'PASS';
28 <body onload=
"runTest()">
29 <p>Ensure that simulated click is not dispatched to a disabled node. Clicking on the label should not change the value of the checkbox.
</p>
31 <input type=
"checkbox" id=
"target" disabled
>
32 <label for=
"target">CLICK ME
</label>