Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: LayoutTests/fast/events/touch/gesture/gesture-tap-click-common-ancestor.html

Issue 429793004: Re-add extra hit-tests on GestureTap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix patch Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <script src="../../../../resources/js-test.js"></script>
3 <style>
4 #target {
5 position: relative;
6 width: 100px;
7 height: 100px;
8 border: 1px solid black;
9 }
10 #target div {
11 position: absolute;
12 top: 0;
13 left: 0;
14 background-color: white;
15 width: 100px;
16 height: 100px;
17 }
18 #ancestor {
19 width: 0;
20 height: 0;
21 }
22 </style>
23 <div id=target>
24 <div id=ancestor12>
25 <div id=child1>1</div>
26 <div id=child2>2</div>
27 </div>
28 <div id=child3>3</div>
29 </div>
30 <div id=console></div>
31 <script>
32
33 description("Verifies that each mouse event that occurs when tapping on an eleme nt reflects the node under the point at the time of that event, and the click ev ent goes to the common ancestor of the mousedown and mouseup events.");
34
35 var rect = target.getBoundingClientRect();
36 var point = {
37 x: rect.left + rect.width / 2,
38 y: rect.top + rect.height / 2
39 };
40
41 var event;
42 function expectEventOn(e, node) {
43 debug("Received " + e.type + " on " + (e.target.id || e.target.nodeName));
44 event = e;
45 shouldBeEqualToString('event.target.id', node.id);
46 node.style.visibility = 'hidden';
47 }
48 document.addEventListener('mousemove', function(e) {
49 expectEventOn(e, child3);
50 });
51 document.addEventListener('mousedown', function(e) {
52 expectEventOn(e, child2);
53 });
54 document.addEventListener('mouseup', function(e) {
55 expectEventOn(e, child1);
56 });
57 document.addEventListener('click', function(e) {
58 expectEventOn(e, ancestor12);
59 });
60
61 if (window.eventSender) {
62 debug("Sending GestureTapDown");
63 eventSender.gestureTapDown(point.x, point.y, 30, 30);
64
65 debug("Sending GestureShowPress");
66 eventSender.gestureShowPress(point.x, point.y, 30, 30);
67
68 debug("Sending GestureTap");
69 eventSender.gestureTap(point.x, point.y, 30, 30);
70 } else {
71 debug("This test requires eventSender");
72 }
73 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698