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

Side by Side Diff: LayoutTests/fast/events/autoscroll-upwards-propagation.html

Issue 23472005: div with overflow:hidden scrolls when dragging in a text box (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: div with overflow:hidden scrolls when dragging in a text box Created 7 years, 3 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 | LayoutTests/fast/events/autoscroll-upwards-propagation-expected.txt » ('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 <head>
3 <style>
4 .overflow-hidden {
5 width: 100px;
6 height: 100px;
7 background: #000;
8 overflow: hidden;
9 }
10 input {
11 font-size: 10px;
12 height: 20px;
13 }
14 button {
15 position: relative;
16 left: 100px;
17 top: 100px;
18 }
19 </style>
20 <script>
21 function runTest() {
22 if (!window.testRunner)
23 return;
24 if (!window.eventSender)
25 return;
26
27 testRunner.dumpAsText();
28 testRunner.waitUntilDone();
29
30 var input = document.getElementById("input");
31 var x = input.offsetLeft + input.offsetWidth / 2;
32 var y = input.offsetTop + input.offsetHeight / 2;
33
34 eventSender.dragMode = false;
35 eventSender.mouseMoveTo(x, y);
36 eventSender.mouseDown();
37
38 // We do the dragging/selection in two steps here, because if we move
39 // the mouse beyond the input boundary right way, it won't start the autoscr oll
40 // timer. See early return in AutoscrollController::startAutoscrollForSelect ion
41 // after calling RenderBox::findAutoscrollable.
42 eventSender.mouseMoveTo(x + 48, y);
43 eventSender.mouseMoveTo(x + 55, y);
44 setTimeout(finishTest, 100);
45 }
46
47 function finishTest()
48 {
49 eventSender.mouseUp();
50 var div = document.getElementById("div");
51 if (div.scrollTop == 0 && div.scrollLeft == 0)
52 document.getElementById("result").innerText = "Test succeeded!";
53 else
54 document.getElementById("result").innerText = "Test failed!";
55
56 testRunner.notifyDone();
57 }
58
59 </script>
60
61 <body onload="runTest()">
62 </head>
63 <p>Test ensures that if an autoscroll starts from within an entry field, it does not propagate
64 to its non-scrollable overflow ancestors.</p>
65 <p>To test manually, start text selecting with a mouse the text within the entry field. Then
66 continue to drag the mouse out of the input field boundary.<br>Scrolling should not propagate to
67 the container overflown div due to its "overflow:hidden"</p>
68 <div id="div" class="overflow-hidden">
69 <input id="input" type="text" value="any text here!"/>
70 <button/>
71 </div>
72 <p id="result">If the test has completed this sentence should be replaced by a s uccess message.</p>
73 </body>
74 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/autoscroll-upwards-propagation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698