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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/contextmenu-follows-focus.html

Issue 2869713003: Make context menu aware of hidden selection (Closed)
Patch Set: Add test as NeverFixTests for Mac Created 3 years, 7 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/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script>
5 var contextForMenu;
6 function catchContextMenu(event) {
7 contextForMenu = event.currentTarget.tagName;
8 }
9 </script>
10
11 <input oncontextmenu="catchContextMenu(event);">
12 <a href="www" oncontextmenu="catchContextMenu(event);">A link</a>
13
14 <script>
15 test(function() {
16 assert_exists(window, 'eventSender', 'This test requires eventSender.');
17
18 document.querySelector('INPUT').focus();
19 eventSender.keyDown('ContextMenu');
20 assert_equals(contextForMenu, 'INPUT',
21 'ContextMenu should use the focused input field as context.');
22
23 // Hide INPUT's context menu before we display A's context menu.
24 eventSender.keyDown('Escape');
25
26 document.querySelector('A').focus();
27 eventSender.keyDown('ContextMenu');
28 assert_equals(contextForMenu, 'A',
29 'ContextMenu should use the focused link as context.');
30
31 }, 'ContextMenu should always follow focused element.');
32 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/NeverFixTests ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698