11 <script src=
"../../../resources/js-test.js"></script>
15 <dialog id=
"dialog"></dialog>
18 description('Test for bug 110952. Ensure that closed dialogs do not block mouse events. To test manually, click the red box. The test succeeds if the red box turns green.');
20 function clickOn(element
)
22 if (!window
.eventSender
)
27 for (var parentNode
= element
; parentNode
; parentNode
= parentNode
.offsetParent
) {
28 absoluteLeft
+= parentNode
.offsetLeft
;
29 absoluteTop
+= parentNode
.offsetTop
;
32 var x
= absoluteLeft
+ element
.offsetWidth
/ 2;
33 var y
= absoluteTop
+ element
.offsetHeight
/ 2;
34 eventSender
.mouseMoveTo(x
, y
);
35 eventSender
.mouseDown();
37 eventSender
.mouseMoveTo(0, 0);
40 if (window
.testRunner
)
41 testRunner
.dumpAsText();
43 dialog
= document
.getElementById('dialog');
47 div
= document
.getElementById('div');
48 div
.addEventListener('click', function(event
) {
50 div
.style
.backgroundColor
= 'green';
55 shouldBeTrue('div.firedOn');