[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
weinig at apple.com
weinig at apple.com
Sun Feb 20 23:34:27 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit d7d77c3e91849ad1f5dcbf3d849713f3c84e2076
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 21 20:15:04 2011 +0000
Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
https://bugs.webkit.org/show_bug.cgi?id=52779
Reviewed by Anders Carlsson.
Rename ScrollbarClient -> ScrollableArea.
Source/WebCore:
- Also replaces Scrollbar::setClient with Scrollbar::disconnectFromScrollableArea
since that was its only use case.
* CMakeLists.txt:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AccessibilityScrollbar.cpp:
(WebCore::AccessibilityScrollbar::setValue):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::SelectorChecker::checkScrollbarPseudoClass):
* page/FrameView.h:
* platform/PopupMenuClient.h:
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::create):
(WebCore::ScrollAnimator::ScrollAnimator):
(WebCore::ScrollAnimator::scroll):
(WebCore::ScrollAnimator::notityPositionChanged):
* platform/ScrollAnimator.h:
* platform/ScrollAnimatorWin.cpp:
(WebCore::ScrollAnimator::create):
(WebCore::ScrollAnimatorWin::ScrollAnimatorWin):
(WebCore::ScrollAnimatorWin::scroll):
* platform/ScrollAnimatorWin.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::scroll):
(WebCore::ScrollView::updateScrollbars):
(WebCore::ScrollView::wheelEvent):
* platform/ScrollView.h:
* platform/ScrollableArea.cpp: Copied from WebCore/platform/ScrollbarClient.cpp.
(WebCore::ScrollableArea::ScrollableArea):
(WebCore::ScrollableArea::~ScrollableArea):
(WebCore::ScrollableArea::scroll):
(WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
(WebCore::ScrollableArea::scrollToXOffsetWithoutAnimation):
(WebCore::ScrollableArea::scrollToYOffsetWithoutAnimation):
(WebCore::ScrollableArea::setScrollOffsetFromAnimation):
* platform/ScrollableArea.h: Copied from WebCore/platform/ScrollbarClient.h.
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::createNativeScrollbar):
(WebCore::Scrollbar::Scrollbar):
(WebCore::Scrollbar::offsetDidChange):
(WebCore::Scrollbar::autoscrollPressedPart):
(WebCore::Scrollbar::moveThumb):
(WebCore::Scrollbar::mouseMoved):
(WebCore::Scrollbar::isWindowActive):
(WebCore::Scrollbar::invalidateRect):
(WebCore::Scrollbar::convertToContainingView):
(WebCore::Scrollbar::convertFromContainingView):
* platform/Scrollbar.h:
(WebCore::Scrollbar::disconnectFromScrollableArea):
(WebCore::Scrollbar::scrollableArea):
* platform/ScrollbarClient.cpp: Removed.
* platform/ScrollbarClient.h: Removed.
* platform/ScrollbarThemeComposite.cpp:
* platform/chromium/FramelessScrollView.h:
* platform/chromium/ScrollbarThemeChromium.cpp:
(WebCore::ScrollbarThemeChromium::paintTickmarks):
* platform/efl/ScrollbarEfl.cpp:
(Scrollbar::createNativeScrollbar):
(ScrollbarEfl::ScrollbarEfl):
(scrollbarEflEdjeMessage):
* platform/efl/ScrollbarEfl.h:
* platform/gtk/MainFrameScrollbarGtk.cpp:
(MainFrameScrollbarGtk::create):
(MainFrameScrollbarGtk::MainFrameScrollbarGtk):
(MainFrameScrollbarGtk::gtkValueChanged):
* platform/gtk/MainFrameScrollbarGtk.h:
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimator::create):
(WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::scroll):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::paint):
* platform/qt/ScrollbarQt.cpp:
(WebCore::Scrollbar::contextMenu):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::scrollToRevealSelection):
(WebCore::PopupMenuWin::wndProc):
* platform/win/PopupMenuWin.h:
* platform/win/ScrollbarThemeSafari.cpp:
(WebCore::ScrollbarThemeSafari::paintTrackBackground):
(WebCore::ScrollbarThemeSafari::paintButton):
(WebCore::ScrollbarThemeSafari::paintThumb):
* platform/wx/ScrollbarThemeWx.cpp:
(WebCore::ScrollbarThemeWx::paint):
* rendering/RenderDataGrid.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollToOffset):
(WebCore::RenderLayer::destroyScrollbar):
(WebCore::RenderLayer::scroll):
* rendering/RenderLayer.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::scrollToRevealElementAtListIndex):
(WebCore::RenderListBox::scroll):
(WebCore::RenderListBox::logicalScroll):
(WebCore::RenderListBox::setScrollTop):
(WebCore::RenderListBox::destroyScrollbar):
* rendering/RenderListBox.h:
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::createScrollbar):
* rendering/RenderMenuList.h:
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::createCustomScrollbar):
(WebCore::RenderScrollbar::RenderScrollbar):
* rendering/RenderScrollbar.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::createScrollbar):
* rendering/RenderTextControlSingleLine.h:
Source/WebKit/chromium:
* src/AutoFillPopupMenuClient.cpp:
(WebKit::AutoFillPopupMenuClient::createScrollbar):
* src/AutoFillPopupMenuClient.h:
* src/WebScrollbarImpl.cpp:
(WebKit::WebScrollbarImpl::WebScrollbarImpl):
(WebKit::WebScrollbarImpl::scroll):
(WebKit::WebScrollbarImpl::onMouseWheel):
(WebKit::WebScrollbarImpl::onKeyDown):
* src/WebScrollbarImpl.h:
* tests/PopupMenuTest.cpp:
(WebKit::TestPopupMenuClient::createScrollbar):
Source/WebKit/qt:
* Api/qwebframe.cpp:
(QWebFrame::setScrollBarValue):
Source/WebKit/win:
* WebScrollBar.cpp:
(WebScrollBar::scroll):
* WebScrollBar.h:
Source/WebKit2:
* UIProcess/win/WebPopupMenuProxyWin.cpp:
(WebKit::WebPopupMenuProxyWin::onMouseWheel):
(WebKit::WebPopupMenuProxyWin::scrollToRevealSelection):
* UIProcess/win/WebPopupMenuProxyWin.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index 272c66d..95d8790 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -1311,8 +1311,8 @@ SET(WebCore_SOURCES
platform/Logging.cpp
platform/MIMETypeRegistry.cpp
platform/ScrollAnimator.cpp
+ platform/ScrollableArea.cpp
platform/Scrollbar.cpp
- platform/ScrollbarClient.cpp
platform/ScrollbarThemeComposite.cpp
platform/ScrollView.cpp
platform/SharedBuffer.cpp
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 65d7a5e..a5ca3e2 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,125 @@
+2011-01-21 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
+ https://bugs.webkit.org/show_bug.cgi?id=52779
+
+ Rename ScrollbarClient -> ScrollableArea.
+
+ - Also replaces Scrollbar::setClient with Scrollbar::disconnectFromScrollableArea
+ since that was its only use case.
+
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * accessibility/AccessibilityScrollbar.cpp:
+ (WebCore::AccessibilityScrollbar::setValue):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::SelectorChecker::checkScrollbarPseudoClass):
+ * page/FrameView.h:
+ * platform/PopupMenuClient.h:
+ * platform/ScrollAnimator.cpp:
+ (WebCore::ScrollAnimator::create):
+ (WebCore::ScrollAnimator::ScrollAnimator):
+ (WebCore::ScrollAnimator::scroll):
+ (WebCore::ScrollAnimator::notityPositionChanged):
+ * platform/ScrollAnimator.h:
+ * platform/ScrollAnimatorWin.cpp:
+ (WebCore::ScrollAnimator::create):
+ (WebCore::ScrollAnimatorWin::ScrollAnimatorWin):
+ (WebCore::ScrollAnimatorWin::scroll):
+ * platform/ScrollAnimatorWin.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::scroll):
+ (WebCore::ScrollView::updateScrollbars):
+ (WebCore::ScrollView::wheelEvent):
+ * platform/ScrollView.h:
+ * platform/ScrollableArea.cpp: Copied from WebCore/platform/ScrollbarClient.cpp.
+ (WebCore::ScrollableArea::ScrollableArea):
+ (WebCore::ScrollableArea::~ScrollableArea):
+ (WebCore::ScrollableArea::scroll):
+ (WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
+ (WebCore::ScrollableArea::scrollToXOffsetWithoutAnimation):
+ (WebCore::ScrollableArea::scrollToYOffsetWithoutAnimation):
+ (WebCore::ScrollableArea::setScrollOffsetFromAnimation):
+ * platform/ScrollableArea.h: Copied from WebCore/platform/ScrollbarClient.h.
+ * platform/Scrollbar.cpp:
+ (WebCore::Scrollbar::createNativeScrollbar):
+ (WebCore::Scrollbar::Scrollbar):
+ (WebCore::Scrollbar::offsetDidChange):
+ (WebCore::Scrollbar::autoscrollPressedPart):
+ (WebCore::Scrollbar::moveThumb):
+ (WebCore::Scrollbar::mouseMoved):
+ (WebCore::Scrollbar::isWindowActive):
+ (WebCore::Scrollbar::invalidateRect):
+ (WebCore::Scrollbar::convertToContainingView):
+ (WebCore::Scrollbar::convertFromContainingView):
+ * platform/Scrollbar.h:
+ (WebCore::Scrollbar::disconnectFromScrollableArea):
+ (WebCore::Scrollbar::scrollableArea):
+ * platform/ScrollbarClient.cpp: Removed.
+ * platform/ScrollbarClient.h: Removed.
+ * platform/ScrollbarThemeComposite.cpp:
+ * platform/chromium/FramelessScrollView.h:
+ * platform/chromium/ScrollbarThemeChromium.cpp:
+ (WebCore::ScrollbarThemeChromium::paintTickmarks):
+ * platform/efl/ScrollbarEfl.cpp:
+ (Scrollbar::createNativeScrollbar):
+ (ScrollbarEfl::ScrollbarEfl):
+ (scrollbarEflEdjeMessage):
+ * platform/efl/ScrollbarEfl.h:
+ * platform/gtk/MainFrameScrollbarGtk.cpp:
+ (MainFrameScrollbarGtk::create):
+ (MainFrameScrollbarGtk::MainFrameScrollbarGtk):
+ (MainFrameScrollbarGtk::gtkValueChanged):
+ * platform/gtk/MainFrameScrollbarGtk.h:
+ * platform/mac/ScrollAnimatorMac.h:
+ * platform/mac/ScrollAnimatorMac.mm:
+ (WebCore::ScrollAnimator::create):
+ (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
+ (WebCore::ScrollAnimatorMac::scroll):
+ * platform/mac/ScrollbarThemeMac.mm:
+ (WebCore::ScrollbarThemeMac::paint):
+ * platform/qt/ScrollbarQt.cpp:
+ (WebCore::Scrollbar::contextMenu):
+ * platform/win/PopupMenuWin.cpp:
+ (WebCore::PopupMenuWin::scrollToRevealSelection):
+ (WebCore::PopupMenuWin::wndProc):
+ * platform/win/PopupMenuWin.h:
+ * platform/win/ScrollbarThemeSafari.cpp:
+ (WebCore::ScrollbarThemeSafari::paintTrackBackground):
+ (WebCore::ScrollbarThemeSafari::paintButton):
+ (WebCore::ScrollbarThemeSafari::paintThumb):
+ * platform/wx/ScrollbarThemeWx.cpp:
+ (WebCore::ScrollbarThemeWx::paint):
+ * rendering/RenderDataGrid.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::scrollToOffset):
+ (WebCore::RenderLayer::destroyScrollbar):
+ (WebCore::RenderLayer::scroll):
+ * rendering/RenderLayer.h:
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::scrollToRevealElementAtListIndex):
+ (WebCore::RenderListBox::scroll):
+ (WebCore::RenderListBox::logicalScroll):
+ (WebCore::RenderListBox::setScrollTop):
+ (WebCore::RenderListBox::destroyScrollbar):
+ * rendering/RenderListBox.h:
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::createScrollbar):
+ * rendering/RenderMenuList.h:
+ * rendering/RenderScrollbar.cpp:
+ (WebCore::RenderScrollbar::createCustomScrollbar):
+ (WebCore::RenderScrollbar::RenderScrollbar):
+ * rendering/RenderScrollbar.h:
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::createScrollbar):
+ * rendering/RenderTextControlSingleLine.h:
+
2011-01-21 Darin Adler <darin at apple.com>
Fix Leopard build.
diff --git a/Source/WebCore/GNUmakefile.am b/Source/WebCore/GNUmakefile.am
index 19c3179..0975094 100644
--- a/Source/WebCore/GNUmakefile.am
+++ b/Source/WebCore/GNUmakefile.am
@@ -2574,8 +2574,8 @@ webcore_sources += \
Source/WebCore/platform/SchemeRegistry.h \
Source/WebCore/platform/ScrollAnimator.cpp \
Source/WebCore/platform/ScrollAnimator.h \
- Source/WebCore/platform/ScrollbarClient.cpp \
- Source/WebCore/platform/ScrollbarClient.h \
+ Source/WebCore/platform/ScrollableArea.cpp \
+ Source/WebCore/platform/ScrollableArea.h \
Source/WebCore/platform/Scrollbar.cpp \
Source/WebCore/platform/Scrollbar.h \
Source/WebCore/platform/ScrollbarThemeComposite.cpp \
diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi
index 0348c06..ca3ab04 100644
--- a/Source/WebCore/WebCore.gypi
+++ b/Source/WebCore/WebCore.gypi
@@ -3512,10 +3512,10 @@
'platform/ScrollView.h',
'platform/SchemeRegistry.cpp',
'platform/SchemeRegistry.h',
+ 'platform/ScrollableArea.cpp',
+ 'platform/ScrollableArea.h',
'platform/Scrollbar.cpp',
'platform/Scrollbar.h',
- 'platform/ScrollbarClient.cpp',
- 'platform/ScrollbarClient.h',
'platform/ScrollbarTheme.h',
'platform/ScrollbarThemeComposite.cpp',
'platform/ScrollbarThemeComposite.h',
diff --git a/Source/WebCore/WebCore.pro b/Source/WebCore/WebCore.pro
index ff1072a..7b953f3 100644
--- a/Source/WebCore/WebCore.pro
+++ b/Source/WebCore/WebCore.pro
@@ -1255,9 +1255,9 @@ SOURCES += \
platform/network/ResourceResponseBase.cpp \
platform/text/RegularExpression.cpp \
platform/SchemeRegistry.cpp \
+ platform/ScrollableArea.cpp \
platform/ScrollAnimator.cpp \
platform/Scrollbar.cpp \
- platform/ScrollbarClient.cpp \
platform/ScrollbarThemeComposite.cpp \
platform/ScrollView.cpp \
platform/text/SegmentedString.cpp \
@@ -2194,9 +2194,9 @@ HEADERS += \
platform/qt/QtStyleOptionWebComboBox.h \
platform/qt/RenderThemeQt.h \
platform/qt/ScrollbarThemeQt.h \
+ platform/ScrollableArea.h \
platform/ScrollAnimator.h \
platform/Scrollbar.h \
- platform/ScrollbarClient.h \
platform/ScrollbarThemeComposite.h \
platform/ScrollView.h \
platform/SearchPopupMenu.h \
diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
index 009c8ea..f1da922 100755
--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -25754,19 +25754,19 @@
>
</File>
<File
- RelativePath="..\platform\Scrollbar.cpp"
+ RelativePath="..\platform\ScrollableArea.cpp"
>
</File>
<File
- RelativePath="..\platform\Scrollbar.h"
+ RelativePath="..\platform\ScrollableArea.h"
>
</File>
<File
- RelativePath="..\platform\ScrollbarClient.cpp"
+ RelativePath="..\platform\Scrollbar.cpp"
>
</File>
<File
- RelativePath="..\platform\ScrollbarClient.h"
+ RelativePath="..\platform\Scrollbar.h"
>
</File>
<File
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index 8f86edf..4f01530 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -5059,6 +5059,8 @@
BC82432A0D0CE8A200460C8F /* JSSQLTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8243260D0CE8A200460C8F /* JSSQLTransaction.h */; };
BC8243E80D0CFD7500460C8F /* WindowFeatures.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8243E60D0CFD7500460C8F /* WindowFeatures.cpp */; };
BC8243E90D0CFD7500460C8F /* WindowFeatures.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8243E70D0CFD7500460C8F /* WindowFeatures.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ BC8AE34E12EA096A00EB3AE6 /* ScrollableArea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8AE34C12EA096A00EB3AE6 /* ScrollableArea.cpp */; };
+ BC8AE34F12EA096A00EB3AE6 /* ScrollableArea.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8AE34D12EA096A00EB3AE6 /* ScrollableArea.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8B853C0E7C7F1100AB6984 /* ScrollbarThemeMac.h */; };
BC8B854B0E7C7F5600AB6984 /* ScrollbarTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8B854A0E7C7F5600AB6984 /* ScrollbarTheme.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC8BF151105813BF00A40A07 /* UserStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8BF150105813BF00A40A07 /* UserStyleSheet.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5093,8 +5095,6 @@
BC99812E0DBE807A008CE9EF /* DOMAbstractViewFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = BC99812D0DBE807A008CE9EF /* DOMAbstractViewFrame.h */; };
BC9ADD230CC4032600098C4C /* WebKitCSSTransformValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9ADD220CC4032600098C4C /* WebKitCSSTransformValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC9ADD800CC4092200098C4C /* WebKitCSSTransformValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9ADD7F0CC4092200098C4C /* WebKitCSSTransformValue.cpp */; };
- BC9BC64D0E7C4889008B9849 /* ScrollbarClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9BC64B0E7C4889008B9849 /* ScrollbarClient.cpp */; settings = {ATTRIBUTES = (Private, ); }; };
- BC9BC64E0E7C4889008B9849 /* ScrollbarClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9BC64C0E7C4889008B9849 /* ScrollbarClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCA169A20BFD55B40019CA76 /* JSHTMLTableCaptionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA169A00BFD55B40019CA76 /* JSHTMLTableCaptionElement.cpp */; };
BCA169A30BFD55B40019CA76 /* JSHTMLTableCaptionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA169A10BFD55B40019CA76 /* JSHTMLTableCaptionElement.h */; };
BCA257151293C010007A263D /* VerticalPositionCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA257141293C010007A263D /* VerticalPositionCache.h */; };
@@ -11367,6 +11367,8 @@
BC8243260D0CE8A200460C8F /* JSSQLTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLTransaction.h; sourceTree = "<group>"; };
BC8243E60D0CFD7500460C8F /* WindowFeatures.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowFeatures.cpp; sourceTree = "<group>"; };
BC8243E70D0CFD7500460C8F /* WindowFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowFeatures.h; sourceTree = "<group>"; };
+ BC8AE34C12EA096A00EB3AE6 /* ScrollableArea.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollableArea.cpp; sourceTree = "<group>"; };
+ BC8AE34D12EA096A00EB3AE6 /* ScrollableArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollableArea.h; sourceTree = "<group>"; };
BC8B853C0E7C7F1100AB6984 /* ScrollbarThemeMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeMac.h; sourceTree = "<group>"; };
BC8B854A0E7C7F5600AB6984 /* ScrollbarTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarTheme.h; sourceTree = "<group>"; };
BC8BF150105813BF00A40A07 /* UserStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserStyleSheet.h; sourceTree = "<group>"; };
@@ -11404,8 +11406,6 @@
BC99812D0DBE807A008CE9EF /* DOMAbstractViewFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMAbstractViewFrame.h; sourceTree = "<group>"; };
BC9ADD220CC4032600098C4C /* WebKitCSSTransformValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebKitCSSTransformValue.h; sourceTree = "<group>"; };
BC9ADD7F0CC4092200098C4C /* WebKitCSSTransformValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSTransformValue.cpp; sourceTree = "<group>"; };
- BC9BC64B0E7C4889008B9849 /* ScrollbarClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollbarClient.cpp; sourceTree = "<group>"; };
- BC9BC64C0E7C4889008B9849 /* ScrollbarClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarClient.h; sourceTree = "<group>"; };
BCA169A00BFD55B40019CA76 /* JSHTMLTableCaptionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLTableCaptionElement.cpp; sourceTree = "<group>"; };
BCA169A10BFD55B40019CA76 /* JSHTMLTableCaptionElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLTableCaptionElement.h; sourceTree = "<group>"; };
BCA257141293C010007A263D /* VerticalPositionCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VerticalPositionCache.h; sourceTree = "<group>"; };
@@ -18290,12 +18290,12 @@
1C63A2460F71646600C09D5A /* RunLoopTimer.h */,
5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */,
5162C7F311F77EFB00612EFE /* SchemeRegistry.h */,
+ BC8AE34C12EA096A00EB3AE6 /* ScrollableArea.cpp */,
+ BC8AE34D12EA096A00EB3AE6 /* ScrollableArea.h */,
CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */,
CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */,
BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */,
BC7B2AF80450824100A8000F /* Scrollbar.h */,
- BC9BC64B0E7C4889008B9849 /* ScrollbarClient.cpp */,
- BC9BC64C0E7C4889008B9849 /* ScrollbarClient.h */,
BC8B854A0E7C7F5600AB6984 /* ScrollbarTheme.h */,
BC1402880E83680800319717 /* ScrollbarThemeComposite.cpp */,
BC1402890E83680800319717 /* ScrollbarThemeComposite.h */,
@@ -21827,7 +21827,6 @@
CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */,
BCAE1FA712939DB7004CB026 /* ScrollAnimatorMac.h in Headers */,
93F199B808245E59001E9ABC /* Scrollbar.h in Headers */,
- BC9BC64E0E7C4889008B9849 /* ScrollbarClient.h in Headers */,
BC8B854B0E7C7F5600AB6984 /* ScrollbarTheme.h in Headers */,
BC14028B0E83680800319717 /* ScrollbarThemeComposite.h in Headers */,
BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */,
@@ -22411,6 +22410,7 @@
93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
+ BC8AE34F12EA096A00EB3AE6 /* ScrollableArea.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -24621,7 +24621,6 @@
CA3BF67C10D99BAE00E6CE53 /* ScrollAnimator.cpp in Sources */,
BC51156E12B1749C00C96754 /* ScrollAnimatorMac.mm in Sources */,
BCAA90C30A7EBA60008B1229 /* Scrollbar.cpp in Sources */,
- BC9BC64D0E7C4889008B9849 /* ScrollbarClient.cpp in Sources */,
BC14028A0E83680800319717 /* ScrollbarThemeComposite.cpp in Sources */,
BCEF869F0E844E9D00A85CD5 /* ScrollbarThemeMac.mm in Sources */,
5D925B670F64D4DD00B847F0 /* ScrollBehavior.cpp in Sources */,
@@ -25106,6 +25105,7 @@
93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
+ BC8AE34E12EA096A00EB3AE6 /* ScrollableArea.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/WebCore/accessibility/AccessibilityScrollbar.cpp b/Source/WebCore/accessibility/AccessibilityScrollbar.cpp
index b261a46..b225af8 100644
--- a/Source/WebCore/accessibility/AccessibilityScrollbar.cpp
+++ b/Source/WebCore/accessibility/AccessibilityScrollbar.cpp
@@ -97,11 +97,11 @@ void AccessibilityScrollbar::setValue(float value)
if (!m_scrollbar)
return;
- if (!m_scrollbar->client())
+ if (!m_scrollbar->scrollableArea())
return;
float newValue = value * m_scrollbar->maximum();
- m_scrollbar->client()->scrollToOffsetWithoutAnimation(m_scrollbar->orientation(), newValue);
+ m_scrollbar->scrollableArea()->scrollToOffsetWithoutAnimation(m_scrollbar->orientation(), newValue);
}
} // namespace WebCore
diff --git a/Source/WebCore/css/CSSStyleSelector.cpp b/Source/WebCore/css/CSSStyleSelector.cpp
index 27b44d2..63090cf 100644
--- a/Source/WebCore/css/CSSStyleSelector.cpp
+++ b/Source/WebCore/css/CSSStyleSelector.cpp
@@ -2867,7 +2867,7 @@ bool CSSStyleSelector::SelectorChecker::checkScrollbarPseudoClass(CSSSelector* s
return false;
}
case CSSSelector::PseudoCornerPresent:
- return scrollbar->client()->scrollbarCornerPresent();
+ return scrollbar->scrollableArea()->scrollbarCornerPresent();
default:
return false;
}
diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h
index 174619d..8491f5c 100644
--- a/Source/WebCore/page/FrameView.h
+++ b/Source/WebCore/page/FrameView.h
@@ -294,7 +294,7 @@ private:
virtual IntPoint convertToContainingView(const IntPoint&) const;
virtual IntPoint convertFromContainingView(const IntPoint&) const;
- // ScrollBarClient interface
+ // ScrollableArea interface
virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
virtual bool isActive() const;
virtual void getTickmarks(Vector<IntRect>&) const;
diff --git a/Source/WebCore/platform/PopupMenuClient.h b/Source/WebCore/platform/PopupMenuClient.h
index 45912a1..f33b9e2 100644
--- a/Source/WebCore/platform/PopupMenuClient.h
+++ b/Source/WebCore/platform/PopupMenuClient.h
@@ -32,7 +32,7 @@ class Color;
class FontSelector;
class HostWindow;
class Scrollbar;
-class ScrollbarClient;
+class ScrollableArea;
class PopupMenuClient {
public:
@@ -66,7 +66,7 @@ public:
virtual FontSelector* fontSelector() const = 0;
virtual HostWindow* hostWindow() const = 0;
- virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize) = 0;
+ virtual PassRefPtr<Scrollbar> createScrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize) = 0;
};
#if ENABLE(NO_LISTBOX_RENDERING)
diff --git a/Source/WebCore/platform/ScrollAnimator.cpp b/Source/WebCore/platform/ScrollAnimator.cpp
index 5873e88..9def297 100644
--- a/Source/WebCore/platform/ScrollAnimator.cpp
+++ b/Source/WebCore/platform/ScrollAnimator.cpp
@@ -32,20 +32,21 @@
#include "ScrollAnimator.h"
#include "FloatPoint.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
#include <algorithm>
+#include <wtf/PassOwnPtr.h>
namespace WebCore {
#if !ENABLE(SMOOTH_SCROLLING)
-ScrollAnimator* ScrollAnimator::create(ScrollbarClient* client)
+PassOwnPtr<ScrollAnimator> ScrollAnimator::create(ScrollableArea* scrollableArea)
{
- return new ScrollAnimator(client);
+ return adoptPtr(new ScrollAnimator(scrollableArea));
}
#endif
-ScrollAnimator::ScrollAnimator(ScrollbarClient* client)
- : m_client(client)
+ScrollAnimator::ScrollAnimator(ScrollableArea* scrollableArea)
+ : m_scrollableArea(scrollableArea)
, m_currentPosX(0)
, m_currentPosY(0)
{
@@ -58,7 +59,7 @@ ScrollAnimator::~ScrollAnimator()
bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier)
{
float* currentPos = (orientation == HorizontalScrollbar) ? &m_currentPosX : &m_currentPosY;
- float newPos = std::max(std::min(*currentPos + (step * multiplier), static_cast<float>(m_client->scrollSize(orientation))), 0.0f);
+ float newPos = std::max(std::min(*currentPos + (step * multiplier), static_cast<float>(m_scrollableArea->scrollSize(orientation))), 0.0f);
if (*currentPos == newPos)
return false;
*currentPos = newPos;
@@ -82,7 +83,7 @@ FloatPoint ScrollAnimator::currentPosition() const
void ScrollAnimator::notityPositionChanged()
{
- m_client->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_currentPosY));
+ m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_currentPosY));
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/ScrollAnimator.h b/Source/WebCore/platform/ScrollAnimator.h
index 553ceee..155c6e5 100644
--- a/Source/WebCore/platform/ScrollAnimator.h
+++ b/Source/WebCore/platform/ScrollAnimator.h
@@ -32,17 +32,17 @@
#define ScrollAnimator_h
#include "ScrollTypes.h"
+#include <wtf/Forward.h>
namespace WebCore {
class FloatPoint;
-class ScrollbarClient;
+class ScrollableArea;
class ScrollAnimator {
public:
- static ScrollAnimator* create(ScrollbarClient*);
+ static PassOwnPtr<ScrollAnimator> create(ScrollableArea*);
- ScrollAnimator(ScrollbarClient* client);
virtual ~ScrollAnimator();
// Computes a scroll destination for the given parameters. Returns false if
@@ -56,9 +56,11 @@ public:
FloatPoint currentPosition() const;
protected:
+ ScrollAnimator(ScrollableArea*);
+
void notityPositionChanged();
- ScrollbarClient* m_client;
+ ScrollableArea* m_scrollableArea;
float m_currentPosX; // We avoid using a FloatPoint in order to reduce
float m_currentPosY; // subclass code complexity.
};
diff --git a/Source/WebCore/platform/ScrollAnimatorWin.cpp b/Source/WebCore/platform/ScrollAnimatorWin.cpp
index cdbfb94..47a00cb 100644
--- a/Source/WebCore/platform/ScrollAnimatorWin.cpp
+++ b/Source/WebCore/platform/ScrollAnimatorWin.cpp
@@ -35,17 +35,17 @@
#include "ScrollAnimatorWin.h"
#include "FloatPoint.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
#include "ScrollbarTheme.h"
#include <algorithm>
#include <wtf/CurrentTime.h>
+#include <wtf/PassOwnPtr.h>
namespace WebCore {
-// static
-ScrollAnimator* ScrollAnimator::create(ScrollbarClient* client)
+PassOwnPtr<ScrollAnimator> ScrollAnimator::create(ScrollableArea* scrollableArea)
{
- return new ScrollAnimatorWin(client);
+ return adoptPtr(new ScrollAnimatorWin(scrollableArea));
}
const double ScrollAnimatorWin::animationTimerDelay = 0.01;
@@ -61,8 +61,8 @@ ScrollAnimatorWin::PerAxisData::PerAxisData(ScrollAnimatorWin* parent, float* cu
}
-ScrollAnimatorWin::ScrollAnimatorWin(ScrollbarClient* client)
- : ScrollAnimator(client)
+ScrollAnimatorWin::ScrollAnimatorWin(ScrollableArea* scrollableArea)
+ : ScrollAnimator(scrollableArea)
, m_horizontalData(this, &m_currentPosX)
, m_verticalData(this, &m_currentPosY)
{
@@ -82,7 +82,7 @@ bool ScrollAnimatorWin::scroll(ScrollbarOrientation orientation, ScrollGranulari
// This is an animatable scroll. Calculate the scroll delta.
PerAxisData* data = (orientation == VerticalScrollbar) ? &m_verticalData : &m_horizontalData;
- float newPos = std::max(std::min(data->m_desiredPos + (step * multiplier), static_cast<float>(m_client->scrollSize(orientation))), 0.0f);
+ float newPos = std::max(std::min(data->m_desiredPos + (step * multiplier), static_cast<float>(m_scrollableArea->scrollSize(orientation))), 0.0f);
if (newPos == data->m_desiredPos)
return false;
data->m_desiredPos = newPos;
diff --git a/Source/WebCore/platform/ScrollAnimatorWin.h b/Source/WebCore/platform/ScrollAnimatorWin.h
index ef421f3..6f87e58 100644
--- a/Source/WebCore/platform/ScrollAnimatorWin.h
+++ b/Source/WebCore/platform/ScrollAnimatorWin.h
@@ -40,7 +40,7 @@ namespace WebCore {
class ScrollAnimatorWin : public ScrollAnimator {
public:
- ScrollAnimatorWin(ScrollbarClient*);
+ ScrollAnimatorWin(ScrollableArea*);
virtual ~ScrollAnimatorWin();
virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp
index 1010b15..cc2a09e 100644
--- a/Source/WebCore/platform/ScrollView.cpp
+++ b/Source/WebCore/platform/ScrollView.cpp
@@ -387,7 +387,7 @@ bool ScrollView::scroll(ScrollDirection direction, ScrollGranularity granularity
if (platformWidget())
return platformScroll(direction, granularity);
- return ScrollbarClient::scroll(direction, granularity);
+ return ScrollableArea::scroll(direction, granularity);
}
bool ScrollView::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity)
@@ -548,7 +548,7 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset)
updateScrollCorner();
}
- ScrollbarClient::scrollToOffsetWithoutAnimation(FloatPoint(scroll.width() + m_scrollOrigin.x(), scroll.height() + m_scrollOrigin.y()));
+ ScrollableArea::scrollToOffsetWithoutAnimation(FloatPoint(scroll.width() + m_scrollOrigin.x(), scroll.height() + m_scrollOrigin.y()));
m_inUpdateScrollbars = false;
}
@@ -752,9 +752,9 @@ void ScrollView::wheelEvent(PlatformWheelEvent& e)
}
if (deltaY)
- ScrollbarClient::scroll(ScrollUp, ScrollByPixel, deltaY);
+ ScrollableArea::scroll(ScrollUp, ScrollByPixel, deltaY);
if (deltaX)
- ScrollbarClient::scroll(ScrollLeft, ScrollByPixel, deltaX);
+ ScrollableArea::scroll(ScrollLeft, ScrollByPixel, deltaX);
}
}
diff --git a/Source/WebCore/platform/ScrollView.h b/Source/WebCore/platform/ScrollView.h
index 00e8bf8..a70624d 100644
--- a/Source/WebCore/platform/ScrollView.h
+++ b/Source/WebCore/platform/ScrollView.h
@@ -29,7 +29,7 @@
#include "IntRect.h"
#include "Scrollbar.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
#include "ScrollTypes.h"
#include "Widget.h"
@@ -54,16 +54,16 @@ class HostWindow;
class PlatformWheelEvent;
class Scrollbar;
-class ScrollView : public Widget, public ScrollbarClient {
+class ScrollView : public Widget, public ScrollableArea {
public:
~ScrollView();
- // ScrollbarClient functions. FrameView overrides the others.
+ // ScrollableArea functions. FrameView overrides the others.
virtual int scrollSize(ScrollbarOrientation orientation) const;
virtual int scrollPosition(Scrollbar*) const;
virtual void setScrollOffset(const IntPoint&);
- // NOTE: This should only be called by the overriden setScrollOffset from ScrollbarClient.
+ // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
virtual void scrollTo(const IntSize& newOffset);
// The window thats hosts the ScrollView. The ScrollView will communicate scrolls and repaints to the
diff --git a/Source/WebCore/platform/ScrollableArea.cpp b/Source/WebCore/platform/ScrollableArea.cpp
new file mode 100644
index 0000000..176cb7e
--- /dev/null
+++ b/Source/WebCore/platform/ScrollableArea.cpp
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2010, Google Inc. All rights reserved.
+ * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScrollableArea.h"
+
+#include "FloatPoint.h"
+#include "PlatformWheelEvent.h"
+#include "ScrollAnimator.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+ScrollableArea::ScrollableArea()
+ : m_scrollAnimator(ScrollAnimator::create(this))
+{
+}
+
+ScrollableArea::~ScrollableArea()
+{
+}
+
+bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
+{
+ ScrollbarOrientation orientation;
+ Scrollbar* scrollbar;
+ if (direction == ScrollUp || direction == ScrollDown) {
+ orientation = VerticalScrollbar;
+ scrollbar = verticalScrollbar();
+ } else {
+ orientation = HorizontalScrollbar;
+ scrollbar = horizontalScrollbar();
+ }
+
+ if (!scrollbar)
+ return false;
+
+ float step = 0;
+ switch (granularity) {
+ case ScrollByLine:
+ step = scrollbar->lineStep();
+ break;
+ case ScrollByPage:
+ step = scrollbar->pageStep();
+ break;
+ case ScrollByDocument:
+ step = scrollbar->totalSize();
+ break;
+ case ScrollByPixel:
+ step = scrollbar->pixelStep();
+ break;
+ }
+
+ if (direction == ScrollUp || direction == ScrollLeft)
+ multiplier = -multiplier;
+
+ return m_scrollAnimator->scroll(orientation, granularity, step, multiplier);
+}
+
+void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
+{
+ m_scrollAnimator->scrollToOffsetWithoutAnimation(offset);
+}
+
+void ScrollableArea::scrollToOffsetWithoutAnimation(ScrollbarOrientation orientation, float offset)
+{
+ if (orientation == HorizontalScrollbar)
+ scrollToXOffsetWithoutAnimation(offset);
+ else
+ scrollToYOffsetWithoutAnimation(offset);
+}
+
+void ScrollableArea::scrollToXOffsetWithoutAnimation(float x)
+{
+ scrollToOffsetWithoutAnimation(FloatPoint(x, m_scrollAnimator->currentPosition().y()));
+}
+
+void ScrollableArea::scrollToYOffsetWithoutAnimation(float y)
+{
+ scrollToOffsetWithoutAnimation(FloatPoint(m_scrollAnimator->currentPosition().x(), y));
+}
+
+void ScrollableArea::setScrollOffsetFromAnimation(const IntPoint& offset)
+{
+ // Tell the derived class to scroll its contents.
+ setScrollOffset(offset);
+
+ // Tell the scrollbars to update their thumb postions.
+ if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar())
+ horizontalScrollbar->offsetDidChange();
+ if (Scrollbar* verticalScrollbar = this->verticalScrollbar())
+ verticalScrollbar->offsetDidChange();
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/platform/ScrollableArea.h b/Source/WebCore/platform/ScrollableArea.h
new file mode 100644
index 0000000..148ecdb
--- /dev/null
+++ b/Source/WebCore/platform/ScrollableArea.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollableArea_h
+#define ScrollableArea_h
+
+#include "IntRect.h"
+#include "Scrollbar.h"
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class FloatPoint;
+class PlatformWheelEvent;
+class ScrollAnimator;
+
+class ScrollableArea {
+public:
+ ScrollableArea();
+ virtual ~ScrollableArea();
+
+ bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
+ void scrollToOffsetWithoutAnimation(const FloatPoint&);
+ void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset);
+ void scrollToXOffsetWithoutAnimation(float x);
+ void scrollToYOffsetWithoutAnimation(float x);
+
+ virtual int scrollSize(ScrollbarOrientation) const = 0;
+ virtual int scrollPosition(Scrollbar*) const = 0;
+ virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) = 0;
+ virtual bool isActive() const = 0;
+ virtual bool scrollbarCornerPresent() const = 0;
+ virtual void getTickmarks(Vector<IntRect>&) const { }
+
+ // This function should be overriden by subclasses to perform the actual
+ // scroll of the content.
+ virtual void setScrollOffset(const IntPoint&) = 0;
+
+
+ // Convert points and rects between the scrollbar and its containing view.
+ // The client needs to implement these in order to be aware of layout effects
+ // like CSS transforms.
+ virtual IntRect convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& scrollbarRect) const
+ {
+ return scrollbar->Widget::convertToContainingView(scrollbarRect);
+ }
+ virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
+ {
+ return scrollbar->Widget::convertFromContainingView(parentRect);
+ }
+ virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& scrollbarPoint) const
+ {
+ return scrollbar->Widget::convertToContainingView(scrollbarPoint);
+ }
+ virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
+ {
+ return scrollbar->Widget::convertFromContainingView(parentPoint);
+ }
+
+ virtual Scrollbar* horizontalScrollbar() const { return 0; }
+ virtual Scrollbar* verticalScrollbar() const { return 0; }
+
+private:
+ // NOTE: Only called from the ScrollAnimator.
+ friend class ScrollAnimator;
+ void setScrollOffsetFromAnimation(const IntPoint&);
+
+ OwnPtr<ScrollAnimator> m_scrollAnimator;
+};
+
+} // namespace WebCore
+
+#endif // ScrollableArea_h
diff --git a/Source/WebCore/platform/Scrollbar.cpp b/Source/WebCore/platform/Scrollbar.cpp
index 377186d..4c625f4 100644
--- a/Source/WebCore/platform/Scrollbar.cpp
+++ b/Source/WebCore/platform/Scrollbar.cpp
@@ -26,14 +26,14 @@
#include "config.h"
#include "Scrollbar.h"
-#include "AccessibilityScrollbar.h"
#include "AXObjectCache.h"
+#include "AccessibilityScrollbar.h"
#include "EventHandler.h"
#include "Frame.h"
#include "FrameView.h"
#include "GraphicsContext.h"
#include "PlatformMouseEvent.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
#include "ScrollbarTheme.h"
#include <algorithm>
@@ -49,9 +49,9 @@ using namespace std;
namespace WebCore {
#if !PLATFORM(EFL)
-PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size)
+PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size)
{
- return adoptRef(new Scrollbar(client, orientation, size));
+ return adoptRef(new Scrollbar(scrollableArea, orientation, size));
}
#endif
@@ -61,9 +61,9 @@ int Scrollbar::maxOverlapBetweenPages()
return maxOverlapBetweenPages;
}
-Scrollbar::Scrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize,
+Scrollbar::Scrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize,
ScrollbarTheme* theme)
- : m_client(client)
+ : m_scrollableArea(scrollableArea)
, m_orientation(orientation)
, m_controlSize(controlSize)
, m_theme(theme)
@@ -106,9 +106,9 @@ Scrollbar::~Scrollbar()
void Scrollbar::offsetDidChange()
{
- ASSERT(m_client);
+ ASSERT(m_scrollableArea);
- float position = static_cast<float>(m_client->scrollPosition(this));
+ float position = static_cast<float>(m_scrollableArea->scrollPosition(this));
if (position == m_currentPos)
return;
@@ -196,7 +196,7 @@ void Scrollbar::autoscrollPressedPart(double delay)
}
// Handle the arrows and track.
- if (client()->scroll(pressedPartScrollDirection(), pressedPartScrollGranularity()))
+ if (scrollableArea()->scroll(pressedPartScrollDirection(), pressedPartScrollGranularity()))
startTimerIfNeeded(delay);
}
@@ -268,7 +268,7 @@ void Scrollbar::moveThumb(int pos)
if (delta) {
float newPosition = static_cast<float>(thumbPos + delta) * maximum() / (trackLen - thumbLen);
- client()->scrollToOffsetWithoutAnimation(m_orientation, newPosition);
+ scrollableArea()->scrollToOffsetWithoutAnimation(m_orientation, newPosition);
}
}
@@ -301,7 +301,7 @@ bool Scrollbar::mouseMoved(const PlatformMouseEvent& evt)
{
if (m_pressedPart == ThumbPart) {
if (theme()->shouldSnapBackToDragOrigin(this, evt))
- client()->scrollToOffsetWithoutAnimation(m_orientation, m_dragOrigin);
+ scrollableArea()->scrollToOffsetWithoutAnimation(m_orientation, m_dragOrigin);
else {
moveThumb(m_orientation == HorizontalScrollbar ?
convertFromContainingWindow(evt.pos()).x() :
@@ -433,7 +433,7 @@ void Scrollbar::setEnabled(bool e)
bool Scrollbar::isWindowActive() const
{
- return m_client && m_client->isActive();
+ return m_scrollableArea && m_scrollableArea->isActive();
}
AXObjectCache* Scrollbar::axObjectCache() const
@@ -449,38 +449,38 @@ void Scrollbar::invalidateRect(const IntRect& rect)
{
if (suppressInvalidation())
return;
- if (m_client)
- m_client->invalidateScrollbarRect(this, rect);
+ if (m_scrollableArea)
+ m_scrollableArea->invalidateScrollbarRect(this, rect);
}
IntRect Scrollbar::convertToContainingView(const IntRect& localRect) const
{
- if (m_client)
- return m_client->convertFromScrollbarToContainingView(this, localRect);
+ if (m_scrollableArea)
+ return m_scrollableArea->convertFromScrollbarToContainingView(this, localRect);
return Widget::convertToContainingView(localRect);
}
IntRect Scrollbar::convertFromContainingView(const IntRect& parentRect) const
{
- if (m_client)
- return m_client->convertFromContainingViewToScrollbar(this, parentRect);
+ if (m_scrollableArea)
+ return m_scrollableArea->convertFromContainingViewToScrollbar(this, parentRect);
return Widget::convertFromContainingView(parentRect);
}
IntPoint Scrollbar::convertToContainingView(const IntPoint& localPoint) const
{
- if (m_client)
- return m_client->convertFromScrollbarToContainingView(this, localPoint);
+ if (m_scrollableArea)
+ return m_scrollableArea->convertFromScrollbarToContainingView(this, localPoint);
return Widget::convertToContainingView(localPoint);
}
IntPoint Scrollbar::convertFromContainingView(const IntPoint& parentPoint) const
{
- if (m_client)
- return m_client->convertFromContainingViewToScrollbar(this, parentPoint);
+ if (m_scrollableArea)
+ return m_scrollableArea->convertFromContainingViewToScrollbar(this, parentPoint);
return Widget::convertFromContainingView(parentPoint);
}
diff --git a/Source/WebCore/platform/Scrollbar.h b/Source/WebCore/platform/Scrollbar.h
index 869aef2..5db191a 100644
--- a/Source/WebCore/platform/Scrollbar.h
+++ b/Source/WebCore/platform/Scrollbar.h
@@ -36,31 +36,26 @@ namespace WebCore {
class GraphicsContext;
class IntRect;
-class ScrollbarClient;
-class ScrollbarTheme;
class PlatformMouseEvent;
+class ScrollableArea;
+class ScrollbarTheme;
class Scrollbar : public Widget {
public:
- enum ScrollSource {
- FromScrollAnimator,
- NotFromScrollAnimator,
- };
+ // Must be implemented by platforms that can't simply use the Scrollbar base class. Right now the only platform that is not using the base class is GTK.
+ static PassRefPtr<Scrollbar> createNativeScrollbar(ScrollableArea*, ScrollbarOrientation orientation, ScrollbarControlSize size);
virtual ~Scrollbar();
- // Must be implemented by platforms that can't simply use the Scrollbar base class. Right now the only platform that is not using the base class is GTK.
- static PassRefPtr<Scrollbar> createNativeScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size);
-
- // Called by the ScrollbarClient when the scroll offset changes.
+ // Called by the ScrollableArea when the scroll offset changes.
void offsetDidChange();
static int pixelsPerLineStep() { return 40; }
static float minFractionToStepWhenPaging() { return 0.875f; }
static int maxOverlapBetweenPages();
- void setClient(ScrollbarClient* client) { m_client = client; }
- ScrollbarClient* client() const { return m_client; }
+ void disconnectFromScrollableArea() { m_scrollableArea = 0; }
+ ScrollableArea* scrollableArea() const { return m_scrollableArea; }
virtual bool isCustomScrollbar() const { return false; }
ScrollbarOrientation orientation() const { return m_orientation; }
@@ -130,7 +125,7 @@ public:
virtual IntPoint convertFromContainingView(const IntPoint&) const;
protected:
- Scrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
+ Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
void updateThumb();
virtual void updateThumbPosition();
@@ -145,7 +140,7 @@ protected:
void moveThumb(int pos);
- ScrollbarClient* m_client;
+ ScrollableArea* m_scrollableArea;
ScrollbarOrientation m_orientation;
ScrollbarControlSize m_controlSize;
ScrollbarTheme* m_theme;
diff --git a/Source/WebCore/platform/ScrollbarClient.cpp b/Source/WebCore/platform/ScrollbarClient.cpp
deleted file mode 100644
index d8529b4..0000000
--- a/Source/WebCore/platform/ScrollbarClient.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2010, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ScrollbarClient.h"
-
-#include "FloatPoint.h"
-#include "PlatformWheelEvent.h"
-#include "ScrollAnimator.h"
-
-namespace WebCore {
-
-ScrollbarClient::ScrollbarClient()
- : m_scrollAnimator(ScrollAnimator::create(this))
-{
-}
-
-ScrollbarClient::~ScrollbarClient()
-{
-}
-
-bool ScrollbarClient::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
-{
- ScrollbarOrientation orientation;
- Scrollbar* scrollbar;
- if (direction == ScrollUp || direction == ScrollDown) {
- orientation = VerticalScrollbar;
- scrollbar = verticalScrollbar();
- } else {
- orientation = HorizontalScrollbar;
- scrollbar = horizontalScrollbar();
- }
-
- if (!scrollbar)
- return false;
-
- float step = 0;
- switch (granularity) {
- case ScrollByLine:
- step = scrollbar->lineStep();
- break;
- case ScrollByPage:
- step = scrollbar->pageStep();
- break;
- case ScrollByDocument:
- step = scrollbar->totalSize();
- break;
- case ScrollByPixel:
- step = scrollbar->pixelStep();
- break;
- }
-
- if (direction == ScrollUp || direction == ScrollLeft)
- multiplier = -multiplier;
-
- return m_scrollAnimator->scroll(orientation, granularity, step, multiplier);
-}
-
-void ScrollbarClient::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
-{
- m_scrollAnimator->scrollToOffsetWithoutAnimation(offset);
-}
-
-void ScrollbarClient::scrollToOffsetWithoutAnimation(ScrollbarOrientation orientation, float offset)
-{
- if (orientation == HorizontalScrollbar)
- scrollToXOffsetWithoutAnimation(offset);
- else
- scrollToYOffsetWithoutAnimation(offset);
-}
-
-void ScrollbarClient::scrollToXOffsetWithoutAnimation(float x)
-{
- scrollToOffsetWithoutAnimation(FloatPoint(x, m_scrollAnimator->currentPosition().y()));
-}
-
-void ScrollbarClient::scrollToYOffsetWithoutAnimation(float y)
-{
- scrollToOffsetWithoutAnimation(FloatPoint(m_scrollAnimator->currentPosition().x(), y));
-}
-
-void ScrollbarClient::setScrollOffsetFromAnimation(const IntPoint& offset)
-{
- // Tell the derived class to scroll its contents.
- setScrollOffset(offset);
-
- // Tell the scrollbars to update their thumb postions.
- if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar())
- horizontalScrollbar->offsetDidChange();
- if (Scrollbar* verticalScrollbar = this->verticalScrollbar())
- verticalScrollbar->offsetDidChange();
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/platform/ScrollbarClient.h b/Source/WebCore/platform/ScrollbarClient.h
deleted file mode 100644
index 4abd51e..0000000
--- a/Source/WebCore/platform/ScrollbarClient.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ScrollbarClient_h
-#define ScrollbarClient_h
-
-#include "IntRect.h"
-#include "Scrollbar.h"
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class FloatPoint;
-class PlatformWheelEvent;
-class ScrollAnimator;
-
-class ScrollbarClient {
-public:
- ScrollbarClient();
- virtual ~ScrollbarClient();
-
- bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
- void scrollToOffsetWithoutAnimation(const FloatPoint&);
- void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset);
- void scrollToXOffsetWithoutAnimation(float x);
- void scrollToYOffsetWithoutAnimation(float x);
-
- virtual int scrollSize(ScrollbarOrientation) const = 0;
- virtual int scrollPosition(Scrollbar*) const = 0;
- virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) = 0;
- virtual bool isActive() const = 0;
- virtual bool scrollbarCornerPresent() const = 0;
- virtual void getTickmarks(Vector<IntRect>&) const { }
-
- // This function should be overriden by subclasses to perform the actual
- // scroll of the content.
- virtual void setScrollOffset(const IntPoint&) = 0;
-
-
- // Convert points and rects between the scrollbar and its containing view.
- // The client needs to implement these in order to be aware of layout effects
- // like CSS transforms.
- virtual IntRect convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& scrollbarRect) const
- {
- return scrollbar->Widget::convertToContainingView(scrollbarRect);
- }
- virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
- {
- return scrollbar->Widget::convertFromContainingView(parentRect);
- }
- virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& scrollbarPoint) const
- {
- return scrollbar->Widget::convertToContainingView(scrollbarPoint);
- }
- virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
- {
- return scrollbar->Widget::convertFromContainingView(parentPoint);
- }
-
- virtual Scrollbar* horizontalScrollbar() const { return 0; }
- virtual Scrollbar* verticalScrollbar() const { return 0; }
-
-private:
- // NOTE: Only called from the ScrollAnimator.
- friend class ScrollAnimator;
- void setScrollOffsetFromAnimation(const IntPoint&);
-
- OwnPtr<ScrollAnimator> m_scrollAnimator;
-};
-
-} // namespace WebCore
-
-#endif // ScrollbarClient_h
diff --git a/Source/WebCore/platform/ScrollbarThemeComposite.cpp b/Source/WebCore/platform/ScrollbarThemeComposite.cpp
index bf00ebb..ec5f308 100644
--- a/Source/WebCore/platform/ScrollbarThemeComposite.cpp
+++ b/Source/WebCore/platform/ScrollbarThemeComposite.cpp
@@ -34,7 +34,7 @@
#include "Page.h"
#include "PlatformMouseEvent.h"
#include "Scrollbar.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
#include "Settings.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/chromium/FramelessScrollView.h b/Source/WebCore/platform/chromium/FramelessScrollView.h
index 300f418..033d953 100644
--- a/Source/WebCore/platform/chromium/FramelessScrollView.h
+++ b/Source/WebCore/platform/chromium/FramelessScrollView.h
@@ -61,7 +61,7 @@ namespace WebCore {
virtual bool handleWheelEvent(const PlatformWheelEvent&) = 0;
virtual bool handleKeyEvent(const PlatformKeyboardEvent&) = 0;
- // ScrollbarClient public methods:
+ // ScrollableArea public methods:
virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
virtual bool isActive() const;
diff --git a/Source/WebCore/platform/chromium/ScrollbarThemeChromium.cpp b/Source/WebCore/platform/chromium/ScrollbarThemeChromium.cpp
index fe09553..b23e625 100644
--- a/Source/WebCore/platform/chromium/ScrollbarThemeChromium.cpp
+++ b/Source/WebCore/platform/chromium/ScrollbarThemeChromium.cpp
@@ -29,8 +29,8 @@
#include "PlatformBridge.h"
#include "PlatformMouseEvent.h"
+#include "ScrollableArea.h"
#include "Scrollbar.h"
-#include "ScrollbarClient.h"
#include "ScrollbarThemeComposite.h"
// -----------------------------------------------------------------------------
@@ -110,7 +110,7 @@ void ScrollbarThemeChromium::paintTickmarks(GraphicsContext* context, Scrollbar*
// Get the tickmarks for the frameview.
Vector<IntRect> tickmarks;
- scrollbar->client()->getTickmarks(tickmarks);
+ scrollbar->scrollableArea()->getTickmarks(tickmarks);
if (!tickmarks.size())
return;
diff --git a/Source/WebCore/platform/efl/ScrollbarEfl.cpp b/Source/WebCore/platform/efl/ScrollbarEfl.cpp
index a7a063d..e71d1e3 100644
--- a/Source/WebCore/platform/efl/ScrollbarEfl.cpp
+++ b/Source/WebCore/platform/efl/ScrollbarEfl.cpp
@@ -42,13 +42,13 @@
using namespace std;
using namespace WebCore;
-PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size)
+PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size)
{
- return adoptRef(new ScrollbarEfl(client, orientation, size));
+ return adoptRef(new ScrollbarEfl(scrollableArea, orientation, size));
}
-ScrollbarEfl::ScrollbarEfl(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
- : Scrollbar(client, orientation, controlSize)
+ScrollbarEfl::ScrollbarEfl(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
+ : Scrollbar(scrollableArea, orientation, controlSize)
, m_lastPos(0)
, m_lastTotalSize(0)
, m_lastVisibleSize(0)
@@ -84,7 +84,7 @@ static void scrollbarEflEdjeMessage(void* data, Evas_Object* o, Edje_Message_Typ
m = static_cast<Edje_Message_Float*>(msg);
v = m->val * (that->totalSize() - that->visibleSize());
- that->client()->scrollToOffsetWithoutAnimation(that->orientation(), v);
+ that->scrollableArea()->scrollToOffsetWithoutAnimation(that->orientation(), v);
}
void ScrollbarEfl::setParent(ScrollView* view)
diff --git a/Source/WebCore/platform/efl/ScrollbarEfl.h b/Source/WebCore/platform/efl/ScrollbarEfl.h
index 35375a6..09dc64f 100644
--- a/Source/WebCore/platform/efl/ScrollbarEfl.h
+++ b/Source/WebCore/platform/efl/ScrollbarEfl.h
@@ -52,7 +52,7 @@ public:
virtual void paint(GraphicsContext* context, const IntRect& damageRect);
protected:
- ScrollbarEfl(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+ ScrollbarEfl(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize);
virtual void updateThumbPositionAndProportion();
virtual void updateThumbPosition();
diff --git a/Source/WebCore/platform/gtk/MainFrameScrollbarGtk.cpp b/Source/WebCore/platform/gtk/MainFrameScrollbarGtk.cpp
index 9eef3dc..d1571a5 100644
--- a/Source/WebCore/platform/gtk/MainFrameScrollbarGtk.cpp
+++ b/Source/WebCore/platform/gtk/MainFrameScrollbarGtk.cpp
@@ -25,14 +25,14 @@
#include "GraphicsContext.h"
#include "GtkVersioning.h"
#include "IntRect.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
#include <gtk/gtk.h>
using namespace WebCore;
-PassRefPtr<MainFrameScrollbarGtk> MainFrameScrollbarGtk::create(ScrollbarClient* client, ScrollbarOrientation orientation, GtkAdjustment* adj)
+PassRefPtr<MainFrameScrollbarGtk> MainFrameScrollbarGtk::create(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, GtkAdjustment* adj)
{
- return adoptRef(new MainFrameScrollbarGtk(client, orientation, adj));
+ return adoptRef(new MainFrameScrollbarGtk(scrollableArea, orientation, adj));
}
// Main frame scrollbars are slaves to a GtkAdjustment. If a main frame
@@ -42,8 +42,8 @@ PassRefPtr<MainFrameScrollbarGtk> MainFrameScrollbarGtk::create(ScrollbarClient*
// state. These scrollbars are never painted, as the container takes care of
// that. They exist only to shuttle data from the GtkWidget container into
// WebCore and vice-versa.
-MainFrameScrollbarGtk::MainFrameScrollbarGtk(ScrollbarClient* client, ScrollbarOrientation orientation, GtkAdjustment* adjustment)
- : Scrollbar(client, orientation, RegularScrollbar)
+MainFrameScrollbarGtk::MainFrameScrollbarGtk(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, GtkAdjustment* adjustment)
+ : Scrollbar(scrollableArea, orientation, RegularScrollbar)
, m_adjustment(0)
{
attachAdjustment(adjustment);
@@ -109,7 +109,7 @@ void MainFrameScrollbarGtk::updateThumbProportion()
void MainFrameScrollbarGtk::gtkValueChanged(GtkAdjustment*, MainFrameScrollbarGtk* that)
{
- that->client()->scrollToOffsetWithoutAnimation(that->orientation(), static_cast<int>(gtk_adjustment_get_value(that->m_adjustment.get())));
+ that->scrollableArea()->scrollToOffsetWithoutAnimation(that->orientation(), static_cast<int>(gtk_adjustment_get_value(that->m_adjustment.get())));
}
void MainFrameScrollbarGtk::paint(GraphicsContext* context, const IntRect& rect)
diff --git a/Source/WebCore/platform/gtk/MainFrameScrollbarGtk.h b/Source/WebCore/platform/gtk/MainFrameScrollbarGtk.h
index f184425..f104f81 100644
--- a/Source/WebCore/platform/gtk/MainFrameScrollbarGtk.h
+++ b/Source/WebCore/platform/gtk/MainFrameScrollbarGtk.h
@@ -30,18 +30,19 @@ namespace WebCore {
class MainFrameScrollbarGtk : public Scrollbar {
public:
+ static PassRefPtr<MainFrameScrollbarGtk> create(ScrollableArea*, ScrollbarOrientation, GtkAdjustment*);
+
~MainFrameScrollbarGtk();
virtual void paint(GraphicsContext*, const IntRect&);
void detachAdjustment();
void attachAdjustment(GtkAdjustment*);
- static PassRefPtr<MainFrameScrollbarGtk> create(ScrollbarClient*, ScrollbarOrientation, GtkAdjustment*);
protected:
virtual void updateThumbPosition();
virtual void updateThumbProportion();
private:
- MainFrameScrollbarGtk(ScrollbarClient*, ScrollbarOrientation, GtkAdjustment*);
+ MainFrameScrollbarGtk(ScrollableArea*, ScrollbarOrientation, GtkAdjustment*);
static void gtkValueChanged(GtkAdjustment*, MainFrameScrollbarGtk*);
GRefPtr<GtkAdjustment> m_adjustment;
diff --git a/Source/WebCore/platform/mac/ScrollAnimatorMac.h b/Source/WebCore/platform/mac/ScrollAnimatorMac.h
index 401833c..f05db40 100644
--- a/Source/WebCore/platform/mac/ScrollAnimatorMac.h
+++ b/Source/WebCore/platform/mac/ScrollAnimatorMac.h
@@ -41,7 +41,7 @@ namespace WebCore {
class ScrollAnimatorMac : public ScrollAnimator {
public:
- ScrollAnimatorMac(ScrollbarClient*);
+ ScrollAnimatorMac(ScrollableArea*);
virtual ~ScrollAnimatorMac();
virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
diff --git a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm b/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
index fcca519..59b333b 100644
--- a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
+++ b/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
@@ -27,9 +27,11 @@
#if ENABLE(SMOOTH_SCROLLING)
-#include "FloatPoint.h"
#include "ScrollAnimatorMac.h"
-#include "ScrollbarClient.h"
+
+#include "FloatPoint.h"
+#include "ScrollableArea.h"
+#include <wtf/PassOwnPtr.h>
@interface NSObject (NSScrollAnimationHelperDetails)
- (id)initWithDelegate:(id)delegate;
@@ -122,13 +124,13 @@ static NSSize abs(NSSize size)
namespace WebCore {
-ScrollAnimator* ScrollAnimator::create(ScrollbarClient* client)
+PassOwnPtr<ScrollAnimator> ScrollAnimator::create(ScrollableArea* scrollableArea)
{
- return new ScrollAnimatorMac(client);
+ return adoptPtr(new ScrollAnimatorMac(scrollableArea));
}
-ScrollAnimatorMac::ScrollAnimatorMac(ScrollbarClient* client)
- : ScrollAnimator(client)
+ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea)
+ : ScrollAnimator(scrollableArea)
{
m_scrollAnimationHelperDelegate.adoptNS([[ScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]);
m_scrollAnimationHelper.adoptNS([[NSClassFromString(@"NSScrollAnimationHelper") alloc] initWithDelegate:m_scrollAnimationHelperDelegate.get()]);
@@ -147,7 +149,7 @@ bool ScrollAnimatorMac::scroll(ScrollbarOrientation orientation, ScrollGranulari
return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
float currentPos = orientation == HorizontalScrollbar ? m_currentPosX : m_currentPosY;
- float newPos = std::max<float>(std::min<float>(currentPos + (step * multiplier), static_cast<float>(m_client->scrollSize(orientation))), 0);
+ float newPos = std::max<float>(std::min<float>(currentPos + (step * multiplier), static_cast<float>(m_scrollableArea->scrollSize(orientation))), 0);
if (currentPos == newPos)
return false;
diff --git a/Source/WebCore/platform/mac/ScrollbarThemeMac.mm b/Source/WebCore/platform/mac/ScrollbarThemeMac.mm
index ee1f5ed..032d9f3 100644
--- a/Source/WebCore/platform/mac/ScrollbarThemeMac.mm
+++ b/Source/WebCore/platform/mac/ScrollbarThemeMac.mm
@@ -420,7 +420,7 @@ bool ScrollbarThemeMac::paint(Scrollbar* scrollbar, GraphicsContext* context, co
if (!scrollbar->enabled())
trackInfo.enableState = kThemeTrackDisabled;
else
- trackInfo.enableState = scrollbar->client()->isActive() ? kThemeTrackActive : kThemeTrackInactive;
+ trackInfo.enableState = scrollbar->scrollableArea()->isActive() ? kThemeTrackActive : kThemeTrackInactive;
if (hasThumb(scrollbar))
trackInfo.attributes |= kThemeTrackShowThumb;
diff --git a/Source/WebCore/platform/qt/ScrollbarQt.cpp b/Source/WebCore/platform/qt/ScrollbarQt.cpp
index d32e693..dda82e9 100644
--- a/Source/WebCore/platform/qt/ScrollbarQt.cpp
+++ b/Source/WebCore/platform/qt/ScrollbarQt.cpp
@@ -34,7 +34,7 @@
#include "GraphicsContext.h"
#include "IntRect.h"
#include "PlatformMouseEvent.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
#include "ScrollbarTheme.h"
#include <QApplication>
@@ -77,17 +77,17 @@ bool Scrollbar::contextMenu(const PlatformMouseEvent& event)
const QPoint pos = convertFromContainingWindow(event.pos());
moveThumb(horizontal ? pos.x() : pos.y());
} else if (actionSelected == actScrollTop)
- client()->scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByDocument);
+ scrollableArea()->scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByDocument);
else if (actionSelected == actScrollBottom)
- client()->scroll(horizontal ? ScrollRight : ScrollDown, ScrollByDocument);
+ scrollableArea()->scroll(horizontal ? ScrollRight : ScrollDown, ScrollByDocument);
else if (actionSelected == actPageUp)
- client()->scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByPage);
+ scrollableArea()->scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByPage);
else if (actionSelected == actPageDown)
- client()->scroll(horizontal ? ScrollRight : ScrollDown, ScrollByPage);
+ scrollableArea()->scroll(horizontal ? ScrollRight : ScrollDown, ScrollByPage);
else if (actionSelected == actScrollUp)
- client()->scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByLine);
+ scrollableArea()->scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByLine);
else if (actionSelected == actScrollDown)
- client()->scroll(horizontal ? ScrollRight : ScrollDown, ScrollByLine);
+ scrollableArea()->scroll(horizontal ? ScrollRight : ScrollDown, ScrollByLine);
#endif // QT_NO_CONTEXTMENU
return true;
}
diff --git a/Source/WebCore/platform/win/PopupMenuWin.cpp b/Source/WebCore/platform/win/PopupMenuWin.cpp
index fe903cd..15871e6 100644
--- a/Source/WebCore/platform/win/PopupMenuWin.cpp
+++ b/Source/WebCore/platform/win/PopupMenuWin.cpp
@@ -532,12 +532,12 @@ bool PopupMenuWin::scrollToRevealSelection()
int index = focusedIndex();
if (index < m_scrollOffset) {
- ScrollbarClient::scrollToYOffsetWithoutAnimation(index);
+ ScrollableArea::scrollToYOffsetWithoutAnimation(index);
return true;
}
if (index >= m_scrollOffset + visibleItems()) {
- ScrollbarClient::scrollToYOffsetWithoutAnimation(index - visibleItems() + 1);
+ ScrollableArea::scrollToYOffsetWithoutAnimation(index - visibleItems() + 1);
return true;
}
@@ -994,7 +994,7 @@ LRESULT PopupMenuWin::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
--i;
}
- ScrollbarClient::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollByLine, abs(i));
+ ScrollableArea::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollByLine, abs(i));
break;
}
diff --git a/Source/WebCore/platform/win/PopupMenuWin.h b/Source/WebCore/platform/win/PopupMenuWin.h
index de7a93d..0d7630c 100644
--- a/Source/WebCore/platform/win/PopupMenuWin.h
+++ b/Source/WebCore/platform/win/PopupMenuWin.h
@@ -1,4 +1,5 @@
/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* This library is free software; you can redistribute it and/or
@@ -23,8 +24,8 @@
#include "IntRect.h"
#include "PopupMenu.h"
#include "PopupMenuClient.h"
+#include "ScrollableArea.h"
#include "Scrollbar.h"
-#include "ScrollbarClient.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
@@ -38,7 +39,7 @@ namespace WebCore {
class FrameView;
class Scrollbar;
-class PopupMenuWin : public PopupMenu, private ScrollbarClient {
+class PopupMenuWin : public PopupMenu, private ScrollableArea {
public:
PopupMenuWin(PopupMenuClient*);
~PopupMenuWin();
@@ -89,7 +90,7 @@ private:
bool scrollbarCapturingMouse() const { return m_scrollbarCapturingMouse; }
void setScrollbarCapturingMouse(bool b) { m_scrollbarCapturingMouse = b; }
- // ScrollBarClient
+ // ScrollableArea
virtual int scrollSize(ScrollbarOrientation orientation) const;
virtual int scrollPosition(Scrollbar*) const;
virtual void setScrollOffset(const IntPoint&);
@@ -98,7 +99,7 @@ private:
virtual bool scrollbarCornerPresent() const { return false; }
virtual Scrollbar* verticalScrollbar() const { return m_scrollbar.get(); }
- // NOTE: This should only be called by the overriden setScrollOffset from ScrollbarClient.
+ // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
void scrollTo(int offset);
void calculatePositionAndSize(const IntRect&, FrameView*);
@@ -123,6 +124,6 @@ private:
bool m_showPopup;
};
-}
+} // namespace WebCore
#endif // PopupMenuWin_h
diff --git a/Source/WebCore/platform/win/ScrollbarThemeSafari.cpp b/Source/WebCore/platform/win/ScrollbarThemeSafari.cpp
index 4e979f2..343bbb2 100644
--- a/Source/WebCore/platform/win/ScrollbarThemeSafari.cpp
+++ b/Source/WebCore/platform/win/ScrollbarThemeSafari.cpp
@@ -32,8 +32,8 @@
#include "IntRect.h"
#include "Page.h"
#include "PlatformMouseEvent.h"
+#include "ScrollableArea.h"
#include "Scrollbar.h"
-#include "ScrollbarClient.h"
#include "ScrollbarThemeWin.h"
#include "Settings.h"
#include "SoftLinking.h"
@@ -209,7 +209,7 @@ void ScrollbarThemeSafari::paintTrackBackground(GraphicsContext* graphicsContext
return;
NSControlSize size = scrollbar->controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
ThemeControlState state = 0;
- if (scrollbar->client()->isActive())
+ if (scrollbar->scrollableArea()->isActive())
state |= ActiveState;
if (hasButtons(scrollbar))
state |= EnabledState;
@@ -222,7 +222,7 @@ void ScrollbarThemeSafari::paintButton(GraphicsContext* graphicsContext, Scrollb
return;
NSControlSize size = scrollbar->controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
ThemeControlState state = 0;
- if (scrollbar->client()->isActive())
+ if (scrollbar->scrollableArea()->isActive())
state |= ActiveState;
if (hasButtons(scrollbar))
state |= EnabledState;
@@ -242,7 +242,7 @@ void ScrollbarThemeSafari::paintThumb(GraphicsContext* graphicsContext, Scrollba
return;
NSControlSize size = scrollbar->controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
ThemeControlState state = 0;
- if (scrollbar->client()->isActive())
+ if (scrollbar->scrollableArea()->isActive())
state |= ActiveState;
if (hasThumb(scrollbar))
state |= EnabledState;
diff --git a/Source/WebCore/platform/wx/ScrollbarThemeWx.cpp b/Source/WebCore/platform/wx/ScrollbarThemeWx.cpp
index 82e4a15..957f958 100644
--- a/Source/WebCore/platform/wx/ScrollbarThemeWx.cpp
+++ b/Source/WebCore/platform/wx/ScrollbarThemeWx.cpp
@@ -29,8 +29,8 @@
#include "HostWindow.h"
#include "NotImplemented.h"
#include "PlatformMouseEvent.h"
+#include "ScrollableArea.h"
#include "Scrollbar.h"
-#include "ScrollbarClient.h"
#include "scrollbar_render.h"
#include "ScrollbarThemeComposite.h"
#include "ScrollView.h"
@@ -185,7 +185,7 @@ bool ScrollbarThemeWx::paint(Scrollbar* scrollbar, GraphicsContext* context, con
{
wxOrientation orientation = (scrollbar->orientation() == HorizontalScrollbar) ? wxHORIZONTAL : wxVERTICAL;
int flags = 0;
- if (scrollbar->client()->isActive())
+ if (scrollbar->scrollableArea()->isActive())
flags |= wxCONTROL_FOCUSED;
if (!scrollbar->enabled())
diff --git a/Source/WebCore/rendering/RenderDataGrid.h b/Source/WebCore/rendering/RenderDataGrid.h
index 1492d26..852010c 100644
--- a/Source/WebCore/rendering/RenderDataGrid.h
+++ b/Source/WebCore/rendering/RenderDataGrid.h
@@ -30,14 +30,14 @@
#include "HTMLDataGridElement.h"
#include "RenderBlock.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
#include "StyleImage.h"
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace WebCore {
-class RenderDataGrid : public RenderBlock, private ScrollbarClient {
+class RenderDataGrid : public RenderBlock, private ScrollableArea {
public:
RenderDataGrid(Element*);
~RenderDataGrid();
@@ -66,7 +66,7 @@ private:
HTMLDataGridElement* gridElement() const { return static_cast<HTMLDataGridElement*>(node()); }
- // ScrollbarClient interface.
+ // ScrollableArea interface.
virtual int scrollSize(ScrollbarOrientation orientation) const;
virtual void setScrollOffsetFromAnimation(const IntPoint&);
virtual void valueChanged(Scrollbar*);
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp
index 900054e..94a1d90 100644
--- a/Source/WebCore/rendering/RenderLayer.cpp
+++ b/Source/WebCore/rendering/RenderLayer.cpp
@@ -1308,7 +1308,7 @@ void RenderLayer::scrollByRecursively(int xDelta, int yDelta)
void RenderLayer::scrollToOffset(int x, int y)
{
- ScrollbarClient::scrollToOffsetWithoutAnimation(IntPoint(x, y));
+ ScrollableArea::scrollToOffsetWithoutAnimation(IntPoint(x, y));
}
void RenderLayer::scrollTo(int x, int y)
@@ -1820,7 +1820,7 @@ void RenderLayer::destroyScrollbar(ScrollbarOrientation orientation)
static_cast<RenderScrollbar*>(scrollbar.get())->clearOwningRenderer();
scrollbar->removeFromParent();
- scrollbar->setClient(0);
+ scrollbar->disconnectFromScrollableArea();
scrollbar = 0;
}
}
@@ -2274,7 +2274,7 @@ bool RenderLayer::hitTestOverflowControls(HitTestResult& result, const IntPoint&
bool RenderLayer::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
{
- return ScrollbarClient::scroll(direction, granularity, multiplier);
+ return ScrollableArea::scroll(direction, granularity, multiplier);
}
void RenderLayer::paint(GraphicsContext* p, const IntRect& damageRect, PaintBehavior paintBehavior, RenderObject *paintingRoot)
diff --git a/Source/WebCore/rendering/RenderLayer.h b/Source/WebCore/rendering/RenderLayer.h
index cca3a7e..a9a817b 100644
--- a/Source/WebCore/rendering/RenderLayer.h
+++ b/Source/WebCore/rendering/RenderLayer.h
@@ -47,7 +47,7 @@
#include "PaintInfo.h"
#include "RenderBox.h"
#include "ScrollBehavior.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
#include <wtf/OwnPtr.h>
namespace WebCore {
@@ -154,7 +154,7 @@ private:
bool m_fixed : 1;
};
-class RenderLayer : public ScrollbarClient {
+class RenderLayer : public ScrollableArea {
public:
friend class RenderReplica;
@@ -513,7 +513,7 @@ private:
bool shouldBeNormalFlowOnly() const;
- // ScrollBarClient interface
+ // ScrollableArea interface
virtual int scrollSize(ScrollbarOrientation orientation) const;
virtual void setScrollOffset(const IntPoint&);
virtual int scrollPosition(Scrollbar*) const;
@@ -525,7 +525,7 @@ private:
virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoint&) const;
virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const;
- // NOTE: This should only be called by the overriden setScrollOffset from ScrollbarClient.
+ // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
void scrollTo(int x, int y);
IntSize scrollbarOffset(const Scrollbar*) const;
diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp
index 3df1486..90f13da 100644
--- a/Source/WebCore/rendering/RenderListBox.cpp
+++ b/Source/WebCore/rendering/RenderListBox.cpp
@@ -495,7 +495,7 @@ bool RenderListBox::scrollToRevealElementAtListIndex(int index)
else
newOffset = index - numVisibleItems() + 1;
- ScrollbarClient::scrollToYOffsetWithoutAnimation(newOffset);
+ ScrollableArea::scrollToYOffsetWithoutAnimation(newOffset);
return true;
}
@@ -507,12 +507,12 @@ bool RenderListBox::listIndexIsVisible(int index)
bool RenderListBox::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier, Node**)
{
- return ScrollbarClient::scroll(direction, granularity, multiplier);
+ return ScrollableArea::scroll(direction, granularity, multiplier);
}
bool RenderListBox::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity, float multiplier, Node**)
{
- return ScrollbarClient::scroll(logicalToPhysical(direction, style()->isHorizontalWritingMode(), style()->isFlippedBlocksWritingMode()), granularity, multiplier);
+ return ScrollableArea::scroll(logicalToPhysical(direction, style()->isHorizontalWritingMode(), style()->isFlippedBlocksWritingMode()), granularity, multiplier);
}
void RenderListBox::valueChanged(unsigned listIndex)
@@ -592,7 +592,7 @@ void RenderListBox::setScrollTop(int newTop)
if (index < 0 || index >= numItems() || index == m_indexOffset)
return;
- ScrollbarClient::scrollToYOffsetWithoutAnimation(index);
+ ScrollableArea::scrollToYOffsetWithoutAnimation(index);
}
bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
@@ -714,7 +714,7 @@ void RenderListBox::destroyScrollbar()
return;
m_vBar->removeFromParent();
- m_vBar->setClient(0);
+ m_vBar->disconnectFromScrollableArea();
m_vBar = 0;
}
diff --git a/Source/WebCore/rendering/RenderListBox.h b/Source/WebCore/rendering/RenderListBox.h
index f768247..1ba2b94 100644
--- a/Source/WebCore/rendering/RenderListBox.h
+++ b/Source/WebCore/rendering/RenderListBox.h
@@ -32,11 +32,11 @@
#define RenderListBox_h
#include "RenderBlock.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
namespace WebCore {
-class RenderListBox : public RenderBlock, private ScrollbarClient {
+class RenderListBox : public RenderBlock, private ScrollableArea {
public:
RenderListBox(Element*);
virtual ~RenderListBox();
@@ -94,7 +94,7 @@ private:
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
- // ScrollbarClient interface.
+ // ScrollableArea interface.
virtual int scrollSize(ScrollbarOrientation orientation) const;
virtual int scrollPosition(Scrollbar*) const;
virtual void setScrollOffset(const IntPoint&);
@@ -107,7 +107,7 @@ private:
virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const;
virtual Scrollbar* verticalScrollbar() const { return m_vBar.get(); }
- // NOTE: This should only be called by the overriden setScrollOffset from ScrollbarClient.
+ // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
void scrollTo(int newOffset);
void setHasVerticalScrollbar(bool hasScrollbar);
diff --git a/Source/WebCore/rendering/RenderMenuList.cpp b/Source/WebCore/rendering/RenderMenuList.cpp
index 8b98370..e55b5ca 100644
--- a/Source/WebCore/rendering/RenderMenuList.cpp
+++ b/Source/WebCore/rendering/RenderMenuList.cpp
@@ -456,14 +456,14 @@ HostWindow* RenderMenuList::hostWindow() const
return document()->view()->hostWindow();
}
-PassRefPtr<Scrollbar> RenderMenuList::createScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
+PassRefPtr<Scrollbar> RenderMenuList::createScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
{
RefPtr<Scrollbar> widget;
bool hasCustomScrollbarStyle = style()->hasPseudoStyle(SCROLLBAR);
if (hasCustomScrollbarStyle)
- widget = RenderScrollbar::createCustomScrollbar(client, orientation, this);
+ widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, this);
else
- widget = Scrollbar::createNativeScrollbar(client, orientation, controlSize);
+ widget = Scrollbar::createNativeScrollbar(scrollableArea, orientation, controlSize);
return widget.release();
}
diff --git a/Source/WebCore/rendering/RenderMenuList.h b/Source/WebCore/rendering/RenderMenuList.h
index 2c99b1e..b84b799 100644
--- a/Source/WebCore/rendering/RenderMenuList.h
+++ b/Source/WebCore/rendering/RenderMenuList.h
@@ -107,7 +107,7 @@ private:
virtual void selectionCleared() {}
virtual FontSelector* fontSelector() const;
virtual HostWindow* hostWindow() const;
- virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+ virtual PassRefPtr<Scrollbar> createScrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize);
#if ENABLE(NO_LISTBOX_RENDERING)
virtual void listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow = true);
diff --git a/Source/WebCore/rendering/RenderScrollbar.cpp b/Source/WebCore/rendering/RenderScrollbar.cpp
index 44a0126..4091d51 100644
--- a/Source/WebCore/rendering/RenderScrollbar.cpp
+++ b/Source/WebCore/rendering/RenderScrollbar.cpp
@@ -34,13 +34,13 @@
namespace WebCore {
-PassRefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, RenderBox* renderer, Frame* owningFrame)
+PassRefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, RenderBox* renderer, Frame* owningFrame)
{
- return adoptRef(new RenderScrollbar(client, orientation, renderer, owningFrame));
+ return adoptRef(new RenderScrollbar(scrollableArea, orientation, renderer, owningFrame));
}
-RenderScrollbar::RenderScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, RenderBox* renderer, Frame* owningFrame)
- : Scrollbar(client, orientation, RegularScrollbar, RenderScrollbarTheme::renderScrollbarTheme())
+RenderScrollbar::RenderScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, RenderBox* renderer, Frame* owningFrame)
+ : Scrollbar(scrollableArea, orientation, RegularScrollbar, RenderScrollbarTheme::renderScrollbarTheme())
, m_owner(renderer)
, m_owningFrame(owningFrame)
{
diff --git a/Source/WebCore/rendering/RenderScrollbar.h b/Source/WebCore/rendering/RenderScrollbar.h
index de70624..8f4de4f 100644
--- a/Source/WebCore/rendering/RenderScrollbar.h
+++ b/Source/WebCore/rendering/RenderScrollbar.h
@@ -39,11 +39,11 @@ class RenderStyle;
class RenderScrollbar : public Scrollbar {
protected:
- RenderScrollbar(ScrollbarClient*, ScrollbarOrientation, RenderBox*, Frame*);
+ RenderScrollbar(ScrollableArea*, ScrollbarOrientation, RenderBox*, Frame*);
public:
friend class Scrollbar;
- static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollbarClient*, ScrollbarOrientation, RenderBox*, Frame* owningFrame = 0);
+ static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollableArea*, ScrollbarOrientation, RenderBox*, Frame* owningFrame = 0);
virtual ~RenderScrollbar();
static ScrollbarPart partForStyleResolve();
diff --git a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
index c850321..306e8ba 100644
--- a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -1079,14 +1079,14 @@ bool RenderTextControlSingleLine::logicalScroll(ScrollLogicalDirection direction
return RenderBlock::logicalScroll(direction, granularity, multiplier, stopNode);
}
-PassRefPtr<Scrollbar> RenderTextControlSingleLine::createScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
+PassRefPtr<Scrollbar> RenderTextControlSingleLine::createScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
{
RefPtr<Scrollbar> widget;
bool hasCustomScrollbarStyle = style()->hasPseudoStyle(SCROLLBAR);
if (hasCustomScrollbarStyle)
- widget = RenderScrollbar::createCustomScrollbar(client, orientation, this);
+ widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, this);
else
- widget = Scrollbar::createNativeScrollbar(client, orientation, controlSize);
+ widget = Scrollbar::createNativeScrollbar(scrollableArea, orientation, controlSize);
return widget.release();
}
diff --git a/Source/WebCore/rendering/RenderTextControlSingleLine.h b/Source/WebCore/rendering/RenderTextControlSingleLine.h
index 16ce1e4..6b99f59 100644
--- a/Source/WebCore/rendering/RenderTextControlSingleLine.h
+++ b/Source/WebCore/rendering/RenderTextControlSingleLine.h
@@ -140,7 +140,7 @@ private:
virtual void setTextFromItem(unsigned listIndex);
virtual FontSelector* fontSelector() const;
virtual HostWindow* hostWindow() const;
- virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+ virtual PassRefPtr<Scrollbar> createScrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize);
InputElement* inputElement() const;
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog
index c50aa6f..1b0de4a 100644
--- a/Source/WebKit/chromium/ChangeLog
+++ b/Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,24 @@
+2011-01-21 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
+ https://bugs.webkit.org/show_bug.cgi?id=52779
+
+ Rename ScrollbarClient -> ScrollableArea.
+
+ * src/AutoFillPopupMenuClient.cpp:
+ (WebKit::AutoFillPopupMenuClient::createScrollbar):
+ * src/AutoFillPopupMenuClient.h:
+ * src/WebScrollbarImpl.cpp:
+ (WebKit::WebScrollbarImpl::WebScrollbarImpl):
+ (WebKit::WebScrollbarImpl::scroll):
+ (WebKit::WebScrollbarImpl::onMouseWheel):
+ (WebKit::WebScrollbarImpl::onKeyDown):
+ * src/WebScrollbarImpl.h:
+ * tests/PopupMenuTest.cpp:
+ (WebKit::TestPopupMenuClient::createScrollbar):
+
2011-01-21 Sailesh Agrawal <sail at chromium.org>
Reviewed by Ryosuke Niwa.
diff --git a/Source/WebKit/chromium/src/AutoFillPopupMenuClient.cpp b/Source/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
index 4f57994..2ce31a9 100644
--- a/Source/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
+++ b/Source/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
@@ -254,11 +254,11 @@ HostWindow* AutoFillPopupMenuClient::hostWindow() const
}
PassRefPtr<Scrollbar> AutoFillPopupMenuClient::createScrollbar(
- ScrollbarClient* client,
+ ScrollableArea* scrollableArea,
ScrollbarOrientation orientation,
ScrollbarControlSize size)
{
- return Scrollbar::createNativeScrollbar(client, orientation, size);
+ return Scrollbar::createNativeScrollbar(scrollableArea, orientation, size);
}
void AutoFillPopupMenuClient::initialize(
diff --git a/Source/WebKit/chromium/src/AutoFillPopupMenuClient.h b/Source/WebKit/chromium/src/AutoFillPopupMenuClient.h
index 0129a81..0071121 100644
--- a/Source/WebKit/chromium/src/AutoFillPopupMenuClient.h
+++ b/Source/WebKit/chromium/src/AutoFillPopupMenuClient.h
@@ -97,7 +97,7 @@ public:
virtual WebCore::FontSelector* fontSelector() const;
virtual WebCore::HostWindow* hostWindow() const;
virtual PassRefPtr<WebCore::Scrollbar> createScrollbar(
- WebCore::ScrollbarClient* client,
+ WebCore::ScrollableArea* client,
WebCore::ScrollbarOrientation orientation,
WebCore::ScrollbarControlSize size);
diff --git a/Source/WebKit/chromium/src/WebScrollbarImpl.cpp b/Source/WebKit/chromium/src/WebScrollbarImpl.cpp
index 527634a..004ae1c 100644
--- a/Source/WebKit/chromium/src/WebScrollbarImpl.cpp
+++ b/Source/WebKit/chromium/src/WebScrollbarImpl.cpp
@@ -65,7 +65,7 @@ WebScrollbarImpl::WebScrollbarImpl(WebScrollbarClient* client, Orientation orien
, m_scrollOffset(0)
{
m_scrollbar = Scrollbar::createNativeScrollbar(
- static_cast<ScrollbarClient*>(this),
+ static_cast<ScrollableArea*>(this),
static_cast<ScrollbarOrientation>(orientation),
RegularScrollbar);
}
@@ -114,7 +114,7 @@ void WebScrollbarImpl::scroll(ScrollDirection direction, ScrollGranularity granu
else
dir = horizontal ? ScrollLeft : ScrollUp;
- WebCore::ScrollbarClient::scroll(dir, static_cast<WebCore::ScrollGranularity>(granularity), multiplier);
+ WebCore::ScrollableArea::scroll(dir, static_cast<WebCore::ScrollGranularity>(granularity), multiplier);
}
void WebScrollbarImpl::paint(WebCanvas* canvas, const WebRect& rect)
@@ -220,7 +220,7 @@ bool WebScrollbarImpl::onMouseWheel(const WebInputEvent& event)
if (negative)
delta *= -1;
}
- WebCore::ScrollbarClient::scroll((m_scrollbar->orientation() == HorizontalScrollbar) ? WebCore::ScrollLeft : WebCore::ScrollUp, WebCore::ScrollByPixel, delta);
+ WebCore::ScrollableArea::scroll((m_scrollbar->orientation() == HorizontalScrollbar) ? WebCore::ScrollLeft : WebCore::ScrollUp, WebCore::ScrollByPixel, delta);
return true;
}
@@ -259,7 +259,7 @@ bool WebScrollbarImpl::onKeyDown(const WebInputEvent& event)
WebCore::ScrollGranularity scrollGranularity;
if (WebViewImpl::mapKeyCodeForScroll(keyCode, &scrollDirection, &scrollGranularity)) {
// Will return false if scroll direction wasn't compatible with this scrollbar.
- return WebCore::ScrollbarClient::scroll(scrollDirection, scrollGranularity);
+ return WebCore::ScrollableArea::scroll(scrollDirection, scrollGranularity);
}
return false;
}
diff --git a/Source/WebKit/chromium/src/WebScrollbarImpl.h b/Source/WebKit/chromium/src/WebScrollbarImpl.h
index 71b6dca..4dcfd5d 100644
--- a/Source/WebKit/chromium/src/WebScrollbarImpl.h
+++ b/Source/WebKit/chromium/src/WebScrollbarImpl.h
@@ -31,7 +31,7 @@
#ifndef WebScrollbarImpl_h
#define WebScrollbarImpl_h
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
#include "WebScrollbar.h"
#include <wtf/RefPtr.h>
@@ -43,7 +43,7 @@ class Scrollbar;
namespace WebKit {
class WebScrollbarImpl : public WebScrollbar,
- public WebCore::ScrollbarClient {
+ public WebCore::ScrollableArea {
public:
WebScrollbarImpl(WebScrollbarClient*, Orientation orientation);
~WebScrollbarImpl();
@@ -57,7 +57,7 @@ public:
virtual void paint(WebCanvas*, const WebRect&);
virtual bool handleInputEvent(const WebInputEvent&);
- // WebCore::ScrollbarClient methods
+ // WebCore::ScrollableArea methods
virtual int scrollSize(WebCore::ScrollbarOrientation) const;
virtual int scrollPosition(WebCore::Scrollbar*) const;
virtual void setScrollOffset(const WebCore::IntPoint&);
diff --git a/Source/WebKit/chromium/tests/PopupMenuTest.cpp b/Source/WebKit/chromium/tests/PopupMenuTest.cpp
index dab5ff9..4c9a149 100644
--- a/Source/WebKit/chromium/tests/PopupMenuTest.cpp
+++ b/Source/WebKit/chromium/tests/PopupMenuTest.cpp
@@ -96,7 +96,7 @@ public:
virtual FontSelector* fontSelector() const { return 0; }
virtual HostWindow* hostWindow() const { return 0; }
- virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize) { return 0; }
+ virtual PassRefPtr<Scrollbar> createScrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize) { return 0; }
private:
unsigned m_selectIndex;
diff --git a/Source/WebKit/qt/Api/qwebframe.cpp b/Source/WebKit/qt/Api/qwebframe.cpp
index e5019d2..0d502b3 100644
--- a/Source/WebKit/qt/Api/qwebframe.cpp
+++ b/Source/WebKit/qt/Api/qwebframe.cpp
@@ -1071,7 +1071,7 @@ void QWebFrame::setScrollBarValue(Qt::Orientation orientation, int value)
value = 0;
else if (value > scrollBarMaximum(orientation))
value = scrollBarMaximum(orientation);
- sb->client()->scrollToOffsetWithoutAnimation(orientation == Qt::Horizontal ? HorizontalScrollbar : VerticalScrollbar, value);
+ sb->scrollableArea()->scrollToOffsetWithoutAnimation(orientation == Qt::Horizontal ? HorizontalScrollbar : VerticalScrollbar, value);
}
}
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index aba8a47..aec5b45 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-21 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
+ https://bugs.webkit.org/show_bug.cgi?id=52779
+
+ Rename ScrollbarClient -> ScrollableArea.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setScrollBarValue):
+
2011-01-20 Sam Weinig <sam at webkit.org>
Fix build.
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog
index b1981da..7776c1e 100644
--- a/Source/WebKit/win/ChangeLog
+++ b/Source/WebKit/win/ChangeLog
@@ -1,3 +1,16 @@
+2011-01-21 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
+ https://bugs.webkit.org/show_bug.cgi?id=52779
+
+ Rename ScrollbarClient -> ScrollableArea.
+
+ * WebScrollBar.cpp:
+ (WebScrollBar::scroll):
+ * WebScrollBar.h:
+
2011-01-20 Adam Roben <aroben at apple.com>
Update for CACFLayerTreeHost changes
diff --git a/Source/WebKit/win/WebScrollBar.cpp b/Source/WebKit/win/WebScrollBar.cpp
index 1f8cb84..45bc8f3 100644
--- a/Source/WebKit/win/WebScrollBar.cpp
+++ b/Source/WebKit/win/WebScrollBar.cpp
@@ -248,11 +248,12 @@ HRESULT STDMETHODCALLTYPE WebScrollBar::scroll(
{
ScrollDirection webCoreScrollDirection = (ScrollDirection) direction;
ScrollGranularity webCoreGranularity = (ScrollGranularity) granularity;
- ScrollbarClient::scroll(webCoreScrollDirection, webCoreGranularity, multiplier);
+ ScrollableArea::scroll(webCoreScrollDirection, webCoreGranularity, multiplier);
return S_OK;
}
-// ScrollbarClient -------------------------------------------------------
+// ScrollableArea -------------------------------------------------------
+
int WebScrollBar::scrollSize(ScrollbarOrientation orientation) const
{
return (orientation == m_scrollBar->orientation()) ? (m_scrollBar->totalSize() - m_scrollBar->visibleSize()) : 0;
diff --git a/Source/WebKit/win/WebScrollBar.h b/Source/WebKit/win/WebScrollBar.h
index d7d923b..cad926e 100644
--- a/Source/WebKit/win/WebScrollBar.h
+++ b/Source/WebKit/win/WebScrollBar.h
@@ -34,17 +34,14 @@
#pragma warning(push, 0)
#include <WebCore/COMPtr.h>
#include <WebCore/Scrollbar.h>
-#include <WebCore/ScrollbarClient.h>
+#include <WebCore/ScrollableArea.h>
#pragma warning(pop)
namespace WebCore {
class Scrollbar;
}
-using namespace WebCore;
-
-class WebScrollBar : public IWebScrollBarPrivate, ScrollbarClient
-{
+class WebScrollBar : public IWebScrollBarPrivate, WebCore::ScrollableArea {
public:
static WebScrollBar* createInstance();
protected:
@@ -115,7 +112,7 @@ public:
/* [in] */ float multiplier);
protected:
- // ScrollbarClient
+ // ScrollableArea
virtual int scrollSize(ScrollbarOrientation orientation) const;
virtual int scrollPosition(Scrollbar*) const;
virtual void setScrollOffset(const IntPoint&);
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 6bfc039..2edcaaa 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,17 @@
+2011-01-21 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
+ https://bugs.webkit.org/show_bug.cgi?id=52779
+
+ Rename ScrollbarClient -> ScrollableArea.
+
+ * UIProcess/win/WebPopupMenuProxyWin.cpp:
+ (WebKit::WebPopupMenuProxyWin::onMouseWheel):
+ (WebKit::WebPopupMenuProxyWin::scrollToRevealSelection):
+ * UIProcess/win/WebPopupMenuProxyWin.h:
+
2011-01-21 Adam Roben <aroben at apple.com>
Update for WKCACFLayerRenderer -> CACFLayerView rename
diff --git a/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp b/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp
index ae97ab8..40e3556 100644
--- a/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp
+++ b/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp
@@ -432,8 +432,6 @@ void WebPopupMenuProxyWin::invalidateItem(int index)
::InvalidateRect(m_popup, &r, TRUE);
}
-// ScrollbarClient
-
int WebPopupMenuProxyWin::scrollSize(ScrollbarOrientation orientation) const
{
return ((orientation == VerticalScrollbar) && m_scrollbar) ? (m_scrollbar->totalSize() - m_scrollbar->visibleSize()) : 0;
@@ -723,7 +721,7 @@ LRESULT WebPopupMenuProxyWin::onMouseWheel(HWND hWnd, UINT message, WPARAM wPara
--i;
}
- ScrollbarClient::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollByLine, abs(i));
+ ScrollableArea::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollByLine, abs(i));
return 0;
}
@@ -925,12 +923,12 @@ bool WebPopupMenuProxyWin::scrollToRevealSelection()
int index = focusedIndex();
if (index < m_scrollOffset) {
- ScrollbarClient::scrollToYOffsetWithoutAnimation(index);
+ ScrollableArea::scrollToYOffsetWithoutAnimation(index);
return true;
}
if (index >= m_scrollOffset + visibleItems()) {
- ScrollbarClient::scrollToYOffsetWithoutAnimation(index - visibleItems() + 1);
+ ScrollableArea::scrollToYOffsetWithoutAnimation(index - visibleItems() + 1);
return true;
}
diff --git a/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.h b/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.h
index 0ed69e2..d1dc466 100644
--- a/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.h
+++ b/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.h
@@ -30,7 +30,7 @@
#include "WebPopupItem.h"
#include "WebPopupMenuProxy.h"
#include <WebCore/Scrollbar.h>
-#include <WebCore/ScrollbarClient.h>
+#include <WebCore/ScrollableArea.h>
typedef struct HWND__* HWND;
typedef struct HDC__* HDC;
@@ -40,7 +40,7 @@ namespace WebKit {
class WebView;
-class WebPopupMenuProxyWin : public WebPopupMenuProxy, private WebCore::ScrollbarClient {
+class WebPopupMenuProxyWin : public WebPopupMenuProxy, private WebCore::ScrollableArea {
public:
static PassRefPtr<WebPopupMenuProxyWin> create(WebView* webView, WebPopupMenuProxy::Client* client)
{
@@ -58,8 +58,8 @@ private:
WebCore::Scrollbar* scrollbar() const { return m_scrollbar.get(); }
- // ScrollBarClient
- virtual int scrollSize(WebCore::ScrollbarOrientation orientation) const;
+ // ScrollableArea
+ virtual int scrollSize(WebCore::ScrollbarOrientation) const;
virtual int scrollPosition(WebCore::Scrollbar*) const;
virtual void setScrollOffset(const WebCore::IntPoint&);
virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect&);
@@ -67,7 +67,7 @@ private:
virtual bool scrollbarCornerPresent() const { return false; }
virtual WebCore::Scrollbar* verticalScrollbar() const { return m_scrollbar.get(); }
- // NOTE: This should only be called by the overriden setScrollOffset from ScrollbarClient.
+ // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
void scrollTo(int offset);
static bool registerWindowClass();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list