OLD | NEW |
(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> |
OLD | NEW |