Changeset 96549 in webkit


Ignore:
Timestamp:
Oct 3, 2011 3:31:24 PM (12 years ago)
Author:
andersca@apple.com
Message:

Remove custom scrollbar painting hooks
https://bugs.webkit.org/show_bug.cgi?id=69163

Source/WebCore:

Reviewed by Alexey Proskuryakov.

The custom scrollbar and scroll corner painting hooks aren't used by anyone
so go ahead and remove them. This removes the setter/getter and ChromeClient functions.

  • page/Chrome.cpp:
  • page/ChromeClient.h:
  • page/Settings.cpp:

(WebCore::Settings::Settings):

  • page/Settings.h:
  • platform/ScrollbarThemeComposite.cpp:

(WebCore::ScrollbarThemeComposite::paint):
(WebCore::ScrollbarThemeComposite::paintScrollCorner):

Source/WebKit/chromium:

Reviewed by Alexey Proskuryakov.

  • src/WebSettingsImpl.cpp:

(WebKit::WebSettingsImpl::setShouldPaintCustomScrollbars):

Source/WebKit/win:

Reviewed by Alexey Proskuryakov.

Remove now unused WebPreferences and ChromeClient overrides.

  • Interfaces/IWebPreferences.idl:
  • WebCoreSupport/WebChromeClient.cpp:
  • WebCoreSupport/WebChromeClient.h:
  • WebPreferenceKeysPrivate.h:
  • WebPreferences.cpp:

(WebPreferences::unused3):
(WebPreferences::unused4):

  • WebPreferences.h:
  • WebView.cpp:

(WebView::notifyPreferencesChanged):

Source/WebKit2:

Remove overridden ChromeClient member functions.

Reviewed by Alexey Proskuryakov.

  • WebProcess/WebCoreSupport/WebChromeClient.cpp:
  • WebProcess/WebCoreSupport/WebChromeClient.h:

Tools:

Reviewed by Alexey Proskuryakov.

  • DumpRenderTree/chromium/WebPreferences.cpp:

(WebPreferences::applyTo):
No need to enable custom scrollbar painting.

Location:
trunk
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r96547 r96549  
     12011-10-03  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove custom scrollbar painting hooks
     4        https://bugs.webkit.org/show_bug.cgi?id=69163
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        The custom scrollbar and scroll corner painting hooks aren't used by anyone
     9        so go ahead and remove them. This removes the setter/getter and ChromeClient functions.
     10
     11        * page/Chrome.cpp:
     12        * page/ChromeClient.h:
     13        * page/Settings.cpp:
     14        (WebCore::Settings::Settings):
     15        * page/Settings.h:
     16        * platform/ScrollbarThemeComposite.cpp:
     17        (WebCore::ScrollbarThemeComposite::paint):
     18        (WebCore::ScrollbarThemeComposite::paintScrollCorner):
     19
    1202011-09-22  Darin Adler  <darin@apple.com>
    221
  • trunk/Source/WebCore/WebCore.exp.in

    r96480 r96549  
    224224__ZN7WebCore11toUserSpaceERK7_NSRectP8NSWindow
    225225__ZN7WebCore11writeToFileEiPKci
    226 __ZN7WebCore12ChromeClient20paintCustomScrollbarEPNS_15GraphicsContextERKNS_9FloatRectENS_20ScrollbarControlSizeEjNS_13ScrollbarPartEbffj
    227226__ZN7WebCore12ChromeClient23paintCustomOverhangAreaEPNS_15GraphicsContextERKNS_7IntRectES5_S5_
    228 __ZN7WebCore12ChromeClient23paintCustomScrollCornerEPNS_15GraphicsContextERKNS_9FloatRectE
    229227__ZN7WebCore12EditingStyleD1Ev
    230228__ZN7WebCore12EventHandler10mouseMovedEP7NSEvent
  • trunk/Source/WebCore/page/Chrome.cpp

    r94908 r96549  
    560560}
    561561
    562 bool ChromeClient::paintCustomScrollbar(GraphicsContext*, const FloatRect&, ScrollbarControlSize,
    563                                         ScrollbarControlState, ScrollbarPart, bool,
    564                                         float, float, ScrollbarControlPartMask)
    565 {
    566     return false;
    567 }
    568 
    569 bool ChromeClient::paintCustomScrollCorner(GraphicsContext*, const FloatRect&)
    570 {
    571     return false;
    572 }
    573 
    574562bool ChromeClient::paintCustomOverhangArea(GraphicsContext*, const IntRect&, const IntRect&, const IntRect&)
    575563{
  • trunk/Source/WebCore/page/ChromeClient.h

    r95919 r96549  
    218218        virtual String generateReplacementFile(const String& path);
    219219
    220         virtual bool paintCustomScrollbar(GraphicsContext*, const FloatRect&, ScrollbarControlSize,
    221                                           ScrollbarControlState, ScrollbarPart pressedPart, bool vertical,
    222                                           float value, float proportion, ScrollbarControlPartMask);
    223         virtual bool paintCustomScrollCorner(GraphicsContext*, const FloatRect&);
    224 
    225220        virtual bool paintCustomOverhangArea(GraphicsContext*, const IntRect&, const IntRect&, const IntRect&);
    226221
  • trunk/Source/WebCore/page/Settings.cpp

    r95988 r96549  
    168168    , m_inApplicationChromeMode(false)
    169169    , m_offlineWebApplicationCacheEnabled(false)
    170     , m_shouldPaintCustomScrollbars(false)
    171170    , m_enforceCSSMIMETypeInNoQuirksMode(true)
    172171    , m_usesEncodingDetector(false)
     
    651650}
    652651
    653 void Settings::setShouldPaintCustomScrollbars(bool shouldPaintCustomScrollbars)
    654 {
    655     m_shouldPaintCustomScrollbars = shouldPaintCustomScrollbars;
    656 }
    657 
    658652void Settings::setEnforceCSSMIMETypeInNoQuirksMode(bool enforceCSSMIMETypeInNoQuirksMode)
    659653{
  • trunk/Source/WebCore/page/Settings.h

    r95988 r96549  
    279279        void setOfflineWebApplicationCacheEnabled(bool);
    280280        bool offlineWebApplicationCacheEnabled() const { return m_offlineWebApplicationCacheEnabled; }
    281 
    282         void setShouldPaintCustomScrollbars(bool);
    283         bool shouldPaintCustomScrollbars() const { return m_shouldPaintCustomScrollbars; }
    284281       
    285282        void setEnforceCSSMIMETypeInNoQuirksMode(bool);
     
    551548        bool m_inApplicationChromeMode : 1;
    552549        bool m_offlineWebApplicationCacheEnabled : 1;
    553         bool m_shouldPaintCustomScrollbars : 1;
    554550        bool m_enforceCSSMIMETypeInNoQuirksMode : 1;
    555551        bool m_usesEncodingDetector : 1;
  • trunk/Source/WebCore/platform/ScrollbarThemeComposite.cpp

    r96348 r96549  
    4242namespace WebCore {
    4343
    44 static Page* pageForScrollView(ScrollView* view)
    45 {
    46     if (!view)
    47         return 0;
    48     if (!view->isFrameView())
    49         return 0;
    50     FrameView* frameView = static_cast<FrameView*>(view);
    51     if (!frameView->frame())
    52         return 0;
    53     return frameView->frame()->page();
    54 }
    55 
    5644bool ScrollbarThemeComposite::paint(Scrollbar* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)
    5745{
     
    9583            scrollMask |= ForwardTrackPart;
    9684    }
    97 
    98 #if PLATFORM(WIN)
    99     // FIXME: This API makes the assumption that the custom scrollbar's metrics will match
    100     // the theme's metrics.  This is not a valid assumption.  The ability for a client to paint
    101     // custom scrollbars should be removed once scrollbars can be styled via CSS.
    102     if (Page* page = pageForScrollView(scrollbar->parent())) {
    103         if (page->settings()->shouldPaintCustomScrollbars()) {
    104             float proportion = static_cast<float>(scrollbar->visibleSize()) / scrollbar->totalSize();
    105             float value = scrollbar->currentPos() / static_cast<float>(scrollbar->maximum());
    106             ScrollbarControlState s = 0;
    107             if (scrollbar->scrollableArea()->isActive())
    108                 s |= ActiveScrollbarState;
    109             if (scrollbar->enabled())
    110                 s |= EnabledScrollbarState;
    111             if (scrollbar->pressedPart() != NoPart)
    112                 s |= PressedScrollbarState;
    113             if (page->chrome()->client()->paintCustomScrollbar(graphicsContext,
    114                                                                scrollbar->frameRect(),
    115                                                                scrollbar->controlSize(),
    116                                                                s,
    117                                                                scrollbar->pressedPart(),
    118                                                                scrollbar->orientation() == VerticalScrollbar,
    119                                                                value,
    120                                                                proportion,
    121                                                                scrollMask))
    122                 return true;
    123         }
    124     }
    125 #endif
    12685
    12786    // Paint the scrollbar background (only used by custom CSS scrollbars).
     
    305264}
    306265
    307 void ScrollbarThemeComposite::paintScrollCorner(ScrollView* view, GraphicsContext* context, const IntRect& cornerRect)
    308 {
    309     Page* page = pageForScrollView(view);
    310     if (page && page->settings()->shouldPaintCustomScrollbars() && page->chrome()->client()->paintCustomScrollCorner(context, cornerRect))
    311         return;
     266void ScrollbarThemeComposite::paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& cornerRect)
     267{
    312268    context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB);
    313269}
  • trunk/Source/WebKit/chromium/ChangeLog

    r96533 r96549  
     12011-10-03  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove custom scrollbar painting hooks
     4        https://bugs.webkit.org/show_bug.cgi?id=69163
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * src/WebSettingsImpl.cpp:
     9        (WebKit::WebSettingsImpl::setShouldPaintCustomScrollbars):
     10
    1112011-10-03  Elliot Poger  <epoger@google.com>
    212
  • trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp

    r95901 r96549  
    248248void WebSettingsImpl::setShouldPaintCustomScrollbars(bool enabled)
    249249{
    250     m_settings->setShouldPaintCustomScrollbars(enabled);
     250    // FIXME: This should be removed.
    251251}
    252252
  • trunk/Source/WebKit/win/ChangeLog

    r95944 r96549  
     12011-10-03  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove custom scrollbar painting hooks
     4        https://bugs.webkit.org/show_bug.cgi?id=69163
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        Remove now unused WebPreferences and ChromeClient overrides.
     9
     10        * Interfaces/IWebPreferences.idl:
     11        * WebCoreSupport/WebChromeClient.cpp:
     12        * WebCoreSupport/WebChromeClient.h:
     13        * WebPreferenceKeysPrivate.h:
     14        * WebPreferences.cpp:
     15        (WebPreferences::unused3):
     16        (WebPreferences::unused4):
     17        * WebPreferences.h:
     18        * WebView.cpp:
     19        (WebView::notifyPreferencesChanged):
     20
    1212011-09-23  Adam Roben  <aroben@apple.com>
    222
  • trunk/Source/WebKit/win/Interfaces/IWebPreferences.idl

    r95650 r96549  
    189189    HRESULT setCacheModel([in] WebCacheModel cacheModel);
    190190
    191     HRESULT setShouldPaintCustomScrollbars(BOOL shouldPaint);
    192     HRESULT shouldPaintCustomScrollbars(BOOL *shouldPaint);
     191    HRESULT unused3();
     192    HRESULT unused4();
    193193
    194194    HRESULT setZoomsTextOnly(BOOL zoomsTextOnly);
  • trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp

    r95919 r96549  
    644644}
    645645
    646 bool WebChromeClient::paintCustomScrollbar(GraphicsContext* context, const FloatRect& rect, ScrollbarControlSize size,
    647                                            ScrollbarControlState state, ScrollbarPart pressedPart, bool vertical,
    648                                            float value, float proportion, ScrollbarControlPartMask parts)
    649 {
    650     if (context->paintingDisabled())
    651         return false;
    652 
    653     COMPtr<IWebUIDelegate> delegate = uiDelegate();
    654     if (!delegate)
    655         return false;
    656 
    657     WebScrollbarControlPartMask webParts = WebNoScrollPart;
    658     if (parts & BackButtonStartPart) // FIXME: Hyatt, what about BackButtonEndPart?
    659         webParts |= WebBackButtonPart;
    660     if (parts & BackTrackPart)
    661         webParts |= WebBackTrackPart;
    662     if (parts & ThumbPart)
    663         webParts |= WebThumbPart;
    664     if (parts & ForwardTrackPart)
    665         webParts |= WebForwardTrackPart;
    666     if (parts & ForwardButtonStartPart) // FIXME: Hyatt, what about ForwardButtonEndPart?
    667         webParts |= WebForwardButtonPart;
    668 
    669     WebScrollbarControlPart webPressedPart = WebNoScrollPart;
    670     switch (pressedPart) {
    671         case BackButtonStartPart: // FIXME: Hyatt, what about BackButtonEndPart?
    672             webPressedPart = WebBackButtonPart;
    673             break;
    674         case BackTrackPart:
    675             webPressedPart = WebBackTrackPart;
    676             break;
    677         case ThumbPart:
    678             webPressedPart = WebThumbPart;
    679             break;
    680         case ForwardTrackPart:
    681             webPressedPart = WebForwardTrackPart;
    682             break;
    683         case ForwardButtonStartPart: // FIXME: Hyatt, what about ForwardButtonEndPart?
    684             webPressedPart = WebForwardButtonPart;
    685             break;
    686         default:
    687             break;
    688     }
    689 
    690     WebScrollBarControlSize webSize;
    691     switch (size) {
    692         case SmallScrollbar:
    693             webSize = WebSmallScrollbar;
    694             break;
    695         case RegularScrollbar:
    696         default:
    697             webSize = WebRegularScrollbar;
    698     }
    699     WebScrollbarControlState webState = 0;
    700     if (state & ActiveScrollbarState)
    701         webState |= WebActiveScrollbarState;
    702     if (state & EnabledScrollbarState)
    703         webState |= WebEnabledScrollbarState;
    704     if (state & PressedScrollbarState)
    705         webState |= WebPressedScrollbarState;
    706    
    707     RECT webRect = enclosingIntRect(rect);
    708     LocalWindowsContext windowsContext(context, webRect);
    709     HRESULT hr = delegate->paintCustomScrollbar(m_webView, windowsContext.hdc(), webRect, webSize, webState, webPressedPart,
    710                                                           vertical, value, proportion, webParts);
    711     return SUCCEEDED(hr);
    712 }
    713 
    714 bool WebChromeClient::paintCustomScrollCorner(GraphicsContext* context, const FloatRect& rect)
    715 {
    716     if (context->paintingDisabled())
    717         return false;
    718 
    719     COMPtr<IWebUIDelegate> delegate = uiDelegate();
    720     if (!delegate)
    721         return false;
    722 
    723     RECT webRect = enclosingIntRect(rect);
    724     LocalWindowsContext windowsContext(context, webRect);
    725     HRESULT hr = delegate->paintCustomScrollCorner(m_webView, windowsContext.hdc(), webRect);
    726     return SUCCEEDED(hr);
    727 }
    728 
    729646void WebChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser)
    730647{
  • trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h

    r95919 r96549  
    127127    virtual void populateVisitedLinks();
    128128
    129     virtual bool paintCustomScrollbar(WebCore::GraphicsContext*, const WebCore::FloatRect&, WebCore::ScrollbarControlSize,
    130                                         WebCore::ScrollbarControlState, WebCore::ScrollbarPart pressedPart, bool vertical,
    131                                         float value, float proportion, WebCore::ScrollbarControlPartMask);
    132     virtual bool paintCustomScrollCorner(WebCore::GraphicsContext*, const WebCore::FloatRect&);
    133 
    134129    virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
    135130    virtual void loadIconForFiles(const Vector<WTF::String>&, WebCore::FileIconLoader*);
  • trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h

    r93027 r96549  
    126126#define WebKitAuthorAndUserStylesEnabledPreferenceKey "WebKitAuthorAndUserStylesEnabled"
    127127
    128 #define WebKitPaintCustomScrollbarsPreferenceKey "WebKitPaintCustomScrollbars"
    129 
    130128#define WebKitPaintNativeControlsPreferenceKey "WebKitPaintNativeControls"
    131129
  • trunk/Source/WebKit/win/WebPreferences.cpp

    r93014 r96549  
    13191319}
    13201320
    1321 HRESULT WebPreferences::setShouldPaintCustomScrollbars(BOOL shouldPaint)
    1322 {
    1323     setBoolValue(CFSTR(WebKitPaintCustomScrollbarsPreferenceKey), shouldPaint);
    1324     return S_OK;
    1325 }
    1326 
    1327 HRESULT WebPreferences::shouldPaintCustomScrollbars(BOOL* shouldPaint)
    1328 {
    1329     *shouldPaint = boolValueForKey(CFSTR(WebKitPaintCustomScrollbarsPreferenceKey));
    1330     return S_OK;
     1321HRESULT WebPreferences::unused3()
     1322{
     1323    ASSERT_NOT_REACHED();
     1324    return E_FAIL;
     1325}
     1326
     1327HRESULT WebPreferences::unused4()
     1328{
     1329    ASSERT_NOT_REACHED();
     1330    return E_FAIL;
    13311331}
    13321332
  • trunk/Source/WebKit/win/WebPreferences.h

    r93014 r96549  
    287287     /* [in] */ WebCacheModel cacheModel);
    288288
    289     virtual HRESULT STDMETHODCALLTYPE setShouldPaintCustomScrollbars(
    290     /* [in] */ BOOL shouldPaint);
    291 
    292     virtual HRESULT STDMETHODCALLTYPE shouldPaintCustomScrollbars(
    293     /* [retval][out] */ BOOL *shouldPaint);
     289    virtual HRESULT STDMETHODCALLTYPE unused3();
     290    virtual HRESULT STDMETHODCALLTYPE unused4();
    294291
    295292    virtual HRESULT STDMETHODCALLTYPE setAVFoundationEnabled(
  • trunk/Source/WebKit/win/WebView.cpp

    r95271 r96549  
    47064706    settings->setDOMPasteAllowed(!!enabled);
    47074707
    4708     hr = preferences->shouldPaintCustomScrollbars(&enabled);
    4709     if (FAILED(hr))
    4710         return hr;
    4711     settings->setShouldPaintCustomScrollbars(!!enabled);
    4712 
    47134708    hr = preferences->zoomsTextOnly(&enabled);
    47144709    if (FAILED(hr))
  • trunk/Source/WebKit2/ChangeLog

    r96545 r96549  
     12011-10-03  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove custom scrollbar painting hooks
     4        https://bugs.webkit.org/show_bug.cgi?id=69163
     5
     6        Remove overridden ChromeClient member functions.
     7
     8        Reviewed by Alexey Proskuryakov.
     9
     10        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     11        * WebProcess/WebCoreSupport/WebChromeClient.h:
     12
    1132011-10-03  Jer Noble  <jer.noble@apple.com>
    214
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r96413 r96549  
    588588}
    589589
    590 bool WebChromeClient::paintCustomScrollbar(GraphicsContext*, const FloatRect&, ScrollbarControlSize,
    591                                            ScrollbarControlState, ScrollbarPart pressedPart, bool vertical,
    592                                            float value, float proportion, ScrollbarControlPartMask)
    593 {
    594     notImplemented();
    595     return false;
    596 }
    597 
    598 bool WebChromeClient::paintCustomScrollCorner(GraphicsContext*, const FloatRect&)
    599 {
    600     notImplemented();
    601     return false;
    602 }
    603 
    604590bool WebChromeClient::paintCustomOverhangArea(GraphicsContext* context, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect)
    605591{
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h

    r95919 r96549  
    152152    virtual String generateReplacementFile(const String& path) OVERRIDE;
    153153   
    154     virtual bool paintCustomScrollbar(WebCore::GraphicsContext*, const WebCore::FloatRect&, WebCore::ScrollbarControlSize,
    155                                       WebCore::ScrollbarControlState, WebCore::ScrollbarPart pressedPart, bool vertical,
    156                                       float value, float proportion, WebCore::ScrollbarControlPartMask) OVERRIDE;
    157     virtual bool paintCustomScrollCorner(WebCore::GraphicsContext*, const WebCore::FloatRect&) OVERRIDE;
    158 
    159154    virtual bool paintCustomOverhangArea(WebCore::GraphicsContext*, const WebCore::IntRect&, const WebCore::IntRect&, const WebCore::IntRect&) OVERRIDE;
    160155
  • trunk/Tools/ChangeLog

    r96541 r96549  
     12011-10-03  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove custom scrollbar painting hooks
     4        https://bugs.webkit.org/show_bug.cgi?id=69163
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * DumpRenderTree/chromium/WebPreferences.cpp:
     9        (WebPreferences::applyTo):
     10        No need to enable custom scrollbar painting.
     11
    1122011-10-03  David Levin  <levin@chromium.org>
    213
  • trunk/Tools/DumpRenderTree/chromium/WebPreferences.cpp

    r94214 r96549  
    171171
    172172    // Fixed values.
    173     settings->setShouldPaintCustomScrollbars(true);
    174173    settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded();
    175174    settings->setDownloadableBinaryFontsEnabled(true);
Note: See TracChangeset for help on using the changeset viewer.