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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html b/third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html
new file mode 100644
index 0000000000000000000000000000000000000000..0d539bb09f3f3499a84d0fb6e7cb3006fa13d15a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<div id="outer" style="background: orange; padding: 50px; user-select: none" tabindex="-1">
+ <input id="input" value="foo">
+</div>
+<script>
+promise_test(() => {
+ return new Promise((resolve, reject) => {
+ if (window.eventSender === undefined)
+ return reject('required window.eventSender');
+ if (window.chrome === undefined)
+ return reject('required chrome.gpuBenchmarking');
+ if (window.chrome.gpuBenchmarking === undefined)
+ return reject('required chrome.gpuBenchmarking');
+ input.focus();
+ assert_equals(document.activeElement, input);
+ // Click in outer element outside of input element.
+ var pointerActions =
+ [{source: 'mouse',
+ actions: [
+ { name: 'pointerDown', x: 20, y: 20, button:'left' },
+ { name: 'pointerUp', button:'left' },]}];
+ 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.
+ }).then(() => {
+ 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.
+ assert_equals(document.activeElement, outer, 'outer is focued.');
+ eventSender.keyDown('a');
+ assert_equals(input.value, 'foo', 'Input value should not change.');
+ });
+});
+</script>
« 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