[whatwg] <object> behavior

Michael A. Puls II shadow2531 at gmail.com
Sun Oct 18 03:56:19 PDT 2009


On Mon, 14 Sep 2009 02:10:22 -0400, Ian Hickson <ian at hixie.ch> wrote:

> On Thu, 3 Sep 2009, Michael A. Puls II wrote:
>> On Wed, 02 Sep 2009 17:39:00 -0400, Ian Hickson <ian at hixie.ch> wrote:
>> > On Thu, 27 Aug 2009, Michael A. Puls II wrote:
>> > >
>> > > Here's an example that uses a more modern plug-in that shows what
>> > > browsers do.
>> > >
>> > > window.onload = function() {
>> > >     var obj = document.createElement("object");
>> > >     obj.type = "application/x-shockwave-flash";
>> > >     obj.data = "http://adobe.com/shockwave/welcome/flash.swf";
>> > >     obj.width = "320";
>> > >     obj.height = "240";
>> > >     //document.body.appendChild(obj);
>> > >     //obj.style.display = "none";
>> > >     setTimeout(function() {
>> > >         alert(obj.SetVariable);
>> > >     }, 1000);
>> > > };
>> > >
>> > > In other words, for a plug-in to be initialized (and scriptable if  
>> it's
>> > > capable):
>> > >
>> > > 1. Its element must be attached to the document.
>> >
>> > I'm told this is considered a bug.
>>
>> O.K., so once that's fixed in browsers, if I do:
>>
>> var obj = document.createElement("object");
>> obj.type = "application/x-shockwave-flash";
>> obj.data = "file.swf"
>> obj.appendParam("quality", "low");
>>
>> , will that load as soon as I set @type (according to HTML5) and result  
>> in
>> @data and the param not being honored because the plug-in already  
>> initialized?
>
> Hm, good point.
>
> Fixed.

O.K., that requires that the element is "in a Document", which is great.  
However, if I use createDocument() to create an HTMLDocument and then  
append an HTMLObjectElement to that document, the plug-in shouldn't load  
as the document is not active/has no browsing context or something.

Is the spec clear that nothing should happen in that case? It seems  
obvious, but want to make sure.

-- 
Michael


More information about the whatwg mailing list