Closed Bug 765704 Opened 9 years ago Closed 9 years ago

Don't throw when setting XHR.responseType to an invalid value

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16
Tracking Status
firefox14 + fixed
firefox15 + verified
firefox16 + fixed

People

(Reporter: Ms2ger, Assigned: Ms2ger)

References

Details

(Keywords: regression)

Attachments

(1 file)

The algorithm at <http://dev.w3.org/2006/webapi/WebIDL/#dfn-attribute-setter> explicitly special-cases enums, so that setting an enum attribute to an unrecognized value silently fails, rather than throwing. We broke that.
We have to fix this before release.
Attached patch Patch v1Splinter Review
This isn't terribly elegant, but it seems to work, at least.
Assignee: nobody → Ms2ger
Status: NEW → ASSIGNED
Attachment #634043 - Flags: review?(bzbarsky)
Comment on attachment 634043 [details] [diff] [review]
Patch v1

I don't think you need the invalidEnumValueFatal function.  Just pass "not setter" in CGPerSignatureCall.__init__ ?

r=me.  Please add mochtests for XHR here or something to actually exercise this code?  Also tests for the fact that the method argument throws...
Attachment #634043 - Flags: review?(bzbarsky) → review+
Comment on attachment 634043 [details] [diff] [review]
Patch v1

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 740069
User impact if declined: scripts can break if they set responseType to something unrecognized
Testing completed (on m-c, etc.): passes try <https://tbpl.mozilla.org/?tree=Try&rev=ac41076a1718>
Risk to taking this patch (and alternatives if risky): small
String or UUID changes made by this patch: none
Attachment #634043 - Flags: approval-mozilla-beta?
Attachment #634043 - Flags: approval-mozilla-aurora?
Looks like we'll get this into all branches with plenty of time but setting tracking anyway in case there are any followup issues.
Comment on attachment 634043 [details] [diff] [review]
Patch v1

low risk fix, test included, and we're still nice and early in the beta cycle - approving.
Attachment #634043 - Flags: approval-mozilla-beta?
Attachment #634043 - Flags: approval-mozilla-beta+
Attachment #634043 - Flags: approval-mozilla-aurora?
Attachment #634043 - Flags: approval-mozilla-aurora+
https://hg.mozilla.org/mozilla-central/rev/9ce5e415d5da
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
Component: DOM: Mozilla Extensions → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.