RESOLVED FIXED Bug 40647
Add optional contentType parameter to Blob.slice per latest File API spec
https://bugs.webkit.org/show_bug.cgi?id=40647
Summary Add optional contentType parameter to Blob.slice per latest File API spec
Jian Li
Reported 2010-06-15 17:24:52 PDT
Need to add optional contentType parameter to Blob.slice per latest File API spec (http://dev.w3.org/2006/webapi/FileAPI/#dfn-Blob).
Attachments
Proposed Patch (8.47 KB, patch)
2010-06-15 17:28 PDT, Jian Li
jianli: commit-queue-
Proposed Patch (8.58 KB, patch)
2010-06-16 14:11 PDT, Jian Li
levin: review+
jianli: commit-queue-
Jian Li
Comment 1 2010-06-15 17:28:18 PDT
Created attachment 58839 [details] Proposed Patch
Kinuko Yasuda
Comment 2 2010-06-15 21:07:05 PDT
(The patch looks good to me though I'm not a reviewer.) > diff --git a/LayoutTests/http/tests/local/resources/send-sliced-dragged-file.js b/LayoutTests/http/tests/local/resources/send-sliced-dragged-file.js > + subfile = (contentType != undefined) ? file.slice(start, length, contentType) : file.slice(start, length); > diff --git a/WebCore/html/Blob.idl b/WebCore/html/Blob.idl > + Blob slice(in long long start, in long long length, in [Optional] DOMString contentType); One question - don't we want to make the contentType parameter [Optional, ConvertUndefinedOrNullToNullString]? Passing undefined value for an optional parameter leaves Blob.type undefined - it sounds a bit awkward to me.
Darin Fisher (:fishd, Google)
Comment 3 2010-06-16 11:28:48 PDT
Comment on attachment 58839 [details] Proposed Patch WebCore/html/Blob.h:69 + PassRefPtr<Blob> slice(long long start, long long length, const String& contentType = "") const; Do you really want to pass "" here and not String()?
Jian Li
Comment 4 2010-06-16 14:11:12 PDT
Created attachment 58933 [details] Proposed Patch All fixed.
Jian Li
Comment 5 2010-06-17 13:15:11 PDT
Note You need to log in before you can comment on or make changes to this bug.