The autoscroll uses m_autoscrollTimer to perform drag scroll animation, then uses RenderLayer::scrollRectToVisible to perform scroll. In this scenario RenderLayer::scrollRectToVisible shouldn't consider scroll-behavior and scroll immediately.
Created attachment 392397 [details] Patch
Created attachment 392398 [details] Patch
Created attachment 392685 [details] Patch
About the test for this patch, we need to create a drag action. I tried to use eventSender, but it doesn't work. Maybe we can add a manual test?
Created attachment 392686 [details] Patch
Comment on attachment 392686 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=392686&action=review LGTM, I wonder if we already have tests for this feature and whether we can adapt them for scroll behavior? > Source/WebCore/rendering/RenderLayer.cpp:2797 > +void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insideFixed, const ScrollRectToVisibleOptions& options, bool isAutoscrollInProgress) I guess it should be AutoScrollInProgress?
(In reply to Frédéric Wang (:fredw) from comment #6) > Comment on attachment 392686 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=392686&action=review > > LGTM, I wonder if we already have tests for this feature and whether we can > adapt them for scroll behavior? > Good idea! I'll have a try! > > Source/WebCore/rendering/RenderLayer.cpp:2797 > > +void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insideFixed, const ScrollRectToVisibleOptions& options, bool isAutoscrollInProgress) > > I guess it should be AutoScrollInProgress? Done, changed it to autoscrollInProgress.
Created attachment 392708 [details] Patch
Created attachment 392710 [details] Patch
Comment on attachment 392710 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=392710&action=review > Source/WebCore/rendering/RenderLayer.cpp:2802 > + if (autoscrollInProgress) > + ASSERT(false); hmm? > Source/WebCore/rendering/RenderLayer.cpp:3040 > + scrollRectToVisible(LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), false, { SelectionRevealMode::Reveal, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded, ShouldAllowCrossOriginScrolling::Yes }, true); Boolean trap
Created attachment 392738 [details] drag-smooth-scroll-element Add test case.
Comment on attachment 392710 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=392710&action=review Hi Simon, Thanks for the review:) >> Source/WebCore/rendering/RenderLayer.cpp:2802 >> + ASSERT(false); > > hmm? Ah, sorry, this is used to find out the autoscroll tests. It'll remove in the new patch. >> Source/WebCore/rendering/RenderLayer.cpp:3040 >> + scrollRectToVisible(LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), false, { SelectionRevealMode::Reveal, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded, ShouldAllowCrossOriginScrolling::Yes }, true); > > Boolean trap Thanks, how about enum AutoscrollStatus { NotInProgress, InProgress } ?
Created attachment 392747 [details] Patch
Hi Fred and Simon, The new patch add a test using eventSender to simulate the drag action. Please take a look, thanks:)
Created attachment 393121 [details] Patch
Comment on attachment 393121 [details] Patch This LGTM, but I think it would be better to have a test for WK2. Can't you use UIHelper (e.g. dragFromPointToPoint?). See how it is done for other tests in fast/scrolling.
(In reply to Frédéric Wang (:fredw) from comment #16) > Comment on attachment 393121 [details] > Patch > > This LGTM, but I think it would be better to have a test for WK2. Can't you > use UIHelper (e.g. dragFromPointToPoint?). See how it is done for other > tests in fast/scrolling. Hi Fred, Thanks for the review! It seems UIScriptControllerMac::dragFromPointToPoint for WebKitTestRunner is not implemented yet. I found UIScriptControllerMac::activateAtPoint which is related to mouse event and has implemented, is also using eventSender. I also looked into some examples of autoscroll tests, they are also using eventSender. So I guess eventSender is the common way to trigger an autoscroll in test. Bug:42194 is tracing the incomplete implementation for eventSender. So the test would cover WK2 if Bug:42194 fixed. Sorry, it seems my comments in changeLogs is confusing. I'll reword them.
Created attachment 393253 [details] Patch
Created attachment 393378 [details] Patch
Created attachment 393456 [details] Patch
Comment on attachment 393456 [details] Patch Clearing flags on attachment: 393456 Committed r258382: <https://trac.webkit.org/changeset/258382>
All reviewed patches have been landed. Closing bug.
<rdar://problem/60404576>