This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27649 - [MSE] Confused when set MediaSource.duration to NaN throwing an InvalidAccessError exception
Summary: [MSE] Confused when set MediaSource.duration to NaN throwing an InvalidAccess...
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Media Source Extensions (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: CR
Assignee: Aaron Colwell
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-18 03:22 UTC by Qin Jiajia
Modified: 2015-01-09 19:29 UTC (History)
3 users (show)

See Also:


Attachments

Description Qin Jiajia 2014-12-18 03:22:04 UTC
In https://w3c.github.io/media-source/#widl-MediaSource-duration, on setting step 1: If the value being set is negative or NaN then throw an InvalidAccessError exception. However, in https://w3c.github.io/media-source/#mediasource-detach, step 2: Set the duration attribute to NaN. The two steps are conflicting. I think when set duration value to NaN, it shouldn't throw exception.
Comment 1 Aaron Colwell 2014-12-18 18:23:46 UTC
(In reply to Qin Jiajia from comment #0)
> In https://w3c.github.io/media-source/#widl-MediaSource-duration, on setting
> step 1: If the value being set is negative or NaN then throw an
> InvalidAccessError exception. However, in
> https://w3c.github.io/media-source/#mediasource-detach, step 2: Set the
> duration attribute to NaN. The two steps are conflicting. I think when set
> duration value to NaN, it shouldn't throw exception.

The former is called from JavaScript. The latter is a step that is executed internal to the UA so the setter algorithm isn't run. 

This language is similar to how other attribute values are updated so I don't really understand why there is confusion. For example, the latter doesn't say to "run the duration setter algorithm" so I don't think the reader should assume that the exception checking and such in that algorithm should apply.
Comment 2 Aaron Colwell 2014-12-18 18:34:21 UTC
(In reply to Aaron Colwell from comment #1)
> (In reply to Qin Jiajia from comment #0)
> > In https://w3c.github.io/media-source/#widl-MediaSource-duration, on setting
> > step 1: If the value being set is negative or NaN then throw an
> > InvalidAccessError exception. However, in
> > https://w3c.github.io/media-source/#mediasource-detach, step 2: Set the
> > duration attribute to NaN. The two steps are conflicting. I think when set
> > duration value to NaN, it shouldn't throw exception.
> 
> The former is called from JavaScript. The latter is a step that is executed
> internal to the UA so the setter algorithm isn't run. 
> 
> This language is similar to how other attribute values are updated so I
> don't really understand why there is confusion. For example, the latter
> doesn't say to "run the duration setter algorithm" so I don't think the
> reader should assume that the exception checking and such in that algorithm
> should apply.

If you think it would make it clearer, I could change the text in the detach algorithm to say "Update duration to NaN" so that it is similar to the language in step 3 of the "duration change algorithm".
Comment 3 Qin Jiajia 2014-12-19 02:28:21 UTC
(In reply to Aaron Colwell from comment #2)
> (In reply to Aaron Colwell from comment #1)
> > (In reply to Qin Jiajia from comment #0)
> > > In https://w3c.github.io/media-source/#widl-MediaSource-duration, on setting
> > > step 1: If the value being set is negative or NaN then throw an
> > > InvalidAccessError exception. However, in
> > > https://w3c.github.io/media-source/#mediasource-detach, step 2: Set the
> > > duration attribute to NaN. The two steps are conflicting. I think when set
> > > duration value to NaN, it shouldn't throw exception.
> > 
> > The former is called from JavaScript. The latter is a step that is executed
> > internal to the UA so the setter algorithm isn't run. 
> > 
> > This language is similar to how other attribute values are updated so I
> > don't really understand why there is confusion. For example, the latter
> > doesn't say to "run the duration setter algorithm" so I don't think the
> > reader should assume that the exception checking and such in that algorithm
> > should apply.
> 
> If you think it would make it clearer, I could change the text in the detach
> algorithm to say "Update duration to NaN" so that it is similar to the
> language in step 3 of the "duration change algorithm".

Got it. It's better to say "Update duration to NaN". Thanks :)