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

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: TIL, gclient sync may rebase changes back in time Created 5 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <p id="description"></p>
4 <select id='top'></select>
5 <pre id="console"></pre>
6 <script>
7 description("Tests to ensure that default action does not occur for mouse events from script.");
8
9 function focusHandler() {
10 testFailed('default action should not occur for mouse events from script.');
11 }
12
13 function mousedownHandler() {
14 debug('mousedown event is fired.');
15 }
16
17 function test()
18 {
19 if (window.testRunner)
20 testRunner.dumpAsText();
21
22 var node = document.getElementById('top');
23 node.addEventListener('focus', focusHandler, false);
24 node.addEventListener('mousedown', mousedownHandler, false);
25 var client = node.getBoundingClientRect();
26
27 var event = new MouseEvent('mousedown', { button: 1 });
28 node.dispatchEvent(event);
29 }
30
31 test();
32 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698