From 2a554d587d4d1665a540d367cf692d46f2af1334 Mon Sep 17 00:00:00 2001 From: "haraken@chromium.org" Date: Fri, 17 Feb 2012 00:10:19 +0000 Subject: [PATCH] Remove [ConvertScriptString] from FileReaderSync.idl 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 --- LayoutTests/ChangeLog | 20 ++++++++++ LayoutTests/fast/files/resources/read-common.js | 28 +++++++++++++ .../workers/worker-read-blob-sync-expected.txt | 19 +++++++++ .../workers/worker-read-file-sync-expected.txt | 20 ++++++++++ Source/WebCore/ChangeLog | 46 ++++++++++++++++++++++ Source/WebCore/bindings/scripts/CodeGeneratorJS.pm | 4 +- Source/WebCore/bindings/scripts/CodeGeneratorV8.pm | 2 - .../bindings/scripts/test/CPP/WebDOMTestObj.cpp | 8 ---- .../bindings/scripts/test/CPP/WebDOMTestObj.h | 1 - .../scripts/test/GObject/WebKitDOMTestObj.cpp | 23 ----------- .../scripts/test/GObject/WebKitDOMTestObj.h | 10 ----- .../WebCore/bindings/scripts/test/JS/JSTestObj.cpp | 11 ------ .../WebCore/bindings/scripts/test/JS/JSTestObj.h | 1 - .../bindings/scripts/test/ObjC/DOMTestObj.h | 1 - .../bindings/scripts/test/ObjC/DOMTestObj.mm | 6 --- Source/WebCore/bindings/scripts/test/TestObj.idl | 3 -- .../WebCore/bindings/scripts/test/V8/V8TestObj.cpp | 9 ----- Source/WebCore/fileapi/FileReaderSync.cpp | 16 ++++++-- Source/WebCore/fileapi/FileReaderSync.idl | 6 +-- 19 files changed, 149 insertions(+), 85 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index b3a1301..eb7034b 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,23 @@ +2012-02-16 Kentaro Hara + + 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 [chromium] Clipping/Transforms applied in wrong order in opaque paint tracking diff --git a/LayoutTests/fast/files/resources/read-common.js b/LayoutTests/fast/files/resources/read-common.js index 609f0ed..07125a5 100644 --- a/LayoutTests/fast/files/resources/read-common.js +++ b/LayoutTests/fast/files/resources/read-common.js @@ -79,6 +79,13 @@ function _readBlobAsArrayBufferSync(testFiles, blob) 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); } @@ -92,6 +99,13 @@ function _readBlobAsBinaryStringSync(testFiles, blob) 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); } @@ -105,6 +119,13 @@ function _readBlobAsTextSync(testFiles, blob, encoding) 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); } @@ -118,6 +139,13 @@ function _readBlobAsDataURLSync(testFiles, blob) 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); } diff --git a/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt b/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt index b176781..55fa2fe 100644 --- a/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt +++ b/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt @@ -2,58 +2,77 @@ 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 diff --git a/LayoutTests/fast/files/workers/worker-read-file-sync-expected.txt b/LayoutTests/fast/files/workers/worker-read-file-sync-expected.txt index 78484f0..ab993a0 100644 --- a/LayoutTests/fast/files/workers/worker-read-file-sync-expected.txt +++ b/LayoutTests/fast/files/workers/worker-read-file-sync-expected.txt @@ -2,60 +2,80 @@ 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 diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index d1b6f47..1027692 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,49 @@ +2012-02-16 Kentaro Hara + + 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 [chromium] Clipping/Transforms applied in wrong order in opaque paint tracking diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm index 546b2a0..979b97b 100644 --- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm +++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm @@ -2945,12 +2945,10 @@ sub NativeToJSValue die "Unknown value for TreatReturnedNullStringAs extended attribute"; } - $conv = $signature->extendedAttributes->{"ConvertScriptString"}; - return "jsOwnedStringOrNull(exec, $value)" if $conv; AddToImplIncludes("", $conditional); return "jsString(exec, $value)"; } - + my $globalObject = "$thisValue->globalObject()"; if ($type eq "CSSStyleDeclaration") { diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm index b014f9e..ff7fb8d 100644 --- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm +++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm @@ -3676,8 +3676,6 @@ sub NativeToJSValue die "Unknown value for TreatReturnedNullStringAs extended attribute"; } - $conv = $signature->extendedAttributes->{"ConvertScriptString"}; - return "v8StringOrNull($value)" if $conv; return "v8String($value)"; } diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp index 1c72e4f..9c1540a 100644 --- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp +++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp @@ -630,14 +630,6 @@ void WebDOMTestObj::setWithScriptArgumentsAndCallStackAttribute(const WebDOMTest impl()->setWithScriptArgumentsAndCallStackAttribute(toWebCore(newWithScriptArgumentsAndCallStackAttribute)); } -WebDOMString WebDOMTestObj::scriptStringAttr() const -{ - if (!impl()) - return WebDOMString(); - - return static_cast(impl()->scriptStringAttr()); -} - #if ENABLE(Condition1) int WebDOMTestObj::conditionalAttr1() const { diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h index ebacbc2..b357185 100644 --- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h +++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h @@ -136,7 +136,6 @@ public: void setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(const WebDOMTestObj&); WebDOMTestObj withScriptArgumentsAndCallStackAttribute() const; void setWithScriptArgumentsAndCallStackAttribute(const WebDOMTestObj&); - WebDOMString scriptStringAttr() const; #if ENABLE(Condition1) int conditionalAttr1() const; void setConditionalAttr1(int); diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp index 529da91..35add30 100644 --- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp +++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp @@ -1314,16 +1314,6 @@ webkit_dom_test_obj_set_with_script_execution_context_and_script_state_with_spac 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) { @@ -1571,7 +1561,6 @@ enum { 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) */ @@ -1936,11 +1925,6 @@ static void webkit_dom_test_obj_get_property(GObject* object, guint prop_id, GVa 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: { @@ -2277,13 +2261,6 @@ G_MAXLONG, /* max */ "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, diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h index 367b716..caeb51f 100644 --- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h +++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h @@ -1149,16 +1149,6 @@ WEBKIT_API void 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 * diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp index 38737e7..74cd902 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp @@ -110,7 +110,6 @@ static const HashTableValue JSTestObjTableValues[] = { "withScriptExecutionContextAndScriptStateAttributeRaises", DontDelete, (intptr_t)static_cast(jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises), (intptr_t)setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises, NoIntrinsic }, { "withScriptExecutionContextAndScriptStateWithSpacesAttribute", DontDelete, (intptr_t)static_cast(jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute), (intptr_t)setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute, NoIntrinsic }, { "withScriptArgumentsAndCallStackAttribute", DontDelete, (intptr_t)static_cast(jsTestObjWithScriptArgumentsAndCallStackAttribute), (intptr_t)setJSTestObjWithScriptArgumentsAndCallStackAttribute, NoIntrinsic }, - { "scriptStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast(jsTestObjScriptStringAttr), (intptr_t)0, NoIntrinsic }, #if ENABLE(Condition1) { "conditionalAttr1", DontDelete, (intptr_t)static_cast(jsTestObjConditionalAttr1), (intptr_t)setJSTestObjConditionalAttr1, NoIntrinsic }, #endif @@ -718,16 +717,6 @@ JSValue jsTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSVal } -JSValue jsTestObjScriptStringAttr(ExecState* exec, JSValue slotBase, const Identifier&) -{ - JSTestObj* castedThis = static_cast(asObject(slotBase)); - UNUSED_PARAM(exec); - TestObj* impl = static_cast(castedThis->impl()); - JSValue result = jsOwnedStringOrNull(exec, impl->scriptStringAttr()); - return result; -} - - #if ENABLE(Condition1) JSValue jsTestObjConditionalAttr1(ExecState* exec, JSValue slotBase, const Identifier&) { diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h index 60a652c..cb9dafb 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h @@ -269,7 +269,6 @@ JSC::JSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribut 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&); diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h index 58cdcab..295741e 100644 --- a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h +++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h @@ -130,7 +130,6 @@ enum { - (void)setWithScriptExecutionContextAndScriptStateWithSpacesAttribute:(DOMTestObj *)newWithScriptExecutionContextAndScriptStateWithSpacesAttribute; - (DOMTestObj *)withScriptArgumentsAndCallStackAttribute; - (void)setWithScriptArgumentsAndCallStackAttribute:(DOMTestObj *)newWithScriptArgumentsAndCallStackAttribute; -- (NSString *)scriptStringAttr; #if ENABLE(Condition1) - (int)conditionalAttr1; - (void)setConditionalAttr1:(int)newConditionalAttr1; diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm index 6738e49..38f9c6b 100644 --- a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm +++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm @@ -535,12 +535,6 @@ IMPL->setWithScriptArgumentsAndCallStackAttribute(core(newWithScriptArgumentsAndCallStackAttribute)); } -- (NSString *)scriptStringAttr -{ - WebCore::JSMainThreadNullState state; - return IMPL->scriptStringAttr(); -} - #if ENABLE(Condition1) - (int)conditionalAttr1 { diff --git a/Source/WebCore/bindings/scripts/test/TestObj.idl b/Source/WebCore/bindings/scripts/test/TestObj.idl index 245a505..1f31c42 100644 --- a/Source/WebCore/bindings/scripts/test/TestObj.idl +++ b/Source/WebCore/bindings/scripts/test/TestObj.idl @@ -136,9 +136,6 @@ module test { 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; diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp index ec663dc..b44b683 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp @@ -716,13 +716,6 @@ static void withScriptArgumentsAndCallStackAttributeAttrSetter(v8::Local scriptStringAttrAttrGetter(v8::Local 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 conditionalAttr1AttrGetter(v8::Local name, const v8::AccessorInfo& info) @@ -1816,8 +1809,6 @@ static const BatchedAttribute TestObjAttrs[] = { {"withScriptExecutionContextAndScriptStateWithSpacesAttribute", TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrGetter, TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSetter, 0 /* no data */, static_cast(v8::DEFAULT), static_cast(v8::None), 0 /* on instance */}, // Attribute 'withScriptArgumentsAndCallStackAttribute' (Type: 'attribute' ExtAttr: 'CallWith') {"withScriptArgumentsAndCallStackAttribute", TestObjInternal::withScriptArgumentsAndCallStackAttributeAttrGetter, TestObjInternal::withScriptArgumentsAndCallStackAttributeAttrSetter, 0 /* no data */, static_cast(v8::DEFAULT), static_cast(v8::None), 0 /* on instance */}, - // Attribute 'scriptStringAttr' (Type: 'readonly attribute' ExtAttr: 'ConvertScriptString') - {"scriptStringAttr", TestObjInternal::scriptStringAttrAttrGetter, 0, 0 /* no data */, static_cast(v8::DEFAULT), static_cast(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::DEFAULT), static_cast(v8::None), 0 /* on instance */}, diff --git a/Source/WebCore/fileapi/FileReaderSync.cpp b/Source/WebCore/fileapi/FileReaderSync.cpp index 1fe5c7f..79e5200 100644 --- a/Source/WebCore/fileapi/FileReaderSync.cpp +++ b/Source/WebCore/fileapi/FileReaderSync.cpp @@ -49,8 +49,10 @@ FileReaderSync::FileReaderSync() PassRefPtr 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); @@ -60,8 +62,10 @@ PassRefPtr FileReaderSync::readAsArrayBuffer(ScriptExecutionContext 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); @@ -70,8 +74,10 @@ String FileReaderSync::readAsBinaryString(ScriptExecutionContext* scriptExecutio 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); @@ -81,8 +87,10 @@ String FileReaderSync::readAsText(ScriptExecutionContext* scriptExecutionContext 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()); diff --git a/Source/WebCore/fileapi/FileReaderSync.idl b/Source/WebCore/fileapi/FileReaderSync.idl index 77250da..920f368 100644 --- a/Source/WebCore/fileapi/FileReaderSync.idl +++ b/Source/WebCore/fileapi/FileReaderSync.idl @@ -36,11 +36,11 @@ module html { ] 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); }; } -- 2.7.4