2011-02-24 Dimitri Glazkov <dglazkov@chromium.org>
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Feb 2011 21:10:03 +0000 (21:10 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Feb 2011 21:10:03 +0000 (21:10 +0000)
commitd2f279c5456b98ad88672666f7f82db96cfc83e7
tree8a10577f26b8ec425fe370237e20d4e507f255f7
parent3716dd00aa6a864c3eabc632956e555266688160
2011-02-24  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        Simplify RenderTheme::volumeSliderOffsetFromMuteButton, unduplicate code.
        https://bugs.webkit.org/show_bug.cgi?id=55157

        Refactoring, no functional changes. Covered by existing tests.

        RenderTheme::volumeSliderOffsetFromMuteButton has the same duplicated
        logic for all platforms. This patch:
        a) moves the common logic of determining absolute positioning to a
           platform-agnostic place;
        b) simplifies the method to return constant offset.

        * html/shadow/MediaControls.cpp:
        (WebCore::volumeSliderOffset): Added new helper function,
            capturing common logic of finding the absolute position of the volume slider.
        (WebCore::MediaControls::updateVolumeSliderContainer): Changed to use the
            new helper.
        * rendering/RenderMediaControls.cpp:
        (WebCore::RenderMediaControls::volumeSliderOffsetRelativeToMuteButton): Simplified.
        * rendering/RenderMediaControls.h: Ditto.
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::volumeSliderOffsetRelativeToMuteButton): Ditto.
        * rendering/RenderTheme.h: Ditto.
        * rendering/RenderThemeChromiumMac.h: Ditto.
        * rendering/RenderThemeChromiumMac.mm: Ditto.
        (WebCore::RenderThemeChromiumMac::volumeSliderOffsetRelativeToMuteButton): Ditto.
        * rendering/RenderThemeMac.h: Ditto.
        * rendering/RenderThemeMac.mm: Ditto.
        (WebCore::RenderThemeMac::volumeSliderOffsetRelativeToMuteButton): Ditto.
        * rendering/RenderThemeWin.cpp: Ditto.
        (WebCore::RenderThemeWin::volumeSliderOffsetRelativeToMuteButton): Ditto.
        * rendering/RenderThemeWin.h: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
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
Source/WebCore/rendering/RenderThemeWin.h