2011-03-03 Dimitri Glazkov <dglazkov@chromium.org>
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Mar 2011 21:19:23 +0000 (21:19 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Mar 2011 21:19:23 +0000 (21:19 +0000)
        Reviewed by Darin Adler.

        Use RenderBox in volumeSliderOffsetFromMuteButton, since that's what is actually being used.
        https://bugs.webkit.org/show_bug.cgi?id=55099

        Cleanup, no behavior change.

        * html/shadow/MediaControls.cpp:
        (WebCore::MediaControls::updateVolumeSliderContainer): Changed to pass RenderBox
            instead of Node.
        * rendering/RenderMediaControls.cpp:
        (WebCore::RenderMediaControls::volumeSliderOffsetFromMuteButton): Changed
            to use RenderBox as argument.
        * rendering/RenderMediaControls.h: Ditto.
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::volumeSliderOffsetFromMuteButton): Ditto.
        * rendering/RenderTheme.h: Ditto.
        * rendering/RenderThemeChromiumMac.h: Ditto.
        * rendering/RenderThemeChromiumMac.mm:
        (WebCore::RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton): Ditto.
        * rendering/RenderThemeMac.h: Ditto.
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::volumeSliderOffsetFromMuteButton): Ditto.
        * rendering/RenderThemeWin.cpp:
        (WebCore::RenderThemeWin::volumeSliderOffsetFromMuteButton): Ditto.

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

Source/WebCore/ChangeLog
Source/WebCore/html/shadow/MediaControls.cpp
Source/WebCore/rendering/RenderMediaControls.cpp
Source/WebCore/rendering/RenderMediaControls.h
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeChromiumMac.h
Source/WebCore/rendering/RenderThemeChromiumMac.mm
Source/WebCore/rendering/RenderThemeMac.h
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderThemeWin.cpp

index 33c21f1..1cc67a9 100644 (file)
@@ -1,3 +1,31 @@
+2011-03-03  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Use RenderBox in volumeSliderOffsetFromMuteButton, since that's what is actually being used.
+        https://bugs.webkit.org/show_bug.cgi?id=55099
+
+        Cleanup, no behavior change.
+
+        * html/shadow/MediaControls.cpp:
+        (WebCore::MediaControls::updateVolumeSliderContainer): Changed to pass RenderBox
+            instead of Node.
+        * rendering/RenderMediaControls.cpp:
+        (WebCore::RenderMediaControls::volumeSliderOffsetFromMuteButton): Changed
+            to use RenderBox as argument.
+        * rendering/RenderMediaControls.h: Ditto.
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::volumeSliderOffsetFromMuteButton): Ditto.
+        * rendering/RenderTheme.h: Ditto.
+        * rendering/RenderThemeChromiumMac.h: Ditto.
+        * rendering/RenderThemeChromiumMac.mm:
+        (WebCore::RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton): Ditto.
+        * rendering/RenderThemeMac.h: Ditto.
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::volumeSliderOffsetFromMuteButton): Ditto.
+        * rendering/RenderThemeWin.cpp:
+        (WebCore::RenderThemeWin::volumeSliderOffsetFromMuteButton): Ditto.
+
 2011-03-03  Alexis Menard  <alexis.menard@openbossa.org>
 
         Reviewed by Andreas Kling.
index c21e0e6..d8c9936 100644 (file)
@@ -467,7 +467,7 @@ void MediaControls::updateVolumeSliderContainer(bool visible)
         RefPtr<RenderStyle> s = m_volumeSliderContainer->styleForElement();
         int height = s->height().isPercent() ? 0 : s->height().value();
         int width = s->width().isPercent() ? 0 : s->width().value();
-        IntPoint offset = m_mediaElement->document()->page()->theme()->volumeSliderOffsetFromMuteButton(m_muteButton->renderer()->node(), IntSize(width, height));
+        IntPoint offset = m_mediaElement->document()->page()->theme()->volumeSliderOffsetFromMuteButton(m_muteButton->renderBox(), IntSize(width, height));
         int x = offset.x() + m_muteButton->renderBox()->offsetLeft();
         int y = offset.y() + m_muteButton->renderBox()->offsetTop();
 
index 0a3f8f7..dd58cd2 100644 (file)
@@ -179,16 +179,16 @@ bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, R
 
 #endif
 
-IntPoint RenderMediaControls::volumeSliderOffsetFromMuteButton(Node* muteButton, const IntSize& size)
+IntPoint RenderMediaControls::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size)
 {
     static const int xOffset = -4;
     static const int yOffset = 5;
 
-    float zoomLevel = muteButton->renderer()->style()->effectiveZoom();
-    int y = yOffset * zoomLevel + muteButton->renderBox()->offsetHeight() - size.height();
-    FloatPoint absPoint = muteButton->renderer()->localToAbsolute(FloatPoint(muteButton->renderBox()->offsetLeft(), y), true, true);
+    float zoomLevel = muteButtonBox->style()->effectiveZoom();
+    int y = yOffset * zoomLevel + muteButtonBox->offsetHeight() - size.height();
+    FloatPoint absPoint = muteButtonBox->localToAbsolute(FloatPoint(muteButtonBox->offsetLeft(), y), true, true);
     if (absPoint.y() < 0)
-        y = muteButton->renderBox()->height();
+        y = muteButtonBox->height();
     return IntPoint(xOffset * zoomLevel, y);
 }
 
index 4c663bc..3d3b017 100644 (file)
@@ -42,7 +42,7 @@ public:
     static bool paintMediaControlsPart(MediaControlElementType, RenderObject*, const PaintInfo&, const IntRect&);
     static void adjustMediaSliderThumbSize(RenderObject*);
 #endif
-    static IntPoint volumeSliderOffsetFromMuteButton(Node*, const IntSize&);
+    static IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&);
 };
 
 } // namespace WebCore
index b0b7735..73a4ef7 100644 (file)
@@ -537,12 +537,12 @@ String RenderTheme::formatMediaControlsRemainingTime(float currentTime, float du
     return formatMediaControlsTime(currentTime - duration);
 }
 
-IntPoint RenderTheme::volumeSliderOffsetFromMuteButton(Node* muteButton, const IntSize& size) const
+IntPoint RenderTheme::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
 {
     int y = -size.height();
-    FloatPoint absPoint = muteButton->renderer()->localToAbsolute(FloatPoint(muteButton->renderBox()->offsetLeft(), y), true, true);
+    FloatPoint absPoint = muteButtonBox->localToAbsolute(FloatPoint(muteButtonBox->offsetLeft(), y), true, true);
     if (absPoint.y() < 0)
-        y = muteButton->renderBox()->height();
+        y = muteButtonBox->height();
     return IntPoint(0, y);
 }
 
index bce8d78..35f256c 100644 (file)
@@ -188,7 +188,7 @@ public:
     virtual String formatMediaControlsRemainingTime(float currentTime, float duration) const;
     
     // Returns the media volume slider container's offset from the mute button.
-    virtual IntPoint volumeSliderOffsetFromMuteButton(Node*, const IntSize&) const;
+    virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;
 #endif
 
 #if ENABLE(METER_TAG)
index 80bbae4..4fd371f 100644 (file)
@@ -45,7 +45,7 @@ protected:
     virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual IntPoint volumeSliderOffsetFromMuteButton(Node*, const IntSize&) const;
+    virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;
     virtual bool usesMediaControlStatusDisplay() { return false; }
 
 #endif
index 10285ac..a7d59a9 100644 (file)
@@ -155,9 +155,9 @@ bool RenderThemeChromiumMac::paintMediaSliderThumb(RenderObject* object, const P
     return RenderMediaControlsChromium::paintMediaControlsPart(MediaSliderThumb, object, paintInfo, rect);
 }
 
-IntPoint RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton(Node* muteButton, const IntSize& size) const
+IntPoint RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
 {
-    return RenderTheme::volumeSliderOffsetFromMuteButton(muteButton, size);
+    return RenderTheme::volumeSliderOffsetFromMuteButton(muteButtonBox, size);
 }
 #endif
 
index 9837c2a..d951ff6 100644 (file)
@@ -166,7 +166,7 @@ protected:
     virtual bool shouldRenderMediaControlPart(ControlPart, Element*);
     virtual bool usesMediaControlStatusDisplay();
     virtual void adjustMediaSliderThumbSize(RenderObject*) const;
-    virtual IntPoint volumeSliderOffsetFromMuteButton(Node*, const IntSize&) const;
+    virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;
 #endif
     
     virtual bool shouldShowPlaceholderWhenFocused() const;
index 3510a81..f5611dc 100644 (file)
@@ -1987,9 +1987,9 @@ bool RenderThemeMac::usesMediaControlStatusDisplay()
     return mediaControllerTheme() == MediaControllerThemeQuickTime;
 }
 
-IntPoint RenderThemeMac::volumeSliderOffsetFromMuteButton(Node* muteButton, const IntSize& size) const
+IntPoint RenderThemeMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
 {
-    return RenderMediaControls::volumeSliderOffsetFromMuteButton(muteButton, size);
+    return RenderMediaControls::volumeSliderOffsetFromMuteButton(muteButtonBox, size);
 }
 
 bool RenderThemeMac::shouldShowPlaceholderWhenFocused() const
index 5581db8..d5e4155 100644 (file)
@@ -1108,9 +1108,9 @@ bool RenderThemeWin::paintMediaVolumeSliderThumb(RenderObject* o, const PaintInf
     return RenderMediaControls::paintMediaControlsPart(MediaVolumeSliderThumb, o, paintInfo, r);
 }
 
-IntPoint RenderThemeWin::volumeSliderOffsetFromMuteButton(Node* muteButton, const IntSize& size) const
+IntPoint RenderThemeWin::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
 {
-    return RenderMediaControls::volumeSliderOffsetFromMuteButton(muteButton, size);
+    return RenderMediaControls::volumeSliderOffsetFromMuteButton(muteButtonBox, size);
 }