Closed
Bug 798187
Opened 12 years ago
Closed 12 years ago
WebIDL bindings: add support for dictionary return values
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla19
People
(Reporter: bjacob, Assigned: bzbarsky)
Details
(Keywords: dev-doc-complete)
Attachments
(3 files)
16.64 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
8.05 KB,
patch
|
peterv
:
review+
bjacob
:
review+
|
Details | Diff | Splinter Review |
1.28 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
It would be nice to be able to return a dictionary. For example, in WebGL, getContextAttributes() is supposed to return a dictionary.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #668550 -
Flags: review?(peterv)
Assignee | ||
Comment 2•12 years ago
|
||
Attachment #668551 -
Flags: review?(peterv)
Attachment #668551 -
Flags: review?(bjacob)
Assignee | ||
Comment 3•12 years ago
|
||
Try push: https://tbpl.mozilla.org/?tree=Try&rev=ac40d85f77bc
Assignee | ||
Updated•12 years ago
|
Whiteboard: [need review]
Reporter | ||
Comment 4•12 years ago
|
||
Comment on attachment 668551 [details] [diff] [review] part 2. Switch WebGLContextAttributes to being a dictionary. Review of attachment 668551 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/canvas/src/WebGLContext.cpp @@ +876,5 @@ > if (!IsContextStable()) > { > + // XXXbz spec says we should still return our attributes in > + // this case! Should we store them all in mOptions? > + return; Yes, probably; in my local patch implementing attributes as an interface, I was refactoring WebGLContextOptions into WebGLContextAttributes.
Attachment #668551 -
Flags: review?(bjacob) → review+
Comment 5•12 years ago
|
||
Comment on attachment 668550 [details] [diff] [review] part 1. Add support for dictionary return values. Review of attachment 668550 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/Codegen.py @@ +5405,5 @@ > m in d.members) + "\n" > + "};\n" > + "struct ${selfName}Initializer : public ${selfName} {\n" > + " ${selfName}Initializer() {\n" > + " // Safe to pass a null context if we pass a null value\n" It is not safe right now, because we try to init the JS ids, but we don't actually need them. I'd make Init deal with a null JSContext by skipping the id initing, but only after asserting that the value is JS::NullValue().
Attachment #668550 -
Flags: review?(peterv) → review+
Updated•12 years ago
|
Attachment #668551 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 6•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/085bffb67692 https://hg.mozilla.org/integration/mozilla-inbound/rev/0b6a823a8cfe
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla19
Assignee | ||
Comment 7•12 years ago
|
||
Man, I suck. I was pretty sure I'd run the webgl tests on this, but I had not. The code that returns dictionaries never returns the new objects, causing test fails. Patch coming up to fix that.
Assignee | ||
Comment 8•12 years ago
|
||
Attachment #673941 -
Flags: review?(peterv)
Comment 9•12 years ago
|
||
Comment on attachment 673941 [details] [diff] [review] followup. Actually return our newly-created object from dictionary ToObject. As you mentioned, might be slightly better to do this in the "no parent" path.
Attachment #673941 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 10•12 years ago
|
||
Followups: https://hg.mozilla.org/integration/mozilla-inbound/rev/c2a70bac7627 https://hg.mozilla.org/integration/mozilla-inbound/rev/12e833d6f152
Comment 11•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/085bffb67692 https://hg.mozilla.org/mozilla-central/rev/0b6a823a8cfe https://hg.mozilla.org/mozilla-central/rev/c2a70bac7627 https://hg.mozilla.org/mozilla-central/rev/12e833d6f152
Status: NEW → RESOLVED
Closed: 12 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
•