Bug 128867 - Setting currentTime on HTMLMediaElement with media controller should throw exception
Summary: Setting currentTime on HTMLMediaElement with media controller should throw ex...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-15 00:58 PST by Piotr Grad
Modified: 2014-02-19 10:06 PST (History)
10 users (show)

See Also:


Attachments
Patch & layout test (5.01 KB, patch)
2014-02-15 03:37 PST, Piotr Grad
no flags Details | Formatted Diff | Diff
Patch & layout test (4.91 KB, patch)
2014-02-15 03:41 PST, Piotr Grad
eric.carlson: review+
Details | Formatted Diff | Diff
Patch & layout test (4.85 KB, patch)
2014-02-15 08:39 PST, Piotr Grad
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Grad 2014-02-15 00:58:41 PST
According to spec. On setting, if the media element has a current media controller, then the user agent must throw an InvalidStateError exception [1]

[1] http://www.w3.org/TR/html51/embedded-content-0.html#dom-media-currenttime
Comment 1 Piotr Grad 2014-02-15 03:37:37 PST
Created attachment 224296 [details]
Patch & layout test
Comment 2 Piotr Grad 2014-02-15 03:41:14 PST
Created attachment 224297 [details]
Patch & layout test
Comment 3 Eric Carlson 2014-02-15 08:24:53 PST
Comment on attachment 224297 [details]
Patch & layout test

View in context: https://bugs.webkit.org/attachment.cgi?id=224297&action=review

> LayoutTests/media/video-controller-currentTime.html:7
> +            function start() {

Nit: a function's opening brace should be on a new line.

> LayoutTests/media/video-controller-currentTime.html:13
> +            function canPlayThrough() {

Ditto.

> LayoutTests/media/video-controller-currentTime.html:19
> +                try {
> +                    video.currentTime = 3;
> +                } catch (e) {
> +                    consoleWrite(e);
> +                    endTest();
> +                }

You should also test that an INVALID_STATE_ERR exception is thrown, eg.:

testDOMException("video.currentTime = 3", "DOMException.INVALID_STATE_ERR");
Comment 4 Piotr Grad 2014-02-15 08:39:16 PST
Created attachment 224299 [details]
Patch & layout test
Comment 5 Eric Carlson 2014-02-15 09:24:53 PST
Comment on attachment 224299 [details]
Patch & layout test

Thank you!
Comment 6 WebKit Commit Bot 2014-02-15 09:55:13 PST
Comment on attachment 224299 [details]
Patch & layout test

Clearing flags on attachment: 224299

Committed r164174: <http://trac.webkit.org/changeset/164174>
Comment 7 WebKit Commit Bot 2014-02-15 09:55:16 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Darin Adler 2014-02-19 10:06:05 PST
Comment on attachment 224299 [details]
Patch & layout test

View in context: https://bugs.webkit.org/attachment.cgi?id=224299&action=review

> Source/WebCore/html/HTMLMediaElement.h:183
> +    virtual void setCurrentTime(double, ExceptionCode&);

I see no reason for this function to be virtual.