[whatwg] A slightly different use-case for shared workers

On Thu, Aug 28, 2008 at 2:23 PM, Aaron Boodman <aa at google.com> wrote:

> On Wed, Aug 27, 2008 at 6:46 PM, Robert O'Callahan <robert at ocallahan.org>
> wrote:
> > Works on Firefox trunk :-). Testcase attached. (The Vorbis file takes a
> > while to download so you should probably let it play through once before
> > trying the test.)
>
> What is the rationale behind having to call play() again?


I think the motivation was that if you remove a DOM subtree which happens to
contain <video> or <audio> elements, they should pause. Otherwise, if you
want to "safely" remove a DOM subtree you would have to always iterate
through it to stop all media elements, otherwise you're leaking because
elements (especially looping ones) can play indefinitely even if there are
no outstanding references to them. A paused media element can be freed if
there are no outstanding references to it, since there is no way for it to
ever start playing again.

Also, should it also work if you just pass a reference to the node
> into the other window?
>

No, because its ownerdocument would be the old document and when that
document is not active, the element will not play.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080828/0b4dfb5b/attachment.htm>

Received on Wednesday, 27 August 2008 19:58:03 UTC