Since specification bug: "Bug 26316 - Changed duration change algorithm to avoid open transition on endOfStream()." (https://www.w3.org/Bugs/Public/show_bug.cgi?id=26316) was resolved, FIXME introduced by (https://bugs.webkit.org/show_bug.cgi?id=134852) can be dealt with. (Also fixing that is prerequisity for correctly handling 'ended' state when calling buffered() of a multi trackBuffers Sourcebuffer)
Created attachment 244908 [details] implement range removal algorithm v1 Added algorithm as per spec. I've decided to keep this change here, instead of adding this to my previous patch (139813). as it's atomic enough to detect early if any additional platform specific test will be broken, I have test for this for multi-trackbuffer case, but I'm not sure where should I post it - here or there? (Seems natural for me to put it there) Also should I add test for removing this fixme? Like, "after eos() if event 'sourceopen' then fail." ? I wasn't sure isn't this too bug specific to write (would not check anything else; for the second patch I will check whether samples are removed, but that requires 2 trackBuffers).
Comment on attachment 244908 [details] implement range removal algorithm v1 Seems like there could be a test here that calling setDuration() when a SourceBuffer is in the "ended" state does not re-open it.
Created attachment 244919 [details] implement range removal algorithm v1+test Added simple LayoutTest for this (which actually would pass without this patch anyway now, as long as that FIXME is there, but as I said - can't make failing test for this without multi-trackbuffer support) As for MediaSource.setDuration(): Unless I misunderstood, point 2 from spec would cancel anything (with InvalidStateErr) while in 'ended' state.
Comment on attachment 244919 [details] implement range removal algorithm v1+test Thanks for adding the test.
Comment on attachment 244919 [details] implement range removal algorithm v1+test Clearing flags on attachment: 244919 Committed r179044: <http://trac.webkit.org/changeset/179044>
All reviewed patches have been landed. Closing bug.