This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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.
(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.
(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".
(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 :)
Change committed... https://github.com/w3c/media-source/commit/d41abbdd4d10aa7bb552a86518c734e30449d0b2