Title: [120191] trunk
Revision
120191
Author
[email protected]
Date
2012-06-13 05:41:24 -0700 (Wed, 13 Jun 2012)

Log Message

FileAPI: type should be converted to be lower case in Blob constructor.
https://bugs.webkit.org/show_bug.cgi?id=88696

Patch by Li Yin <[email protected]> on 2012-06-13
Reviewed by Kentaro Hara.

Source/WebCore:

Spec: http://dev.w3.org/2006/webapi/FileAPI/#dfn-BlobPropertyBag
Spec: http://dev.w3.org/2006/webapi/FileAPI/#attributes-blob
The ASCII-encoded string in lower case representing the media type of the Blob.

Test: fast/files/blob-constructor.html

* bindings/js/JSBlobCustom.cpp:
(WebCore::JSBlobConstructor::constructJSBlob):
* bindings/v8/custom/V8BlobCustom.cpp:
(WebCore::V8Blob::constructorCallback):

LayoutTests:

Spec: http://dev.w3.org/2006/webapi/FileAPI/#dfn-BlobPropertyBag
Add sub-test to track changing upper case into lower case of type in Blob constructor.

* fast/files/blob-constructor-expected.txt:
* fast/files/script-tests/blob-constructor.js:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (120190 => 120191)


--- trunk/LayoutTests/ChangeLog	2012-06-13 12:34:26 UTC (rev 120190)
+++ trunk/LayoutTests/ChangeLog	2012-06-13 12:41:24 UTC (rev 120191)
@@ -1,3 +1,16 @@
+2012-06-13  Li Yin  <[email protected]>
+
+        FileAPI: type should be converted to be lower case in Blob constructor.
+        https://bugs.webkit.org/show_bug.cgi?id=88696
+
+        Reviewed by Kentaro Hara.
+
+        Spec: http://dev.w3.org/2006/webapi/FileAPI/#dfn-BlobPropertyBag
+        Add sub-test to track changing upper case into lower case of type in Blob constructor.
+
+        * fast/files/blob-constructor-expected.txt:
+        * fast/files/script-tests/blob-constructor.js:
+
 2012-06-13  Ryosuke Niwa  <[email protected]>
 
         Fonts, fullscreen, gamepad, and html5lib tests should use testRunner instead of layoutTestController

Modified: trunk/LayoutTests/fast/files/blob-constructor-expected.txt (120190 => 120191)


--- trunk/LayoutTests/fast/files/blob-constructor-expected.txt	2012-06-13 12:34:26 UTC (rev 120190)
+++ trunk/LayoutTests/fast/files/blob-constructor-expected.txt	2012-06-13 12:41:24 UTC (rev 120191)
@@ -42,6 +42,7 @@
 PASS (new Blob([], function () {})) instanceof window.Blob is true
 PASS (new Blob([], {type:'text/html'})).type is 'text/html'
 PASS (new Blob([], {type:'text/html'})).size is 0
+PASS (new Blob([], {type:'text/plain;charset=UTF-8'})).type is 'text/plain;charset=utf-8'
 PASS window.Blob.length is 2
 PASS new Blob([new DataView(new ArrayBuffer(100))]).size is 100
 PASS new Blob([new Uint8Array(100)]).size is 100

Modified: trunk/LayoutTests/fast/files/script-tests/blob-constructor.js (120190 => 120191)


--- trunk/LayoutTests/fast/files/script-tests/blob-constructor.js	2012-06-13 12:34:26 UTC (rev 120190)
+++ trunk/LayoutTests/fast/files/script-tests/blob-constructor.js	2012-06-13 12:41:24 UTC (rev 120191)
@@ -60,6 +60,7 @@
 // Test that the type/size is correctly added to the Blob
 shouldBe("(new Blob([], {type:'text/html'})).type", "'text/html'");
 shouldBe("(new Blob([], {type:'text/html'})).size", "0");
+shouldBe("(new Blob([], {type:'text/plain;charset=UTF-8'})).type", "'text/plain;charset=utf-8'");
 
 // Odds and ends
 shouldBe("window.Blob.length", "2");

Modified: trunk/Source/WebCore/ChangeLog (120190 => 120191)


--- trunk/Source/WebCore/ChangeLog	2012-06-13 12:34:26 UTC (rev 120190)
+++ trunk/Source/WebCore/ChangeLog	2012-06-13 12:41:24 UTC (rev 120191)
@@ -1,3 +1,21 @@
+2012-06-13  Li Yin  <[email protected]>
+
+        FileAPI: type should be converted to be lower case in Blob constructor.
+        https://bugs.webkit.org/show_bug.cgi?id=88696
+
+        Reviewed by Kentaro Hara.
+
+        Spec: http://dev.w3.org/2006/webapi/FileAPI/#dfn-BlobPropertyBag
+        Spec: http://dev.w3.org/2006/webapi/FileAPI/#attributes-blob
+        The ASCII-encoded string in lower case representing the media type of the Blob.
+
+        Test: fast/files/blob-constructor.html
+
+        * bindings/js/JSBlobCustom.cpp:
+        (WebCore::JSBlobConstructor::constructJSBlob):
+        * bindings/v8/custom/V8BlobCustom.cpp:
+        (WebCore::V8Blob::constructorCallback):
+
 2012-06-13  Robin Cao  <[email protected]>
 
         [BlackBerry] Enable MEDIA_STREAM by default

Modified: trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp (120190 => 120191)


--- trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp	2012-06-13 12:34:26 UTC (rev 120190)
+++ trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp	2012-06-13 12:41:24 UTC (rev 120191)
@@ -106,6 +106,7 @@
             return JSValue::encode(jsUndefined());
         if (!type.containsOnlyASCII())
             return throwVMError(exec, createSyntaxError(exec, "type must consist of ASCII characters"));
+        type.makeLower();
     }
 
     ASSERT(endings == "transparent" || endings == "native");

Modified: trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp (120190 => 120191)


--- trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp	2012-06-13 12:34:26 UTC (rev 120190)
+++ trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp	2012-06-13 12:41:24 UTC (rev 120191)
@@ -105,6 +105,7 @@
             return throwError(tryCatchType.Exception(), args.GetIsolate());
         if (!type.containsOnlyASCII())
             return V8Proxy::throwError(V8Proxy::SyntaxError, "type must consist of ASCII characters", args.GetIsolate());
+        type.makeLower();
     }
 
     ASSERT(endings == "transparent" || endings == "native");
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to