https://bugs.webkit.org/show_bug.cgi?id=96158
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Sep 2012 00:37:06 +0000 (00:37 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Sep 2012 00:37:06 +0000 (00:37 +0000)
commitfedec9063f02324890c1acf2ad8c53ebd6d3e8be
treed672e4fad09672c9e30db3ca43c4449c4e65803b
parent4421061358036accc0ae8ed0d501dec4e1d5a8af
https://bugs.webkit.org/show_bug.cgi?id=96158
Need API to suppress scrollbar animations
-and corresponding-
<rdar://problem/12210972>

Reviewed by Sam Weinig.

Source/WebCore:

This patch re-names ScrollableAre::isOnActivePage() to
ScrollableArea::scrollbarsCanBeActive(). The new name better reflects
how the function is actually used, and it allows us to use the same
function for the new API that has been added to WebKit2. Now when a
client has used that API to indicate that scrollbars should be
suppressed, ScrollableArea::scrollbarsCanBeActive() will return
false.

Page has a new member variable which indicated whether scrollbar
animations for all scrollbars associated with that page should be
suppressed. Whenever it is set to true (meaning the animations
should be suppressed), Page iterates through all of the
ScrollableAreas to tell each one to finishCurrentScrollAnimations().
* WebCore.exp.in:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setShouldSuppressScrollbarAnimations):
(WebCore):
* page/Page.h:
(WebCore::Page::shouldSuppressScrollbarAnimations):
(Page):

FrameView::isOnActivePage() is renamed to scrollbarsCanBeActive ()
and it will now return false if the Page says that scrollbar
animations should be suppressed.
* page/FrameView.cpp:
(WebCore::FrameView::scrollbarsCanBeActive):

scrollbarsCanBeActive() must now be a public member of FrameView so
that it can be called from RenderLayer and RenderListBox.
* page/FrameView.h:
(FrameView):

New ScrollAnimator function calls hideOverlayScrollers.
* platform/ScrollAnimator.h:
(WebCore::ScrollAnimator::finishCurrentScrollAnimations):
(ScrollAnimator):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::finishCurrentScrollAnimations):
(WebCore):
* platform/ScrollableArea.h:
(ScrollableArea):
* platform/mac/ScrollAnimatorMac.h:
(ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::finishCurrentScrollAnimations):

Re-name. isOnActivePage() -> scrollbarsCanBeActive()
(WebCore::FrameView::setAnimatorsAreActive):
(WebCore::FrameView::notifyPageThatContentAreaWillPaint):
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPainterControllerDelegate scrollerImpPair:setContentAreaNeedsDisplayInRect:]):
(WebCore::ScrollAnimatorMac::contentAreaWillPaint):
(WebCore::ScrollAnimatorMac::mouseEnteredContentArea):
(WebCore::ScrollAnimatorMac::mouseExitedContentArea):
(WebCore::ScrollAnimatorMac::mouseMovedInContentArea):
(WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
(WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
(WebCore::ScrollAnimatorMac::willStartLiveResize):
(WebCore::ScrollAnimatorMac::contentsResized):
(WebCore::ScrollAnimatorMac::willEndLiveResize):
(WebCore::ScrollAnimatorMac::contentAreaDidShow):
(WebCore::ScrollAnimatorMac::contentAreaDidHide):
(WebCore::ScrollAnimatorMac::didBeginScrollGesture):
(WebCore::ScrollAnimatorMac::didEndScrollGesture):
(WebCore::ScrollAnimatorMac::mayBeginScrollGesture):
(WebCore):
(WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
(WebCore::ScrollAnimatorMac::updateScrollerStyle):
* rendering/RenderLayer.cpp:

RenderLayer and RenderListBox should call into FrameView's
scrollbarsCanBeActive() so that they also return false when Page::
shouldSuppressScrollbarAnimations() is true.
(WebCore::RenderLayer::scrollbarsCanBeActive):
* rendering/RenderLayer.h:
(RenderLayer):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::scrollbarsCanBeActive):
* rendering/RenderListBox.h:

This is the one caller of ScrollableArea:: scrollbarsCanBeActive()
that needs to distinguish between the scrollbar-suppressing scenario
and the in-the-page-cache scenario.
* page/FocusController.cpp:
(WebCore::FocusController::setContainingWindowIsVisible):

Source/WebKit/chromium:

ScrollableArea::isOnActivePage() has been re-named to
ScrollableArea:: scrollbarsCanBeActive().
* src/ScrollbarGroup.cpp:
(WebKit::ScrollbarGroup::scrollbarsCanBeActive):
* src/ScrollbarGroup.h:
* tests/GraphicsLayerChromiumTest.cpp:
* tests/ScrollAnimatorNoneTest.cpp:
(MockScrollableArea):

Source/WebKit/win:

ScrollableArea::isOnActivePage() has been re-named to
ScrollableArea:: scrollbarsCanBeActive().
* WebScrollBar.cpp:
(WebScrollBar::scrollbarsCanBeActive):
* WebScrollBar.h:
(WebScrollBar):

Source/WebKit2:

Add suppressScrollbarAnimations as a WebCreationParameter.
* Shared/WebPageCreationParameters.h:
(WebPageCreationParameters):

New API. Calls into the web process for the setter but not the
getter.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetSuppressScrollbarAnimations):
(WKPageAreScrollbarAnimationsSuppressed):
* UIProcess/API/C/WKPage.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setSuppressScrollbarAnimations):
(WebKit):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
(WebKit::WebPageProxy::areScrollbarAnimationsSuppressed):
* WebProcess/WebPage/WebPage.messages.in:

Call into WebCore.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setSuppressScrollbarAnimations):
(WebKit):
* WebProcess/WebPage/WebPage.h:
(WebPage):

This ScrollableArea area function is re-named by this patch in
WebCore.
* WebProcess/Plugins/PDF/BuiltInPDFView.h:
* WebProcess/Plugins/PDF/BuiltInPDFView.mm:
(WebKit::BuiltInPDFView::scrollbarsCanBeActive):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@128134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
40 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/platform/ScrollAnimator.h
Source/WebCore/platform/ScrollableArea.cpp
Source/WebCore/platform/ScrollableArea.h
Source/WebCore/platform/chromium/FramelessScrollView.cpp
Source/WebCore/platform/chromium/FramelessScrollView.h
Source/WebCore/platform/mac/ScrollAnimatorMac.h
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/platform/win/PopupMenuWin.cpp
Source/WebCore/platform/win/PopupMenuWin.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderListBox.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/ScrollbarGroup.cpp
Source/WebKit/chromium/src/ScrollbarGroup.h
Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp
Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebScrollBar.cpp
Source/WebKit/win/WebScrollBar.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPageCreationParameters.h
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/win/WebPopupMenuProxyWin.h
Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h
Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in