RESOLVED FIXED 104764
Handling autoscroll in EventHandler should be re-factor
https://bugs.webkit.org/show_bug.cgi?id=104764
Summary Handling autoscroll in EventHandler should be re-factor
yosin
Reported 2012-12-11 21:55:36 PST
There are number of works regarding auto scrolling, e.g. drag-and-drop with autoscroll, drag-and-drop with gesture, and so on. It seems code for handling auto scroll will be increased, e.g. https://bugs.webkit.org/attachment.cgi?id=177950&action=prettypatch To make code of EventHandler clean and extensible, we should factor out autoscroll handling from EventHandler class.
Attachments
Patch 1 (29.17 KB, patch)
2012-12-12 01:57 PST, yosin
no flags
Patch 2 (29.29 KB, patch)
2012-12-12 02:34 PST, yosin
no flags
Patch 3 (42.02 KB, patch)
2012-12-12 23:37 PST, yosin
no flags
Patch 4 (42.01 KB, patch)
2012-12-12 23:48 PST, yosin
no flags
Patch 5 (41.80 KB, patch)
2012-12-13 00:03 PST, yosin
no flags
Patch 6 (42.92 KB, patch)
2012-12-13 00:54 PST, yosin
no flags
Patch 7 (42.87 KB, patch)
2012-12-13 22:08 PST, yosin
no flags
yosin
Comment 1 2012-12-12 01:57:23 PST
yosin
Comment 2 2012-12-12 01:58:40 PST
Comment on attachment 179003 [details] Patch 1 Could you review this patch? Thanks in advance.
Early Warning System Bot
Comment 3 2012-12-12 02:13:45 PST
WebKit Review Bot
Comment 4 2012-12-12 02:19:00 PST
Comment on attachment 179003 [details] Patch 1 Attachment 179003 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/15280431
yosin
Comment 5 2012-12-12 02:34:21 PST
yosin
Comment 6 2012-12-12 02:35:31 PST
Comment on attachment 179010 [details] Patch 2 Could you review this patch? Thanks in advance. = Changes from the last patch = * Fix compilation error on Linux ** Windows compilation was succeeded on Patch 1...
Build Bot
Comment 7 2012-12-12 03:10:49 PST
Hajime Morrita
Comment 8 2012-12-12 03:37:49 PST
Comment on attachment 179010 [details] Patch 2 View in context: https://bugs.webkit.org/attachment.cgi?id=179010&action=review > Source/WebCore/page/EventHandler.cpp:1057 > void EventHandler::stopAutoscrollTimer(bool rendererIsBeingDestroyed) This is bad. We should make this just a delegation to AutoScrollController then AutoScrollController can notify back to event handler to do cleanup. Hopefully more code could be move to the controller. > Source/WebCore/page/EventHandler.cpp:3940 > + , m_eventHandler(eventHandler) Can we pass this as a function parameter instead of holding this as a member? Cyclic reference is bad design and should be avoided as much as possible. > Source/WebCore/page/EventHandler.cpp:4078 > + bool east = m_panScrollStartPos.x() < (m_eventHandler->m_currentMousePosition.x() - ScrollView::noPanScrollRadius); If we can change to pass EventHandler as a parameter. We even no longer need to pass it: We only need to pass m_currentMousePosition and FrameView. > Source/WebCore/page/EventHandler.h:247 > + enum AutoscrollType { I think this is safe to be WebCore global. name looks unique enough. > Source/WebCore/page/EventHandler.h:255 > + class AutoscrollController { Let's move this out from EventHandler definition. nested class often results maintenance burden.
yosin
Comment 9 2012-12-12 23:37:24 PST
yosin
Comment 10 2012-12-12 23:48:51 PST
yosin
Comment 11 2012-12-13 00:03:57 PST
yosin
Comment 12 2012-12-13 00:06:18 PST
Comment on attachment 179212 [details] Patch 5 Could you review this patch? Thanks in advance. = Changes since the last review = * Move AutoscrollController class to its own files. * Remove m_eventHandler from AutoscrollController ** Using m_autoscrollRenderer->frame()->eventHandler() if we needed. * EventHandler::stopAutoscrollTimer() is just wrapper of AutoscrollController::stopAutoscrollTimer().
Hajime Morrita
Comment 13 2012-12-13 00:30:07 PST
Comment on attachment 179212 [details] Patch 5 View in context: https://bugs.webkit.org/attachment.cgi?id=179212&action=review This looks much better! > Source/WebCore/page/EventHandler.h:118 > + AutoscrollController& autoscrollController() { return m_autoscrollController; } Let's kill this. We can just provide didPanScrollStop() and didPanScrollStart() or something to limit the usage. > Source/WebCore/page/EventHandler.h:404 > + AutoscrollController m_autoscrollController; And make this OwnPtr. Then we can hide AutoscrollController.h in EventHandler.cpp.
yosin
Comment 14 2012-12-13 00:54:38 PST
yosin
Comment 15 2012-12-13 00:57:41 PST
Comment on attachment 179224 [details] Patch 6 Could you review this patch? Thanks in advance. = Changes since the last review = * In EventHandler, use OwnPtr for AutoscrollController instead of containment. * Introduce didPanScrollStart/didPanScrollTop not to exposure AutoscrollControll.
Hajime Morrita
Comment 16 2012-12-13 01:02:35 PST
Comment on attachment 179224 [details] Patch 6 Please wait until bots become green.
yosin
Comment 17 2012-12-13 17:46:52 PST
Comment on attachment 179224 [details] Patch 6 Clearing flags on attachment: 179224 Committed r137691: <http://trac.webkit.org/changeset/137691>
yosin
Comment 18 2012-12-13 17:46:58 PST
All reviewed patches have been landed. Closing bug.
Roger Fong
Comment 19 2012-12-13 18:47:24 PST
Regression caused: http://build.webkit.org/results/Apple%20Win%207%20Release%20(Tests)/r137691%20(30897)/results.html platform/win/fast/events/panScroll-click-hyperlink.html platform/win/fast/events/panScroll-event-fired.html platform/win/fast/events/panScroll-nested-divs.html It says the tests fail because pan scrolling may not be supported on the platform. However, seeing as this is just a refactor, that does not seem to be the case. Reopening bug.
Hajime Morrita
Comment 20 2012-12-13 18:59:20 PST
(In reply to comment #19) > Regression caused: > > http://build.webkit.org/results/Apple%20Win%207%20Release%20(Tests)/r137691%20(30897)/results.html > > platform/win/fast/events/panScroll-click-hyperlink.html > platform/win/fast/events/panScroll-event-fired.html > platform/win/fast/events/panScroll-nested-divs.html > > It says the tests fail because pan scrolling may not be supported on the platform. > However, seeing as this is just a refactor, that does not seem to be the case. > > Reopening bug. Thanks for the taking care of this. Yes, this patch shouldn't change the behavior.
yosin
Comment 21 2012-12-13 19:45:19 PST
Sorry, rolling out now.
yosin
Comment 22 2012-12-13 19:48:01 PST
Reverted r137691 for reason: panscroll test on AppleWin failed Committed r137703: <http://trac.webkit.org/changeset/137703>
yosin
Comment 23 2012-12-13 22:08:22 PST
yosin
Comment 24 2012-12-13 22:11:09 PST
Comment on attachment 179418 [details] Patch 7 Could you review this patch? Thanks in advance. = Changes since the last patch = * In EventHandler::handleMouseReleaseEvent, calling stopAutoscrollTimer() if autoscroll in progress. Previous patch does't check it. ** So, during pan-scrolling mouse up stops pan-scrolling, then some tests failed, e.g. panscroll-clicking-hyperlink.html
Hajime Morrita
Comment 25 2012-12-13 22:45:41 PST
On bug 104991, Yoshin is adding a test for Chromium port to cover this.
yosin
Comment 26 2012-12-14 00:33:27 PST
Comment on attachment 179418 [details] Patch 7 Clearing flags on attachment: 179418 Committed r137726: <http://trac.webkit.org/changeset/137726>
yosin
Comment 27 2012-12-14 00:33:33 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.