Index: LayoutTests/fast/events/autoscroll-upwards-propagation.html |
diff --git a/LayoutTests/fast/events/autoscroll-upwards-propagation.html b/LayoutTests/fast/events/autoscroll-upwards-propagation.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c2e9c1cd1513bb9bbeaa11ec868eff89b0509059 |
--- /dev/null |
+++ b/LayoutTests/fast/events/autoscroll-upwards-propagation.html |
@@ -0,0 +1,74 @@ |
+<!DOCTYPE html> |
+<head> |
+<style> |
+.overflow-hidden { |
+ width: 100px; |
+ height: 100px; |
+ background: #000; |
+ overflow: hidden; |
+} |
+input { |
+ font-size: 10px; |
+ height: 20px; |
+} |
+button { |
+ position: relative; |
+ left: 100px; |
+ top: 100px; |
+} |
+</style> |
+<script> |
+function runTest() { |
+ if (!window.testRunner) |
+ return; |
+ if (!window.eventSender) |
+ return; |
+ |
+ testRunner.dumpAsText(); |
+ testRunner.waitUntilDone(); |
+ |
+ var input = document.getElementById("input"); |
+ var x = input.offsetLeft + input.offsetWidth / 2; |
+ var y = input.offsetTop + input.offsetHeight / 2; |
+ |
+ eventSender.dragMode = false; |
+ eventSender.mouseMoveTo(x, y); |
+ eventSender.mouseDown(); |
+ |
+ // We do the dragging/selection in two steps here, because if we move |
+ // the mouse beyond the input boundary right way, it won't start the autoscroll |
+ // timer. See early return in AutoscrollController::startAutoscrollForSelection |
+ // after calling RenderBox::findAutoscrollable. |
+ eventSender.mouseMoveTo(x + 48, y); |
+ eventSender.mouseMoveTo(x + 55, y); |
+ setTimeout(finishTest, 100); |
+} |
+ |
+function finishTest() |
+{ |
+ eventSender.mouseUp(); |
+ var div = document.getElementById("div"); |
+ if (div.scrollTop == 0 && div.scrollLeft == 0) |
+ document.getElementById("result").innerText = "Test succeeded!"; |
+ else |
+ document.getElementById("result").innerText = "Test failed!"; |
+ |
+ testRunner.notifyDone(); |
+} |
+ |
+</script> |
+ |
+<body onload="runTest()"> |
+</head> |
+<p>Test ensures that if an autoscroll starts from within an entry field, it does not propagate |
+to its non-scrollable overflow ancestors.</p> |
+<p>To test manually, start text selecting with a mouse the text within the entry field. Then |
+continue to drag the mouse out of the input field boundary.<br>Scrolling should not propagate to |
+the container overflown div due to its "overflow:hidden"</p> |
+<div id="div" class="overflow-hidden"> |
+<input id="input" type="text" value="any text here!"/> |
+<button/> |
+</div> |
+<p id="result">If the test has completed this sentence should be replaced by a success message.</p> |
+</body> |
+</html> |