Changeset 119466 in webkit


Ignore:
Timestamp:
Jun 5, 2012 1:12:59 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

IETC: FileList.item(-1) should return null instead of raising
https://bugs.webkit.org/show_bug.cgi?id=77899

Patch by Li Yin <li.yin@intel.com> on 2012-06-05
Reviewed by Kentaro Hara.

Source/WebCore:

IETC: http://samples.msdn.microsoft.com/ietestcenter/fileapi/filelist.htm
Accroding to http://es5.github.com/#x9.6
When the index is negative, it should not raise exception.
Firefox and IE returns null when there is not indexth File object.

Test: fast/files/file-list-test.html

  • fileapi/FileList.idl:

LayoutTests:

IETC: http://samples.msdn.microsoft.com/ietestcenter/fileapi/filelist.htm
Ref: http://es5.github.com/#x9.6
Some index values have been covered in this test, including negative index,
undefined, null, normal index(0~length-1), more than length index.

  • fast/files/file-list-test-expected.txt:
  • fast/files/file-list-test.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r119465 r119466  
     12012-06-05  Li Yin  <li.yin@intel.com>
     2
     3        IETC: FileList.item(-1) should return null instead of raising
     4        https://bugs.webkit.org/show_bug.cgi?id=77899
     5
     6        Reviewed by Kentaro Hara.
     7
     8        IETC: http://samples.msdn.microsoft.com/ietestcenter/fileapi/filelist.htm
     9        Ref: http://es5.github.com/#x9.6
     10        Some index values have been covered in this test, including negative index,
     11        undefined, null, normal index(0~length-1), more than length index.
     12
     13        * fast/files/file-list-test-expected.txt:
     14        * fast/files/file-list-test.html:
     15
    1162012-06-05  Adam Barth  <abarth@webkit.org>
    217
  • trunk/LayoutTests/fast/files/file-list-test-expected.txt

    r118787 r119466  
    1010PASS files.item(1) instanceof File is true
    1111PASS files.item(1).name is "UTF8-2.txt"
    12 PASS files.item(999) is null
     12PASS files.item(2) is null
     13PASS files.item(-1) is null
     14PASS files.item(0) === files.item(4294967296) is true
     15PASS files.item(1) === files.item(4294967297) is true
     16PASS files.item(2) === files.item(4294967298) is true
     17PASS files.item(-1) === files.item(4294967295) is true
     18PASS files.item(-4294967295) === files.item(1) is true
     19PASS files.item(-4294967296) === files.item(0) is true
     20PASS files.item(null) === files.item(0) is true
     21PASS files.item(undefined) === files.item(0) is true
    1322PASS successfullyParsed is true
    1423
  • trunk/LayoutTests/fast/files/file-list-test.html

    r118787 r119466  
    1111description("Test the attribute of FileList.");
    1212
     13debug("Start");
     14
    1315function onInputFileChange(files)
    1416{
    1517    window.files = files;
    16     debug("Start");
    1718    shouldBe("files.length", "2");
    1819    shouldBeTrue("files.item(0) instanceof File");
    19     shouldBeEqualToString('files.item(0).name', 'UTF8.txt');
     20    shouldBeEqualToString("files.item(0).name", "UTF8.txt");
    2021    shouldBeTrue("files.item(1) instanceof File");
    21     shouldBeEqualToString('files.item(1).name', 'UTF8-2.txt');
    22     shouldBeNull("files.item(999)");
     22    shouldBeEqualToString("files.item(1).name", "UTF8-2.txt");
     23    shouldBeNull("files.item(2)");
     24    shouldBeNull("files.item(-1)");
     25    shouldBeTrue("files.item(0) === files.item(4294967296)");
     26    shouldBeTrue("files.item(1) === files.item(4294967297)");
     27    shouldBeTrue("files.item(2) === files.item(4294967298)");
     28    shouldBeTrue("files.item(-1) === files.item(4294967295)");
     29    shouldBeTrue("files.item(-4294967295) === files.item(1)");
     30    shouldBeTrue("files.item(-4294967296) === files.item(0)");
     31    shouldBeTrue("files.item(null) === files.item(0)");
     32    shouldBeTrue("files.item(undefined) === files.item(0)");
    2333}
    2434
    25 eventSender.beginDragWithFiles(['resources/UTF8.txt', 'resources/UTF8-2.txt']);
     35eventSender.beginDragWithFiles(["resources/UTF8.txt", "resources/UTF8-2.txt"]);
    2636eventSender.mouseMoveTo(10, 10);
    2737eventSender.mouseUp();
  • trunk/Source/WebCore/ChangeLog

    r119465 r119466  
     12012-06-05  Li Yin  <li.yin@intel.com>
     2
     3        IETC: FileList.item(-1) should return null instead of raising
     4        https://bugs.webkit.org/show_bug.cgi?id=77899
     5
     6        Reviewed by Kentaro Hara.
     7
     8        IETC: http://samples.msdn.microsoft.com/ietestcenter/fileapi/filelist.htm
     9        Accroding to http://es5.github.com/#x9.6
     10        When the index is negative, it should not raise exception.
     11        Firefox and IE returns null when there is not indexth File object.
     12
     13        Test: fast/files/file-list-test.html
     14
     15        * fileapi/FileList.idl:
     16
    1172012-06-05  Adam Barth  <abarth@webkit.org>
    218
  • trunk/Source/WebCore/fileapi/FileList.idl

    r106798 r119466  
    3131    ] FileList {
    3232        readonly attribute unsigned long length;
    33         File item(in [IsIndex] unsigned long index);
     33        File item(in unsigned long index);
    3434    };
    3535
Note: See TracChangeset for help on using the changeset viewer.