Make custom scrollbar theme for use in DRT, to reduce pixel diffs between platforms
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Oct 2011 04:36:07 +0000 (04:36 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Oct 2011 04:36:07 +0000 (04:36 +0000)
commitfb1b4471036dbbc95d76974fbe2ee573fe375674
tree0dee391d6f4bbb8087dbd350829ed0c6aa9cd6df
parentb0e90524f75ff5380f8c94c47760a3f0634980cf
Make custom scrollbar theme for use in DRT, to reduce pixel diffs between platforms
https://bugs.webkit.org/show_bug.cgi?id=68134

Reviewed by Darin Adler.

Source/WebCore:

Use ScrollbarThemeMock when the setting to use mock scrollbars is enabled.

Make ScrollbarTheme::nativeTheme() private, and add a new static theme() method
that reads the setting, and returns the mock theme if set. All callers now use
theme() rther than nativeTheme(). Add the new ScrollbarTheme.cpp file to the build.

Fix scroll animator code for Mac and Chromium that was casting the ScrollbarTheme
without type-checking it to test whether it's the mock theme.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SpinButtonElement::startRepeatingTimer):
* platform/ScrollAnimatorWin.cpp:
(WebCore::ScrollAnimatorWin::scroll):
(WebCore::ScrollAnimatorWin::accelerationTime):
(WebCore::ScrollAnimatorWin::animateScroll):
* platform/ScrollView.cpp:
(WebCore::ScrollView::wheelEvent):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::setScrollbarOverlayStyle):
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::maxOverlapBetweenPages):
(WebCore::Scrollbar::Scrollbar):
* platform/ScrollbarTheme.cpp: Copied from Source/WebCore/platform/mock/ScrollbarThemeMock.h.
(WebCore::ScrollbarTheme::theme):
* platform/ScrollbarTheme.h:
(WebCore::ScrollbarTheme::isMockTheme):
* platform/chromium/PopupListBox.cpp:
(WebCore::PopupListBox::layout):
* platform/chromium/ScrollAnimatorChromiumMac.mm:
(WebCore::chromiumScrollbarTheme):
(WebCore::ScrollAnimatorChromiumMac::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorChromiumMac::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorChromiumMac::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorChromiumMac::willRemoveHorizontalScrollbar):
(WebCore::ScrollAnimatorChromiumMac::updateScrollerStyle):
* platform/chromium/ScrollbarThemeChromiumMac.mm:
(+[ScrollbarPrefsObserver appearancePrefsChanged:]):
(+[ScrollbarPrefsObserver behaviorPrefsChanged:]):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::macScrollbarTheme):
(WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
(WebCore::ScrollAnimatorMac::updateScrollerStyle):
* platform/mac/ScrollbarThemeMac.mm:
(+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
(+[WebScrollbarPrefsObserver behaviorPrefsChanged:]):
* platform/mock/ScrollbarThemeMock.h:
(WebCore::ScrollbarThemeMock::isMockTheme):
* platform/qt/RenderThemeQt.cpp:
(WebCore::RenderThemeQt::adjustInnerSpinButtonStyle):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::calculatePositionAndSize):
* rendering/RenderLayer.cpp:
(WebCore::cornerRect):
* rendering/RenderScrollbarPart.cpp:
(WebCore::calcScrollbarThicknessUsing):
* rendering/RenderScrollbarTheme.h:
(WebCore::RenderScrollbarTheme::scrollbarThickness):
(WebCore::RenderScrollbarTheme::buttonsPlacement):
(WebCore::RenderScrollbarTheme::shouldCenterOnThumb):
(WebCore::RenderScrollbarTheme::initialAutoscrollTimerDelay):
(WebCore::RenderScrollbarTheme::autoscrollTimerDelay):
(WebCore::RenderScrollbarTheme::registerScrollbar):
(WebCore::RenderScrollbarTheme::unregisterScrollbar):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::scrollbarThickness):
* rendering/RenderThemeChromiumSkia.cpp:
(WebCore::RenderThemeChromiumSkia::menuListInternalPadding):
* rendering/RenderThemeChromiumWin.cpp:
(WebCore::RenderThemeChromiumWin::adjustInnerSpinButtonStyle):

Source/WebKit/chromium:

Use ScrollbarThemeMock when the setting to use mock scrollbars is enabled.

Make ScrollbarTheme::nativeTheme() private, and add a new static theme() method
that reads the setting, and returns the mock theme if set. All callers now use
theme() rther than nativeTheme(). Add the new ScrollbarTheme.cpp file to the build.

* src/WebScrollbarImpl.cpp:
(WebKit::WebScrollbar::defaultThickness):

Source/WebKit/qt:

Use ScrollbarThemeMock when the setting to use mock scrollbars is enabled.

Make ScrollbarTheme::nativeTheme() private, and add a new static theme() method
that reads the setting, and returns the mock theme if set. All callers now use
theme() rther than nativeTheme(). Add the new ScrollbarTheme.cpp file to the build.

* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::windowResizerRect):

Source/WebKit/win:

Use ScrollbarThemeMock when the setting to use mock scrollbars is enabled.

Make ScrollbarTheme::nativeTheme() private, and add a new static theme() method
that reads the setting, and returns the mock theme if set. All callers now use
theme() rther than nativeTheme(). Add the new ScrollbarTheme.cpp file to the build.

* WebScrollBar.cpp:
(WebScrollBar::requestedWidth):
(WebScrollBar::requestedHeight):
* WebView.cpp:
(WebView::WebViewWndProc):

Source/WebKit2:

Use ScrollbarThemeMock when the setting to use mock scrollbars is enabled.

Make ScrollbarTheme::nativeTheme() private, and add a new static theme() method
that reads the setting, and returns the mock theme if set. All callers now use
theme() rther than nativeTheme(). Add the new ScrollbarTheme.cpp file to the build.

* UIProcess/win/WebPopupMenuProxyWin.cpp:
(WebKit::WebPopupMenuProxyWin::calculatePositionAndSize):
* WebProcess/Plugins/PDF/BuiltInPDFView.cpp:
(WebKit::BuiltInPDFView::paintControls):
* WebProcess/WebPage/PageOverlay.cpp:
(WebKit::PageOverlay::bounds):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
40 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.pro
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/platform/ScrollAnimatorWin.cpp
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/ScrollableArea.cpp
Source/WebCore/platform/Scrollbar.cpp
Source/WebCore/platform/ScrollbarTheme.cpp [new file with mode: 0644]
Source/WebCore/platform/ScrollbarTheme.h
Source/WebCore/platform/chromium/PopupListBox.cpp
Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.mm
Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/platform/mac/ScrollbarThemeMac.mm
Source/WebCore/platform/mock/ScrollbarThemeMock.h
Source/WebCore/platform/qt/RenderThemeQt.cpp
Source/WebCore/platform/win/PopupMenuWin.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderScrollbarPart.cpp
Source/WebCore/rendering/RenderScrollbarTheme.h
Source/WebCore/rendering/RenderTextControl.cpp
Source/WebCore/rendering/RenderThemeChromiumSkia.cpp
Source/WebCore/rendering/RenderThemeChromiumWin.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebScrollbarImpl.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebScrollBar.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp
Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp
Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp