Remove scrolling tree dependency on wheel event handler counts, and use fast scrollin...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Apr 2015 18:30:39 +0000 (18:30 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Apr 2015 18:30:39 +0000 (18:30 +0000)
commit21b892cd00736f4465d942c25ee45ba6382cd09f
treefc8c3a8a6a7363a1462f5bbd2ad95b84b3b148f4
parent5f572e1960054fdad91a14392af2dedf18152498
Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
https://bugs.webkit.org/show_bug.cgi?id=143288
rdar://problem/16049624

Reviewed by Beth Dakin.

Remove the wheel event counting that Document does, and passes into the scrolling tree.
The ScrollingTree now just uses the non-fast scrollable region to determine when to
fast scroll on pages with wheel event handlers.

If a handler includes position:fixed renderers, we just cover the whole document
with the slow-scrolling region currently. This could be improved.

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::wheelEventHandlersChanged):
(WebCore::Document::didAddWheelEventHandler):
(WebCore::Document::didRemoveWheelEventHandler):
(WebCore::Document::wheelEventHandlerCount):
(WebCore::Document::touchEventHandlerCount):
(WebCore::Document::absoluteRegionForEventTargets): Changed to return a pair<Region, bool>
where the bool indicates whether any handler includes position:fixed content.
(WebCore::pageWheelEventHandlerCountChanged): Deleted.
(WebCore::wheelEventHandlerCountChanged): Deleted.
* dom/Document.h:
(WebCore::Document::wheelEventHandlerCount): Deleted.
* loader/EmptyClients.h:
* page/ChromeClient.h:
* page/DebugPageOverlays.cpp:
(WebCore::MouseWheelRegionOverlay::updateRegion):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
(WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
(WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::ScrollingCoordinator::computeCurrentWheelEventHandlerCount): Deleted.
(WebCore::ScrollingCoordinator::frameViewWheelEventHandlerCountChanged): Deleted.
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setWheelEventHandlerCount): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::ScrollingTree):
(WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
(WebCore::ScrollingTree::commitNewTreeState):
* page/scrolling/ScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::updateTiledScrollingIndicator):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
(WebCore::logWheelEventHandlerCountChanged): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::touchEventHandlerCount):

Source/WebKit/mac:
Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
https://bugs.webkit.org/show_bug.cgi?id=143288

Reviewed by Beth Dakin.

Remove the wheel event counting that Document does, and passes into the scrolling tree.
The ScrollingTree now just uses the non-fast scrollable region to determine when to
fast scroll on pages with wheel event handlers.

* WebCoreSupport/WebChromeClient.h:

Source/WebKit2:
Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
https://bugs.webkit.org/show_bug.cgi?id=143288
rdar://problem/16049624

Reviewed by Beth Dakin.

Remove the wheel event counting that Document does, and passes into the scrolling tree.
The ScrollingTree now just uses the non-fast scrollable region to determine when to
fast scroll on pages with wheel event handlers.

If a handler includes position:fixed renderers, we just cover the whole document
with the slow-scrolling region currently. This could be improved.

* Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
(WebKit::RemoteScrollingTreeTextStream::dump):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::wheelEventHandlersChanged):
(WebKit::WebChromeClient::numWheelEventHandlersChanged): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::wheelEventHandlersChanged):
(WebKit::WebPage::recomputeShortCircuitHorizontalWheelEventsState):
(WebKit::WebPage::numWheelEventHandlersChanged): Deleted.
* WebProcess/WebPage/WebPage.h:

LayoutTests:
Make it possible to compute a region for elements on the page that have wheel event handlers
https://bugs.webkit.org/show_bug.cgi?id=142807

Reviewed by Beth Dakin.

Update results, since any handler with position:fixed now causes the region to cover the document.

* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/loader/EmptyClients.h
Source/WebCore/page/ChromeClient.h
Source/WebCore/page/DebugPageOverlays.cpp
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
Source/WebCore/page/scrolling/ScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h
Source/WebCore/page/scrolling/ScrollingTree.cpp
Source/WebCore/page/scrolling/ScrollingTree.h
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
Source/WebCore/testing/Internals.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h