<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17277</bug_id>
          
          <creation_ts>2012-06-01 00:47:28 +0000</creation_ts>
          <short_desc>[FileAPI] It have no clear behavior about negative index of FileList.item</short_desc>
          <delta_ts>2012-06-01 07:38:41 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>File API</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Li Yin">li.yin</reporter>
          <assigned_to name="Arun">arun</assigned_to>
          <cc>glenn</cc>
    
    <cc>jonas</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68463</commentid>
    <comment_count>0</comment_count>
    <who name="Li Yin">li.yin</who>
    <bug_when>2012-06-01 00:47:28 +0000</bug_when>
    <thetext>From current spec, http://www.w3.org/TR/FileAPI/#dfn-filelist
MUST return the indexth File object in the FileList. If there is no indexth File object in the FileList, then this method must return null.
But when the index is negative number, string, null, or undefined and so on, what should be returned, whether it should raise exception or return null directly.

Currently, webkit based browser and firefox have the different behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68464</commentid>
    <comment_count>1</comment_count>
    <who name="Li Yin">li.yin</who>
    <bug_when>2012-06-01 00:53:43 +0000</bug_when>
    <thetext>According to the idl.
interface FileList {
      getter File? item(unsigned long index);
      readonly attribute unsigned long length;
};
unsigned long index represents the negative number is not expected.
So, webkit based browser raises exception when the index is negative.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68466</commentid>
    <comment_count>2</comment_count>
    <who name="Glenn Maynard">glenn</who>
    <bug_when>2012-06-01 01:48:06 +0000</bug_when>
    <thetext>First, you want http://dev.w3.org/2006/webapi/FileAPI/#dfn-filelist.  You almost never want &quot;TR&quot; links; if you find yourself on one, click the &quot;latest editor&apos;s draft&quot; link at the top.

The behavior of unsigned long is defined by WebIDL.  http://dev.w3.org/2006/webapi/WebIDL/#es-unsigned-long</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68476</commentid>
    <comment_count>3</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-06-01 07:38:41 +0000</bug_when>
    <thetext>WebKit bug. Converting to an &apos;unsigned long&apos; should wrap modulo 2**32.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>