[whatwg] <object> behavior

Michael A. Puls II shadow2531 at gmail.com
Fri Aug 14 02:58:08 PDT 2009


On Thu, 13 Aug 2009 22:05:26 -0400, Ian Hickson <ian at hixie.ch> wrote:

>> - Should <object>s exist all the time whether they are attached to the
>> document or not?
> Assuming you mean the plugins, as opposed to the elements themselves,  
> then
> the way the spec is written, the plugin instantiates regardless of  
> whether
> it is in the document or not.

Are you saying that in the following case (for the Netscape 6.4 WMP  
plug-in (the liveconnect-supported one) for example):

<script>
     var obj = document.createElement("object");
     obj.setAttribute("type", "application/x-mplayer2");
     //document.documentElement.appendChild(obj);
     window.onload = function() {
         setTimeout(function() {
             alert(obj.SetFileName);
             //document.documentElement.removeChild(obj);
             //alert(obj.SetFileName);
         }, 10000);
     };
</script>

that .SetFileName() (a function the plug-in supports), will be accessible  
even if the object hasn't been attached yet? Are you also saying that if  
it is attached and you remove it from the document that SetFileName will  
still be callable?

If so, that's not what happens in Opera. Pulling the object out of the  
document nukes the plug-in instance and an instance isn't created until  
you append to the document. Firefox behaves that way with plug-ins too.  
And, I think that behavior is required for compat.

-- 
Michael


More information about the whatwg mailing list