Skip to content
Permalink
Browse files
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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
nt1m committed May 24, 2022
1 parent 0862e86 commit b85b20b6c8c07abb3ba2ec432b47b6b80145ef47
Showing 4 changed files with 1 addition and 59 deletions.
@@ -77,7 +77,7 @@ inline static bool hasVerticalAppearance(HTMLInputElement& input)
const RenderStyle& sliderStyle = input.renderer()->style();

#if ENABLE(VIDEO)
if (sliderStyle.effectiveAppearance() == MediaVolumeSliderPart && input.renderer()->theme().usesVerticalVolumeSlider())
if (sliderStyle.effectiveAppearance() == MediaVolumeSliderPart)
return true;
#endif

@@ -698,43 +698,6 @@ void RenderTheme::paintDecorations(const RenderBox& box, const PaintInfo& paintI
}
}

#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);
@@ -206,23 +206,6 @@ class RenderTheme {
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;

@@ -150,10 +150,6 @@ class RenderThemeMac final : public RenderThemeCocoa {
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;

0 comments on commit b85b20b

Please sign in to comment.