⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 294746 in webkit


Ignore:
Timestamp:
May 24, 2022, 8:01:15 AM (4 years ago)
Author:
ntim@apple.com
Message:

Remove unused RenderTheme video-related methods
https://bugs.webkit.org/show_bug.cgi?id=240862

Reviewed by Antoine Quint.

  • Source/WebCore/html/shadow/SliderThumbElement.cpp:

(WebCore::hasVerticalAppearance):

  • Source/WebCore/rendering/RenderTheme.cpp:

(WebCore::RenderTheme::formatMediaControlsTime const): Deleted.
(WebCore::RenderTheme::formatMediaControlsCurrentTime const): Deleted.
(WebCore::RenderTheme::formatMediaControlsRemainingTime const): Deleted.
(WebCore::RenderTheme::volumeSliderOffsetFromMuteButton const): Deleted.

  • Source/WebCore/rendering/RenderTheme.h:

(WebCore::RenderTheme::supportsClosedCaptioning const): Deleted.
(WebCore::RenderTheme::hasOwnDisabledStateHandlingFor const): Deleted.
(WebCore::RenderTheme::usesMediaControlStatusDisplay): Deleted.
(WebCore::RenderTheme::usesMediaControlVolumeSlider const): Deleted.
(WebCore::RenderTheme::usesVerticalVolumeSlider const): Deleted.
(WebCore::RenderTheme::mediaControlsFadeInDuration): Deleted.
(WebCore::RenderTheme::mediaControlsFadeOutDuration): Deleted.

  • Source/WebCore/rendering/RenderThemeMac.h:

(WebCore::RenderThemeMac::supportsClosedCaptioning const final): Deleted.

Canonical link: https://commits.webkit.org/250914@main

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp

    r294728 r294746  
    7878
    7979#if ENABLE(VIDEO)
    80     if (sliderStyle.effectiveAppearance() == MediaVolumeSliderPart && input.renderer()->theme().usesVerticalVolumeSlider())
     80    if (sliderStyle.effectiveAppearance() == MediaVolumeSliderPart)
    8181        return true;
    8282#endif
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r294680 r294746  
    698698    }
    699699}
    700 
    701 #if ENABLE(VIDEO)
    702 
    703 String RenderTheme::formatMediaControlsTime(float time) const
    704 {
    705     if (!std::isfinite(time))
    706         time = 0;
    707     // FIXME: Seems like it would be better to use std::lround here.
    708     int seconds = static_cast<int>(std::abs(time));
    709     int hours = seconds / (60 * 60);
    710     int minutes = (seconds / 60) % 60;
    711     seconds %= 60;
    712     if (hours)
    713         return makeString((time < 0 ? "-" : ""), hours, ':', pad('0', 2, minutes), ':', pad('0', 2, seconds));
    714     return makeString((time < 0 ? "-" : ""), pad('0', 2, minutes), ':', pad('0', 2, seconds));
    715 }
    716 
    717 String RenderTheme::formatMediaControlsCurrentTime(float currentTime, float /*duration*/) const
    718 {
    719     return formatMediaControlsTime(currentTime);
    720 }
    721 
    722 String RenderTheme::formatMediaControlsRemainingTime(float currentTime, float duration) const
    723 {
    724     return formatMediaControlsTime(currentTime - duration);
    725 }
    726 
    727 LayoutPoint RenderTheme::volumeSliderOffsetFromMuteButton(const RenderBox& muteButtonBox, const LayoutSize& size) const
    728 {
    729     LayoutUnit y = -size.height();
    730     FloatPoint absPoint = muteButtonBox.localToAbsolute(FloatPoint(muteButtonBox.offsetLeft(), y), { IsFixed, UseTransforms });
    731     if (absPoint.y() < 0)
    732         y = muteButtonBox.height();
    733     return LayoutPoint(0_lu, y);
    734 }
    735 
    736 #endif
    737700
    738701Color RenderTheme::activeSelectionBackgroundColor(OptionSet<StyleColorOptions> options) const
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r294640 r294746  
    207207    virtual IntRect progressBarRectForBounds(const RenderObject&, const IntRect&) const;
    208208
    209 #if ENABLE(VIDEO)
    210     // Media controls
    211     virtual bool supportsClosedCaptioning() const { return false; }
    212     virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const { return false; }
    213     virtual bool usesMediaControlStatusDisplay() { return false; }
    214     virtual bool usesMediaControlVolumeSlider() const { return true; }
    215     virtual bool usesVerticalVolumeSlider() const { return true; }
    216     virtual double mediaControlsFadeInDuration() { return 0.1; }
    217     virtual Seconds mediaControlsFadeOutDuration() { return 300_ms; }
    218     virtual String formatMediaControlsTime(float time) const;
    219     virtual String formatMediaControlsCurrentTime(float currentTime, float duration) const;
    220     virtual String formatMediaControlsRemainingTime(float currentTime, float duration) const;
    221    
    222     // Returns the media volume slider container's offset from the mute button.
    223     virtual LayoutPoint volumeSliderOffsetFromMuteButton(const RenderBox&, const LayoutSize&) const;
    224 #endif
    225 
    226209    virtual IntSize meterSizeForBounds(const RenderMeter&, const IntRect&) const;
    227210    virtual bool supportsMeter(ControlPart, const HTMLMeterElement&) const;
  • trunk/Source/WebCore/rendering/RenderThemeMac.h

    r294680 r294746  
    151151#endif
    152152
    153 #if ENABLE(VIDEO)
    154     bool supportsClosedCaptioning() const final { return true; }
    155 #endif
    156 
    157153#if ENABLE(ATTACHMENT_ELEMENT)
    158154    LayoutSize attachmentIntrinsicSize(const RenderAttachment&) const final;
Note: See TracChangeset for help on using the changeset viewer.