[whatwg] <object> behavior

On 9/18/09 4:57 AM, Michael A. Puls II wrote:
>> We (Gecko) consider it a bug that a display:none <object> in a
>> document doesn't instantiate the plug-in.
>
> BTW, what is the reason for considering it a bug?

Because the current behavior of having the plug-in instantiation handled 
by effectively the CSS box means that any time that box changes (e.g. 
when you switch from display:block to display:inline) the plug-in is 
reinstantiated.  Worse yet, it can be reinstantiated due to other 
unrelated DOM mutations, depending on what effect they have on CSS 
boxes.  That's pretty undesirable.

> {
> visibility: hidden;
> width: 0;
> height: 0;
> padding: 0;
> margin: 0;
> line-height: 0;
> font-size: 0
> border: 0
> }
>
> is insufficient and or a pain when you want to load a plug-in but
> completely hide it so it's as if it's not there layout-wise?

That CSS is a pain _and_ insufficient, depending on context.  For 
example, consider the situation when the parent of that <object> is 
display:table-row.

> Do you know of any sites that would work better if the bug was fixed?

Looking at https://bugzilla.mozilla.org/show_bug.cgi?id=90268 and its 
duplicates and depenencies, at least:

http://reviewkaki.blogspot.com/
http://www.youtube.com/
Any site using Dojo 1.0.0 TabContainer with plug-ins in the tabs

and a number of cases where web site developers ended up having to work 
around this behavior or reported it without mentioning which site they 
were working on.

Funny enough, people want to be able to set paused Flash videos to 
display:none and back without losing their position in the video....

> Know any sites that'd break or begin to unexpectedly load a bunch of
> <object>'s that weren't meant to be loaded yet?

Not sure, but since as far as I now Opera and IE both keep the plug-in 
alive when the CSS box goes away, as far as I can tell, I'm rather 
hoping there won't be many.  Not sure what webkit's behavior is here. 
Want to test?

> If the change is trivial, maybe someone can throw up an experimental FF
> or webkit binary with the fix.

If the change were trivial it would have been done back when the bug was 
filed, in 2001.

-Boris

Received on Friday, 18 September 2009 05:18:04 UTC