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

Side by Side Diff: LayoutTests/fast/events/dispatch-synthetic-mouseevent-no-action.html

Issue 894913002: Prevent default actions for JS-generated mouse events other than click (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: changed failing tests to use eventsender Created 5 years, 8 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
Rick Byers 2015/06/10 21:56:57 nit: omit html, head, body tags: https://www.chrom
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <select id='top'></select>
9 <pre id="console"></pre>
10 <script>
11 description("Tests to ensure that default action does not occur.");
Rick Byers 2015/06/10 21:56:57 nit: add "for synthetic mouse events".
12
13 function focusHandler() {
14 testFailed('default action should not occur.');
15 }
16
17 function mousedownHandler() {
18 debug('mousedown event is fired.');
19 }
20
21 function test()
22 {
23 if (window.testRunner)
24 testRunner.dumpAsText();
25
26 var node = document.getElementById('top');
27 node.addEventListener('focus', focusHandler, false);
28 node.addEventListener('mousedown', mousedownHandler, false);
29 var client = node.getBoundingClientRect();
30
31 var event = new MouseEvent('mousedown', { button: 1 });
32 node.dispatchEvent(event);
33 }
34
35 test();
36 </script>
37 </body>
38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698