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

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
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..1d5b5b403880b67e159f7dce83409261bc7db554
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html
@@ -0,0 +1,29 @@
+<script src="../../../resources/testharness.js"></script>
yosin_UTC9 2017/05/17 10:17:58 nit: Please add <!doctype html>
yoichio 2017/05/18 09:31:49 Done.
+<script src="../../../resources/testharnessreport.js"></script>
+<div id="outer" style="background: orange; padding: 50px; user-select: none" tabindex="-1">
+ <input id="input" value="foo" autofocus>
+</div>
+<script>
+var test = async_test();
+
+var outer_isClicked = false;
yosin_UTC9 2017/05/17 10:15:39 nit: %s/outer_isClicked/outerIsClicked/
yoichio 2017/05/18 09:31:49 Acknowledged.
+outer.onclick = function() { outer_isClicked = true;};
+var step2 = function() {
+ test.step(function(){
+ assert_true(outer_isClicked, 'outer div is clicked');
yosin_UTC9 2017/05/17 10:15:39 Please add assert_exists(window, 'eventSender', '
yoichio 2017/05/18 09:31:49 Done.
+ assert_equals(document.activeElement, outer, 'outer is focued');
+ eventSender.keyDown('a');
+ assert_equals(input.value, "foo", '');
yosin_UTC9 2017/05/17 10:15:39 nit: s/"/'/
yoichio 2017/05/18 09:31:49 Done.
+ test.done();
+ });
+};
+
+input.onfocus = function() {
+ var pointerActions =
+ [{source: "mouse",
yosin_UTC9 2017/05/17 10:15:39 nit: s/"/'/
yoichio 2017/05/18 09:31:49 Done.
+ actions: [
+ { name: "pointerDown", x: 20, y: 20, button:'left' },
yosin_UTC9 2017/05/17 10:15:39 nit: s/"/'/
Xiaocheng 2017/05/17 19:29:25 nit: For readability, please add a comment that th
yoichio 2017/05/18 09:31:48 Done.
yoichio 2017/05/18 09:31:49 Done.
+ { name: "pointerUp", button:'left' },]}];
yosin_UTC9 2017/05/17 10:15:39 nit: s/"/'/
yoichio 2017/05/18 09:31:49 Done.
+ chrome.gpuBenchmarking.pointerActionSequence(pointerActions, step2);
yosin_UTC9 2017/05/17 10:17:58 nit: Please add check for |chrome| and |chrome.gpu
yoichio 2017/05/18 09:31:49 Done.
+};
+</script>

Powered by Google App Engine
This is Rietveld 408576698