2011-06-08 Kent Tamura <tkent@chromium.org>
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jun 2011 23:45:55 +0000 (23:45 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jun 2011 23:45:55 +0000 (23:45 +0000)
        Reviewed by Dimitri Glazkov.

        Change the argument of RenderTheme::adjustSliderThumbSize(): RenderObject* -> RenderStyle*
        https://bugs.webkit.org/show_bug.cgi?id=62208

        Change the argument type of RenderTheme::adjustSliderThumbSize() and
        RenderMediaControls::adjustMediaSliderThumbSize() from RenderObject* to RenderStyle*.

        Also, each of adjustSliderThumbStyle() overrides calls RenderTheme::
        adjustSliderThumbStyle() for future changes.

        No new tests. This is a refactoring and should not change any behavior.

        * html/shadow/SliderThumbElement.cpp:
        (WebCore::RenderSliderThumb::layout): Passing RenderStyle* and remove a FIXME comment.
        * platform/efl/RenderThemeEfl.cpp:
        (WebCore::RenderThemeEfl::adjustSliderThumbStyle): Calls RenderTheme::adjustSliderThumbStyle().
        * platform/gtk/RenderThemeGtk.cpp:
        (WebCore::RenderThemeGtk::adjustSliderThumbStyle): ditto.
        (WebCore::RenderThemeGtk::adjustMediaSliderThumbSize):
        * platform/gtk/RenderThemeGtk.h:
        * platform/gtk/RenderThemeGtk2.cpp:
        (WebCore::RenderThemeGtk::adjustSliderThumbSize):
        * platform/gtk/RenderThemeGtk3.cpp:
        (WebCore::RenderThemeGtk::adjustSliderThumbSize):
        * platform/qt/RenderThemeQt.cpp:
        (WebCore::RenderThemeQt::adjustSliderThumbStyle): ditto.
        (WebCore::RenderThemeQt::adjustSliderThumbSize):
        * rendering/RenderMediaControls.cpp:
        (WebCore::RenderMediaControls::adjustMediaSliderThumbSize):
        * rendering/RenderMediaControls.h:
        * rendering/RenderMediaControlsChromium.cpp:
        (WebCore::RenderMediaControlsChromium::adjustMediaSliderThumbSize):
        * rendering/RenderMediaControlsChromium.h:
        * rendering/RenderSlider.cpp:
        (WebCore::RenderSlider::layout): Passing RenderStyle* and remove a FIXME comment.
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::adjustSliderThumbStyle): Add a comment.
        (WebCore::RenderTheme::adjustSliderThumbSize):
        * rendering/RenderTheme.h:
        * rendering/RenderThemeChromiumLinux.cpp:
        (WebCore::RenderThemeChromiumLinux::adjustSliderThumbSize):
        * rendering/RenderThemeChromiumLinux.h:
        * rendering/RenderThemeChromiumMac.h:
        * rendering/RenderThemeChromiumMac.mm:
        (WebCore::RenderThemeChromiumMac::adjustMediaSliderThumbSize):
        * rendering/RenderThemeChromiumSkia.cpp:
        (WebCore::RenderThemeChromiumSkia::adjustSliderThumbSize):
        * rendering/RenderThemeChromiumSkia.h:
        * rendering/RenderThemeChromiumWin.cpp:
        (WebCore::RenderThemeChromiumWin::adjustSliderThumbSize):
        * rendering/RenderThemeChromiumWin.h:
        * rendering/RenderThemeMac.h:
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::adjustSliderThumbStyle): Calls RenderTheme::adjustSliderThumbStyle().
        (WebCore::RenderThemeMac::adjustSliderThumbSize):
        (WebCore::RenderThemeMac::adjustMediaSliderThumbSize):
        * rendering/RenderThemeSafari.cpp:
        (WebCore::RenderThemeSafari::adjustSliderThumbStyle): Calls RenderTheme::adjustSliderThumbStyle().
        (WebCore::RenderThemeSafari::adjustSliderThumbSize):
        * rendering/RenderThemeSafari.h:
        * rendering/RenderThemeWin.cpp:
        (WebCore::RenderThemeWin::adjustSliderThumbSize):
        * rendering/RenderThemeWin.h:
        * rendering/RenderThemeWinCE.cpp:
        (WebCore::RenderThemeWinCE::adjustSliderThumbSize):
        * rendering/RenderThemeWinCE.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@88405 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/platform/efl/RenderThemeEfl.cpp
Source/WebCore/platform/gtk/RenderThemeGtk.cpp
Source/WebCore/platform/gtk/RenderThemeGtk.h
Source/WebCore/platform/gtk/RenderThemeGtk2.cpp
Source/WebCore/platform/gtk/RenderThemeGtk3.cpp
Source/WebCore/platform/qt/RenderThemeQt.cpp
Source/WebCore/rendering/RenderMediaControls.cpp
Source/WebCore/rendering/RenderMediaControls.h
Source/WebCore/rendering/RenderMediaControlsChromium.cpp
Source/WebCore/rendering/RenderMediaControlsChromium.h
Source/WebCore/rendering/RenderSlider.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeChromiumLinux.cpp
Source/WebCore/rendering/RenderThemeChromiumLinux.h
Source/WebCore/rendering/RenderThemeChromiumMac.h
Source/WebCore/rendering/RenderThemeChromiumMac.mm
Source/WebCore/rendering/RenderThemeChromiumSkia.cpp
Source/WebCore/rendering/RenderThemeChromiumSkia.h
Source/WebCore/rendering/RenderThemeChromiumWin.cpp
Source/WebCore/rendering/RenderThemeChromiumWin.h
Source/WebCore/rendering/RenderThemeMac.h
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderThemeSafari.cpp
Source/WebCore/rendering/RenderThemeSafari.h
Source/WebCore/rendering/RenderThemeWin.cpp
Source/WebCore/rendering/RenderThemeWin.h
Source/WebCore/rendering/RenderThemeWinCE.cpp
Source/WebCore/rendering/RenderThemeWinCE.h

index 57748dbeb4f28153ea5b704cc4b0bef48613ba75..fc7d6e47fe921d99b490a6992c54dd01857a6b39 100644 (file)
@@ -1,3 +1,73 @@
+2011-06-08  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Change the argument of RenderTheme::adjustSliderThumbSize(): RenderObject* -> RenderStyle*
+        https://bugs.webkit.org/show_bug.cgi?id=62208
+
+        Change the argument type of RenderTheme::adjustSliderThumbSize() and
+        RenderMediaControls::adjustMediaSliderThumbSize() from RenderObject* to RenderStyle*.
+
+        Also, each of adjustSliderThumbStyle() overrides calls RenderTheme::
+        adjustSliderThumbStyle() for future changes.
+
+        No new tests. This is a refactoring and should not change any behavior.
+
+        * html/shadow/SliderThumbElement.cpp:
+        (WebCore::RenderSliderThumb::layout): Passing RenderStyle* and remove a FIXME comment.
+        * platform/efl/RenderThemeEfl.cpp:
+        (WebCore::RenderThemeEfl::adjustSliderThumbStyle): Calls RenderTheme::adjustSliderThumbStyle().
+        * platform/gtk/RenderThemeGtk.cpp:
+        (WebCore::RenderThemeGtk::adjustSliderThumbStyle): ditto.
+        (WebCore::RenderThemeGtk::adjustMediaSliderThumbSize):
+        * platform/gtk/RenderThemeGtk.h:
+        * platform/gtk/RenderThemeGtk2.cpp:
+        (WebCore::RenderThemeGtk::adjustSliderThumbSize):
+        * platform/gtk/RenderThemeGtk3.cpp:
+        (WebCore::RenderThemeGtk::adjustSliderThumbSize):
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::adjustSliderThumbStyle): ditto.
+        (WebCore::RenderThemeQt::adjustSliderThumbSize):
+        * rendering/RenderMediaControls.cpp:
+        (WebCore::RenderMediaControls::adjustMediaSliderThumbSize):
+        * rendering/RenderMediaControls.h:
+        * rendering/RenderMediaControlsChromium.cpp:
+        (WebCore::RenderMediaControlsChromium::adjustMediaSliderThumbSize):
+        * rendering/RenderMediaControlsChromium.h:
+        * rendering/RenderSlider.cpp:
+        (WebCore::RenderSlider::layout): Passing RenderStyle* and remove a FIXME comment.
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::adjustSliderThumbStyle): Add a comment.
+        (WebCore::RenderTheme::adjustSliderThumbSize):
+        * rendering/RenderTheme.h:
+        * rendering/RenderThemeChromiumLinux.cpp:
+        (WebCore::RenderThemeChromiumLinux::adjustSliderThumbSize):
+        * rendering/RenderThemeChromiumLinux.h:
+        * rendering/RenderThemeChromiumMac.h:
+        * rendering/RenderThemeChromiumMac.mm:
+        (WebCore::RenderThemeChromiumMac::adjustMediaSliderThumbSize):
+        * rendering/RenderThemeChromiumSkia.cpp:
+        (WebCore::RenderThemeChromiumSkia::adjustSliderThumbSize):
+        * rendering/RenderThemeChromiumSkia.h:
+        * rendering/RenderThemeChromiumWin.cpp:
+        (WebCore::RenderThemeChromiumWin::adjustSliderThumbSize):
+        * rendering/RenderThemeChromiumWin.h:
+        * rendering/RenderThemeMac.h:
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::adjustSliderThumbStyle): Calls RenderTheme::adjustSliderThumbStyle().
+        (WebCore::RenderThemeMac::adjustSliderThumbSize):
+        (WebCore::RenderThemeMac::adjustMediaSliderThumbSize):
+        * rendering/RenderThemeSafari.cpp:
+        (WebCore::RenderThemeSafari::adjustSliderThumbStyle): Calls RenderTheme::adjustSliderThumbStyle().
+        (WebCore::RenderThemeSafari::adjustSliderThumbSize):
+        * rendering/RenderThemeSafari.h:
+        * rendering/RenderThemeWin.cpp:
+        (WebCore::RenderThemeWin::adjustSliderThumbSize):
+        * rendering/RenderThemeWin.h:
+        * rendering/RenderThemeWinCE.cpp:
+        (WebCore::RenderThemeWinCE::adjustSliderThumbSize):
+        * rendering/RenderThemeWinCE.h:
+
 2011-06-08  Brian Salomon  <bsalomon@google.com>
 
         Reviewed by James Robinson.
index 8a06cb33fb5cbfca00ffc8ae6dfef54d91c74dbf..a49e3ebc0040fb8e25db19e6f941e9c6d83eda79 100644 (file)
@@ -75,10 +75,8 @@ void RenderSliderThumb::layout()
     else if (parentStyle->appearance() == MediaVolumeSliderPart)
         style()->setAppearance(MediaVolumeSliderThumbPart);
 
-    if (style()->hasAppearance()) {
-        // FIXME: This should pass the style, not the renderer, to the theme.
-        theme()->adjustSliderThumbSize(this);
-    }
+    if (style()->hasAppearance())
+        theme()->adjustSliderThumbSize(style());
     RenderBlock::layout();
 }
 
index 1ef8e50ec6acb96cd35f3abbb6f36b9a64b3e934..65e263d2a4e1590adc7ac5fbebf3b6f5ff853b8c 100644 (file)
@@ -834,6 +834,7 @@ void RenderThemeEfl::adjustSliderTrackStyle(CSSStyleSelector* selector, RenderSt
 
 void RenderThemeEfl::adjustSliderThumbStyle(CSSStyleSelector* selector, RenderStyle* style, Element* element) const
 {
+    RenderTheme::adjustSliderThumbStyle(selector, style, element);
     adjustSliderTrackStyle(selector, style, element);
 }
 
index f6ad7af82010d992c6e1a8f74dcd4486a97dd4f9..146862ba5eea546898546a377c625e64209b6ad5 100644 (file)
@@ -396,8 +396,9 @@ void RenderThemeGtk::adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle* styl
     style->setBoxShadow(nullptr);
 }
 
-void RenderThemeGtk::adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
+void RenderThemeGtk::adjustSliderThumbStyle(CSSStyleSelector* selector, RenderStyle* style, Element* element) const
 {
+    RenderTheme::adjustSliderThumbStyle(selector, style, element);
     style->setBoxShadow(nullptr);
 }
 
@@ -472,11 +473,11 @@ String RenderThemeGtk::extraMediaControlsStyleSheet()
     return String(mediaControlsGtkUserAgentStyleSheet, sizeof(mediaControlsGtkUserAgentStyleSheet));
 }
 
-void RenderThemeGtk::adjustMediaSliderThumbSize(RenderObject* renderObject) const
+void RenderThemeGtk::adjustMediaSliderThumbSize(RenderStyle* style) const
 {
-    ASSERT(renderObject->style()->appearance() == MediaSliderThumbPart);
-    renderObject->style()->setWidth(Length(m_mediaSliderThumbWidth, Fixed));
-    renderObject->style()->setHeight(Length(m_mediaSliderThumbHeight, Fixed));
+    ASSERT(style->appearance() == MediaSliderThumbPart);
+    style->setWidth(Length(m_mediaSliderThumbWidth, Fixed));
+    style->setHeight(Length(m_mediaSliderThumbHeight, Fixed));
 }
 
 bool RenderThemeGtk::paintMediaButton(RenderObject* renderObject, GraphicsContext* context, const IntRect& rect, const char* iconName)
index 4e60fdfbc7e11781ed5901f66f1e82b18c90aaa0..6a24d5914b48e25c5d36b67c5cfa3fab3f3c9fb5 100644 (file)
@@ -142,12 +142,12 @@ protected:
     virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
     virtual void adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
-    virtual void adjustSliderThumbSize(RenderObject* object) const;
+    virtual void adjustSliderThumbSize(RenderStyle*) const;
 
 #if ENABLE(VIDEO)
     void initMediaColors();
     void initMediaButtons();
-    void adjustMediaSliderThumbSize(RenderObject*) const;
+    void adjustMediaSliderThumbSize(RenderStyle*) const;
     virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const { return true; }
     virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&);
index a3b3b701b8a5181bd99429117c86ab09fb9bdd83..50675d1e940b38ef646ca901633efdd5b978b255 100644 (file)
@@ -524,12 +524,12 @@ bool RenderThemeGtk::paintSliderThumb(RenderObject* object, const PaintInfo& inf
     return false;
 }
 
-void RenderThemeGtk::adjustSliderThumbSize(RenderObject* o) const
+void RenderThemeGtk::adjustSliderThumbSize(RenderStyle* style) const
 {
-    ControlPart part = o->style()->appearance();
+    ControlPart part = style->appearance();
 #if ENABLE(VIDEO)
     if (part == MediaSliderThumbPart) {
-        adjustMediaSliderThumbSize(o);
+        adjustMediaSliderThumbSize(style);
         return;
     }
 #endif
@@ -542,13 +542,13 @@ void RenderThemeGtk::adjustSliderThumbSize(RenderObject* o) const
                          NULL);
 
     if (part == SliderThumbHorizontalPart) {
-        o->style()->setWidth(Length(length, Fixed));
-        o->style()->setHeight(Length(width, Fixed));
+        style->setWidth(Length(length, Fixed));
+        style->setHeight(Length(width, Fixed));
         return;
     }
     ASSERT(part == SliderThumbVerticalPart || part == MediaVolumeSliderThumbPart);
-    o->style()->setWidth(Length(width, Fixed));
-    o->style()->setHeight(Length(length, Fixed));
+    style->setWidth(Length(width, Fixed));
+    style->setHeight(Length(length, Fixed));
 }
 
 #if ENABLE(PROGRESS_TAG)
index 1b2b8cc788c364cbad385bd2122ad5de300a9eaa..d7041f52a8993204c362c2aa825750b3155d9515 100644 (file)
@@ -663,12 +663,12 @@ bool RenderThemeGtk::paintSliderThumb(RenderObject* renderObject, const PaintInf
     return false;
 }
 
-void RenderThemeGtk::adjustSliderThumbSize(RenderObject* renderObject) const
+void RenderThemeGtk::adjustSliderThumbSize(RenderStyle* style) const
 {
-    ControlPart part = renderObject->style()->appearance();
+    ControlPart part = style->appearance();
 #if ENABLE(VIDEO)
     if (part == MediaSliderThumbPart) {
-        adjustMediaSliderThumbSize(renderObject);
+        adjustMediaSliderThumbSize(style);
         return;
     }
 #endif
@@ -679,13 +679,13 @@ void RenderThemeGtk::adjustSliderThumbSize(RenderObject* renderObject) const
                                 "slider-length", &sliderLength,
                                 NULL);
     if (part == SliderThumbHorizontalPart) {
-        renderObject->style()->setWidth(Length(sliderLength, Fixed));
-        renderObject->style()->setHeight(Length(sliderWidth, Fixed));
+        style->setWidth(Length(sliderLength, Fixed));
+        style->setHeight(Length(sliderWidth, Fixed));
         return;
     }
     ASSERT(part == SliderThumbVerticalPart || part == MediaVolumeSliderThumbPart);
-    renderObject->style()->setWidth(Length(sliderWidth, Fixed));
-    renderObject->style()->setHeight(Length(sliderLength, Fixed));
+    style->setWidth(Length(sliderWidth, Fixed));
+    style->setHeight(Length(sliderLength, Fixed));
 }
 
 #if ENABLE(PROGRESS_TAG)
index 4d19acd9eff8a47e0c45499fa65bd4275dc6846c..da19394a17d9bfaeb786603105e34b9a00fb0ebc 100644 (file)
@@ -961,8 +961,9 @@ bool RenderThemeQt::paintSliderThumb(RenderObject* o, const PaintInfo& pi,
     return false;
 }
 
-void RenderThemeQt::adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
+void RenderThemeQt::adjustSliderThumbStyle(CSSStyleSelector* selector, RenderStyle* style, Element* element) const
 {
+    RenderTheme::adjustSliderThumbStyle(selector, style, element);
     style->setBoxShadow(nullptr);
 }
 
@@ -1463,7 +1464,7 @@ bool RenderThemeQt::paintMediaSliderThumb(RenderObject* o, const PaintInfo& pain
 }
 #endif
 
-void RenderThemeQt::adjustSliderThumbSize(RenderObject* o) const
+void RenderThemeQt::adjustSliderThumbSize(RenderStyle* style) const
 {
     // timelineThumbHeight should match the height property of -webkit-media-controls-timeline in mediaControlsQt.css.
     const int timelineThumbHeight = 12;
@@ -1471,25 +1472,25 @@ void RenderThemeQt::adjustSliderThumbSize(RenderObject* o) const
     // volumeThumbWidth should match the width property of -webkit-media-controls-volume-slider in mediaControlsQt.css.
     const int volumeThumbWidth = 12;
     const int volumeThumbHeight = volumeThumbWidth / 3;
-    ControlPart part = o->style()->appearance();
+    ControlPart part = style->appearance();
 
     if (part == MediaSliderThumbPart) {
-        o->style()->setWidth(Length(timelineThumbWidth, Fixed));
-        o->style()->setHeight(Length(timelineThumbHeight, Fixed));
+        style->setWidth(Length(timelineThumbWidth, Fixed));
+        style->setHeight(Length(timelineThumbHeight, Fixed));
     } else if (part == MediaVolumeSliderThumbPart) {
-        o->style()->setHeight(Length(volumeThumbHeight, Fixed));
-        o->style()->setWidth(Length(volumeThumbWidth, Fixed));
+        style->setHeight(Length(volumeThumbHeight, Fixed));
+        style->setWidth(Length(volumeThumbWidth, Fixed));
     } else if (part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart) {
         QStyleOptionSlider option;
         if (part == SliderThumbVerticalPart)
             option.orientation = Qt::Vertical;
 
-        QStyle* style = qStyle();
+        QStyle* qstyle = qStyle();
 
-        int width = style->pixelMetric(QStyle::PM_SliderLength, &option);
-        int height = style->pixelMetric(QStyle::PM_SliderThickness, &option);
-        o->style()->setWidth(Length(width, Fixed));
-        o->style()->setHeight(Length(height, Fixed));
+        int width = qstyle->pixelMetric(QStyle::PM_SliderLength, &option);
+        int height = qstyle->pixelMetric(QStyle::PM_SliderThickness, &option);
+        style->setWidth(Length(width, Fixed));
+        style->setHeight(Length(height, Fixed));
     }
 }
 
index 7570f29930927d8f02e956f389fa2486dccd85a4..92aa2abd01727e5c69c4388dbd591d2f49feacda 100644 (file)
@@ -88,19 +88,18 @@ static FloatRect getUnzoomedRectAndAdjustCurrentContext(RenderObject* o, const P
 static const int mediaSliderThumbWidth = 13;
 static const int mediaSliderThumbHeight = 14;
 
-void RenderMediaControls::adjustMediaSliderThumbSize(RenderObject* o)
+void RenderMediaControls::adjustMediaSliderThumbSize(RenderStyle* style)
 {
-    ControlPart part = o->style()->appearance();
-
+    ControlPart part = style->appearance();
     if (part != MediaSliderThumbPart && part != MediaVolumeSliderThumbPart)
         return;
 
     CGSize size;
     wkMeasureMediaUIPart(part == MediaSliderThumbPart ? MediaSliderThumb : MediaVolumeSliderThumb, WKMediaControllerThemeQuickTime, 0, &size);
 
-    float zoomLevel = o->style()->effectiveZoom();
-    o->style()->setWidth(Length(static_cast<int>(size.width * zoomLevel), Fixed));
-    o->style()->setHeight(Length(static_cast<int>(size.height * zoomLevel), Fixed));
+    float zoomLevel = style->effectiveZoom();
+    style->setWidth(Length(static_cast<int>(size.width * zoomLevel), Fixed));
+    style->setHeight(Length(static_cast<int>(size.height * zoomLevel), Fixed));
 }
 
 bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
index 3d3b017654ef429195cdf4b498f1eb144cb18770..f9d3f3d7827a3d875d2fcfb9d627ab737b92c388 100644 (file)
@@ -40,7 +40,7 @@ public:
 
 #if PLATFORM(WIN)
     static bool paintMediaControlsPart(MediaControlElementType, RenderObject*, const PaintInfo&, const IntRect&);
-    static void adjustMediaSliderThumbSize(RenderObject*);
+    static void adjustMediaSliderThumbSize(RenderStyle*);
 #endif
     static IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&);
 };
index 40ee9b0ab8a3a698adc40121611d7a6240a04454..de5f59483a0b07a167e982aab4fd5654ace6acf0 100644 (file)
@@ -280,21 +280,21 @@ bool RenderMediaControlsChromium::paintMediaControlsPart(MediaControlElementType
     return false;
 }
 
-void RenderMediaControlsChromium::adjustMediaSliderThumbSize(RenderObject* object)
+void RenderMediaControlsChromium::adjustMediaSliderThumbSize(RenderStyle* style)
 {
     static Image* mediaSliderThumb = platformResource("mediaSliderThumb");
     static Image* mediaVolumeSliderThumb = platformResource("mediaVolumeSliderThumb");
 
     Image* thumbImage = 0;
-    if (object->style()->appearance() == MediaSliderThumbPart)
+    if (style->appearance() == MediaSliderThumbPart)
         thumbImage = mediaSliderThumb;
-    else if (object->style()->appearance() == MediaVolumeSliderThumbPart)
+    else if (style->appearance() == MediaVolumeSliderThumbPart)
         thumbImage = mediaVolumeSliderThumb;
 
-    float zoomLevel = object->style()->effectiveZoom();
+    float zoomLevel = style->effectiveZoom();
     if (thumbImage) {
-        object->style()->setWidth(Length(static_cast<int>(thumbImage->width() * zoomLevel), Fixed));
-        object->style()->setHeight(Length(static_cast<int>(thumbImage->height() * zoomLevel), Fixed));
+        style->setWidth(Length(static_cast<int>(thumbImage->width() * zoomLevel), Fixed));
+        style->setHeight(Length(static_cast<int>(thumbImage->height() * zoomLevel), Fixed));
     }
 }
 
index 895ac439b02d9918b351b8620e023ce911b1d05a..9af93960ffefcce99af1264384ed33416a2d9f61 100644 (file)
@@ -37,7 +37,7 @@ class HTMLMediaElement;
 class RenderMediaControlsChromium {
 public:
     static bool paintMediaControlsPart(MediaControlElementType, RenderObject*, const PaintInfo&, const IntRect&);
-    static void adjustMediaSliderThumbSize(RenderObject*);
+    static void adjustMediaSliderThumbSize(RenderStyle*);
 };
 
 } // namespace WebCore
index 5449c412bf249c67000994360330dabf7e6186d7..2b849998b7cab1ca278cf5f0aec3d6b8b993f5f8 100644 (file)
@@ -136,10 +136,8 @@ void RenderSlider::layout()
 
     if (thumb) {
         // Allow the theme to set the size of the thumb.
-        if (thumb->style()->hasAppearance()) {
-            // FIXME: This should pass the style, not the renderer, to the theme.
-            theme()->adjustSliderThumbSize(thumb);
-        }
+        if (thumb->style()->hasAppearance())
+            theme()->adjustSliderThumbSize(thumb->style());
 
         baseSize.expand(thumb->style()->width().calcMinValue(0), thumb->style()->height().calcMinValue(0));
     }
index cb6e484077989621656028793f9c0d28d1d6f4f3..ee2d0b88d32d273b47834d2b2db0f6b89a29196f 100644 (file)
@@ -969,9 +969,10 @@ void RenderTheme::adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle*, Elemen
 
 void RenderTheme::adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle*, Element*) const
 {
+    // FIXME: Should call adjustSliderThumbSize().
 }
 
-void RenderTheme::adjustSliderThumbSize(RenderObject*) const
+void RenderTheme::adjustSliderThumbSize(RenderStyle*) const
 {
 }
 
index bf4fb42d620db2fcd2eb93bb42fe8b934e28df40..7dfe0564a56ac737e4cf39135cc39f3021c2676c 100644 (file)
@@ -160,7 +160,7 @@ public:
 
     virtual int minimumMenuListSize(RenderStyle*) const { return 0; }
 
-    virtual void adjustSliderThumbSize(RenderObject*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*) const;
 
     virtual int popupInternalPaddingLeft(RenderStyle*) const { return 0; }
     virtual int popupInternalPaddingRight(RenderStyle*) const { return 0; }
index c3f15c87a9d43487aec6939cdf233378a999d0b2..7af14c2e8446951f14e0413ce2fd23e6a5fbbdc2 100644 (file)
@@ -143,18 +143,18 @@ Color RenderThemeChromiumLinux::platformInactiveSelectionForegroundColor() const
     return m_inactiveSelectionForegroundColor;
 }
 
-void RenderThemeChromiumLinux::adjustSliderThumbSize(RenderObject* o) const
+void RenderThemeChromiumLinux::adjustSliderThumbSize(RenderStyle* style) const
 {
     IntSize size = PlatformBridge::getThemePartSize(PlatformBridge::PartSliderThumb);
 
-    if (o->style()->appearance() == SliderThumbHorizontalPart) {
-        o->style()->setWidth(Length(size.width(), Fixed));
-        o->style()->setHeight(Length(size.height(), Fixed));
-    } else if (o->style()->appearance() == SliderThumbVerticalPart) {
-        o->style()->setWidth(Length(size.height(), Fixed));
-        o->style()->setHeight(Length(size.width(), Fixed));
+    if (style->appearance() == SliderThumbHorizontalPart) {
+        style->setWidth(Length(size.width(), Fixed));
+        style->setHeight(Length(size.height(), Fixed));
+    } else if (style->appearance() == SliderThumbVerticalPart) {
+        style->setWidth(Length(size.height(), Fixed));
+        style->setHeight(Length(size.width(), Fixed));
     } else
-        RenderThemeChromiumSkia::adjustSliderThumbSize(o);
+        RenderThemeChromiumSkia::adjustSliderThumbSize(style);
 }
 
 bool RenderThemeChromiumLinux::supportsControlTints() const
index 8f3eb982f3cf51dfc919920b3b07a3fb1fbdf9c8..099001dfd72719be434444d2e72f23da36bc0404 100644 (file)
@@ -54,7 +54,7 @@ namespace WebCore {
         virtual Color platformActiveSelectionForegroundColor() const;
         virtual Color platformInactiveSelectionForegroundColor() const;
 
-        virtual void adjustSliderThumbSize(RenderObject*) const;
+        virtual void adjustSliderThumbSize(RenderStyle*) const;
 
         static void setCaretBlinkInterval(double interval);
         virtual double caretBlinkIntervalInternal() const;
index 84b4dbd63f84c9190f5017e4bf6a3b6e9bfb4e04..34853c06b32555d6c7ff0897896131c033124e4f 100644 (file)
@@ -33,7 +33,7 @@ public:
     static PassRefPtr<RenderTheme> create();
 protected:
 #if ENABLE(VIDEO)
-    virtual void adjustMediaSliderThumbSize(RenderObject*) const;
+    virtual void adjustMediaSliderThumbSize(RenderStyle*) const;
     virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
index 606797a6b240455684c9b881533e9aa1c7e0dca2..cccb7d3261e7bc8da0ba63df00376fac69e296d8 100644 (file)
@@ -122,9 +122,9 @@ void RenderThemeChromiumMac::updateActiveState(NSCell* cell, const RenderObject*
 
 #if ENABLE(VIDEO)
 
-void RenderThemeChromiumMac::adjustMediaSliderThumbSize(RenderObject* o) const
+void RenderThemeChromiumMac::adjustMediaSliderThumbSize(RenderStyle* style) const
 {
-    RenderMediaControlsChromium::adjustMediaSliderThumbSize(o);
+    RenderMediaControlsChromium::adjustMediaSliderThumbSize(style);
 }
 
 bool RenderThemeChromiumMac::paintMediaPlayButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
index cafc34d312e1291e776c9e9c3d2104abe48d9deb..e2bcff2db86c557dc005b8c89cf0b0b495eafaa8 100644 (file)
@@ -407,12 +407,12 @@ bool RenderThemeChromiumSkia::paintMediaVolumeSliderTrack(RenderObject* object,
 #endif
 }
 
-void RenderThemeChromiumSkia::adjustSliderThumbSize(RenderObject* object) const
+void RenderThemeChromiumSkia::adjustSliderThumbSize(RenderStyle* style) const
 {
 #if ENABLE(VIDEO)
-    RenderMediaControlsChromium::adjustMediaSliderThumbSize(object);
+    RenderMediaControlsChromium::adjustMediaSliderThumbSize(style);
 #else
-    UNUSED_PARAM(object);
+    UNUSED_PARAM(style);
 #endif
 }
 
index 2faf0644ec273df21f73fe2f8cf85a06f0e85aa1..0c998b326541fdac49b82ecb454f908e9983dabb 100644 (file)
@@ -91,7 +91,7 @@ class RenderThemeChromiumSkia : public RenderTheme {
         virtual bool paintMediaControlsBackground(RenderObject*, const PaintInfo&, const IntRect&);
         virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
         virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
-        virtual void adjustSliderThumbSize(RenderObject*) const;
+        virtual void adjustSliderThumbSize(RenderStyle*) const;
         virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
         virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
         virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&);
index 53ec9cbec38339f1ec83a2381806241e07d388dc..f289637853c831c24d8e75ba7f6ba864f31d6d11 100644 (file)
@@ -397,19 +397,19 @@ Color RenderThemeChromiumWin::systemColor(int cssValueId) const
     return Color(GetRValue(color), GetGValue(color), GetBValue(color));
 }
 
-void RenderThemeChromiumWin::adjustSliderThumbSize(RenderObject* o) const
+void RenderThemeChromiumWin::adjustSliderThumbSize(RenderStyle* style) const
 {
     // These sizes match what WinXP draws for various menus.
     const int sliderThumbAlongAxis = 11;
     const int sliderThumbAcrossAxis = 21;
-    if (o->style()->appearance() == SliderThumbHorizontalPart) {
-        o->style()->setWidth(Length(sliderThumbAlongAxis, Fixed));
-        o->style()->setHeight(Length(sliderThumbAcrossAxis, Fixed));
-    } else if (o->style()->appearance() == SliderThumbVerticalPart) {
-        o->style()->setWidth(Length(sliderThumbAcrossAxis, Fixed));
-        o->style()->setHeight(Length(sliderThumbAlongAxis, Fixed));
+    if (style->appearance() == SliderThumbHorizontalPart) {
+        style->setWidth(Length(sliderThumbAlongAxis, Fixed));
+        style->setHeight(Length(sliderThumbAcrossAxis, Fixed));
+    } else if (style->appearance() == SliderThumbVerticalPart) {
+        style->setWidth(Length(sliderThumbAcrossAxis, Fixed));
+        style->setHeight(Length(sliderThumbAlongAxis, Fixed));
     } else
-        RenderThemeChromiumSkia::adjustSliderThumbSize(o);
+        RenderThemeChromiumSkia::adjustSliderThumbSize(style);
 }
 
 bool RenderThemeChromiumWin::paintCheckbox(RenderObject* o, const PaintInfo& i, const IntRect& r)
index 661b6239df54cba8023558babaefafced88324a7..c47a67910d8078a6ebb7aa5732ff341a95e5ee44 100644 (file)
@@ -61,7 +61,7 @@ namespace WebCore {
         virtual void systemFont(int propId, FontDescription&) const;
         virtual Color systemColor(int cssValueId) const;
 
-        virtual void adjustSliderThumbSize(RenderObject*) const;
+        virtual void adjustSliderThumbSize(RenderStyle*) const;
 
         // Various paint functions.
         virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&);
index 8a17acf833cb07d5fa8b61d2aaa4c6c2a71854aa..b923b3e2f96765b187df0dfb4c35852c0f623fab 100644 (file)
@@ -71,7 +71,7 @@ public:
 
     virtual int minimumMenuListSize(RenderStyle*) const;
 
-    virtual void adjustSliderThumbSize(RenderObject*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*) const;
     
     virtual int popupInternalPaddingLeft(RenderStyle*) const;
     virtual int popupInternalPaddingRight(RenderStyle*) const;
@@ -170,7 +170,7 @@ protected:
     virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const;
     virtual bool usesMediaControlStatusDisplay();
     virtual bool usesMediaControlVolumeSlider() const;
-    virtual void adjustMediaSliderThumbSize(RenderObject*) const;
+    virtual void adjustMediaSliderThumbSize(RenderStyle*) const;
     virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;
 #endif
     
index d0fc9eb6211e25e529e549510531761340bd8e56..1d227772cc7f5ec720e780e62e6903851d98c536 100644 (file)
@@ -1289,8 +1289,9 @@ bool RenderThemeMac::paintSliderTrack(RenderObject* o, const PaintInfo& paintInf
     return false;
 }
 
-void RenderThemeMac::adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
+void RenderThemeMac::adjustSliderThumbStyle(CSSStyleSelector* selector, RenderStyle* style, Element* element) const
 {
+    RenderTheme::adjustSliderThumbStyle(selector, style, element);
     style->setBoxShadow(nullptr);
 }
 
@@ -1643,40 +1644,40 @@ const int sliderThumbHeight = 15;
 const int mediaSliderThumbWidth = 13;
 const int mediaSliderThumbHeight = 14;
 
-void RenderThemeMac::adjustSliderThumbSize(RenderObject* o) const
+void RenderThemeMac::adjustSliderThumbSize(RenderStyle* style) const
 {
-    float zoomLevel = o->style()->effectiveZoom();
-    if (o->style()->appearance() == SliderThumbHorizontalPart || o->style()->appearance() == SliderThumbVerticalPart) {
-        o->style()->setWidth(Length(static_cast<int>(sliderThumbWidth * zoomLevel), Fixed));
-        o->style()->setHeight(Length(static_cast<int>(sliderThumbHeight * zoomLevel), Fixed));
+    float zoomLevel = style->effectiveZoom();
+    if (style->appearance() == SliderThumbHorizontalPart || style->appearance() == SliderThumbVerticalPart) {
+        style->setWidth(Length(static_cast<int>(sliderThumbWidth * zoomLevel), Fixed));
+        style->setHeight(Length(static_cast<int>(sliderThumbHeight * zoomLevel), Fixed));
     } 
 
 #if ENABLE(VIDEO)
-    adjustMediaSliderThumbSize(o);
+    adjustMediaSliderThumbSize(style);
 #endif
 }
 
 #if ENABLE(VIDEO)
 
-void RenderThemeMac::adjustMediaSliderThumbSize(RenderObject* o) const
+void RenderThemeMac::adjustMediaSliderThumbSize(RenderStyle* style) const
 {
-    ControlPart part = o->style()->appearance();
+    ControlPart part = style->appearance();
 
     if (part == MediaSliderThumbPart || part == MediaVolumeSliderThumbPart) {
         int width = mediaSliderThumbWidth;
         int height = mediaSliderThumbHeight;
         
         if (mediaControllerTheme() == MediaControllerThemeQuickTime) {
-            CGSize  size;
+            CGSize size;
             
             wkMeasureMediaUIPart(part == MediaSliderThumbPart ? MediaSliderThumb : MediaVolumeSliderThumb, MediaControllerThemeQuickTime, NULL, &size);
             width = size.width;
             height = size.height;
         }
 
-        float zoomLevel = o->style()->effectiveZoom();
-        o->style()->setWidth(Length(static_cast<int>(width * zoomLevel), Fixed));
-        o->style()->setHeight(Length(static_cast<int>(height * zoomLevel), Fixed));
+        float zoomLevel = style->effectiveZoom();
+        style->setWidth(Length(static_cast<int>(width * zoomLevel), Fixed));
+        style->setHeight(Length(static_cast<int>(height * zoomLevel), Fixed));
     }
 }
 
index 1a8934552ecb25c6e1f1bcb010d1e9e12f6a343f..ee5e68a967daf7f96d5a95bdc8157880cab10419 100644 (file)
@@ -990,6 +990,7 @@ bool RenderThemeSafari::paintSliderTrack(RenderObject* o, const PaintInfo& paint
 
 void RenderThemeSafari::adjustSliderThumbStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const 
 { 
+    RenderTheme::adjustSliderThumbStyle(selector, style, e);
     style->setBoxShadow(nullptr); 
 } 
 
@@ -1014,15 +1015,15 @@ bool RenderThemeSafari::paintSliderThumb(RenderObject* o, const PaintInfo& paint
 const int sliderThumbWidth = 15;
 const int sliderThumbHeight = 15;
 
-void RenderThemeSafari::adjustSliderThumbSize(RenderObject* o) const
+void RenderThemeSafari::adjustSliderThumbSize(RenderStyle* style) const
 {
-    if (o->style()->appearance() == SliderThumbHorizontalPart || o->style()->appearance() == SliderThumbVerticalPart) {
-        o->style()->setWidth(Length(sliderThumbWidth, Fixed));
-        o->style()->setHeight(Length(sliderThumbHeight, Fixed));
+    if (style->appearance() == SliderThumbHorizontalPart || style->appearance() == SliderThumbVerticalPart) {
+        style->setWidth(Length(sliderThumbWidth, Fixed));
+        style->setHeight(Length(sliderThumbHeight, Fixed));
     } 
 #if ENABLE(VIDEO)
-    else if (o->style()->appearance() == MediaSliderThumbPart) 
-        RenderMediaControls::adjustMediaSliderThumbSize(o);
+    else if (style->appearance() == MediaSliderThumbPart) 
+        RenderMediaControls::adjustMediaSliderThumbSize(style);
 #endif
 }
 
index b91e28e6ef5cafbeceee2d015f230728555d6c24..66004f0440dd0fd97c5a2f9b83f50d90fa92f36b 100644 (file)
@@ -76,7 +76,7 @@ public:
 
     virtual int minimumMenuListSize(RenderStyle*) const;
 
-    virtual void adjustSliderThumbSize(RenderObject*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*) const;
     virtual void adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle*, Element*) const; 
     
     virtual int popupInternalPaddingLeft(RenderStyle*) const;
index 15f64c5e4c64b60ca25d865cad4b2bad3a0982ee..68c8ad1163753d86329aebd9f6139d634abec6ea 100644 (file)
@@ -833,19 +833,19 @@ bool RenderThemeWin::paintSliderThumb(RenderObject* o, const PaintInfo& i, const
 const int sliderThumbWidth = 7;
 const int sliderThumbHeight = 15;
 
-void RenderThemeWin::adjustSliderThumbSize(RenderObject* o) const
+void RenderThemeWin::adjustSliderThumbSize(RenderStyle* style) const
 {
-    ControlPart part = o->style()->appearance();
+    ControlPart part = style->appearance();
     if (part == SliderThumbVerticalPart) {
-        o->style()->setWidth(Length(sliderThumbHeight, Fixed));
-        o->style()->setHeight(Length(sliderThumbWidth, Fixed));
+        style->setWidth(Length(sliderThumbHeight, Fixed));
+        style->setHeight(Length(sliderThumbWidth, Fixed));
     } else if (part == SliderThumbHorizontalPart) {
-        o->style()->setWidth(Length(sliderThumbWidth, Fixed));
-        o->style()->setHeight(Length(sliderThumbHeight, Fixed));
+        style->setWidth(Length(sliderThumbWidth, Fixed));
+        style->setHeight(Length(sliderThumbHeight, Fixed));
     }
 #if ENABLE(VIDEO)
     else if (part == MediaSliderThumbPart || part == MediaVolumeSliderThumbPart) 
-        RenderMediaControls::adjustMediaSliderThumbSize(o);
+        RenderMediaControls::adjustMediaSliderThumbSize(style);
 #endif
 }
 
index 7e8a4915282edf7199e905e616b035f4eec73abd..373b4794d7704b9cc9d808d5c164170ddf754f1a 100644 (file)
@@ -93,7 +93,7 @@ public:
 
     virtual bool paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r);
     virtual bool paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r);
-    virtual void adjustSliderThumbSize(RenderObject*) const;
+    virtual void adjustSliderThumbSize(RenderStyle*) const;
 
     virtual bool popupOptionSupportsTextIndent() const { return true; }
 
index a56ab3ea47a5bf283206eabd3c12ebe89504a726..abc7216db4fa81a179a48f6f0c0642cdb3efe7c5 100644 (file)
@@ -331,14 +331,14 @@ Color RenderThemeWinCE::systemColor(int cssValueId) const
 const int sliderThumbWidth = 7;
 const int sliderThumbHeight = 15;
 
-void RenderThemeWinCE::adjustSliderThumbSize(RenderObject* o) const
-{
-    if (o->style()->appearance() == SliderThumbVerticalPart) {
-        o->style()->setWidth(Length(sliderThumbHeight, Fixed));
-        o->style()->setHeight(Length(sliderThumbWidth, Fixed));
-    } else if (o->style()->appearance() == SliderThumbHorizontalPart) {
-        o->style()->setWidth(Length(sliderThumbWidth, Fixed));
-        o->style()->setHeight(Length(sliderThumbHeight, Fixed));
+void RenderThemeWinCE::adjustSliderThumbSize(RenderStyle* style) const
+{
+    if (style->appearance() == SliderThumbVerticalPart) {
+        style->setWidth(Length(sliderThumbHeight, Fixed));
+        style->setHeight(Length(sliderThumbWidth, Fixed));
+    } else if (style->appearance() == SliderThumbHorizontalPart) {
+        style->setWidth(Length(sliderThumbWidth, Fixed));
+        style->setHeight(Length(sliderThumbHeight, Fixed));
     }
 }
 
index 14a5b1283266c0036e7aed3d15cbd00fbc2b7683..a7df48967faec63fe982b70abb709a98ffaac3fc 100644 (file)
@@ -89,7 +89,7 @@ namespace WebCore {
 
         virtual bool paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r);
         virtual bool paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r);
-        virtual void adjustSliderThumbSize(RenderObject*) const;
+        virtual void adjustSliderThumbSize(RenderStyle*) const;
 
         virtual bool popupOptionSupportsTextIndent() const { return true; }