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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/text/input-readonly-autoscroll.html

Issue 2536083002: SelectionAutoscroll should not happen in user-select:none. (Closed)
Patch Set: To pass the tests. Created 4 years 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
1 <html> 1 <html>
2 <head> 2 <head>
3 <script> 3 <script>
4 function test() 4 function test()
5 { 5 {
6 if (window.testRunner) { 6 if (window.testRunner) {
7 testRunner.waitUntilDone(); 7 testRunner.waitUntilDone();
8 setTimeout(autoscrollTestPart1, 0); 8 setTimeout(autoscrollTestPart1, 0);
9 } 9 }
10 } 10 }
11 function autoscrollTestPart1() 11 function autoscrollTestPart1()
12 { 12 {
13 var tf = document.getElementById('tf'); 13 var tf = document.getElementById('tf');
14 if (window.eventSender) { 14 if (window.eventSender) {
15 tf.scrollIntoView(); 15 tf.scrollIntoView();
16 var h = tf.offsetTop - document.scrollingElement.scrollTop + 10; 16 var h = tf.offsetTop - document.scrollingElement.scrollTop + 10;
17 eventSender.dragMode = false; 17 eventSender.dragMode = false;
18 eventSender.mouseMoveTo(20, h); 18 eventSender.mouseMoveTo(20, h);
19 eventSender.mouseDown(); 19 eventSender.mouseDown();
20 eventSender.mouseMoveTo(20, h); 20 eventSender.mouseMoveTo(40, h);
bokan 2016/12/05 15:39:36 Why was this change necessary?
sunyunjia 2016/12/05 15:44:39 Autoscroll can only be triggered AFTER some text h
bokan 2016/12/05 15:45:54 Yah, but wouldn't the mouseMove below cause select
sunyunjia 2016/12/05 16:25:53 I did some more investigation. The autoscroll is t
21 eventSender.mouseMoveTo(300, h); 21 eventSender.mouseMoveTo(300, h);
22 } 22 }
23 setTimeout(autoscrollTestPart2, 100); 23 setTimeout(autoscrollTestPart2, 100);
24 } 24 }
25 function autoscrollTestPart2() 25 function autoscrollTestPart2()
26 { 26 {
27 if (window.eventSender) 27 if (window.eventSender)
28 eventSender.mouseUp(); 28 eventSender.mouseUp();
29 log("ScrollLeft: " + document.getElementById('tf').scrollLeft); 29 log("ScrollLeft: " + document.getElementById('tf').scrollLeft);
30 if (window.testRunner) 30 if (window.testRunner)
31 testRunner.notifyDone(); 31 testRunner.notifyDone();
32 } 32 }
33 function log(msg) 33 function log(msg)
34 { 34 {
35 var res = document.getElementById('res'); 35 var res = document.getElementById('res');
36 res.innerHTML = res.innerHTML + msg + "<br>"; 36 res.innerHTML = res.innerHTML + msg + "<br>";
37 } 37 }
38 </script> 38 </script>
39 </head> 39 </head>
40 <body onload="test()"> 40 <body onload="test()">
41 <p>Test for <a href=http://bugs.webkit.org/show_bug.cgi?id=11534">bug 11 534</a>.</p> 41 <p>Test for <a href=http://bugs.webkit.org/show_bug.cgi?id=11534">bug 11 534</a>.</p>
42 <p>Readonly text fields don't scroll when selecting content.</p> 42 <p>Readonly text fields don't scroll when selecting content.</p>
43 <input id="tf" readonly value="abcdefghijklmnopqrstuvwxyz"></input> 43 <input id="tf" readonly value="abcdefghijklmnopqrstuvwxyz"></input>
44 <div id="res"></div> 44 <div id="res"></div>
45 </body> 45 </body>
46 </html> 46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698