Closed Bug 373652 Opened 17 years ago Closed 7 years ago

Implement XBL baseBinding (calling super) and named implementations

Categories

(Core :: XBL, defect)

defect
Not set
major

Tracking

()

RESOLVED WONTFIX

People

(Reporter: BenB, Unassigned)

References

()

Details

(Keywords: helpwanted)

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
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.
Ah, a text search on that spec shows that it does indeed specify baseBinding.
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.
(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 :)
> This bug won't be hard to implement, would it? 

Patches accepted.
Keywords: helpwanted
> Patches accepted.

OK :). If it pains me too much, I'll do that.
-> self
Assignee: general → ben.bucksch
QA Contact: ian → xbl
Blocks: XBL2
Assignee: ben.bucksch → nobody
Summary: Implement baseBinding (calling super) and named implementations → Implement XBL baseBinding (calling super) and named implementations
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]);
Any plans to fix this issue? It would be very nice for extensions.
I think the plan is to get rid of XBL eventually.
And what will be provided as a replacement?
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).
Web Components \o/
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.