RESOLVED FIXED 112612
HTMLOptionsCollection.add() should not throw for infinity- or NaN-valued indices
https://bugs.webkit.org/show_bug.cgi?id=112612
Summary HTMLOptionsCollection.add() should not throw for infinity- or NaN-valued indices
Michael Pruett
Reported 2013-03-18 13:09:32 PDT
Currently HTMLOptionsCollection.add() throws a type error when its optional index argument is +/-Infinity or NaN. This behavior is incorrect according to both the HTML and Web IDL specifications. According to the HTML specification, "if before is omitted, null, or a number out of range, then element will be added at the end of the list": http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#htmloptionscollection-0 And according to the Web IDL specification, absent the EnforceRange attribute, converting a value of NaN or +/-Infinity should result in an integer value of 0 without a type error being thrown: http://www.w3.org/TR/WebIDL/ The behavior of HTMLOptionsCollection.add() has been updated for V8 in bug 96798. This bug addresses changes to JSC bindings.
Attachments
Patch (24.83 KB, patch)
2013-03-18 13:29 PDT, Michael Pruett
haraken: review+
Patch (24.81 KB, patch)
2013-03-19 10:14 PDT, Michael Pruett
no flags
Michael Pruett
Comment 1 2013-03-18 13:29:37 PDT
Kentaro Hara
Comment 2 2013-03-18 17:16:31 PDT
Comment on attachment 193638 [details] Patch Looks reasonable to me. We should have fixed this when we added the test to V8. (Please set r? if you want to have the patch be reviewed.)
Kentaro Hara
Comment 3 2013-03-18 22:27:47 PDT
Comment on attachment 193638 [details] Patch Looks good.
Michael Pruett
Comment 4 2013-03-19 10:14:16 PDT
Created attachment 193851 [details] Patch I've simplified the ChangeLog message.
WebKit Review Bot
Comment 5 2013-03-19 17:59:50 PDT
Comment on attachment 193851 [details] Patch Clearing flags on attachment: 193851 Committed r146283: <http://trac.webkit.org/changeset/146283>
WebKit Review Bot
Comment 6 2013-03-19 17:59:53 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.