Commit d7d2d857 authored by David Bokan's avatar David Bokan Committed by Commit Bot

Fix DnD autoscroll under root-layer-scrolls

The drag and drop autoscroll tests were timing out under
root-layer-scrolls but autoscroll itself worked. The issue was that the
LayoutView now owns the scrollbars when RLS is turned on so its
bounding box is larger. This meant that the autoscroll activation region
was further out so the test never activated autoscroll.

This test fixes the issue by excluding the scrollbars when calculating
the autoscroll regions. This means that the activation area starts from
the scrollbar-content edge, rather than the window edge.

Bug: 781431
Change-Id: Ifc0e03d8e5016055586f6242feddc7af50f90069
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_root_layer_scrolls
Reviewed-on: https://chromium-review.googlesource.com/802519
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Reviewed-by: default avatarStefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521162}
parent ceb1274b
...@@ -9,8 +9,6 @@ crbug.com/417782 fast/dom/rtl-scroll-to-leftmost-and-resize.html [ Failure ] ...@@ -9,8 +9,6 @@ crbug.com/417782 fast/dom/rtl-scroll-to-leftmost-and-resize.html [ Failure ]
crbug.com/417782 fast/dom/scroll-reveal-left-overflow.html [ Failure ] crbug.com/417782 fast/dom/scroll-reveal-left-overflow.html [ Failure ]
crbug.com/417782 fast/dom/scroll-reveal-top-overflow.html [ Failure ] crbug.com/417782 fast/dom/scroll-reveal-top-overflow.html [ Failure ]
crbug.com/417782 fast/events/clientXY-in-zoom-and-scroll.html [ Failure ] crbug.com/417782 fast/events/clientXY-in-zoom-and-scroll.html [ Failure ]
crbug.com/417782 fast/events/drag-and-drop-autoscroll-frameset.html [ Timeout ]
crbug.com/417782 fast/events/drag-and-drop-autoscroll-mainframe.html [ Timeout ]
crbug.com/417782 fast/events/pointerevents/pointer-event-mouse-coords-in-zoom-and-scroll.html [ Failure ] crbug.com/417782 fast/events/pointerevents/pointer-event-mouse-coords-in-zoom-and-scroll.html [ Failure ]
crbug.com/417782 fast/events/scale-and-scroll-iframe-window.html [ Failure ] crbug.com/417782 fast/events/scale-and-scroll-iframe-window.html [ Failure ]
crbug.com/417782 fast/events/touch/gesture/gesture-tap-frame-scrolled.html [ Failure ] crbug.com/417782 fast/events/touch/gesture/gesture-tap-frame-scrolled.html [ Failure ]
...@@ -90,9 +88,6 @@ crbug.com/417782 virtual/threaded/http/tests/devtools/tracing/timeline-paint/tim ...@@ -90,9 +88,6 @@ crbug.com/417782 virtual/threaded/http/tests/devtools/tracing/timeline-paint/tim
crbug.com/417782 virtual/threaded/http/tests/devtools/tracing/timeline-paint/timeline-paint.js [ Failure ] crbug.com/417782 virtual/threaded/http/tests/devtools/tracing/timeline-paint/timeline-paint.js [ Failure ]
# Tests known to be flaky # Tests known to be flaky
crbug.com/417782 virtual/mouseevent_fractional/fast/events/drag-and-drop-autoscroll-frameset.html [ Timeout Failure ]
crbug.com/417782 virtual/mouseevent_fractional/fast/events/drag-and-drop-autoscroll-inner-frame.html [ Timeout Failure ]
crbug.com/417782 virtual/mouseevent_fractional/fast/events/drag-and-drop-autoscroll-mainframe.html [ Timeout Failure ]
crbug.com/417782 virtual/mouseevent_fractional/fast/events/mouse-coords-in-zoom-and-scroll.html [ Failure Timeout ] crbug.com/417782 virtual/mouseevent_fractional/fast/events/mouse-coords-in-zoom-and-scroll.html [ Failure Timeout ]
crbug.com/417782 virtual/mouseevent_fractional/fast/events/mouse-right-coords-in-zoom-and-scroll-right.html [ Failure Timeout ] crbug.com/417782 virtual/mouseevent_fractional/fast/events/mouse-right-coords-in-zoom-and-scroll-right.html [ Failure Timeout ]
crbug.com/417782 fast/events/pointerevents/pointer-event-pen-coords-in-zoom-and-scroll.html [ Failure Timeout ] crbug.com/417782 fast/events/pointerevents/pointer-event-pen-coords-in-zoom-and-scroll.html [ Failure Timeout ]
......
...@@ -1104,10 +1104,19 @@ IntSize LayoutBox::CalculateAutoscrollDirection( ...@@ -1104,10 +1104,19 @@ IntSize LayoutBox::CalculateAutoscrollDirection(
if (!frame_view) if (!frame_view)
return IntSize(); return IntSize();
IntRect box(AbsoluteBoundingBoxRect()); LayoutRect box(AbsoluteBoundingBoxRect());
// TODO(bokan): This is wrong. Subtracting the scroll offset would get you to
// frame coordinates (pre-RLS) but *adding* the scroll offset to an absolute
// location never makes sense (and we assume below it's in content
// coordinates).
box.Move(View()->GetFrameView()->ScrollOffsetInt()); box.Move(View()->GetFrameView()->ScrollOffsetInt());
IntRect window_box = View()->GetFrameView()->ContentsToRootFrame(box);
// Exclude scrollbars so the border belt (activation area) starts from the
// scrollbar-content edge rather than the window edge.
ExcludeScrollbars(box, kExcludeOverlayScrollbarSizeForHitTesting);
IntRect window_box =
View()->GetFrameView()->ContentsToRootFrame(PixelSnappedIntRect(box));
IntPoint window_autoscroll_point = point_in_root_frame; IntPoint window_autoscroll_point = point_in_root_frame;
if (window_autoscroll_point.X() < window_box.X() + kAutoscrollBeltSize) if (window_autoscroll_point.X() < window_box.X() + kAutoscrollBeltSize)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment