Update all float attributes in HTMLMediaElement to double
https://bugs.webkit.org/show_bug.cgi?id=113615
Reviewed by Geoffrey Garen
Patch by Aaron Colwell
No new tests. Primary behavior doesn't change. Just time, playbackRate, and volume precision.
All existing LayoutTests/media tests still pass.
* WebCore.exp.in: Remove function that no longer need to be exported.
* html/HTMLMediaElement.cpp: Change all float attributes to double.
* html/HTMLMediaElement.h: Ditto.
* html/HTMLMediaElement.idl: Ditto.
* html/MediaController.cpp: Ditto.
* html/MediaController.h: Ditto.
* html/MediaControllerInterface.h: Ditto.
* html/TimeRanges.cpp: Ditto.
* html/TimeRanges.idl: Ditto.
* html/shadow/MediaControlElementTypes.cpp: Ditto.
* html/shadow/MediaControlElementTypes.h: Ditto.
* html/shadow/MediaControlElements.cpp: Ditto.
* html/shadow/MediaControlElements.h: Ditto.
* html/shadow/MediaControls.cpp: Ditto.
* html/shadow/MediaControlsApple.cpp: Ditto.
* html/shadow/MediaControlsBlackBerry.cpp: Ditto.
* html/shadow/MediaControlsBlackBerry.h: Ditto.
* html/shadow/MediaControlsGtk.cpp: Ditto.
* html/track/TextTrackCue.cpp: Ditto.
* html/track/TextTrackCue.h: Ditto.
* platform/Clock.h: Ditto.
* platform/ClockGeneric.cpp: Ditto.
* platform/ClockGeneric.h: Ditto.
* platform/graphics/MediaPlayer.cpp: Ditto.
* platform/graphics/MediaPlayer.h: Ditto.
* platform/graphics/MediaPlayerPrivate.h: Ditto.
* platform/mac/PlatformClockCA.cpp: Ditto.
* platform/mac/PlatformClockCA.h: Ditto.
* platform/mac/PlatformClockCM.h: Ditto.
* platform/mac/PlatformClockCM.mm: Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/html/MediaController.cpp b/Source/WebCore/html/MediaController.cpp
index 103161b..33c63a6 100644
--- a/Source/WebCore/html/MediaController.cpp
+++ b/Source/WebCore/html/MediaController.cpp
@@ -129,13 +129,13 @@
return playedRanges;
}
-float MediaController::duration() const
+double MediaController::duration() const
{
// FIXME: Investigate caching the maximum duration and only updating the cached value
// when the slaved media elements' durations change.
- float maxDuration = 0;
+ double maxDuration = 0;
for (size_t index = 0; index < m_mediaElements.size(); ++index) {
- float duration = m_mediaElements[index]->duration();
+ double duration = m_mediaElements[index]->duration();
if (std::isnan(duration))
continue;
maxDuration = max(maxDuration, duration);
@@ -143,26 +143,26 @@
return maxDuration;
}
-float MediaController::currentTime() const
+double MediaController::currentTime() const
{
if (m_mediaElements.isEmpty())
return 0;
if (m_position == MediaPlayer::invalidTime()) {
// Some clocks may return times outside the range of [0..duration].
- m_position = max(0.0f, min(duration(), m_clock->currentTime()));
+ m_position = max(0.0, min(duration(), m_clock->currentTime()));
m_clearPositionTimer.startOneShot(0);
}
return m_position;
}
-void MediaController::setCurrentTime(float time, ExceptionCode& code)
+void MediaController::setCurrentTime(double time, ExceptionCode& code)
{
// When the user agent is to seek the media controller to a particular new playback position,
// it must follow these steps:
// If the new playback position is less than zero, then set it to zero.
- time = max(0.0f, time);
+ time = max(0.0, time);
// If the new playback position is greater than the media controller duration, then set it
// to the media controller duration.
@@ -217,7 +217,7 @@
reportControllerState();
}
-void MediaController::setDefaultPlaybackRate(float rate)
+void MediaController::setDefaultPlaybackRate(double rate)
{
if (m_defaultPlaybackRate == rate)
return;
@@ -230,12 +230,12 @@
scheduleEvent(eventNames().ratechangeEvent);
}
-float MediaController::playbackRate() const
+double MediaController::playbackRate() const
{
return m_clock->playRate();
}
-void MediaController::setPlaybackRate(float rate)
+void MediaController::setPlaybackRate(double rate)
{
if (m_clock->playRate() == rate)
return;
@@ -251,7 +251,7 @@
scheduleEvent(eventNames().ratechangeEvent);
}
-void MediaController::setVolume(float level, ExceptionCode& code)
+void MediaController::setVolume(double level, ExceptionCode& code)
{
if (m_volume == level)
return;