blob: 5454a8132e99a25b7c0e20994d3970a3b5c9e6a9 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script>
function clickOn(element)
{
if (!window.eventSender)
return;
var absoluteTop = 0;
var absoluteLeft = 0;
for (var parentNode = element; parentNode; parentNode = parentNode.offsetParent) {
absoluteLeft += parentNode.offsetLeft;
absoluteTop += parentNode.offsetTop;
}
var x = absoluteLeft + element.offsetWidth / 2;
var y = absoluteTop + element.offsetHeight / 2;
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
}
function runTest()
{
if (window.testRunner)
testRunner.dumpAsText();
document.querySelector('dialog').showModal();
clickOn(document.querySelector('label'));
document.querySelector('div').textContent = document.getElementById('target').checked ? 'PASS' : 'FAIL';
}
</script>
</head>
<body onload="runTest()">
<p>Ensure that simulated click is still dispatched to an inert node.
To test manually, click the CLICK ME label and verify it does change the value of the checkbox.</p>
<div>
</div>
<input type="checkbox" id="target">
<dialog><label for="target">CLICK ME</label></dialog>
</body>
</html>