Last Comment Bug 373652 - Implement XBL baseBinding (calling super) and named implementations
: Implement XBL baseBinding (calling super) and named implementations
Status: NEW
: helpwanted
Product: Core
Classification: Components
Component: XBL (show other bugs)
: Trunk
: All All
: -- major with 6 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: Andrew Overholt [:overholt]
Mentors:
http://developer.mozilla.org/en/docs/...
Depends on:
Blocks: XBL2
  Show dependency treegraph
 
Reported: 2007-03-12 09:29 PDT by Ben Bucksch (:BenB)
Modified: 2014-09-05 04:57 PDT (History)
14 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Ben Bucksch (:BenB) 2007-03-12 09:29:39 PDT
http://developer.mozilla.org/en/docs/XBL:XBL_1.0_Reference:Binding_Implementations#Inheritance_of_Implementations

I need a way to call super. I have a binding that |extends| another binding, and overrides a function, but just wants to add things, thus still calling the base binding's function. For example:

<binding id="bar"
         extends="chrome://.../foo.xml#foo">
  <implementation>
  <method name="addItem">
    <parameter name="item"/>
    <body><![CDATA[
      doFluff()
      this.baseBinding.addItem(item);
    ]]></body>
  </method>
  </implementation>

The above spec says that this should work, but I only get a
TypeError: this.baseBinding has no properties
Comment 1 :Gavin Sharp [email: gavin@gavinsharp.com] 2007-03-12 09:50:53 PDT
I suspect that we're not going to be adding features to the current XBL implementation before work begins on XBL2 (http://www.mozilla.org/projects/xbl/xbl2.html). I don't know whether this use-case is supported by the XBL2 spec.
Comment 2 :Gavin Sharp [email: gavin@gavinsharp.com] 2007-03-12 09:51:26 PDT
Ah, a text search on that spec shows that it does indeed specify baseBinding.
Comment 3 Ben Bucksch (:BenB) 2007-03-12 10:18:26 PDT
If you didn't even start, I suspect it's not going to be done, much less usable, within the next year or so?
This bug won't be hard to implement, would it? It's easy in JS. You probably just need to place a JS property in the JS scope.
Comment 4 :Gavin Sharp [email: gavin@gavinsharp.com] 2007-03-12 10:39:51 PDT
(In reply to comment #3)
> If you didn't even start, I suspect it's not going to be done, much less
> usable, within the next year or so?

I'm don't know for sure, but that sounds like a reasonable estimate, I guess.

> This bug won't be hard to implement, would it? It's easy in JS. You probably
> just need to place a JS property in the JS scope.

I can't really comment on how hard it would be, because I don't know offhand. Implementing it for 1.9 does sound better than the vague "wait for XBL2", I agree, but then you probably need to find someone to do it :)
Comment 5 Boris Zbarsky [:bz] (still a bit busy) 2007-03-12 10:41:59 PDT
> This bug won't be hard to implement, would it? 

Patches accepted.
Comment 6 Ben Bucksch (:BenB) 2007-03-12 11:35:20 PDT
> Patches accepted.

OK :). If it pains me too much, I'll do that.
-> self
Comment 7 Ben Bucksch (:BenB) 2010-08-24 17:16:47 PDT
http://groups.google.com/group/mozilla.dev.tech.xbl/browse_thread/thread/2bf7cbaae6bcd214

Patrick Cloke wrote on m.d.platform, thread "XBL method scope (inheritence) ??":
You can call the parent one pretty easy with:
this.__proto__.__proto__.<method name>.call(this[, paramters]);
Comment 8 Evgeny 2014-09-05 03:28:55 PDT
Any plans to fix this issue? It would be very nice for extensions.
Comment 9 Martijn Wargers [:mwargers] (not working for Mozilla) 2014-09-05 03:45:19 PDT
I think the plan is to get rid of XBL eventually.
Comment 10 Evgeny 2014-09-05 04:26:25 PDT
And what will be provided as a replacement?
Comment 11 Olli Pettay [:smaug] 2014-09-05 04:57:41 PDT
Not sure about the plan, but if we want to get rid of XBL, the replacement
would be some form of web components (not exactly what is in the current draft specs, but something a bit better).

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