Commit b96ab1a9 authored by jer.noble@apple.com's avatar jer.noble@apple.com

HTMLMediaElement should not throw an exception from setCurrentTime or fastSeek.

https://bugs.webkit.org/show_bug.cgi?id=124294

Reviewed by Eric Carlson.

Source/WebCore:

Update the seek logic to match the current specification. This means removing exception
throwing from both the .idl and the implementation.

Remove the ExceptionCode parameter from setCurrentTime and fastSeek:
* html/HTMLMediaElement.cpp:
(HTMLMediaElement::fastSeek):
(HTMLMediaElement::seek):
(HTMLMediaElement::seekWithTolerance):
(HTMLMediaElement::setCurrentTime):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* html/MediaController.cpp:
(MediaController::setCurrentTime):
* html/MediaController.h:
* html/MediaController.idl:
* html/MediaControllerInterface.h:

Do not pass in an ExceptionCode placeholder when calling seek:
* html/HTMLMediaElement.cpp:
(HTMLMediaElement::rewind):
(HTMLMediaElement::returnToRealtime):
(HTMLMediaElement::finishSeek):
(HTMLMediaElement::playInternal):
(HTMLMediaElement::mediaPlayerTimeChanged):
(HTMLMediaElement::mediaPlayerDurationChanged):
(HTMLMediaElement::applyMediaFragmentURI):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* html/MediaController.cpp:
(MediaController::bringElementUpToSpeed):
* html/MediaController.h:
* html/MediaController.idl:
* html/MediaControllerInterface.h:
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::MediaControlSeekButtonElement::seekTimerFired):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlRewindButtonElement::defaultEventHandler):
(WebCore::MediaControlTimelineElement::defaultEventHandler):
* platform/mac/WebVideoFullscreenHUDWindowController.mm:
(-[WebVideoFullscreenHUDWindowController setCurrentTime:]):

LayoutTests:

* media/video-seek-no-src-exception-expected.txt: Removed.
* media/video-seek-no-src-exception.html: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 046ca9e7
2013-11-15 Jer Noble <jer.noble@apple.com>
HTMLMediaElement should not throw an exception from setCurrentTime or fastSeek.
https://bugs.webkit.org/show_bug.cgi?id=124294
Reviewed by Eric Carlson.
* media/video-seek-no-src-exception-expected.txt: Removed.
* media/video-seek-no-src-exception.html: Removed.
2013-11-15 Tim Horton <timothy_horton@apple.com>
Layout Test editing/selection/5057506.html frequently times out on Mac WK2
......
Test that seeking video with no 'src' attribute throws an INVALID_STATE_ERR exception.
EXPECTED (video.networkState == '0') OK
EXPECTED (video.readyState == '0') OK
TEST(video.currentTime = 1.1) THROWS(DOMException.INVALID_STATE_ERR) OK
END OF TEST
<html>
<body>
<video loop controls></video>
<p>Test that seeking video with no 'src' attribute throws an INVALID_STATE_ERR exception.</p>
<script src=video-test.js></script>
<script>
testExpected("video.networkState", HTMLMediaElement.NETWORK_EMPTY);
testExpected("video.readyState", HTMLMediaElement.HAVE_NOTHING);
testDOMException("video.currentTime = 1.1", "DOMException.INVALID_STATE_ERR");
setTimeout(endTest, 200)
</script>
</body>
</html>
2013-11-15 Jer Noble <jer.noble@apple.com>
HTMLMediaElement should not throw an exception from setCurrentTime or fastSeek.
https://bugs.webkit.org/show_bug.cgi?id=124294
Reviewed by Eric Carlson.
Update the seek logic to match the current specification. This means removing exception
throwing from both the .idl and the implementation.
Remove the ExceptionCode parameter from setCurrentTime and fastSeek:
* html/HTMLMediaElement.cpp:
(HTMLMediaElement::fastSeek):
(HTMLMediaElement::seek):
(HTMLMediaElement::seekWithTolerance):
(HTMLMediaElement::setCurrentTime):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* html/MediaController.cpp:
(MediaController::setCurrentTime):
* html/MediaController.h:
* html/MediaController.idl:
* html/MediaControllerInterface.h:
Do not pass in an ExceptionCode placeholder when calling seek:
* html/HTMLMediaElement.cpp:
(HTMLMediaElement::rewind):
(HTMLMediaElement::returnToRealtime):
(HTMLMediaElement::finishSeek):
(HTMLMediaElement::playInternal):
(HTMLMediaElement::mediaPlayerTimeChanged):
(HTMLMediaElement::mediaPlayerDurationChanged):
(HTMLMediaElement::applyMediaFragmentURI):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* html/MediaController.cpp:
(MediaController::bringElementUpToSpeed):
* html/MediaController.h:
* html/MediaController.idl:
* html/MediaControllerInterface.h:
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::MediaControlSeekButtonElement::seekTimerFired):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlRewindButtonElement::defaultEventHandler):
(WebCore::MediaControlTimelineElement::defaultEventHandler):
* platform/mac/WebVideoFullscreenHUDWindowController.mm:
(-[WebVideoFullscreenHUDWindowController setCurrentTime:]):
2013-11-15 Brady Eidson <beidson@apple.com>
Remove last vestiges of IDBBackingStore* from IDBTransactionBackend.
......
......@@ -2110,13 +2110,13 @@ void HTMLMediaElement::progressEventTimerFired(Timer<HTMLMediaElement>*)
void HTMLMediaElement::rewind(double timeDelta)
{
LOG(Media, "HTMLMediaElement::rewind(%f)", timeDelta);
setCurrentTime(std::max(currentTime() - timeDelta, minTimeSeekable()), IGNORE_EXCEPTION);
setCurrentTime(std::max(currentTime() - timeDelta, minTimeSeekable()));
}
void HTMLMediaElement::returnToRealtime()
{
LOG(Media, "HTMLMediaElement::returnToRealtime");
setCurrentTime(maxTimeSeekable(), IGNORE_EXCEPTION);
setCurrentTime(maxTimeSeekable());
}
void HTMLMediaElement::addPlayedRange(double start, double end)
......@@ -2146,7 +2146,7 @@ void HTMLMediaElement::prepareToPlay()
m_player->prepareToPlay();
}
void HTMLMediaElement::fastSeek(double time, ExceptionCode& ec)
void HTMLMediaElement::fastSeek(double time)
{
LOG(Media, "HTMLMediaElement::fastSeek(%f)", time);
// 4.7.10.9 Seeking
......@@ -2160,24 +2160,25 @@ void HTMLMediaElement::fastSeek(double time, ExceptionCode& ec)
double negativeTolerance = delta >= 0 ? delta : std::numeric_limits<double>::infinity();
double positiveTolerance = delta < 0 ? -delta : std::numeric_limits<double>::infinity();
seekWithTolerance(time, negativeTolerance, positiveTolerance, ec);
seekWithTolerance(time, negativeTolerance, positiveTolerance);
}
void HTMLMediaElement::seek(double time, ExceptionCode& ec)
void HTMLMediaElement::seek(double time)
{
LOG(Media, "HTMLMediaElement::seek(%f)", time);
seekWithTolerance(time, 0, 0, ec);
seekWithTolerance(time, 0, 0);
}
void HTMLMediaElement::seekWithTolerance(double time, double negativeTolerance, double positiveTolerance, ExceptionCode& ec)
void HTMLMediaElement::seekWithTolerance(double time, double negativeTolerance, double positiveTolerance)
{
// 4.8.9.9 Seeking
// 4.8.10.9 Seeking
// 1 - If the media element's readyState is HAVE_NOTHING, then raise an INVALID_STATE_ERR exception.
if (m_readyState == HAVE_NOTHING || !m_player) {
ec = INVALID_STATE_ERR;
// 1 - Set the media element's show poster flag to false.
setDisplayMode(Video);
// 2 - If the media element's readyState is HAVE_NOTHING, abort these steps.
if (m_readyState == HAVE_NOTHING || !m_player)
return;
}
// If the media engine has been told to postpone loading data, let it go ahead now.
if (m_preload < MediaPlayer::Auto && m_readyState < HAVE_FUTURE_DATA)
......@@ -2187,20 +2188,24 @@ void HTMLMediaElement::seekWithTolerance(double time, double negativeTolerance,
refreshCachedTime();
double now = currentTime();
// 2 - If the element's seeking IDL attribute is true, then another instance of this algorithm is
// 3 - If the element's seeking IDL attribute is true, then another instance of this algorithm is
// already running. Abort that other instance of the algorithm without waiting for the step that
// it is running to complete.
// Nothing specific to be done here.
// 3 - Set the seeking IDL attribute to true.
// 4 - Set the seeking IDL attribute to true.
// The flag will be cleared when the engine tells us the time has actually changed.
m_seeking = true;
// 5 - If the new playback position is later than the end of the media resource, then let it be the end
// 5 - If the seek was in response to a DOM method call or setting of an IDL attribute, then continue
// the script. The remainder of these steps must be run asynchronously.
// Nothing to be done here.
// 6 - If the new playback position is later than the end of the media resource, then let it be the end
// of the media resource instead.
time = std::min(time, duration());
// 6 - If the new playback position is less than the earliest possible position, let it be that position instead.
// 7 - If the new playback position is less than the earliest possible position, let it be that position instead.
double earliestTime = m_player->startTime();
time = std::max(time, earliestTime);
......@@ -2216,7 +2221,7 @@ void HTMLMediaElement::seekWithTolerance(double time, double negativeTolerance,
#endif
time = m_player->mediaTimeForTimeValue(time);
// 7 - If the (possibly now changed) new playback position is not in one of the ranges given in the
// 8 - If the (possibly now changed) new playback position is not in one of the ranges given in the
// seekable attribute, then let it be the position in one of the ranges given in the seekable attribute
// that is the nearest to the new playback position. ... If there are no ranges given in the seekable
// attribute then set the seeking IDL attribute to false and abort these steps.
......@@ -2252,29 +2257,33 @@ void HTMLMediaElement::seekWithTolerance(double time, double negativeTolerance,
m_lastSeekTime = time;
m_sentEndEvent = false;
// 8 - Set the current playback position to the given new playback position
m_player->seekWithTolerance(time, negativeTolerance, positiveTolerance);
// 9 - Queue a task to fire a simple event named seeking at the element.
// 10 - Queue a task to fire a simple event named seeking at the element.
scheduleEvent(eventNames().seekingEvent);
// 10 - Queue a task to fire a simple event named timeupdate at the element.
scheduleTimeupdateEvent(false);
// 11 - Set the current playback position to the given new playback position
m_player->seekWithTolerance(time, negativeTolerance, positiveTolerance);
// 11-15 are handled, if necessary, when the engine signals a readystate change.
// 12 - Wait until the user agent has established whether or not the media data for the new playback
// position is available, and, if it is, until it has decoded enough data to play back that position.
// 13 - Await a stable state. The synchronous section consists of all the remaining steps of this algorithm.
}
void HTMLMediaElement::finishSeek()
{
LOG(Media, "HTMLMediaElement::finishSeek");
// 4.8.10.9 Seeking step 14
// 4.8.10.9 Seeking
// 14 - Set the seeking IDL attribute to false.
m_seeking = false;
// 4.8.10.9 Seeking step 15
scheduleEvent(eventNames().seekedEvent);
// 15 - Run the time maches on steps.
// Handled by mediaPlayerTimeChanged().
setDisplayMode(Video);
// 16 - Queue a task to fire a simple event named timeupdate at the element.
scheduleEvent(eventNames().timeupdateEvent);
// 17 - Queue a task to fire a simple event named seeked at the element.
scheduleEvent(eventNames().seekedEvent);
}
HTMLMediaElement::ReadyState HTMLMediaElement::readyState() const
......@@ -2373,13 +2382,12 @@ double HTMLMediaElement::currentTime() const
return m_cachedTime;
}
void HTMLMediaElement::setCurrentTime(double time, ExceptionCode& ec)
void HTMLMediaElement::setCurrentTime(double time)
{
if (m_mediaController) {
ec = INVALID_STATE_ERR;
if (m_mediaController)
return;
}
seek(time, ec);
seek(time);
}
double HTMLMediaElement::duration() const
......@@ -2522,7 +2530,7 @@ void HTMLMediaElement::playInternal()
scheduleDelayedAction(LoadMediaResource);
if (endedPlayback())
seek(0, IGNORE_EXCEPTION);
seek(0);
if (m_mediaController)
m_mediaController->bringElementUpToSpeed(this);
......@@ -3692,7 +3700,7 @@ void HTMLMediaElement::mediaPlayerTimeChanged(MediaPlayer*)
// then seek to the earliest possible position of the media resource and abort these steps when the direction of
// playback is forwards,
if (now >= dur)
seek(0, IGNORE_EXCEPTION);
seek(0);
} else if ((now <= 0 && m_playbackRate < 0) || (now >= dur && m_playbackRate > 0)) {
// If the media element does not have a current media controller, and the media element
// has still ended playback and paused is false,
......@@ -3757,7 +3765,7 @@ void HTMLMediaElement::mediaPlayerDurationChanged(MediaPlayer* player)
double now = currentTime();
double dur = duration();
if (now > dur)
seek(dur, IGNORE_EXCEPTION);
seek(dur);
endProcessingMediaPlayerCallback();
}
......@@ -5030,7 +5038,7 @@ void HTMLMediaElement::applyMediaFragmentURI()
{
if (m_fragmentStartTime != MediaPlayer::invalidTime()) {
m_sentEndEvent = false;
seek(m_fragmentStartTime, IGNORE_EXCEPTION);
seek(m_fragmentStartTime);
}
}
......
......@@ -159,7 +159,7 @@ public:
// playback state
virtual double currentTime() const OVERRIDE;
virtual void setCurrentTime(double, ExceptionCode&) OVERRIDE;
virtual void setCurrentTime(double) OVERRIDE;
virtual double duration() const OVERRIDE;
virtual bool paused() const OVERRIDE;
virtual double defaultPlaybackRate() const OVERRIDE;
......@@ -178,7 +178,7 @@ public:
void setLoop(bool b);
virtual void play() OVERRIDE;
virtual void pause() OVERRIDE;
void fastSeek(double, ExceptionCode&);
void fastSeek(double);
// captions
bool webkitHasClosedCaptions() const;
......@@ -536,8 +536,8 @@ private:
void startProgressEventTimer();
void stopPeriodicTimers();
void seek(double time, ExceptionCode&);
void seekWithTolerance(double time, double negativeTolerance, double positiveTolerance, ExceptionCode&);
void seek(double time);
void seekWithTolerance(double time, double negativeTolerance, double positiveTolerance);
void finishSeek();
void checkIfSeekNeeded();
void addPlayedRange(double start, double end);
......
......@@ -29,74 +29,74 @@
ActiveDOMObject,
] interface HTMLMediaElement : HTMLElement {
// error state
readonly attribute MediaError error;
// error state
readonly attribute MediaError error;
// network state
[Reflect, URL] attribute DOMString src;
[URL] readonly attribute DOMString currentSrc;
// network state
[Reflect, URL] attribute DOMString src;
[URL] readonly attribute DOMString currentSrc;
const unsigned short NETWORK_EMPTY = 0;
const unsigned short NETWORK_IDLE = 1;
const unsigned short NETWORK_LOADING = 2;
const unsigned short NETWORK_NO_SOURCE = 3;
readonly attribute unsigned short networkState;
attribute DOMString preload;
const unsigned short NETWORK_EMPTY = 0;
const unsigned short NETWORK_IDLE = 1;
const unsigned short NETWORK_LOADING = 2;
const unsigned short NETWORK_NO_SOURCE = 3;
readonly attribute unsigned short networkState;
attribute DOMString preload;
readonly attribute TimeRanges buffered;
void load();
readonly attribute TimeRanges buffered;
void load();
#if defined(ENABLE_ENCRYPTED_MEDIA) && ENABLE_ENCRYPTED_MEDIA
DOMString canPlayType([Default=Undefined] optional DOMString type, [Default=Undefined, TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString keySystem);
#elif defined(ENABLE_ENCRYPTED_MEDIA_V2) && ENABLE_ENCRYPTED_MEDIA_V2
DOMString canPlayType([Default=Undefined] optional DOMString type, [Default=Undefined, TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString keySystem);
#else
DOMString canPlayType([Default=Undefined] optional DOMString type);
DOMString canPlayType([Default=Undefined] optional DOMString type);
#endif
// ready state
const unsigned short HAVE_NOTHING = 0;
const unsigned short HAVE_METADATA = 1;
const unsigned short HAVE_CURRENT_DATA = 2;
const unsigned short HAVE_FUTURE_DATA = 3;
const unsigned short HAVE_ENOUGH_DATA = 4;
readonly attribute unsigned short readyState;
readonly attribute boolean seeking;
// ready state
const unsigned short HAVE_NOTHING = 0;
const unsigned short HAVE_METADATA = 1;
const unsigned short HAVE_CURRENT_DATA = 2;
const unsigned short HAVE_FUTURE_DATA = 3;
const unsigned short HAVE_ENOUGH_DATA = 4;
readonly attribute unsigned short readyState;
readonly attribute boolean seeking;
// playback state
[SetterRaisesException] attribute double currentTime;
readonly attribute double duration;
readonly attribute boolean paused;
attribute double defaultPlaybackRate;
attribute double playbackRate;
readonly attribute TimeRanges played;
readonly attribute TimeRanges seekable;
readonly attribute boolean ended;
[Reflect] attribute boolean autoplay;
[Reflect] attribute boolean loop;
void play();
void pause();
[RaisesException] void fastSeek(double time);
// playback state
attribute double currentTime;
readonly attribute double duration;
readonly attribute boolean paused;
attribute double defaultPlaybackRate;
attribute double playbackRate;
readonly attribute TimeRanges played;
readonly attribute TimeRanges seekable;
readonly attribute boolean ended;
[Reflect] attribute boolean autoplay;
[Reflect] attribute boolean loop;
void play();
void pause();
void fastSeek(double time);
// controls
attribute boolean controls;
[SetterRaisesException] attribute double volume;
attribute boolean muted;
[Reflect=muted] attribute boolean defaultMuted;
// controls
attribute boolean controls;
[SetterRaisesException] attribute double volume;
attribute boolean muted;
[Reflect=muted] attribute boolean defaultMuted;
// WebKit extensions
attribute boolean webkitPreservesPitch;
// WebKit extensions
attribute boolean webkitPreservesPitch;
readonly attribute boolean webkitHasClosedCaptions;
attribute boolean webkitClosedCaptionsVisible;
readonly attribute boolean webkitHasClosedCaptions;
attribute boolean webkitClosedCaptionsVisible;
// The number of bytes consumed by the media decoder.
[Conditional=MEDIA_STATISTICS] readonly attribute unsigned long webkitAudioDecodedByteCount;
[Conditional=MEDIA_STATISTICS] readonly attribute unsigned long webkitVideoDecodedByteCount;
// The number of bytes consumed by the media decoder.
[Conditional=MEDIA_STATISTICS] readonly attribute unsigned long webkitAudioDecodedByteCount;
[Conditional=MEDIA_STATISTICS] readonly attribute unsigned long webkitVideoDecodedByteCount;
#if defined(ENABLE_ENCRYPTED_MEDIA) && ENABLE_ENCRYPTED_MEDIA
[RaisesException] void webkitGenerateKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, optional Uint8Array initData);
[RaisesException] void webkitAddKey([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, Uint8Array key, optional Uint8Array initData, [Default=NullString] optional DOMString sessionId);
[RaisesException] void webkitCancelKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, [Default=NullString] optional DOMString sessionId);
[RaisesException] void webkitGenerateKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, optional Uint8Array initData);
[RaisesException] void webkitAddKey([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, Uint8Array key, optional Uint8Array initData, [Default=NullString] optional DOMString sessionId);
[RaisesException] void webkitCancelKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, [Default=NullString] optional DOMString sessionId);
attribute EventListener onwebkitkeyadded;
attribute EventListener onwebkitkeyerror;
......@@ -109,12 +109,12 @@ attribute boolean webkitClosedCaptionsVisible;
#endif
#if defined(ENABLE_VIDEO_TRACK) && ENABLE_VIDEO_TRACK
[RaisesException] TextTrack addTextTrack(DOMString kind, optional DOMString label, optional DOMString language);
readonly attribute AudioTrackList audioTracks;
readonly attribute TextTrackList textTracks;
readonly attribute VideoTrackList videoTracks;
[RaisesException] TextTrack addTextTrack(DOMString kind, optional DOMString label, optional DOMString language);
readonly attribute AudioTrackList audioTracks;
readonly attribute TextTrackList textTracks;
readonly attribute VideoTrackList videoTracks;
#endif
[Reflect, TreatNullAs=NullString] attribute DOMString mediaGroup;
[CustomSetter] attribute MediaController controller;
[Reflect, TreatNullAs=NullString] attribute DOMString mediaGroup;
[CustomSetter] attribute MediaController controller;
};
......@@ -155,7 +155,7 @@ double MediaController::currentTime() const
return m_position;
}
void MediaController::setCurrentTime(double time, ExceptionCode& code)
void MediaController::setCurrentTime(double time)
{
// When the user agent is to seek the media controller to a particular new playback position,
// it must follow these steps:
......@@ -171,7 +171,7 @@ void MediaController::setCurrentTime(double time, ExceptionCode& code)
// Seek each slaved media element to the new playback position relative to the media element timeline.
for (size_t index = 0; index < m_mediaElements.size(); ++index)
m_mediaElements[index]->seek(time, code);
m_mediaElements[index]->seek(time);
scheduleTimeupdateEvent();
}
......@@ -478,7 +478,7 @@ void MediaController::bringElementUpToSpeed(HTMLMediaElement* element)
// When the user agent is to bring a media element up to speed with its new media controller,
// it must seek that media element to the MediaController's media controller position relative
// to the media element's timeline.
element->seek(currentTime(), IGNORE_EXCEPTION);
element->seek(currentTime());
}
bool MediaController::isBlocked() const
......
......@@ -60,7 +60,7 @@ public:
virtual double duration() const OVERRIDE;
virtual double currentTime() const OVERRIDE;
virtual void setCurrentTime(double, ExceptionCode&) OVERRIDE;
virtual void setCurrentTime(double) OVERRIDE;
virtual bool paused() const OVERRIDE { return m_paused; }
virtual void play() OVERRIDE;
......
......@@ -34,7 +34,7 @@
readonly attribute TimeRanges seekable;
readonly attribute double duration;
[SetterRaisesException] attribute double currentTime;
attribute double currentTime;
readonly attribute boolean paused;
readonly attribute TimeRanges played;
......
......@@ -47,7 +47,7 @@ public:
virtual double duration() const = 0;
virtual double currentTime() const = 0;
virtual void setCurrentTime(double, ExceptionCode&) = 0;
virtual void setCurrentTime(double) = 0;
virtual bool paused() const = 0;
virtual void play() = 0;
......
......@@ -239,7 +239,7 @@ void MediaControlSeekButtonElement::seekTimerFired(Timer<MediaControlSeekButtonE
{
if (m_seekType == Skip) {
double skipTime = isForwardButton() ? cSkipTime : -cSkipTime;
mediaController()->setCurrentTime(mediaController()->currentTime() + skipTime, IGNORE_EXCEPTION);
mediaController()->setCurrentTime(mediaController()->currentTime() + skipTime);
} else
mediaController()->setPlaybackRate(nextRate());
}
......
......@@ -626,7 +626,7 @@ PassRefPtr<MediaControlRewindButtonElement> MediaControlRewindButtonElement::cre
void MediaControlRewindButtonElement::defaultEventHandler(Event* event)
{
if (event->type() == eventNames().clickEvent) {
mediaController()->setCurrentTime(std::max<double>(0, mediaController()->currentTime() - 30), IGNORE_EXCEPTION);
mediaController()->setCurrentTime(std::max<double>(0, mediaController()->currentTime() - 30));
event->setDefaultHandled();
}
HTMLInputElement::defaultEventHandler(event);
......@@ -951,7 +951,7 @@ void MediaControlTimelineElement::defaultEventHandler(Event* event)
double time = value().toDouble();
if (event->type() == eventNames().inputEvent && time != mediaController()->currentTime())
mediaController()->setCurrentTime(time, IGNORE_EXCEPTION);
mediaController()->setCurrentTime(time);
RenderSlider* slider = toRenderSlider(renderer());
if (slider && slider->inDragMode())
......
......@@ -433,7 +433,7 @@ static NSTextField *createTimeTextField(NSRect frame)
{
if (![_delegate mediaElement])
return;
[_delegate mediaElement]->setCurrentTime(currentTime, IGNORE_EXCEPTION);
[_delegate mediaElement]->setCurrentTime(currentTime);
[self updateTime];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment