Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XBL constructor order

1 view
Skip to first unread message

Boris Zbarsky

unread,
Nov 3, 2009, 12:46:46 PM11/3/09
to
Bug 526178 [1] was filed yesterday about the fact that between 3.5 and
3.6b1 XBL constructor behavior changed such that the constructor of an
ancestor is fired after the constructors of the descendants, not before.
The claim is that this breaks various existing code. The change was
inadvertent and was made back in March. The new behavior is in fact
inconsistent as to whether ancestor or descendant gets the constructor
firing first in general (e.g. when display:inline is involved), but for
XUL the descendant's constructor is fired first.

It's pretty simple to restore the 3.5 behavior, but that is of course a
somewhat breaking change from b1...

Where do we go from here, for both m-c and 3.6?

-Boris

P.S. Please follow up to mozilla.dev.tech.xbl

P.P.S. Someone please write some exhaustive XBL tests? :(

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=526178

"neil.stansbury () redbacksystems ! com"

unread,
Mar 10, 2010, 4:00:11 AM3/10/10
to
On 03/11/2009 17:46, Boris Zbarsky wrote:
> Bug 526178 [1] was filed yesterday about the fact that between 3.5 and
> 3.6b1 XBL constructor behavior changed such that the constructor of an
> ancestor is fired after the constructors of the descendants, not before.

>
> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=526178


Hi Boris,

Do you know the status of this bug re: XULRunner 1.9.2?

The bug is flagged as RESOLVED FIXED, but this is still an issue for me on 1.9.2.3705 - the official XULRunner 1.9.2 build with XBL content.

On 1.9.2b1 with:

<binding>
<xbl:content>
<bindinga>
<bindingb/>
</bindinga>
</xbl:content>

<xbl:Constructor>
alert( "Binding c" );
</xbl:Constructor>
</binding>

What happened was:

Binding a

Binding b

Binding c


With 1.9.2 and the "fix", the order is now:

Binding c

Binding a

Binding b


This means an outer XBL constructor is initialising, before any of it its own anonymous content has initialised, I can't see anything in the bug
that this was intended behaviour either?

Can I re-open this bug?


Cheers,


Neil

Boris Zbarsky

unread,
Mar 10, 2010, 10:47:44 AM3/10/10
to
On 3/10/10 4:00 AM, neil.stansbury () redbacksystems ! com wrote:
> Do you know the status of this bug re: XULRunner 1.9.2?

It's fixed.

> On 1.9.2b1 with:
>
> <binding>
> <xbl:content>
> <bindinga>
> <bindingb/>
> </bindinga>
> </xbl:content>
>
> <xbl:Constructor>
> alert( "Binding c" );
> </xbl:Constructor>
> </binding>

That's not the situation in the bug. The situation the bug is about is:

<node-with-binding-a>
<node-with-binding-b/>
</node-with-binding-a>

and the bug was that 'a' fired after 'b'. The bug was about making 'a'
fire before 'b' again.

> With 1.9.2 and the "fix", the order is now:
>
> Binding c
>
> Binding a
>
> Binding b

Yep.

> This means an outer XBL constructor is initialising, before any of it
> its own anonymous content has initialised

Yes. That's also what Firefox 3.5, 3.0, and 2.0 do. I haven't tested
earlier things. XUL testcase attached for anyone who wants to test.

> Can I re-open this bug?

Given the above, seems like "no", right?

-Boris

test.xul

"neil.stansbury () redbacksystems ! com"

unread,
Apr 16, 2010, 9:35:32 AM4/16/10
to
I have re-opened this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=559811

Test case below:

Pre 1.9.2b2 the constructor order was B, C, A
Post 1.9.2b2 the constructor order is now A, B, C

This prevents a constructor addressing it's own anonymous content.

<bindings xmlns="http://www.mozilla.org/xbl" xmlns:xbl="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<binding id="bindinga">
<content>
<xul:bindingb/>
<xul:bindingc/>
</content>
<implementation>
<constructor><![CDATA[
alert("constructing A");
]]></constructor>
</implementation>
</binding>

<binding id="bindingb">
<implementation>
<constructor><![CDATA[
alert("constructing B");
]]></constructor>
</implementation>
</binding>

<binding id="bindingc">
<implementation>
<constructor><![CDATA[
alert("constructing C");
]]></constructor>
</implementation>
</binding>

</bindings>


Boris Zbarsky

unread,
Apr 16, 2010, 9:30:06 PM4/16/10
to
On 4/16/10 9:35 AM, neil.stansbury () redbacksystems ! com wrote:
> I have re-opened this bug:
> https://bugzilla.mozilla.org/show_bug.cgi?id=559811

And I just marked that invalid. I was sure I'd posted in response to
your previous post on this thread, and my newsreader shows that post as
replied-to, but I'm not seeing my response in the newsgroup. Ah, well.

-Boris

Boris Zbarsky

unread,
Apr 17, 2010, 10:48:25 AM4/17/10
to
On 4/16/10 9:30 PM, Boris Zbarsky wrote:
> but I'm not seeing my response in the newsgroup. Ah, well.

Which is because I attached a testcase to that response... and that got
silently filtered without letting me know.

-Boris

0 new messages