Implement XBL baseBinding (calling super) and named implementations

NEW
Unassigned

Status

()

Core
XBL
--
major
10 years ago
3 years ago

People

(Reporter: BenB, Unassigned)

Tracking

(Blocks: 1 bug, {helpwanted})

Trunk
helpwanted
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

10 years ago
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.
(Reporter)

Comment 3

10 years ago
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
(Reporter)

Comment 6

10 years ago
> Patches accepted.

OK :). If it pains me too much, I'll do that.
-> self
Assignee: general → ben.bucksch
QA Contact: ian → xbl
(Reporter)

Updated

7 years ago
Blocks: 374737
(Reporter)

Updated

7 years ago
Assignee: ben.bucksch → nobody
(Reporter)

Updated

7 years ago
Summary: Implement baseBinding (calling super) and named implementations → Implement XBL baseBinding (calling super) and named implementations
(Reporter)

Comment 7

7 years ago
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

3 years ago
Any plans to fix this issue? It would be very nice for extensions.
I think the plan is to get rid of XBL eventually.

Comment 10

3 years ago
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).
You need to log in before you can comment on or make changes to this bug.