2 <style type=
"text/css">
3 input
, em
{ cursor: pointer
; margin-right: 100px; }
4 label
, span
{ cursor: pointer
; background: transparent
; }
6 <script src=
"../../resources/js-test.js"></script>
7 <div><label id=
"clickme1" for=
"checkbox"><input id=
"checkbox" type=
"checkbox">Click the empty area on the left
</input></label></div>
8 <div><span id=
"clickme2"> <em id=
"em">Click the empty area
</em><em>in middle
</em></span></div>
9 <p id=
"description"></p>
10 <div id=
"console"></div>
12 description('Click event should be fired when it occurs within culled inline.');
15 function hitTest(id
) {
16 var element
= document
.getElementById(id
);
17 parent
= element
.parentElement
;
18 // the x, y coordinates on margin of element
19 x
= element
.offsetLeft
+ element
.offsetWidth
+ 10;
20 y
= element
.offsetTop
+ element
.offsetHeight
/ 2;
22 shouldBeEqualToString('document.elementFromPoint(x, y).id', parent
.id
);
24 if (window
.eventSender
) {
26 parent
.addEventListener('click', function(e
) {
27 debug(parent
.nodeName
+ ' that is a parent of ' + element
.nodeName
+ ' is clicked.');
30 eventSender
.mouseMoveTo(x
, y
);
31 eventSender
.mouseDown();
32 eventSender
.mouseUp();
33 shouldBeTrue('gotClick');
41 if (window
.eventSender
)
42 shouldBeTrue('document.getElementById("checkbox").checked');