| Summary: | REGRESSION(r255957): Element with scroll-behavior:smooth isn't draggable after r255957 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | cathiechen <cathiechen> | ||||||||||||||||||||||||||
| Component: | Scrolling | Assignee: | cathiechen <cathiechen> | ||||||||||||||||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||||||||||||||||
| Severity: | Normal | CC: | commit-queue, esprehn+autocc, ews-watchlist, fred.wang, glenn, kondapallykalyan, pdr, simon.fraser, webkit-bug-importer | ||||||||||||||||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||||||||||||||||
| Version: | WebKit Nightly Build | ||||||||||||||||||||||||||||
| Hardware: | Unspecified | ||||||||||||||||||||||||||||
| OS: | Unspecified | ||||||||||||||||||||||||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=42194 | ||||||||||||||||||||||||||||
| Bug Depends on: | 219284 | ||||||||||||||||||||||||||||
| Bug Blocks: | 204882 | ||||||||||||||||||||||||||||
| Attachments: |
|
||||||||||||||||||||||||||||
|
Description
cathiechen
2020-03-04 00:53:55 PST
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. |