| Differences between
and this patch
- a/Source/WebCore/ChangeLog +16 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-06-02  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 NOBODY (OOPS!).
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
1
2012-05-29  Kentaro Hara  <haraken@chromium.org>
17
2012-05-29  Kentaro Hara  <haraken@chromium.org>
2
18
3
        [V8] Rename v8Null() to v8NullWithCheck()
19
        [V8] Rename v8Null() to v8NullWithCheck()
- a/Source/WebCore/fileapi/FileList.idl -1 / +1 lines
Lines 30-36 module html { a/Source/WebCore/fileapi/FileList.idl_sec1
30
        JSNoStaticTables
30
        JSNoStaticTables
31
    ] FileList {
31
    ] FileList {
32
        readonly attribute unsigned long length;
32
        readonly attribute unsigned long length;
33
        File item(in [IsIndex] unsigned long index);
33
        File item(in unsigned long index);
34
    };
34
    };
35
35
36
}
36
}
- a/LayoutTests/ChangeLog +15 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2012-06-02  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 NOBODY (OOPS!).
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
1
2012-05-29  Christophe Dumez  <christophe.dumez@intel.com>
16
2012-05-29  Christophe Dumez  <christophe.dumez@intel.com>
2
17
3
        Some Content Security Policy console messages are missing line numbers in JSC
18
        Some Content Security Policy console messages are missing line numbers in JSC
- a/LayoutTests/fast/files/file-list-test-expected.txt -2 / +8 lines
Lines 3-15 Test the attribute of FileList. a/LayoutTests/fast/files/file-list-test-expected.txt_sec1
3
3
4
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
5
5
6
Start
6
Test 0
7
PASS files.length is 2
7
PASS files.length is 2
8
PASS files.item(0) instanceof File is true
8
PASS files.item(0) instanceof File is true
9
PASS files.item(0).name is "UTF8.txt"
9
PASS files.item(0).name is "UTF8.txt"
10
PASS files.item(1) instanceof File is true
10
PASS files.item(1) instanceof File is true
11
PASS files.item(1).name is "UTF8-2.txt"
11
PASS files.item(1).name is "UTF8-2.txt"
12
PASS files.item(999) is null
12
PASS files.item(2) is null
13
PASS files.item(-1) is null
14
PASS files.item(null) instanceof File is true
15
PASS files.item(null).name is "UTF8.txt"
16
PASS files.item(undefined) instanceof File is true
17
PASS files.item(undefined).name is "UTF8.txt"
18
Test 1
13
PASS successfullyParsed is true
19
PASS successfullyParsed is true
14
20
15
TEST COMPLETE
21
TEST COMPLETE
- a/LayoutTests/fast/files/file-list-test.html -7 / +24 lines
Lines 10-30 a/LayoutTests/fast/files/file-list-test.html_sec1
10
<script>
10
<script>
11
description("Test the attribute of FileList.");
11
description("Test the attribute of FileList.");
12
12
13
var caseArray = [["resources/UTF8.txt", "resources/UTF8-2.txt"], []];
14
var caseIndex = 0;
15
13
function onInputFileChange(files)
16
function onInputFileChange(files)
14
{
17
{
18
    if (caseArray[caseIndex].length == 0) {
19
        testFailed("onInputFileChange was called for an empty file list.");
20
        return;
21
    }
15
    window.files = files;
22
    window.files = files;
16
    debug("Start");
17
    shouldBe("files.length", "2");
23
    shouldBe("files.length", "2");
18
    shouldBeTrue("files.item(0) instanceof File");
24
    shouldBeTrue("files.item(0) instanceof File");
19
    shouldBeEqualToString('files.item(0).name', 'UTF8.txt');
25
    shouldBeEqualToString("files.item(0).name", "UTF8.txt");
20
    shouldBeTrue("files.item(1) instanceof File");
26
    shouldBeTrue("files.item(1) instanceof File");
21
    shouldBeEqualToString('files.item(1).name', 'UTF8-2.txt');
27
    shouldBeEqualToString("files.item(1).name", "UTF8-2.txt");
22
    shouldBeNull("files.item(999)");
28
    shouldBeNull("files.item(2)");
29
    shouldBeNull("files.item(-1)");
30
    shouldBeTrue("files.item(null) instanceof File");
31
    shouldBeEqualToString("files.item(null).name", "UTF8.txt");
32
    shouldBeTrue("files.item(undefined) instanceof File");
33
    shouldBeEqualToString("files.item(undefined).name", "UTF8.txt");
34
    doTest(++caseIndex);
35
}
36
37
function doTest(index) {
38
    debug("Test " + index);
39
    eventSender.beginDragWithFiles(caseArray[index]);
40
    eventSender.mouseMoveTo(10, 10);
41
    eventSender.mouseUp();
23
}
42
}
24
43
25
eventSender.beginDragWithFiles(['resources/UTF8.txt', 'resources/UTF8-2.txt']);
44
doTest(0);
26
eventSender.mouseMoveTo(10, 10);
27
eventSender.mouseUp();
28
45
29
</script>
46
</script>
30
</body>
47
</body>

Return to Bug 77899