Open
Bug 863952
Opened 12 years ago
Updated 2 years ago
Implement support for static attributes and operations in JS-implemented WebIDL
Categories
(Core :: DOM: Bindings (WebIDL), defect)
Core
DOM: Bindings (WebIDL)
Tracking
()
ASSIGNED
People
(Reporter: bzbarsky, Assigned: peterv)
References
(Blocks 3 open bugs)
Details
Right now we try to do things with instance pointers, which is no good:
../TestJSImplGenBinding.cpp:22904:10: error: invalid use of member 'mImpl' in static member function
return mImpl->GetStaticAttribute(global, aRv);
This involves figuring out how to expose static stuff; existing callback codegen never has to worry about it.
Comment 1•12 years ago
|
||
Do we have any ETA for this feature?
Comment 2•12 years ago
|
||
I don't think this is on anybody's radar. Do you need it for something?
Comment 3•12 years ago
|
||
I tried to implement notifications in JS and they include a static method.
But it's not super urgent.
![]() |
Reporter | |
Comment 4•12 years ago
|
||
The main pain points for this are:
1) How to represent GlobalObject in JS?
2) How to find the method to call, given no instance object?
#2 is by far the bigger problem. :(
Assignee | ||
Comment 5•11 years ago
|
||
I think I'll try this:
1) Generate static functions on the native binding class that call static functions on the *JSImpl class
2) Make the *JSImpl static functions call JS functions on the JS object of the XPCOM factory for the contractid of the WebIDL interface
3) add a helper to XPCOMUtils.jsm to create an object that inherits from the JS component's prototype and has a createInstance method, to be used as a _xpcom_factory on the JS component
GlobalObject can probably be reflected as a JS object?
Assignee: nobody → peterv
Status: NEW → ASSIGNED
Updated•11 years ago
|
Blocks: SH-bindings
Updated•11 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Updated•10 years ago
|
No longer blocks: SH-bindings
Comment 7•10 years ago
|
||
:peterv, do you have a plan for this at all? It seems like it's languishing, likely because of no really strong interest. I think that I can generate that interest if that is what is holding you back.
I could probably manage to stumble my way through an implementation of this if it came to that, but I think we'd all rather someone with background in the area did the work.
Flags: needinfo?(peterv)
Assignee | ||
Comment 8•10 years ago
|
||
(In reply to Martin Thomson [:mt:] from comment #7)
> :peterv, do you have a plan for this at all? It seems like it's
> languishing, likely because of no really strong interest.
It's not a matter of interest but of time. I'm currently working on non-binding things.
I have patches for this, but they've probably bitrotted. Most of the work is converting existing JS implemented bindings, and there are more of those added to the tree regularly.
There
Flags: needinfo?(peterv)
Assignee | ||
Comment 9•10 years ago
|
||
There are workarounds available if you're really blocked by this, but I need to figure out if they work for interfaces with both static and non-static attributes. I'll post in bug 1172785.
Comment 10•10 years ago
|
||
I'm interested in hearing about those workarounds. I have a static method that I'd like to route to a C++ implementation somehow.
Comment 11•10 years ago
|
||
Oh, and if you feel like you don't have the time to clean up the bitrotted patches, please just throw them up here on the bug. I might not be fast, but I think that I could produce something that works with only a modest amount of help from you or others.
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Updated•4 years ago
|
Component: DOM: Core & HTML → DOM: Bindings (WebIDL)
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•