Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / touch / gesture / gesture-tap-paragraph-end.html
blobdfbe115b5d215634ed3fdc5e8f939e00e68418f6
1 <!DOCTYPE HTML>
2 <script src="../../../../resources/js-test.js"></script>
3 <style>
4 </style>
5 <p id=target>Tap to the<br><span id=span>right:</span></p>
6 <div id=console></div>
7 <script>
8 var event;
9 function eventLogger(e) {
10 debug("Received " + e.type + " on " + (e.target.id || e.target.nodeName));
11 event = e;
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();
20 var point = {
21 x: rect.right - 50,
22 y: rect.bottom - 5
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);
43 } else {
44 debug("This test requires eventSender");
46 </script>