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

Using XBL in xpcom

0 views
Skip to first unread message

philippe marguinaud

unread,
Dec 28, 2008, 8:48:19 AM12/28/08
to dev-te...@lists.mozilla.org

Hi all,

I would like to know whether it is possible to use XBL in javascript/XPCOM. I have managed to parse an XML document using xpcshell, but I do not see how to trigger XBL loading.
Do someone knows how to do that ?

Regards,

Philippe

_________________________________________________________________
Show them the way! Add maps and directions to your party invites.
http://www.microsoft.com/windows/windowslive/events.aspx

Boris Zbarsky

unread,
Dec 28, 2008, 12:28:18 PM12/28/08
to
philippe marguinaud wrote:
> I would like to know whether it is possible to use XBL in javascript/XPCOM.

XBL is a presentation/behavior binding language. If you're not going to
have a presentation or behavior (e.g. if your document is just a DOM
tree in memory), you don't get XBL binding happening.

> I have managed to parse an XML document using xpcshell, but I do not see how to trigger XBL loading.

There's no presentation or behavior in xpcshell, right?

-Boris

philippe marguinaud

unread,
Dec 28, 2008, 1:15:52 PM12/28/08
to Boris Zbarsky, dev-te...@lists.mozilla.org


Well, there is no presentation in xpcshell, this is true.
But there may be behaviour. I would like to invoke constructor/destructor, and the methods I wrote in my XBL file on the DOM elements.
Again my question: is this possible ?

Philippe

> Date: Sun, 28 Dec 2008 09:28:18 -0800
> From: bzba...@mit.edu
> Subject: Re: Using XBL in xpcom
> To: dev-te...@lists.mozilla.org

> _______________________________________________
> dev-tech-xbl mailing list
> dev-te...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-xbl

_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/photos.aspx

Boris Zbarsky

unread,
Dec 28, 2008, 1:21:30 PM12/28/08
to
philippe marguinaud wrote:
> Well, there is no presentation in xpcshell, this is true.
> But there may be behaviour. I would like to invoke constructor/destructor, and the methods I wrote in my XBL file on the DOM elements.
> Again my question: is this possible ?

You can always load the XBL file, parse it, take the
constructor/destructor, wrap them into functions, eval to get function
objects, and call them.

Of course if your constructor or destructor depends on the anonymous
content of the binding, this won't work.

If the question is whether you can get binding attachment to happen in
your setup, that would require some serious changes to core code.

-Boris

Alex Vincent

unread,
Feb 15, 2009, 6:25:51 PM2/15/09
to
philippe marguinaud wrote:
>
>
> Well, there is no presentation in xpcshell, this is true.
> But there may be behaviour. I would like to invoke constructor/destructor, and the methods I wrote in my XBL file on the DOM elements.
> Again my question: is this possible ?
>
> Philippe

You may want to consider an alternate technology, XTF:
http://weblogs.mozillazine.org/weirdal/archives/017902.html

Alex

0 new messages