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

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
OLDNEW
(Empty)
1 <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.
2 <script src="../../../resources/testharnessreport.js"></script>
3 <div id="outer" style="background: orange; padding: 50px; user-select: none" tab index="-1">
4 <input id="input" value="foo" autofocus>
5 </div>
6 <script>
7 var test = async_test();
8
9 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.
10 outer.onclick = function() { outer_isClicked = true;};
11 var step2 = function() {
12 test.step(function(){
13 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.
14 assert_equals(document.activeElement, outer, 'outer is focued');
15 eventSender.keyDown('a');
16 assert_equals(input.value, "foo", '');
yosin_UTC9 2017/05/17 10:15:39 nit: s/"/'/
yoichio 2017/05/18 09:31:49 Done.
17 test.done();
18 });
19 };
20
21 input.onfocus = function() {
22 var pointerActions =
23 [{source: "mouse",
yosin_UTC9 2017/05/17 10:15:39 nit: s/"/'/
yoichio 2017/05/18 09:31:49 Done.
24 actions: [
25 { 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.
26 { name: "pointerUp", button:'left' },]}];
yosin_UTC9 2017/05/17 10:15:39 nit: s/"/'/
yoichio 2017/05/18 09:31:49 Done.
27 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.
28 };
29 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698