Source/WebCore: Reviewed by Simon Fraser.
Can't horizontally scroll iframes and overflow because wheel events are always accepted
https://bugs.webkit.org/show_bug.cgi?id=60779
* dom/Document.cpp:
(WebCore::Document::Document): Initialize wheel event handler count
(WebCore::Document::didAddWheelEventHandler): Increment count, and tell the main frame
to recalculate the total number of wheel event handlers in all of its frames' documents
(WebCore::Document::didRemoveWheelEventHandler): Reverse of previous method
* dom/Document.h:
(WebCore::Document::wheelEventHandlerCount): Access the count
* dom/Node.cpp:
(WebCore::tryAddEventListener): If the event listener is a mouse wheel event, then
tell the document to increment its count
(WebCore::tryRemoveEventListener): Reverse of previous method
* page/ChromeClient.h: Two new methods:
numWheelEventHandlersChanged: WebProcess tells UIProcess to update its cached
count of total wheel event handlers, which in this case only include horizontal
scrollbars and mouse wheel JS handlers
shouldRubberBandInDirection: allow the UIProcess to provide some control over
whether rubber banding is allowed when scrolling in a particular direction
* loader/EmptyClients.h:
(WebCore::EmptyChromeClient::numWheelEventHandlersChanged): Default empty impl
(WebCore::EmptyChromeClient::shouldRubberBandInDirection): Default empty impl
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent): Remove a redundant pointer check
* page/Frame.cpp:
(WebCore::Frame::setDocument): When the frame's document changes, calculate that
document's total wheel event handlers, and notify the UIProcess
(WebCore::Frame::notifyChromeClientWheelEventHandlerCountChanged): Performs a crawl
of the frame tree to aggregate the count
* page/Frame.h:
* platform/ScrollableArea.h: Virtualize didAddHorizontalScrollbar and
willRemoveHorizontalScrollbar for overriding in RenderLayer and FrameView
(WebCore::ScrollableArea::isHorizontalScrollerPinnedToMinimumPosition): Returns true if there is
no scrollbar or the scroller position is in the minimum scroll position.
(WebCore::ScrollableArea::isHorizontalScrollerPinnedToMaximumPosition): Converse of the above.
(WebCore::ScrollableArea::shouldRubberBandInDirection): Default impl
* page/FrameView.cpp:
(WebCore::FrameView::didAddHorizontalScrollbar): Updates the frame's document's count
(WebCore::FrameView::willRemoveHorizontalScrollbar): Updates the frame's document's
count
(WebCore::FrameView::shouldRubberBandInDirection): Connective glue
* page/FrameView.h: Adding overriding methods from ScrollableArea
* rendering/RenderLayer.cpp: Similar functionality to FrameView
(WebCore::RenderLayer::didAddHorizontalScrollbar):
(WebCore::RenderLayer::willRemoveHorizontalScrollbar):
* rendering/RenderLayer.h:
* platform/mac/ScrollAnimatorMac.h: Fix typo of "momentum"
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Fix typo of "momentum"
(WebCore::ScrollAnimatorMac::smoothScrollWithEvent): Fix typo of "coalesced"
(WebCore::ScrollAnimatorMac::beginScrollGesture): Fix typo of "coalesced"
(WebCore::ScrollAnimatorMac::snapRubberBand): Fix typo of "momentum"
(WebCore::ScrollAnimatorMac::handleWheelEvent): New logic for determining whether
to allow rubber-banding based on the area's scroll position and the wheel event.
Could prevent accepting the wheel event. Also, fix typo of "momentum"
(WebCore::isScrollingLeftAndShouldNotRubberBand): Inline helper function for logic
(WebCore::isScrollingRightAndShouldNotRubberBand): Inline helper function for logic
Source/WebKit/chromium: Can't horizontally scroll iframes and overflow because wheel events are always accepted
https://bugs.webkit.org/show_bug.cgi?id=60779
Reviewed by Simon Fraser.
* src/ChromeClientImpl.h:
(WebKit::ChromeClientImpl::shouldRubberBandInDirection): Default impl of new ChromeClient method
(WebKit::ChromeClientImpl::numWheelEventHandlersChanged): Default impl of new ChromeClient method
Source/WebKit/efl: Can't horizontally scroll iframes and overflow because wheel events are always accepted
https://bugs.webkit.org/show_bug.cgi?id=60779
Reviewed by Simon Fraser.
* WebCoreSupport/ChromeClientEfl.h:
(WebCore::ChromeClientEfl::shouldRubberBandInDirection): Default impl of new ChromeClient method
(WebCore::ChromeClientEfl::numWheelEventHandlersChanged): Default impl of new ChromeClient method
Source/WebKit/gtk: Can't horizontally scroll iframes and overflow because wheel events are always accepted
https://bugs.webkit.org/show_bug.cgi?id=60779
Reviewed by Simon Fraser.
* WebCoreSupport/ChromeClientGtk.h:
(WebKit::ChromeClient::shouldRubberBandInDirection): Default impl of new ChromeClient method
(WebKit::ChromeClient::numWheelEventHandlersChanged): Default impl of new ChromeClient method
Source/WebKit/haiku: Can't horizontally scroll iframes and overflow because wheel events are always accepted
https://bugs.webkit.org/show_bug.cgi?id=60779
Reviewed by Simon Fraser.
* WebCoreSupport/ChromeClientHaiku.h:
(WebCore::ChromeClientHaiku::shouldRubberBandInDirection): Default impl of new ChromeClient method
(WebCore::ChromeClientHaiku::numWheelEventHandlersChanged): Default impl of new ChromeClient method
Source/WebKit/mac: Can't horizontally scroll iframes and overflow because wheel events are always accepted
https://bugs.webkit.org/show_bug.cgi?id=60779
Reviewed by Simon Fraser.
* WebCoreSupport/WebChromeClient.h:
(WebChromeClient::numWheelEventHandlersChanged): Default impl of new ChromeClient method
(WebChromeClient::shouldRubberBandInDirection): Default impl of new ChromeClient method
Source/WebKit/qt: Can't horizontally scroll iframes and overflow because wheel events are always accepted
https://bugs.webkit.org/show_bug.cgi?id=60779
Reviewed by Simon Fraser.
* WebCoreSupport/ChromeClientQt.h:
(WebCore::ChromeClientQt::shouldRubberBandInDirection): Default impl of new ChromeClient method
(WebCore::ChromeClientQt::numWheelEventHandlersChanged): Default impl of new ChromeClient method
Source/WebKit/win: Can't horizontally scroll iframes and overflow because wheel events are always accepted
https://bugs.webkit.org/show_bug.cgi?id=60779
Reviewed by Simon Fraser.
* WebCoreSupport/WebChromeClient.h:
(WebChromeClient::shouldRubberBandInDirection): Default impl of new ChromeClient method
(WebChromeClient::numWheelEventHandlersChanged): Default impl of new ChromeClient method
Source/WebKit/wince: Can't horizontally scroll iframes and overflow because wheel events are always accepted
https://bugs.webkit.org/show_bug.cgi?id=60779
Reviewed by Simon Fraser.
* WebCoreSupport/ChromeClientWinCE.h:
(WebKit::ChromeClientWinCE::shouldRubberBandInDirection): Default impl of new ChromeClient method
(WebKit::ChromeClientWinCE::numWheelEventHandlersChanged): Default impl of new ChromeClient method
Source/WebKit/wx: Can't horizontally scroll iframes and overflow because wheel events are always accepted
https://bugs.webkit.org/show_bug.cgi?id=60779
Reviewed by Simon Fraser.
* WebKitSupport/ChromeClientWx.h:
(WebCore::ChromeClientWx::shouldRubberBandInDirection): Default impl of new ChromeClient method
(WebCore::ChromeClientWx::numWheelEventHandlersChanged): Default impl of new ChromeClient method
Source/WebKit2: Can't horizontally scroll iframes and overflow because wheel events are always accepted
https://bugs.webkit.org/show_bug.cgi?id=60779
Reviewed by Simon Fraser.
We keep track of the number of horizontal scrollbars and mouse wheel event handlers in the
UI process as a means of determining whether horizontal scroll events will be handled
by the web process.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::willHandleHorizontalScrollEvents): Return true if there is at least
one wheel event handler
* UIProcess/WebPageProxy.h: Add new variable to cache the count
(WebKit::WebPageProxy::numWheelEventHandlersChanged): Sets the count
The rest just provides all the connections.
* UIProcess/API/C/WKPage.cpp:
(WKPageWillHandleHorizontalScrollEvents):
* UIProcess/API/C/WKPage.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
(WebKit::InjectedBundlePageUIClient::shouldRubberBandInDirection):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::shouldRubberBandInDirection): Forward to injected bundle UI client
(WebKit::WebChromeClient::updateCountWheelEventHandlers): Updates the web page proxy
* WebProcess/WebCoreSupport/WebChromeClient.h:
Tools: Can't horizontally scroll iframes and overflow because wheel events are always accepted
https://bugs.webkit.org/show_bug.cgi?id=60779
Reviewed by Simon Fraser.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage): Set new default method to nil.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@86584
268f45cc-cd09-0410-ab3c-
d52691b4dbfc