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

Side by Side Diff: LayoutTests/fast/events/touch/gesture/gesture-tap-result.html

Issue 267313008: First-cut at fixing unhandled Tap event returns in Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed handlers for all events other than mousedown. Created 6 years, 6 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/touch/gesture/gesture-tap-result-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../../resources/js-test.js"></script>
5 </head>
6 <body onload="runTest();">
7
8 <input id="input" type="text" value="editable text"><br>
9 <span id="plain">This is plain text with no handler</span><br>
10 <span id="consumes">This text consumes events using preventDefault()</span><br>< br>
11 Clicking or tapping on the "consumes" section should have no effect on the selec tion,
12 but clicking in the plain section should clear it.
13
14 <p id="description"></p>
15 <div id="console"></div>
16
17 <script>
18 var plainResult = null;
19 var consumesResult = null;
20
21 function plainCallback() {
22 }
23
24 function consumeCallback(event) {
25 event.preventDefault();
26 }
27
28 function runTest() {
29 document.getElementById('input').select();
30 var consumes = document.getElementById('consumes');
31 consumes.addEventListener("mousedown", consumeCallback, false);
32 var plain = document.getElementById('plain');
33 plain.addEventListener("mousedown", plainCallback, false);
34
35 if (window.testRunner) {
36 testRunner.dumpAsText();
37 }
38
39 if (window.eventSender) {
40 description("This tests Tap events being consumed by a handler.");
41
42 // A 'tap' gesture event should generate a sequence of mouse events,
43 // which do not affect the selection when consumed.
44 var consumesRect = document.getElementById('consumes').getBoundingClient Rect();
45 consumesResult = eventSender.gestureTap(consumesRect.left, consumesRect. top);
46 shouldBe('consumesResult', 'true');
47 shouldNotBe('window.getSelection().toString()', '');
48
49 // Tapping on plain text does not consume the event, and clears the sele ction.
50 var plainRect = document.getElementById('plain').getBoundingClientRect() ;
51 plainResult = eventSender.gestureTap(plainRect.left, plainRect.top);
52 shouldBe('plainResult', 'false');
53 shouldBeEmptyString('window.getSelection().toString()');
54 } else {
55 debug("This test requires DumpRenderTree. Tap on the text to log.")
56 }
57 }
58 </script>
59 </body>
60 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/touch/gesture/gesture-tap-result-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698