Merge NETWORK_NO_SOURCE and NETWORK_EMPTY

The load() algorithm says

    If the media element's networkState is not set to NETWORK_EMPTY, then
    run these substeps:

If you create a media element with script, then networkState will be  
NETWORK_EMPTY. But if you insert it into the document it will instead be  
NETWORK_NO_SOURCE. Thus, you get an 'emptied' event in the latter case but  
not in the former. This seems like a spec bug.

It seems that the only differences it makes is whether these steps will be  
run when inserting a media element with no source:

    Run the remainder of the resource selection algorithm steps
    asynchronously, allowing the task that invoked this algorithm to
    continue.

    While the media element has neither a src attribute nor any source
    element children, wait. (This step might wait forever.)

and

    When a media element is removed from a Document, if the media element's
    networkState attribute has a value other than NETWORK_EMPTY then the
    user agent must act as if the pause() method had been invoked.

Both of these seem to not really make a difference.

Thus we suggest to merge the NETWORK_NO_SOURCE and NETWORK_EMPTY states.

-- 
Simon Pieters
Opera Software

Received on Monday, 8 June 2009 11:09:20 UTC