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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html

Issue 2889763003: Accept text input only if selection has focus. (Closed)
Patch Set: update 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp » ('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 <div id="outer" style="background: orange; padding: 50px; user-select: none" tab index="-1">
5 <input id="input" value="foo">
6 </div>
7 <script>
8 promise_test(() => {
9 return new Promise((resolve, reject) => {
10 if (window.eventSender === undefined)
11 return reject('required window.eventSender');
12 if (window.chrome === undefined)
13 return reject('required chrome.gpuBenchmarking');
14 if (window.chrome.gpuBenchmarking === undefined)
15 return reject('required chrome.gpuBenchmarking');
16 input.focus();
17 assert_equals(document.activeElement, input);
18 // Click in outer element outside of input element.
19 var pointerActions =
20 [{source: 'mouse',
21 actions: [
22 { name: 'pointerDown', x: 20, y: 20, button:'left' },
23 { name: 'pointerUp', button:'left' },]}];
24 chrome.gpuBenchmarking.pointerActionSequence(pointerActions, resolve);
yosin_UTC9 2017/05/18 10:00:14 I think |input.blur()| is enough.
yoichio 2017/05/19 01:51:23 No, we need focus on |user-select:none, tabindex=-
yosin_UTC9 2017/05/19 02:06:40 How about move to focus to |user-select:none, tabi
yoichio 2017/05/19 05:37:49 Done.
25 }).then(() => {
26 console.log("end");
yosin_UTC9 2017/05/18 10:00:14 nit: We don't need to have |console.log()|.
yoichio 2017/05/19 01:51:23 Done.
27 assert_equals(document.activeElement, outer, 'outer is focued.');
28 eventSender.keyDown('a');
29 assert_equals(input.value, 'foo', 'Input value should not change.');
30 });
31 });
32 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698