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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/autoscroll-disabled-in-fix.html

Issue 2441683002: Prevent AutoscrollForSelection when selecting text in a fixed-position element. (Closed)
Patch Set: findAutoscrollable should return 0 for fixed-position elements Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/events/autoscroll-disabled-in-fix.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/autoscroll-disabled-in-fix.html b/third_party/WebKit/LayoutTests/fast/events/autoscroll-disabled-in-fix.html
new file mode 100644
index 0000000000000000000000000000000000000000..ce1bf3344d81876a8c65216b7e1d7cc561886f59
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-disabled-in-fix.html
@@ -0,0 +1,36 @@
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<div style="height: 400px; position: fixed; width: 400px; top: 500px;">
+<br />Fixed.......................
+<br />Fixed.......................
+<br />Fixed.......................
+<br />Fixed.......................
+<br />Fixed.......................
+<br />Fixed.......................
+<br />Fixed.......................
+</div>
+<div style="height: 2000px"></div>
+<script>
+var testFix = async_test('Selection-autoscroll should not be triggered when the selection is in a fixed-position element');
+testFix.step(function() {
+ if (!window.eventSender)
+ return;
+ document.body.offsetTop;
bokan 2016/10/24 13:22:00 You shouldn't need this. If you're finding that la
sunyunjia 2016/10/24 14:10:25 Done.
+ var dragStartX = 50;
+ var dragStartY = 550;
+ var dragEndX = 60;
+ var dragMoveY = 580;
+ var dragEndY = 820;
+
+ eventSender.dragMode = false;
+ eventSender.mouseMoveTo(dragStartX, dragStartY);
+ eventSender.mouseDown();
+ eventSender.mouseMoveTo(dragEndX, dragMoveY);
+ eventSender.mouseMoveTo(dragEndX, dragEndY);
+
+ requestAnimationFrame(function() {
+ assert_equals(document.body.scrollTop, 0);
+ testFix.done();
+ });
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698