2 <script src=
"../../resources/js-test.js"></script>
3 <iframe src=
"data:text/html,"></iframe>
4 <button type=
"button">Button
</button>
6 description('Mousedown without mouseup in a sub frame should not confuse a click in another frame.');
8 window
.onload = function() {
9 var button
= document
.querySelector('button');
10 button
.addEventListener('mousedown', function(event
) {
11 event
.preventDefault();
13 button
.addEventListener('click', function(event
) {
14 testPassed('Click event was dispatched.');
18 var iframe
= document
.querySelector('iframe');
19 // Mousedown on the iframe, but no mouseup.
20 eventSender
.mouseMoveTo(iframe
.offsetLeft
+ iframe
.offsetWidth
/ 2, iframe
.offsetTop
+ iframe
.offsetHeight
/ 2);
21 eventSender
.mouseDown(1);
22 // Click on the button in the main document.
23 eventSender
.mouseMoveTo(button
.offsetLeft
+ button
.offsetWidth
/ 2, button
.offsetTop
+ button
.offsetHeight
/ 2);
24 eventSender
.mouseDown(0);
25 setTimeout(function() {
26 testFailed('Click event was not dispatched.');
29 eventSender
.mouseUp(0);