2 <script src=
"../../../../resources/js-test.js"></script>
5 <p id=target
>Tap to the
<br><span id=span
>right:
</span></p>
9 function eventLogger(e
) {
10 debug("Received " + e
.type
+ " on " + (e
.target
.id
|| e
.target
.nodeName
));
12 shouldBeEqualToString("event.target.id", "target");
13 shouldBeEqualToString("document.elementFromPoint(event.clientX, event.clientY).id", "target");
16 description("Verifies that tapping in the whitespace at the end of a paragraph sends mouse events properly to the paragraph node (even though there are no text line boxes here). http://crbug.com/398205");
18 // Tap at the far right edge of a paragraph.
19 var rect
= target
.getBoundingClientRect();
25 // This should be inside the paragraph but outside the span
26 shouldBeGreaterThan("point.x", "span.getBoundingClientRect().right");
27 shouldBeEqualToString("document.elementFromPoint(point.x, point.y).id", "target");
29 document
.addEventListener('mousemove', eventLogger
);
30 document
.addEventListener('mousedown', eventLogger
);
31 document
.addEventListener('mouseup', eventLogger
);
32 document
.addEventListener('click', eventLogger
);
34 if (window
.eventSender
) {
35 debug("Sending GestureTapDown");
36 eventSender
.gestureTapDown(point
.x
, point
.y
, 30, 30);
38 debug("Sending GestureShowPress");
39 eventSender
.gestureShowPress(point
.x
, point
.y
, 30, 30);
41 debug("Sending GestureTap");
42 eventSender
.gestureTap(point
.x
, point
.y
, 1, 30, 30);
44 debug("This test requires eventSender");