Source/WebCore: Reviewed by Simon Fraser.
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 May 2011 17:25:02 +0000 (17:25 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 May 2011 17:25:02 +0000 (17:25 +0000)
commit3550432d9b2d02176a3050f7dca8b3ecdfd39f7d
tree40c9bc46a98f4e589c4cbc530fe4c11141196a74
parent4595f7f7a0df5dcccca3d7b801eb6e7328b82b30
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
47 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Node.cpp
Source/WebCore/loader/EmptyClients.h
Source/WebCore/page/ChromeClient.h
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/platform/ScrollableArea.h
Source/WebCore/platform/mac/ScrollAnimatorMac.h
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/ChromeClientImpl.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
Source/WebKit/haiku/ChangeLog
Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebChromeClient.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
Source/WebKit/wx/ChangeLog
Source/WebKit/wx/WebKitSupport/ChromeClientWx.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPage.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp