Auto merge of #11076 - izgzhen:fileapi, r=Ms2ger

Implement File DOM object interface

* Rewrite constructors of `Blob` and `File` with `DataSlice` as argument
* Update WebIDL of `Blob` and `File`
* Implement missing interfaces of `File` (However, due to lack of working `ArrayBuffer/ArrayBufferView` in `Blob`, so it still differs from spec)
* Update WPT test `File-constructor.html`

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11076)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-05-11 10:28:05 -07:00
commit 392135bd0c
12 changed files with 127 additions and 187 deletions

View file

@ -1,17 +1,5 @@
[File-constructor.html]
type: testharness
[DOMString fileBits]
expected: FAIL
[Unicode DOMString fileBits]
expected: FAIL
[Empty Blob fileBits]
expected: FAIL
[Blob fileBits]
expected: FAIL
[ArrayBuffer fileBits]
expected: FAIL
@ -21,24 +9,5 @@
[Various fileBits]
expected: FAIL
[Using fileName]
expected: FAIL
[Using special character in fileName]
expected: FAIL
[Using type on the File constructor]
expected: FAIL
[Using uppercase characters in type]
expected: FAIL
[Using illegal character for type]
expected: FAIL
[Using lastModified]
expected: FAIL
[Misusing name]
expected: FAIL

View file

@ -1,5 +0,0 @@
[Worker-read-file-constructor.worker]
type: testharness
[FileReader in Worker]
expected: FAIL

View file

@ -9,42 +9,6 @@
[URL interface: operation revokeObjectURL(DOMString)]
expected: FAIL
[File interface object length]
expected: FAIL
[File interface: attribute lastModified]
expected: FAIL
[File must be primary interface of new File(["myFileBits"\], "myFileName")]
expected: FAIL
[Stringification of new File(["myFileBits"\], "myFileName")]
expected: FAIL
[File interface: new File(["myFileBits"\], "myFileName") must inherit property "name" with the proper type (0)]
expected: FAIL
[File interface: new File(["myFileBits"\], "myFileName") must inherit property "lastModified" with the proper type (1)]
expected: FAIL
[Blob interface: new File(["myFileBits"\], "myFileName") must inherit property "size" with the proper type (0)]
expected: FAIL
[Blob interface: new File(["myFileBits"\], "myFileName") must inherit property "type" with the proper type (1)]
expected: FAIL
[Blob interface: new File(["myFileBits"\], "myFileName") must inherit property "isClosed" with the proper type (2)]
expected: FAIL
[Blob interface: new File(["myFileBits"\], "myFileName") must inherit property "slice" with the proper type (3)]
expected: FAIL
[Blob interface: calling slice(long long,long long,DOMString) on new File(["myFileBits"\], "myFileName") with too few arguments must throw TypeError]
expected: FAIL
[Blob interface: new File(["myFileBits"\], "myFileName") must inherit property "close" with the proper type (4)]
expected: FAIL
[FileList must be primary interface of file_input.files]
expected: FAIL

View file

@ -9,42 +9,6 @@
[URL interface: operation revokeObjectURL(DOMString)]
expected: FAIL
[File interface object length]
expected: FAIL
[File interface: attribute lastModified]
expected: FAIL
[File must be primary interface of new File(["myFileBits"\], "myFileName")]
expected: FAIL
[Stringification of new File(["myFileBits"\], "myFileName")]
expected: FAIL
[File interface: new File(["myFileBits"\], "myFileName") must inherit property "name" with the proper type (0)]
expected: FAIL
[File interface: new File(["myFileBits"\], "myFileName") must inherit property "lastModified" with the proper type (1)]
expected: FAIL
[Blob interface: new File(["myFileBits"\], "myFileName") must inherit property "size" with the proper type (0)]
expected: FAIL
[Blob interface: new File(["myFileBits"\], "myFileName") must inherit property "type" with the proper type (1)]
expected: FAIL
[Blob interface: new File(["myFileBits"\], "myFileName") must inherit property "isClosed" with the proper type (2)]
expected: FAIL
[Blob interface: new File(["myFileBits"\], "myFileName") must inherit property "slice" with the proper type (3)]
expected: FAIL
[Blob interface: calling slice(long long,long long,DOMString) on new File(["myFileBits"\], "myFileName") with too few arguments must throw TypeError]
expected: FAIL
[Blob interface: new File(["myFileBits"\], "myFileName") must inherit property "close" with the proper type (4)]
expected: FAIL
[FileReader interface: operation readAsArrayBuffer(Blob)]
expected: FAIL