Title: [294746] trunk/Source/WebCore
Revision
294746
Author
[email protected]
Date
2022-05-24 08:01:15 -0700 (Tue, 24 May 2022)

Log 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

Modified Paths

Diff

Modified: trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp (294745 => 294746)


--- trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp	2022-05-24 14:31:01 UTC (rev 294745)
+++ trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp	2022-05-24 15:01:15 UTC (rev 294746)
@@ -77,7 +77,7 @@
     const RenderStyle& sliderStyle = input.renderer()->style();
 
 #if ENABLE(VIDEO)
-    if (sliderStyle.effectiveAppearance() == MediaVolumeSliderPart && input.renderer()->theme().usesVerticalVolumeSlider())
+    if (sliderStyle.effectiveAppearance() == MediaVolumeSliderPart)
         return true;
 #endif
 

Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (294745 => 294746)


--- trunk/Source/WebCore/rendering/RenderTheme.cpp	2022-05-24 14:31:01 UTC (rev 294745)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp	2022-05-24 15:01:15 UTC (rev 294746)
@@ -698,43 +698,6 @@
     }
 }
 
-#if ENABLE(VIDEO)
-
-String RenderTheme::formatMediaControlsTime(float time) const
-{
-    if (!std::isfinite(time))
-        time = 0;
-    // FIXME: Seems like it would be better to use std::lround here.
-    int seconds = static_cast<int>(std::abs(time));
-    int hours = seconds / (60 * 60);
-    int minutes = (seconds / 60) % 60;
-    seconds %= 60;
-    if (hours)
-        return makeString((time < 0 ? "-" : ""), hours, ':', pad('0', 2, minutes), ':', pad('0', 2, seconds));
-    return makeString((time < 0 ? "-" : ""), pad('0', 2, minutes), ':', pad('0', 2, seconds));
-}
-
-String RenderTheme::formatMediaControlsCurrentTime(float currentTime, float /*duration*/) const
-{
-    return formatMediaControlsTime(currentTime);
-}
-
-String RenderTheme::formatMediaControlsRemainingTime(float currentTime, float duration) const
-{
-    return formatMediaControlsTime(currentTime - duration);
-}
-
-LayoutPoint RenderTheme::volumeSliderOffsetFromMuteButton(const RenderBox& muteButtonBox, const LayoutSize& size) const
-{
-    LayoutUnit y = -size.height();
-    FloatPoint absPoint = muteButtonBox.localToAbsolute(FloatPoint(muteButtonBox.offsetLeft(), y), { IsFixed, UseTransforms });
-    if (absPoint.y() < 0)
-        y = muteButtonBox.height();
-    return LayoutPoint(0_lu, y);
-}
-
-#endif
-
 Color RenderTheme::activeSelectionBackgroundColor(OptionSet<StyleColorOptions> options) const
 {
     auto& cache = colorCache(options);

Modified: trunk/Source/WebCore/rendering/RenderTheme.h (294745 => 294746)


--- trunk/Source/WebCore/rendering/RenderTheme.h	2022-05-24 14:31:01 UTC (rev 294745)
+++ trunk/Source/WebCore/rendering/RenderTheme.h	2022-05-24 15:01:15 UTC (rev 294746)
@@ -206,23 +206,6 @@
     virtual Seconds animationDurationForProgressBar(const RenderProgress&) const;
     virtual IntRect progressBarRectForBounds(const RenderObject&, const IntRect&) const;
 
-#if ENABLE(VIDEO)
-    // Media controls
-    virtual bool supportsClosedCaptioning() const { return false; }
-    virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const { return false; }
-    virtual bool usesMediaControlStatusDisplay() { return false; }
-    virtual bool usesMediaControlVolumeSlider() const { return true; }
-    virtual bool usesVerticalVolumeSlider() const { return true; }
-    virtual double mediaControlsFadeInDuration() { return 0.1; }
-    virtual Seconds mediaControlsFadeOutDuration() { return 300_ms; }
-    virtual String formatMediaControlsTime(float time) const;
-    virtual String formatMediaControlsCurrentTime(float currentTime, float duration) const;
-    virtual String formatMediaControlsRemainingTime(float currentTime, float duration) const;
-    
-    // Returns the media volume slider container's offset from the mute button.
-    virtual LayoutPoint volumeSliderOffsetFromMuteButton(const RenderBox&, const LayoutSize&) const;
-#endif
-
     virtual IntSize meterSizeForBounds(const RenderMeter&, const IntRect&) const;
     virtual bool supportsMeter(ControlPart, const HTMLMeterElement&) const;
 

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.h (294745 => 294746)


--- trunk/Source/WebCore/rendering/RenderThemeMac.h	2022-05-24 14:31:01 UTC (rev 294745)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.h	2022-05-24 15:01:15 UTC (rev 294746)
@@ -150,10 +150,6 @@
     void adjustImageControlsButtonStyle(RenderStyle&, const Element*) const final;
 #endif
 
-#if ENABLE(VIDEO)
-    bool supportsClosedCaptioning() const final { return true; }
-#endif
-
 #if ENABLE(ATTACHMENT_ELEMENT)
     LayoutSize attachmentIntrinsicSize(const RenderAttachment&) const final;
     int attachmentBaseline(const RenderAttachment&) const final;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to