diff options
Diffstat (limited to 'Source/WebCore/bindings/scripts/test')
18 files changed, 81 insertions, 5 deletions
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp index a58da40..62ebc3c 100644 --- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp +++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp @@ -83,6 +83,14 @@ WebDOMTestCallback::~WebDOMTestCallback() m_impl = 0; } +bool WebDOMTestCallback::callbackWithNoParam() +{ + if (!impl()) + return false; + + return impl()->callbackWithNoParam(); +} + bool WebDOMTestCallback::callbackWithClass1Param(const WebDOMClass1& class1Param) { if (!impl()) diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h index 91ff787..7a077e2 100644 --- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h +++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h @@ -46,6 +46,7 @@ public: WebDOMTestCallback& operator=(const WebDOMTestCallback&); virtual ~WebDOMTestCallback(); + bool callbackWithNoParam(); bool callbackWithClass1Param(const WebDOMClass1& class1Param); bool callbackWithClass2Param(const WebDOMClass2& class2Param, const WebDOMString& strArg); int callbackWithNonBoolReturnType(const WebDOMClass3& class3Param); diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp index 9c8fa59..054dc38 100644 --- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp +++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp @@ -39,8 +39,9 @@ #include "webkit/WebKitDOMClass3Private.h" #include "webkit/WebKitDOMTestCallback.h" #include "webkit/WebKitDOMTestCallbackPrivate.h" +#include "webkitdefines.h" +#include "webkitglobalsprivate.h" #include "webkitmarshal.h" -#include "webkitprivate.h" namespace WebKit { @@ -57,6 +58,16 @@ WebKitDOMTestCallback* kit(WebCore::TestCallback* obj) } // namespace WebKit // gboolean +webkit_dom_test_callback_callback_with_no_param(WebKitDOMTestCallback* self) +{ + g_return_val_if_fail(self, 0); + WebCore::JSMainThreadNullState state; + WebCore::TestCallback * item = WebKit::core(self); + gboolean res = item->callbackWithNoParam(); + return res; +} + +gboolean webkit_dom_test_callback_callback_with_class1param(WebKitDOMTestCallback* self, WebKitDOMClass1* class1param) { g_return_val_if_fail(self, 0); diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.h index 4f0ac91..6049c79 100644 --- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.h +++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.h @@ -47,6 +47,9 @@ WEBKIT_API GType webkit_dom_test_callback_get_type (void); WEBKIT_API gboolean +webkit_dom_test_callback_callback_with_no_param(WebKitDOMTestCallback* self); + +WEBKIT_API gboolean webkit_dom_test_callback_callback_with_class1param(WebKitDOMTestCallback* self, WebKitDOMClass1* class1param); WEBKIT_API gboolean diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp index b68340b..7086c80 100644 --- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp +++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp @@ -33,8 +33,9 @@ #include "gobject/ConvertToUTF8String.h" #include "webkit/WebKitDOMTestInterface.h" #include "webkit/WebKitDOMTestInterfacePrivate.h" +#include "webkitdefines.h" +#include "webkitglobalsprivate.h" #include "webkitmarshal.h" -#include "webkitprivate.h" namespace WebKit { diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp index 93d0bde..5946ec0 100644 --- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp +++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp @@ -31,8 +31,9 @@ #include "gobject/ConvertToUTF8String.h" #include "webkit/WebKitDOMTestMediaQueryListListener.h" #include "webkit/WebKitDOMTestMediaQueryListListenerPrivate.h" +#include "webkitdefines.h" +#include "webkitglobalsprivate.h" #include "webkitmarshal.h" -#include "webkitprivate.h" namespace WebKit { diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp index 6c94d94..44d58d4 100644 --- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp +++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp @@ -38,8 +38,9 @@ #include "webkit/WebKitDOMSerializedScriptValuePrivate.h" #include "webkit/WebKitDOMTestObj.h" #include "webkit/WebKitDOMTestObjPrivate.h" +#include "webkitdefines.h" +#include "webkitglobalsprivate.h" #include "webkitmarshal.h" -#include "webkitprivate.h" namespace WebKit { diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp index 069b8ae..1f48ee9 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp @@ -56,6 +56,23 @@ JSTestCallback::~JSTestCallback() // Functions +bool JSTestCallback::callbackWithNoParam() +{ + if (!canInvokeCallback()) + return true; + + RefPtr<JSTestCallback> protect(this); + + JSLock lock(SilenceAssertionsOnly); + + ExecState* exec = m_data->globalObject()->globalExec(); + MarkedArgumentBuffer args; + + bool raisedException = false; + m_data->invokeCallback(args, &raisedException); + return !raisedException; +} + bool JSTestCallback::callbackWithClass1Param(Class1* class1Param) { if (!canInvokeCallback()) diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h b/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h index ae91a6c..ba3559c 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h @@ -40,6 +40,7 @@ public: virtual ~JSTestCallback(); // Functions + virtual bool callbackWithNoParam(); virtual bool callbackWithClass1Param(Class1* class1Param); virtual bool callbackWithClass2Param(Class2* class2Param, const String& strArg); COMPILE_ASSERT(false) virtual int callbackWithNonBoolReturnType(Class3* class3Param); diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp index 8e71df1..684f587 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp @@ -166,6 +166,7 @@ JSValue jsTestInterfaceConstructor(ExecState* exec, JSValue slotBase, const Iden JSTestInterface* domObject = static_cast<JSTestInterface*>(asObject(slotBase)); return JSTestInterface::getConstructor(exec, domObject->globalObject()); } + JSValue JSTestInterface::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSTestInterfaceConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp index e505ed2..f1c09b5 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp @@ -162,6 +162,7 @@ JSValue jsTestMediaQueryListListenerConstructor(ExecState* exec, JSValue slotBas JSTestMediaQueryListListener* domObject = static_cast<JSTestMediaQueryListListener*>(asObject(slotBase)); return JSTestMediaQueryListListener::getConstructor(exec, domObject->globalObject()); } + JSValue JSTestMediaQueryListListener::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSTestMediaQueryListListenerConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp index c4c77ee..9d446a2 100644 --- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp +++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp @@ -607,6 +607,7 @@ JSValue jsTestObjConstructor(ExecState* exec, JSValue slotBase, const Identifier JSTestObj* domObject = static_cast<JSTestObj*>(asObject(slotBase)); return JSTestObj::getConstructor(exec, domObject->globalObject()); } + void JSTestObj::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { lookupPut<JSTestObj, Base>(exec, propertyName, value, &JSTestObjTable, this, slot); diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallback.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallback.h index 1213c6f..08c30b7 100644 --- a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallback.h +++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallback.h @@ -36,6 +36,7 @@ @class NSString; @interface DOMTestCallback : DOMObject +- (BOOL)callbackWithNoParam; - (BOOL)callbackWithClass1Param:(DOMClass1 *)class1Param; - (BOOL)callbackWithClass2Param:(DOMClass2 *)class2Param strArg:(NSString *)strArg; - (int)callbackWithNonBoolReturnType:(DOMClass3 *)class3Param; diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallback.mm b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallback.mm index e941eda..c4be39d 100644 --- a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallback.mm +++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallback.mm @@ -79,6 +79,12 @@ [super finalize]; } +- (BOOL)callbackWithNoParam +{ + WebCore::JSMainThreadNullState state; + return IMPL->callbackWithNoParam(); +} + - (BOOL)callbackWithClass1Param:(DOMClass1 *)class1Param { WebCore::JSMainThreadNullState state; diff --git a/Source/WebCore/bindings/scripts/test/TestCallback.idl b/Source/WebCore/bindings/scripts/test/TestCallback.idl index 25db4c6..9679a5a 100644 --- a/Source/WebCore/bindings/scripts/test/TestCallback.idl +++ b/Source/WebCore/bindings/scripts/test/TestCallback.idl @@ -33,6 +33,7 @@ module test { Conditional=DATABASE, Callback ] TestCallback { + boolean callbackWithNoParam(); boolean callbackWithClass1Param(in Class1 class1Param); boolean callbackWithClass2Param(in Class2 class2Param, in DOMString strArg); long callbackWithNonBoolReturnType(in Class3 class3Param); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp index c286c24..36a5ca2 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp @@ -48,6 +48,26 @@ V8TestCallback::~V8TestCallback() // Functions +bool V8TestCallback::callbackWithNoParam() +{ + if (!canInvokeCallback()) + return true; + + v8::HandleScope handleScope; + + v8::Handle<v8::Context> v8Context = toV8Context(scriptExecutionContext(), m_worldContext); + if (v8Context.IsEmpty()) + return true; + + v8::Context::Scope scope(v8Context); + + + v8::Handle<v8::Value> *argv = 0; + + bool callbackReturnValue = false; + return !invokeCallback(m_callback, 0, argv, callbackReturnValue, scriptExecutionContext()); +} + bool V8TestCallback::callbackWithClass1Param(Class1* class1Param) { if (!canInvokeCallback()) diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.h b/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.h index a105d75..8ff8c26 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.h +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.h @@ -45,6 +45,7 @@ public: virtual ~V8TestCallback(); // Functions + virtual bool callbackWithNoParam(); virtual bool callbackWithClass1Param(Class1* class1Param); virtual bool callbackWithClass2Param(Class2* class2Param, const String& strArg); COMPILE_ASSERT(false) virtual int callbackWithNonBoolReturnType(Class3* class3Param); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp index 7a759a3..4298756 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp @@ -260,7 +260,7 @@ static v8::Handle<v8::Value> reflectedUnsignedIntegralAttrAttrGetter(v8::Local<v { INC_STATS("DOM.TestObj.reflectedUnsignedIntegralAttr._get"); TestObj* imp = V8TestObj::toNative(info.Holder()); - return v8::Integer::NewFromUnsigned(imp->getUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr)); + return v8::Integer::NewFromUnsigned(std::max(0, imp->getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr))); } static void reflectedUnsignedIntegralAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) |