[Webkit-unassigned] [Bug 77899] IETC: FileList.item(-1) should return null instead of raising

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 4 18:44:03 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=77899





--- Comment #22 from Li Yin <li.yin at intel.com>  2012-06-04 18:44:02 PST ---
(In reply to comment #21)
> (From update of attachment 145671 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=145671&action=review
> 
> Let me confirm my understanding:
> 
> - Per the Web IDL spec, ToUint32() is called. -1 is converted to 4294967295.
> - files.item(-1) will return the same item as files.item(4294967295).
> - Given that there is no item in the 4294967295th index, files.item(-1) returns null.
> - Firefox11 and IE10 also return null for files.item(-1).
> - Consequently, this change follows the spec and does not violate cross-browser compatibility.
> 
> Is my understanding correct? (If so, the change looks reasonable to me.)
> 
> > LayoutTests/fast/files/file-list-test.html:24
> > +    shouldBeNull("files.item(-1)");
> 
> Shall we add a test for files.item(4294967295)?

Yeah, -1 is converted to 2^32 - 1, do you mean we should test file.item(-4294967295) or file.item(-4294967296)?
file.item(-4294967295) equals file.item(1);
file.item(-4294967296) equals file.item(0);

I will add these tests.

Thanks for your review.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list