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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/input/keyboard_event_without_focus.html

Issue 2628763003: Keyboard event should not insert a character at selection if selection doesn't have focus (Closed)
Patch Set: 2017-01-12T13:25:32 Created 3 years, 11 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 | third_party/WebKit/LayoutTests/fast/events/keypress-focus-change.html » ('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>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../assert_selection.js"></script>
5 <script>
6 test(() => {
7 if (!window.eventSender) {
8 assert_unreached('This test requires eventSender.');
9 return;
10 }
11
12 assert_selection(
13 '<input value="x"><input type="checkbox">',
14 selection => {
15 const document = selection.document;
16 const textField = document.querySelector('input');
17 textField.select();
18 document.querySelector('input[type=checkbox]').focus();
19 eventSender.keyDown('a');
20 // Insert |textField.value| to HTML for verification
Xiaocheng 2017/01/12 08:31:02 I think we should modify assert_selection to repor
yoichio 2017/01/13 02:04:07 If assert_selection won't be used to test such i
21 textField.appendChild(document.createTextNode(textField.value));
22 },
23 '<input value="x">x</input><input type="checkbox">',
24 'unfocused text field should not insert a charcter by keyboard event');
25
26 assert_selection(
27 '<div contenteditable>|</div><input type="checkbox">',
28 selection => {
29 const document = selection.document;
30 document.querySelector('input[type=checkbox]').focus();
31 eventSender.keyDown('a');
32 },
33 '<div contenteditable>|</div><input type="checkbox">',
34 'unfocused content editable should not insert a charcter by keyboard event') ;
35 }, 'Keyboard event without focus should not insert a character.');
36 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/events/keypress-focus-change.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698