Hmm, actually this is bug 64234 (which for some reason has become WFM).
Bug 64234, comment 10 says: (bzbarsky)
"We do resolve style for display:none elements (we need to find out they're
display:none!) but not for their descendants...."

So that means that CSS is not a reliable way for attaching xbl bindings to a
document, right? I really think this sucks.
I'm also thinking of bug 265086. CSS doesn't apply to nodes outside the
document, right?
The computed style of the element in question says it is bound, by the way. I
don't think that is correct when that's not the case. File a new bug?

(In reply to comment #4)
> So that means that CSS is not a reliable way for attaching xbl bindings to a
> document, right? I really think this sucks.
Oops, I should not blaim CSS here, right? According to the CSS spec, the binding
should get applied, not?

> So that means that CSS is not a reliable way for attaching xbl bindings to a
> document, right?
In Mozilla, yes. That's why we're working on introducing other binding methods...
> CSS doesn't apply to nodes outside the document, right?
It sorta can be forced to in Mozilla, but in general this is correct.
> The computed style of the element in question says it is bound,
Note that as soon as you access the element from JavaScript the binding _is_
attached.
> According to the CSS spec, the binding should get applied, not?
The CSS spec doesn't say anything about XBL...

(In reply to comment #6)
> > CSS doesn't apply to nodes outside the document, right?
> It sorta can be forced to in Mozilla, but in general this is correct.
Wouldn't that mean that bug 265086 is invalid, then?
> > The computed style of the element in question says it is bound,
> Note that as soon as you access the element from JavaScript the binding _is_
> attached.
If that was the case, I should get an alert (I have an alert in the
constructor). But I don't get an alert, so I don't think that is the case.

> Wouldn't that mean that bug 265086 is invalid, then?
That bug covers the fact that XBL "cannot" be applied to nodes not in a document
even if a binding mechanism other than CSS were used. (I put "cannot" in quotes
because we apply it in some cases, but inconsistently.)
> If that was the case, I should get an alert
The constructor for this "attach because it was touched from JS" scenario is
only run if the binding can be loaded synchronously (i.e. it's already cached or
has a chrome:// URI). The whole thing is a nasty hack. :(

Note

You need to
log in
before you can comment on or make changes to this bug.