Closed Bug 742195 Opened 12 years ago Closed 12 years ago

Implement the extended attributes for null and undefined handling on string arguments in Paris bindings

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: bzbarsky, Assigned: peterv)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

We'll need it sometime.
Summary: Implement the extended attributes for null and undefined handling on strings → Implement the extended attributes for null and undefined handling on strings in Paris bindings
Attached patch v1 (obsolete) — Splinter Review
Assignee: nobody → peterv
Status: NEW → ASSIGNED
Blocks: 784869
Attachment #654431 - Flags: review?(bzbarsky)
Blocks: 753517
Comment on attachment 654431 [details] [diff] [review]
v1

The mapping from the python enum to the C++ enum is a bit weird because we depend on treatAs having the same ordering as the python enum.

What if we used just a dict mapping the WebIDL string values to our desired string values, and then just stored the WebIDL string value in the IDLArgument?  That would at least nix the ordering dependency.  If we wanted to really be cool, we could change our C++ string values to match the WebIDL ones (e.g. replace eStringify with eDefault or something).

In the WebIDL parser, I don't think we should raise an error on TreatUndefinedAs=Missing.  That's not a problem for the parser per se, and the codegen will already raise an error on it.

In the codegen, even if type.nullable() we need to examine treatUndefinedAs, no?  In particular, if the argument is "[TreatUndefinedAs=EmptyString] DOMString?" then passing undefined should produce an empty string.

r=me with those last two bits fixed and maybe some parser tests added.  A followup bug is fine for the string/enum stuff.
Attachment #654431 - Flags: review?(bzbarsky) → review+
Attached patch v1.1 (obsolete) — Splinter Review
Attachment #654431 - Attachment is obsolete: true
Attachment #654854 - Flags: review+
Attached patch v1.2Splinter Review
Attachment #654854 - Attachment is obsolete: true
Attachment #654874 - Flags: review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/d5f32f0e1c05
Flags: in-testsuite?
Target Milestone: --- → mozilla17
https://hg.mozilla.org/mozilla-central/rev/d5f32f0e1c05
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Summary: Implement the extended attributes for null and undefined handling on strings in Paris bindings → Implement the extended attributes for null and undefined handling on string arguments in Paris bindings
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: