https://bugs.webkit.org/show_bug.cgi?id=78335
Reviewed by Eric Seidel.
Source/WebCore:
The spec says that FileReadSync should throw NOT_FOUND_ERR
if a given blob is invalid: http://www.w3.org/TR/FileAPI/#FileReaderSync
By this fix, we can completely remove [ConvertScriptString] from WebKit.
Tests: fast/files/workers/worker-read-blob-sync.html
fast/files/workers/worker-read-file-sync.html
* fileapi/FileReaderSync.cpp: Modified to throw NOT_FOUND_ERR if a blob is invalid.
(WebCore::FileReaderSync::readAsArrayBuffer):
(WebCore::FileReaderSync::readAsBinaryString):
(WebCore::FileReaderSync::readAsText):
(WebCore::FileReaderSync::readAsDataURL):
* fileapi/FileReaderSync.idl:
* bindings/scripts/CodeGeneratorJS.pm: Removed [ConvertScriptString]
since no one is using it.
(NativeToJSValue):
* bindings/scripts/CodeGeneratorV8.pm: Ditto.
(NativeToJSValue):
* bindings/scripts/test/TestObj.idl: Removed a test case for [ConvertScriptString].
* bindings/scripts/test/CPP/WebDOMTestObj.cpp: Updated run-bindings-tests results.
* bindings/scripts/test/CPP/WebDOMTestObj.h:
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_get_property):
(webkit_dom_test_obj_class_init):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore):
* bindings/scripts/test/JS/JSTestObj.h:
(WebCore):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore):
LayoutTests:
The spec says that FileReadSync should throw NOT_FOUND_ERR
if a given blob is invalid: http://www.w3.org/TR/FileAPI/#FileReaderSync
This patch adds test cases for FileReaderSync with an invalid blob
to check that NOT_FOUND_ERR is thrown.
* fast/files/resources/read-common.js:
(_readBlobAsArrayBufferSync):
(_readBlobAsBinaryStringSync):
(_readBlobAsTextSync):
(_readBlobAsDataURLSync):
* fast/files/workers/worker-read-blob-sync-expected.txt:
* fast/files/workers/worker-read-file-sync-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107994
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-16 Kentaro Hara <haraken@chromium.org>
+
+ Remove [ConvertScriptString] from FileReaderSync.idl
+ https://bugs.webkit.org/show_bug.cgi?id=78335
+
+ Reviewed by Eric Seidel.
+
+ The spec says that FileReadSync should throw NOT_FOUND_ERR
+ if a given blob is invalid: http://www.w3.org/TR/FileAPI/#FileReaderSync
+ This patch adds test cases for FileReaderSync with an invalid blob
+ to check that NOT_FOUND_ERR is thrown.
+
+ * fast/files/resources/read-common.js:
+ (_readBlobAsArrayBufferSync):
+ (_readBlobAsBinaryStringSync):
+ (_readBlobAsTextSync):
+ (_readBlobAsDataURLSync):
+ * fast/files/workers/worker-read-blob-sync-expected.txt:
+ * fast/files/workers/worker-read-file-sync-expected.txt:
+
2012-02-16 Dana Jansens <danakj@chromium.org>
[chromium] Clipping/Transforms applied in wrong order in opaque paint tracking
log("Received exception " + error.code + ": " + error.name);
}
+ try {
+ var result = reader.readAsArrayBuffer(12345);
+ logResult(result);
+ } catch (error) {
+ log("Received exception " + error.code + ": " + error.name);
+ }
+
runNextTest(testFiles);
}
log("Received exception " + error.code + ": " + error.name);
}
+ try {
+ var result = reader.readAsBinaryString(12345);
+ logResult(result);
+ } catch (error) {
+ log("Received exception " + error.code + ": " + error.name);
+ }
+
runNextTest(testFiles);
}
log("Received exception " + error.code + ": " + error.name);
}
+ try {
+ var result = reader.readAsText(12345, encoding);
+ logResult(result);
+ } catch (error) {
+ log("Received exception " + error.code + ": " + error.name);
+ }
+
runNextTest(testFiles);
}
log("Received exception " + error.code + ": " + error.name);
}
+ try {
+ var result = reader.readAsDataURL(12345);
+ logResult(result);
+ } catch (error) {
+ log("Received exception " + error.code + ": " + error.name);
+ }
+
runNextTest(testFiles);
}
Received files in worker
Test reading a blob containing non-existent file
Received exception 1: NOT_FOUND_ERR
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing existent and non-existent file
Received exception 1: NOT_FOUND_ERR
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing empty file
result size: 0
result:
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing empty text
result size: 0
result:
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing empty files and empty texts
result size: 0
result:
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing single file
result size: 5
result: Hello
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing single text
result size: 5
result: First
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing single text as data URL
result size: 20
result: data:base64,Rmlyc3Q=
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing single text as data URL (optional content type provided)
result size: 29
result: data:type/foo;base64,Rmlyc3Q=
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing single ArrayBuffer
result size: 9
result: 0x0 0x1 0x2 0x80 0x81 0x82 0xfd 0xfe 0xff
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing sliced file
result size: 5
result: onder
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing sliced text
result size: 4
result: irst
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing sliced ArrayBuffer
result size: 8
result: 0x1 0x2 0x80 0x81 0x82 0xfd 0xfe 0xff
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing multiple files
result size: 19
result: HelloWonderfulWorld
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing multiple texts
result size: 16
result: FirstSecondThird
+Received exception 8: NOT_FOUND_ERR
Test reading a blob containing multiple ArrayBuffer
result size: 9
result: 0x0 0x1 0x2 0x80 0x81 0x82 0xfd 0xfe 0xff
+Received exception 8: NOT_FOUND_ERR
Test reading a hybrid blob
result size: 38
result: FirstHelloSecondWonderfulWorldThird012
+Received exception 8: NOT_FOUND_ERR
Test reading a sliced hybrid blob
result size: 12
result: lloSecondWon
+Received exception 8: NOT_FOUND_ERR
Test reading a triple-sliced hybrid blob
result size: 30
result: ondWonderfulWorldThird012Foolo
+Received exception 8: NOT_FOUND_ERR
DONE
Received files in worker
Test reading a non-existent file as array buffer
Received exception 1: NOT_FOUND_ERR
+Received exception 8: NOT_FOUND_ERR
Test reading a non-existent file as binary string
Received exception 1: NOT_FOUND_ERR
+Received exception 8: NOT_FOUND_ERR
Test reading a non-existent file as text
Received exception 1: NOT_FOUND_ERR
+Received exception 8: NOT_FOUND_ERR
Test reading a non-existent file as data URL
Received exception 1: NOT_FOUND_ERR
+Received exception 8: NOT_FOUND_ERR
Test reading an empty file as array buffer
result size: 0
result:
+Received exception 8: NOT_FOUND_ERR
Test reading an empty file as binary string
result size: 0
result:
+Received exception 8: NOT_FOUND_ERR
Test reading an empty file as text
result size: 0
result:
+Received exception 8: NOT_FOUND_ERR
Test reading an empty file as data URL
result size: 5
result: data:
+Received exception 8: NOT_FOUND_ERR
Test reading a UTF-8 file as array buffer
result size: 5
result: Hello
+Received exception 8: NOT_FOUND_ERR
Test reading a UTF-8 file as binary string
result size: 5
result: Hello
+Received exception 8: NOT_FOUND_ERR
Test reading a binary file as array buffer
result size: 9
result: 0x0 0x1 0x2 0x80 0x81 0x82 0xfd 0xfe 0xff
+Received exception 8: NOT_FOUND_ERR
Test reading a binary file as binary string
result size: 9
result: 0x0 0x1 0x2 0x80 0x81 0x82 0xfd 0xfe 0xff
+Received exception 8: NOT_FOUND_ERR
Test reading a UTF-8 file as text
result size: 5
result: Hello
+Received exception 8: NOT_FOUND_ERR
Test reading a UTF-16BE BOM file as text
result size: 5
result: Hello
+Received exception 8: NOT_FOUND_ERR
Test reading a UTF-16LE BOM file as text
result size: 5
result: Hello
+Received exception 8: NOT_FOUND_ERR
Test reading a UTF-8 BOM file as text
result size: 5
result: Hello
+Received exception 8: NOT_FOUND_ERR
Test reading a UTF-16BE file as text with UTF-16BE encoding
result size: 5
result: Hello
+Received exception 8: NOT_FOUND_ERR
Test reading a UTF-16BE BOM file as text with UTF8 encoding
result size: 5
result: Hello
+Received exception 8: NOT_FOUND_ERR
Test reading a UTF-16BE BOM file as text with invalid encoding
result size: 5
result: Hello
+Received exception 8: NOT_FOUND_ERR
Test reading a UTF-8 file as data URL
result size: 31
result: data:text/plain;base64,SGVsbG8=
+Received exception 8: NOT_FOUND_ERR
Test calling multiple read methods in a row
result size: 5
result: Hello
+2012-02-16 Kentaro Hara <haraken@chromium.org>
+
+ Remove [ConvertScriptString] from FileReaderSync.idl
+ https://bugs.webkit.org/show_bug.cgi?id=78335
+
+ Reviewed by Eric Seidel.
+
+ The spec says that FileReadSync should throw NOT_FOUND_ERR
+ if a given blob is invalid: http://www.w3.org/TR/FileAPI/#FileReaderSync
+
+ By this fix, we can completely remove [ConvertScriptString] from WebKit.
+
+ Tests: fast/files/workers/worker-read-blob-sync.html
+ fast/files/workers/worker-read-file-sync.html
+
+ * fileapi/FileReaderSync.cpp: Modified to throw NOT_FOUND_ERR if a blob is invalid.
+ (WebCore::FileReaderSync::readAsArrayBuffer):
+ (WebCore::FileReaderSync::readAsBinaryString):
+ (WebCore::FileReaderSync::readAsText):
+ (WebCore::FileReaderSync::readAsDataURL):
+ * fileapi/FileReaderSync.idl:
+
+ * bindings/scripts/CodeGeneratorJS.pm: Removed [ConvertScriptString]
+ since no one is using it.
+ (NativeToJSValue):
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ (NativeToJSValue):
+
+ * bindings/scripts/test/TestObj.idl: Removed a test case for [ConvertScriptString].
+
+ * bindings/scripts/test/CPP/WebDOMTestObj.cpp: Updated run-bindings-tests results.
+ * bindings/scripts/test/CPP/WebDOMTestObj.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ (webkit_dom_test_obj_get_property):
+ (webkit_dom_test_obj_class_init):
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore):
+ * bindings/scripts/test/JS/JSTestObj.h:
+ (WebCore):
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.mm:
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore):
+
+
2012-02-16 Dana Jansens <danakj@chromium.org>
[chromium] Clipping/Transforms applied in wrong order in opaque paint tracking
die "Unknown value for TreatReturnedNullStringAs extended attribute";
}
- $conv = $signature->extendedAttributes->{"ConvertScriptString"};
- return "jsOwnedStringOrNull(exec, $value)" if $conv;
AddToImplIncludes("<runtime/JSString.h>", $conditional);
return "jsString(exec, $value)";
}
-
+
my $globalObject = "$thisValue->globalObject()";
if ($type eq "CSSStyleDeclaration") {
die "Unknown value for TreatReturnedNullStringAs extended attribute";
}
- $conv = $signature->extendedAttributes->{"ConvertScriptString"};
- return "v8StringOrNull($value)" if $conv;
return "v8String($value)";
}
impl()->setWithScriptArgumentsAndCallStackAttribute(toWebCore(newWithScriptArgumentsAndCallStackAttribute));
}
-WebDOMString WebDOMTestObj::scriptStringAttr() const
-{
- if (!impl())
- return WebDOMString();
-
- return static_cast<const WTF::String&>(impl()->scriptStringAttr());
-}
-
#if ENABLE(Condition1)
int WebDOMTestObj::conditionalAttr1() const
{
void setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(const WebDOMTestObj&);
WebDOMTestObj withScriptArgumentsAndCallStackAttribute() const;
void setWithScriptArgumentsAndCallStackAttribute(const WebDOMTestObj&);
- WebDOMString scriptStringAttr() const;
#if ENABLE(Condition1)
int conditionalAttr1() const;
void setConditionalAttr1(int);
item->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(converted_value);
}
-gchar*
-webkit_dom_test_obj_get_script_string_attr(WebKitDOMTestObj* self)
-{
- g_return_val_if_fail(self, 0);
- WebCore::JSMainThreadNullState state;
- WebCore::TestObj * item = WebKit::core(self);
- gchar* res = convertToUTF8String(item->scriptStringAttr());
- return res;
-}
-
glong
webkit_dom_test_obj_get_conditional_attr1(WebKitDOMTestObj* self)
{
PROP_WITH_SCRIPT_EXECUTION_CONTEXT_AND_SCRIPT_STATE_ATTRIBUTE_RAISES,
PROP_WITH_SCRIPT_EXECUTION_CONTEXT_AND_SCRIPT_STATE_WITH_SPACES_ATTRIBUTE,
PROP_WITH_SCRIPT_ARGUMENTS_AND_CALL_STACK_ATTRIBUTE,
- PROP_SCRIPT_STRING_ATTR,
#if ENABLE(Condition1)
PROP_CONDITIONAL_ATTR1,
#endif /* ENABLE(Condition1) */
g_value_set_object(value, WebKit::kit(ptr.get()));
break;
}
- case PROP_SCRIPT_STRING_ATTR:
- {
- g_value_take_string(value, convertToUTF8String(coreSelf->scriptStringAttr()));
- break;
- }
#if ENABLE(Condition1)
case PROP_CONDITIONAL_ATTR1:
{
"read-write WebKitDOMTestObj* TestObj.with-script-arguments-and-call-stack-attribute", /* longer - could do with some extra doc stuff here */
WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */
WEBKIT_PARAM_READWRITE));
- g_object_class_install_property(gobjectClass,
- PROP_SCRIPT_STRING_ATTR,
- g_param_spec_string("script-string-attr", /* name */
- "test_obj_script-string-attr", /* short description */
- "read-only gchar* TestObj.script-string-attr", /* longer - could do with some extra doc stuff here */
- "", /* default */
- WEBKIT_PARAM_READABLE));
#if ENABLE(Condition1)
g_object_class_install_property(gobjectClass,
PROP_CONDITIONAL_ATTR1,
webkit_dom_test_obj_set_with_script_execution_context_and_script_state_with_spaces_attribute(WebKitDOMTestObj* self, WebKitDOMTestObj* value);
/**
- * webkit_dom_test_obj_get_script_string_attr:
- * @self: A #WebKitDOMTestObj
- *
- * Returns:
- *
-**/
-WEBKIT_API gchar*
-webkit_dom_test_obj_get_script_string_attr(WebKitDOMTestObj* self);
-
-/**
* webkit_dom_test_obj_get_conditional_attr1:
* @self: A #WebKitDOMTestObj
*
{ "withScriptExecutionContextAndScriptStateAttributeRaises", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises), (intptr_t)setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises, NoIntrinsic },
{ "withScriptExecutionContextAndScriptStateWithSpacesAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute), (intptr_t)setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute, NoIntrinsic },
{ "withScriptArgumentsAndCallStackAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptArgumentsAndCallStackAttribute), (intptr_t)setJSTestObjWithScriptArgumentsAndCallStackAttribute, NoIntrinsic },
- { "scriptStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjScriptStringAttr), (intptr_t)0, NoIntrinsic },
#if ENABLE(Condition1)
{ "conditionalAttr1", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr1), (intptr_t)setJSTestObjConditionalAttr1, NoIntrinsic },
#endif
}
-JSValue jsTestObjScriptStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
-{
- JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
- UNUSED_PARAM(exec);
- TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- JSValue result = jsOwnedStringOrNull(exec, impl->scriptStringAttr());
- return result;
-}
-
-
#if ENABLE(Condition1)
JSValue jsTestObjConditionalAttr1(ExecState* exec, JSValue slotBase, const Identifier&)
{
void setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjWithScriptArgumentsAndCallStackAttribute(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSTestObjWithScriptArgumentsAndCallStackAttribute(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
-JSC::JSValue jsTestObjScriptStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsTestObjConditionalAttr1(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSTestObjConditionalAttr1(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjConditionalAttr2(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
- (void)setWithScriptExecutionContextAndScriptStateWithSpacesAttribute:(DOMTestObj *)newWithScriptExecutionContextAndScriptStateWithSpacesAttribute;
- (DOMTestObj *)withScriptArgumentsAndCallStackAttribute;
- (void)setWithScriptArgumentsAndCallStackAttribute:(DOMTestObj *)newWithScriptArgumentsAndCallStackAttribute;
-- (NSString *)scriptStringAttr;
#if ENABLE(Condition1)
- (int)conditionalAttr1;
- (void)setConditionalAttr1:(int)newConditionalAttr1;
IMPL->setWithScriptArgumentsAndCallStackAttribute(core(newWithScriptArgumentsAndCallStackAttribute));
}
-- (NSString *)scriptStringAttr
-{
- WebCore::JSMainThreadNullState state;
- return IMPL->scriptStringAttr();
-}
-
#if ENABLE(Condition1)
- (int)conditionalAttr1
{
void methodWithCallbackAndOptionalArg(in [Callback, Optional] TestCallback callback);
#endif
- // 'ConvertScriptString' extended attribute
- readonly attribute [ConvertScriptString] DOMString scriptStringAttr;
-
// 'Conditional' extended attribute
attribute [Conditional=Condition1] long conditionalAttr1;
attribute [Conditional=Condition1&Condition2] long conditionalAttr2;
return;
}
-static v8::Handle<v8::Value> scriptStringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- INC_STATS("DOM.TestObj.scriptStringAttr._get");
- TestObj* imp = V8TestObj::toNative(info.Holder());
- return v8StringOrNull(imp->scriptStringAttr());
-}
-
#if ENABLE(Condition1)
static v8::Handle<v8::Value> conditionalAttr1AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{"withScriptExecutionContextAndScriptStateWithSpacesAttribute", TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrGetter, TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'withScriptArgumentsAndCallStackAttribute' (Type: 'attribute' ExtAttr: 'CallWith')
{"withScriptArgumentsAndCallStackAttribute", TestObjInternal::withScriptArgumentsAndCallStackAttributeAttrGetter, TestObjInternal::withScriptArgumentsAndCallStackAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- // Attribute 'scriptStringAttr' (Type: 'readonly attribute' ExtAttr: 'ConvertScriptString')
- {"scriptStringAttr", TestObjInternal::scriptStringAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
#if ENABLE(Condition1)
// Attribute 'conditionalAttr1' (Type: 'attribute' ExtAttr: 'Conditional')
{"conditionalAttr1", TestObjInternal::conditionalAttr1AttrGetter, TestObjInternal::conditionalAttr1AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
PassRefPtr<ArrayBuffer> FileReaderSync::readAsArrayBuffer(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
{
- if (!blob)
+ if (!blob) {
+ ec = NOT_FOUND_ERR;
return 0;
+ }
FileReaderLoader loader(FileReaderLoader::ReadAsArrayBuffer, 0);
startLoading(scriptExecutionContext, loader, blob, ec);
String FileReaderSync::readAsBinaryString(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
{
- if (!blob)
+ if (!blob) {
+ ec = NOT_FOUND_ERR;
return String();
+ }
FileReaderLoader loader(FileReaderLoader::ReadAsBinaryString, 0);
startLoading(scriptExecutionContext, loader, blob, ec);
String FileReaderSync::readAsText(ScriptExecutionContext* scriptExecutionContext, Blob* blob, const String& encoding, ExceptionCode& ec)
{
- if (!blob)
+ if (!blob) {
+ ec = NOT_FOUND_ERR;
return String();
+ }
FileReaderLoader loader(FileReaderLoader::ReadAsText, 0);
loader.setEncoding(encoding);
String FileReaderSync::readAsDataURL(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
{
- if (!blob)
+ if (!blob) {
+ ec = NOT_FOUND_ERR;
return String();
+ }
FileReaderLoader loader(FileReaderLoader::ReadAsDataURL, 0);
loader.setDataType(blob->type());
] FileReaderSync {
[CallWith=ScriptExecutionContext] ArrayBuffer readAsArrayBuffer(in Blob blob)
raises(FileException);
- [CallWith=ScriptExecutionContext, ConvertScriptString] DOMString readAsBinaryString(in Blob blob)
+ [CallWith=ScriptExecutionContext] DOMString readAsBinaryString(in Blob blob)
raises(FileException);
- [CallWith=ScriptExecutionContext, ConvertScriptString] DOMString readAsText(in Blob blob, in [Optional] DOMString encoding)
+ [CallWith=ScriptExecutionContext] DOMString readAsText(in Blob blob, in [Optional] DOMString encoding)
raises(FileException);
- [CallWith=ScriptExecutionContext, ConvertScriptString] DOMString readAsDataURL(in Blob blob)
+ [CallWith=ScriptExecutionContext] DOMString readAsDataURL(in Blob blob)
raises(FileException);
};
}