Closed
Bug 829248
Opened 11 years ago
Closed 11 years ago
Implement support for [TreatUndefinedAs=Missing] in WebIDL
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
I want this for add/removeEventListener.
Assignee | ||
Comment 1•11 years ago
|
||
Actually, I don't. But this is still useful!
Hello there, My friend and I are interested in helping out. Is this bug still active? If so, where/how do we begin? Thanks.
Assignee | ||
Comment 3•11 years ago
|
||
This is still active, yes. Assuming you've pulled a Firefox tree, you want to look at dom/bindings/Codegen.py and read http://dev.w3.org/2006/webapi/WebIDL/#dfn-overload-resolution-algorithm I guess. Then start thinking about how to best implement it (probably by walking backwards through the arguments and changing argc as neeed up front in the generated code for method calls).
Cool! I assume this is part of a large(r) project overall, are there any other mentored bugs from this project that I could work on while we're at it? Thanks!
Assignee | ||
Comment 5•11 years ago
|
||
You can search bugzilla for mentored bugs, right?
Comment 6•11 years ago
|
||
I'm not familiar with the Implementation of WebIDL but can I take this bug and try to work on it?
Assignee | ||
Comment 7•11 years ago
|
||
Sure. Please feel free to ask questions as needed!
Assignee: nobody → joejoevictor
Comment 8•11 years ago
|
||
I've read the w3c website about WebIDL and I kinda understand it's the interface between JavaScript and browser backend but I'm not sure how the implementation reflects to firefox code base. Could you briefly explain it to me or point me to a page where I can read about it myself? Thanks!
Assignee | ||
Comment 9•11 years ago
|
||
The way it works right now is that there is a Python script (well, several) that parses WebIDL and produces C++ code that acts like glue between JavaScript and the C++. The relevant code is in dom/bindings/parser/WebIDL.py (the parser) and dom/bindings/Codegen.py (the script that builds the C++ code from the data model). The generated code ends up in the dom/bindings subdirectory of the objdir (e.g. dom/bindings/URLBinding.cpp). There's some user-facing (as in, for people writing C++ code that's supposed to implement web stuff) documentation at https://developer.mozilla.org/en/Mozilla/WebIDL_bindings
Comment 10•11 years ago
|
||
Can you confirm that you're still working on this bug?
Flags: needinfo?(joejoevictor)
Assignee | ||
Comment 11•11 years ago
|
||
methods, since it's not clear what that should really look like. This also does not require that [TreatUndefinedAs=Missing] on an argument force it on all later arguments, since it's not clear that we want that long-term.
Attachment #755016 -
Flags: review?(khuey)
Assignee | ||
Updated•11 years ago
|
Assignee: joejoevictor → bzbarsky
Assignee | ||
Comment 12•11 years ago
|
||
Stealing, because this is blocking people.
Flags: needinfo?(joejoevictor)
Whiteboard: [mentor=bz][lang=c++][lang=python] → [need review]
Comment on attachment 755016 [details] [diff] [review] Implement basic support for [TreatUndefinedAs=Missing] in WebIDL. does not add support for [TreatUndefinedAs=Missing] in overloaded Review of attachment 755016 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/parser/WebIDL.py @@ +406,5 @@ > raise WebIDLError("[TreatUndefinedAs=Missing] is only " > "allowed on optional arguments", > [self.location]) > + else: > + if value == 'Null': Is there a reason not to just do elif and not have a separate level of control flow. I don't see one but it's possible I'm still too jetlagged to read code properly ...
Attachment #755016 -
Flags: review?(khuey) → review+
Assignee | ||
Comment 14•11 years ago
|
||
You're totally right. I had the code looking a bit differently partway though writing the patch and then never reread it carefully enough... Fixed to do elif. https://hg.mozilla.org/integration/mozilla-inbound/rev/5f66c33dbf00
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla24
Comment 15•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/5f66c33dbf00
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•