diff options
Diffstat (limited to 'WebCore/bindings/scripts/test')
21 files changed, 1861 insertions, 258 deletions
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp index 0b20841..0436e13 100644 --- a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp +++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp @@ -19,6 +19,9 @@ */ #include "config.h" + +#if ENABLE(Condition1) || ENABLE(Condition2) + #include "WebDOMTestInterface.h" #include "TestInterface.h" @@ -73,3 +76,5 @@ WebDOMTestInterface toWebKit(WebCore::TestInterface* value) { return WebDOMTestInterface(value); } + +#endif // ENABLE(Condition1) || ENABLE(Condition2) diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h index d0cee5b..4e7af6d 100644 --- a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h +++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h @@ -23,6 +23,8 @@ #ifndef WebDOMTestInterface_h #define WebDOMTestInterface_h +#if ENABLE(Condition1) || ENABLE(Condition2) + #include <WebDOMObject.h> #include <WebDOMString.h> @@ -50,3 +52,5 @@ WebCore::TestInterface* toWebCore(const WebDOMTestInterface&); WebDOMTestInterface toWebKit(WebCore::TestInterface*); #endif +#endif // ENABLE(Condition1) || ENABLE(Condition2) + diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp index e540a57..65bc9f3 100644 --- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp +++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp @@ -22,6 +22,7 @@ #include "WebDOMTestObj.h" #include "AtomicString.h" +#include "HTMLNames.h" #include "KURL.h" #include "SerializedScriptValue.h" #include "TestObj.h" @@ -173,33 +174,163 @@ void WebDOMTestObj::setTestObjAttr(const WebDOMTestObj& newTestObjAttr) impl()->setTestObjAttr(toWebCore(newTestObjAttr)); } -int WebDOMTestObj::attrWithException() const +WebDOMString WebDOMTestObj::reflectedStringAttr() const +{ + if (!impl()) + return WebDOMString(); + + return static_cast<const WebCore::String&>(impl()->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr)); +} + +void WebDOMTestObj::setReflectedStringAttr(const WebDOMString& newReflectedStringAttr) +{ + if (!impl()) + return; + + impl()->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, newReflectedStringAttr); +} + +int WebDOMTestObj::reflectedIntegralAttr() const { if (!impl()) return 0; - return impl()->attrWithException(); + return impl()->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr); } -void WebDOMTestObj::setAttrWithException(int newAttrWithException) +void WebDOMTestObj::setReflectedIntegralAttr(int newReflectedIntegralAttr) { if (!impl()) return; - impl()->setAttrWithException(newAttrWithException); + impl()->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, newReflectedIntegralAttr); } -int WebDOMTestObj::attrWithSetterException() const +bool WebDOMTestObj::reflectedBooleanAttr() const +{ + if (!impl()) + return false; + + return impl()->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr); +} + +void WebDOMTestObj::setReflectedBooleanAttr(bool newReflectedBooleanAttr) +{ + if (!impl()) + return; + + impl()->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, newReflectedBooleanAttr); +} + +WebDOMString WebDOMTestObj::reflectedURLAttr() const +{ + if (!impl()) + return WebDOMString(); + + return static_cast<const WebCore::String&>(impl()->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr)); +} + +void WebDOMTestObj::setReflectedURLAttr(const WebDOMString& newReflectedURLAttr) +{ + if (!impl()) + return; + + impl()->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, newReflectedURLAttr); +} + +WebDOMString WebDOMTestObj::reflectedStringAttr() const +{ + if (!impl()) + return WebDOMString(); + + return static_cast<const WebCore::String&>(impl()->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr)); +} + +void WebDOMTestObj::setReflectedStringAttr(const WebDOMString& newReflectedStringAttr) +{ + if (!impl()) + return; + + impl()->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, newReflectedStringAttr); +} + +int WebDOMTestObj::reflectedCustomIntegralAttr() const +{ + if (!impl()) + return 0; + + return impl()->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr); +} + +void WebDOMTestObj::setReflectedCustomIntegralAttr(int newReflectedCustomIntegralAttr) +{ + if (!impl()) + return; + + impl()->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, newReflectedCustomIntegralAttr); +} + +bool WebDOMTestObj::reflectedCustomBooleanAttr() const +{ + if (!impl()) + return false; + + return impl()->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr); +} + +void WebDOMTestObj::setReflectedCustomBooleanAttr(bool newReflectedCustomBooleanAttr) +{ + if (!impl()) + return; + + impl()->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, newReflectedCustomBooleanAttr); +} + +WebDOMString WebDOMTestObj::reflectedURLAttr() const +{ + if (!impl()) + return WebDOMString(); + + return static_cast<const WebCore::String&>(impl()->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr)); +} + +void WebDOMTestObj::setReflectedURLAttr(const WebDOMString& newReflectedURLAttr) +{ + if (!impl()) + return; + + impl()->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, newReflectedURLAttr); +} + +int WebDOMTestObj::attrWithGetterException() const { if (!impl()) return 0; WebCore::ExceptionCode ec = 0; - int result = impl()->attrWithSetterException(ec); + int result = impl()->attrWithGetterException(ec); webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec)); return result; } +void WebDOMTestObj::setAttrWithGetterException(int newAttrWithGetterException) +{ + if (!impl()) + return; + + WebCore::ExceptionCode ec = 0; + impl()->setAttrWithGetterException(newAttrWithGetterException, ec); + webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec)); +} + +int WebDOMTestObj::attrWithSetterException() const +{ + if (!impl()) + return 0; + + return impl()->attrWithSetterException(); +} + void WebDOMTestObj::setAttrWithSetterException(int newAttrWithSetterException) { if (!impl()) @@ -210,21 +341,42 @@ void WebDOMTestObj::setAttrWithSetterException(int newAttrWithSetterException) webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec)); } -int WebDOMTestObj::attrWithGetterException() const +WebDOMString WebDOMTestObj::stringAttrWithGetterException() const { if (!impl()) - return 0; + return WebDOMString(); - return impl()->attrWithGetterException(); + WebCore::ExceptionCode ec = 0; + WebDOMString result = impl()->stringAttrWithGetterException(ec); + webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec)); + return static_cast<const WebCore::String&>(result); } -void WebDOMTestObj::setAttrWithGetterException(int newAttrWithGetterException) +void WebDOMTestObj::setStringAttrWithGetterException(const WebDOMString& newStringAttrWithGetterException) { if (!impl()) return; WebCore::ExceptionCode ec = 0; - impl()->setAttrWithGetterException(newAttrWithGetterException, ec); + impl()->setStringAttrWithGetterException(newStringAttrWithGetterException, ec); + webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec)); +} + +WebDOMString WebDOMTestObj::stringAttrWithSetterException() const +{ + if (!impl()) + return WebDOMString(); + + return static_cast<const WebCore::String&>(impl()->stringAttrWithSetterException()); +} + +void WebDOMTestObj::setStringAttrWithSetterException(const WebDOMString& newStringAttrWithSetterException) +{ + if (!impl()) + return; + + WebCore::ExceptionCode ec = 0; + impl()->setStringAttrWithSetterException(newStringAttrWithSetterException, ec); webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec)); } @@ -236,6 +388,92 @@ WebDOMString WebDOMTestObj::scriptStringAttr() const return static_cast<const WebCore::String&>(impl()->scriptStringAttr()); } +#if ENABLE(Condition1) +int WebDOMTestObj::conditionalAttr1() const +{ + if (!impl()) + return 0; + + return impl()->conditionalAttr1(); +} + +void WebDOMTestObj::setConditionalAttr1(int newConditionalAttr1) +{ + if (!impl()) + return; + + impl()->setConditionalAttr1(newConditionalAttr1); +} + +#endif +#if ENABLE(Condition1) && ENABLE(Condition2) +int WebDOMTestObj::conditionalAttr2() const +{ + if (!impl()) + return 0; + + return impl()->conditionalAttr2(); +} + +void WebDOMTestObj::setConditionalAttr2(int newConditionalAttr2) +{ + if (!impl()) + return; + + impl()->setConditionalAttr2(newConditionalAttr2); +} + +#endif +#if ENABLE(Condition1) || ENABLE(Condition2) +int WebDOMTestObj::conditionalAttr3() const +{ + if (!impl()) + return 0; + + return impl()->conditionalAttr3(); +} + +void WebDOMTestObj::setConditionalAttr3(int newConditionalAttr3) +{ + if (!impl()) + return; + + impl()->setConditionalAttr3(newConditionalAttr3); +} + +#endif +int WebDOMTestObj::description() const +{ + if (!impl()) + return 0; + + return impl()->description(); +} + +int WebDOMTestObj::id() const +{ + if (!impl()) + return 0; + + return impl()->id(); +} + +void WebDOMTestObj::setId(int newId) +{ + if (!impl()) + return; + + impl()->setId(newId); +} + +WebDOMString WebDOMTestObj::hash() const +{ + if (!impl()) + return WebDOMString(); + + return static_cast<const WebCore::String&>(impl()->hash()); +} + void WebDOMTestObj::voidMethod() { if (!impl()) diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h index 7bcd988..33bc7fb 100644 --- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h +++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h @@ -54,15 +54,43 @@ public: void setStringAttr(const WebDOMString&); WebDOMTestObj testObjAttr() const; void setTestObjAttr(const WebDOMTestObj&); - int attrWithException() const; - void setAttrWithException(int); - int attrWithSetterException() const; - void setAttrWithSetterException(int); + WebDOMString reflectedStringAttr() const; + void setReflectedStringAttr(const WebDOMString&); + int reflectedIntegralAttr() const; + void setReflectedIntegralAttr(int); + bool reflectedBooleanAttr() const; + void setReflectedBooleanAttr(bool); + WebDOMString reflectedURLAttr() const; + void setReflectedURLAttr(const WebDOMString&); + WebDOMString reflectedStringAttr() const; + void setReflectedStringAttr(const WebDOMString&); + int reflectedCustomIntegralAttr() const; + void setReflectedCustomIntegralAttr(int); + bool reflectedCustomBooleanAttr() const; + void setReflectedCustomBooleanAttr(bool); + WebDOMString reflectedURLAttr() const; + void setReflectedURLAttr(const WebDOMString&); int attrWithGetterException() const; void setAttrWithGetterException(int); + int attrWithSetterException() const; + void setAttrWithSetterException(int); + WebDOMString stringAttrWithGetterException() const; + void setStringAttrWithGetterException(const WebDOMString&); + WebDOMString stringAttrWithSetterException() const; + void setStringAttrWithSetterException(const WebDOMString&); int customAttr() const; void setCustomAttr(int); WebDOMString scriptStringAttr() const; + int conditionalAttr1() const; + void setConditionalAttr1(int); + int conditionalAttr2() const; + void setConditionalAttr2(int); + int conditionalAttr3() const; + void setConditionalAttr3(int); + int description() const; + int id() const; + void setId(int); + WebDOMString hash() const; void voidMethod(); void voidMethodWithArgs(int intArg, const WebDOMString& strArg, const WebDOMTestObj& objArg); diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp index a67b6ac..94f4ca5 100644 --- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp +++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp @@ -21,6 +21,8 @@ #include <glib-object.h> #include "config.h" +#if ENABLE(DATABASE) + #include <wtf/GetPtr.h> #include <wtf/RefPtr.h> #include "ExceptionCode.h" @@ -55,38 +57,38 @@ gpointer kit(WebCore::TestCallback* obj) gboolean webkit_dom_test_callback_callback_with_class1param(WebKitDOMTestCallback* self, WebKitDOMClass1* class1param) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestCallback * item = WebKit::core(self); - g_return_val_if_fail (class1param, 0); - WebCore::Class1 * _g_class1param = WebKit::core(class1param); - g_return_val_if_fail (_g_class1param, 0); - gboolean res = item->callbackWithClass1Param(_g_class1param); + g_return_val_if_fail(class1param, 0); + WebCore::Class1 * converted_class1param = WebKit::core(class1param); + g_return_val_if_fail(converted_class1param, 0); + gboolean res = item->callbackWithClass1Param(converted_class1param); return res; } gboolean webkit_dom_test_callback_callback_with_class2param(WebKitDOMTestCallback* self, WebKitDOMClass2* class2param, gchar* str_arg) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestCallback * item = WebKit::core(self); - g_return_val_if_fail (class2param, 0); - g_return_val_if_fail (str_arg, 0); - WebCore::Class2 * _g_class2param = WebKit::core(class2param); - g_return_val_if_fail (_g_class2param, 0); - WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg); - gboolean res = item->callbackWithClass2Param(_g_class2param, _g_str_arg); + g_return_val_if_fail(class2param, 0); + g_return_val_if_fail(str_arg, 0); + WebCore::Class2 * converted_class2param = WebKit::core(class2param); + g_return_val_if_fail(converted_class2param, 0); + WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg); + gboolean res = item->callbackWithClass2Param(converted_class2param, converted_str_arg); return res; } glong webkit_dom_test_callback_callback_with_non_bool_return_type(WebKitDOMTestCallback* self, WebKitDOMClass3* class3param) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestCallback * item = WebKit::core(self); - g_return_val_if_fail (class3param, 0); - WebCore::Class3 * _g_class3param = WebKit::core(class3param); - g_return_val_if_fail (_g_class3param, 0); - glong res = item->callbackWithNonBoolReturnType(_g_class3param); + g_return_val_if_fail(class3param, 0); + WebCore::Class3 * converted_class3param = WebKit::core(class3param); + g_return_val_if_fail(converted_class3param, 0); + glong res = item->callbackWithNonBoolReturnType(converted_class3param); return res; } @@ -182,3 +184,4 @@ WebKitDOMTestCallback* wrapTestCallback(WebCore::TestCallback* coreObject) return wrapper; } } // namespace WebKit +#endif /* ENABLE(DATABASE) */ diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp index 0d0021d..af22530 100644 --- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp +++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp @@ -21,6 +21,8 @@ #include <glib-object.h> #include "config.h" +#if ENABLE(Condition1) || ENABLE(Condition2) + #include <wtf/GetPtr.h> #include <wtf/RefPtr.h> #include "ExceptionCode.h" @@ -138,3 +140,4 @@ WebKitDOMTestInterface* wrapTestInterface(WebCore::TestInterface* coreObject) return wrapper; } } // namespace WebKit +#endif /* ENABLE(Condition1) || ENABLE(Condition2) */ diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp index 5dfb255..efb362b 100644 --- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp +++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp @@ -24,6 +24,7 @@ #include <wtf/GetPtr.h> #include <wtf/RefPtr.h> #include "ExceptionCode.h" +#include "HTMLNames.h" #include "TestObj.h" #include "WebKitDOMBinding.h" #include "gobject/ConvertToUTF8String.h" @@ -51,7 +52,7 @@ gpointer kit(WebCore::TestObj* obj) void webkit_dom_test_obj_void_method(WebKitDOMTestObj* self) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->voidMethod(); } @@ -59,20 +60,20 @@ webkit_dom_test_obj_void_method(WebKitDOMTestObj* self) void webkit_dom_test_obj_void_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); - g_return_if_fail (str_arg); - g_return_if_fail (obj_arg); - WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg); - WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg); - g_return_if_fail (_g_obj_arg); - item->voidMethodWithArgs(int_arg, _g_str_arg, _g_obj_arg); + g_return_if_fail(str_arg); + g_return_if_fail(obj_arg); + WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg); + WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg); + g_return_if_fail(converted_obj_arg); + item->voidMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg); } glong webkit_dom_test_obj_int_method(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); glong res = item->intMethod(); return res; @@ -81,21 +82,21 @@ webkit_dom_test_obj_int_method(WebKitDOMTestObj* self) glong webkit_dom_test_obj_int_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); - g_return_val_if_fail (str_arg, 0); - g_return_val_if_fail (obj_arg, 0); - WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg); - WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg); - g_return_val_if_fail (_g_obj_arg, 0); - glong res = item->intMethodWithArgs(int_arg, _g_str_arg, _g_obj_arg); + g_return_val_if_fail(str_arg, 0); + g_return_val_if_fail(obj_arg, 0); + WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg); + WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg); + g_return_val_if_fail(converted_obj_arg, 0); + glong res = item->intMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg); return res; } WebKitDOMTestObj* webkit_dom_test_obj_obj_method(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethod()); WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get())); @@ -105,14 +106,14 @@ webkit_dom_test_obj_obj_method(WebKitDOMTestObj* self) WebKitDOMTestObj* webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); - g_return_val_if_fail (str_arg, 0); - g_return_val_if_fail (obj_arg, 0); - WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg); - WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg); - g_return_val_if_fail (_g_obj_arg, 0); - PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethodWithArgs(int_arg, _g_str_arg, _g_obj_arg)); + g_return_val_if_fail(str_arg, 0); + g_return_val_if_fail(obj_arg, 0); + WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg); + WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg); + g_return_val_if_fail(converted_obj_arg, 0); + PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg)); WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get())); return res; } @@ -120,14 +121,14 @@ webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong int_arg, WebKitDOMTestObj* webkit_dom_test_obj_method_that_requires_all_args(WebKitDOMTestObj* self, gchar* str_arg, WebKitDOMTestObj* obj_arg) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); - g_return_val_if_fail (str_arg, 0); - g_return_val_if_fail (obj_arg, 0); - WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg); - WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg); - g_return_val_if_fail (_g_obj_arg, 0); - PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgs(_g_str_arg, _g_obj_arg)); + g_return_val_if_fail(str_arg, 0); + g_return_val_if_fail(obj_arg, 0); + WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg); + WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg); + g_return_val_if_fail(converted_obj_arg, 0); + PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgs(converted_str_arg, converted_obj_arg)); WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get())); return res; } @@ -135,15 +136,15 @@ webkit_dom_test_obj_method_that_requires_all_args(WebKitDOMTestObj* self, gchar* WebKitDOMTestObj* webkit_dom_test_obj_method_that_requires_all_args_and_throws(WebKitDOMTestObj* self, gchar* str_arg, WebKitDOMTestObj* obj_arg, GError **error) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); - g_return_val_if_fail (str_arg, 0); - g_return_val_if_fail (obj_arg, 0); - WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg); - WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg); - g_return_val_if_fail (_g_obj_arg, 0); + g_return_val_if_fail(str_arg, 0); + g_return_val_if_fail(obj_arg, 0); + WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg); + WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg); + g_return_val_if_fail(converted_obj_arg, 0); WebCore::ExceptionCode ec = 0; - PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgsAndThrows(_g_str_arg, _g_obj_arg, ec)); + PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgsAndThrows(converted_str_arg, converted_obj_arg, ec)); if (ec) { WebCore::ExceptionCodeDescription ecdesc; WebCore::getExceptionCodeDescription(ec, ecdesc); @@ -156,18 +157,18 @@ webkit_dom_test_obj_method_that_requires_all_args_and_throws(WebKitDOMTestObj* s void webkit_dom_test_obj_serialized_value(WebKitDOMTestObj* self, WebKitDOMSerializedScriptValue* serialized_arg) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); - g_return_if_fail (serialized_arg); - WebCore::SerializedScriptValue * _g_serialized_arg = WebKit::core(serialized_arg); - g_return_if_fail (_g_serialized_arg); - item->serializedValue(_g_serialized_arg); + g_return_if_fail(serialized_arg); + WebCore::SerializedScriptValue * converted_serialized_arg = WebKit::core(serialized_arg); + g_return_if_fail(converted_serialized_arg); + item->serializedValue(converted_serialized_arg); } void webkit_dom_test_obj_method_with_exception(WebKitDOMTestObj* self, GError **error) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); WebCore::ExceptionCode ec = 0; item->methodWithException(ec); @@ -187,7 +188,7 @@ webkit_dom_test_obj_method_with_exception(WebKitDOMTestObj* self, GError **error void webkit_dom_test_obj_with_dynamic_frame(WebKitDOMTestObj* self) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->withDynamicFrame(); } @@ -195,7 +196,7 @@ webkit_dom_test_obj_with_dynamic_frame(WebKitDOMTestObj* self) void webkit_dom_test_obj_with_dynamic_frame_and_arg(WebKitDOMTestObj* self, glong int_arg) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->withDynamicFrameAndArg(int_arg); } @@ -203,7 +204,7 @@ webkit_dom_test_obj_with_dynamic_frame_and_arg(WebKitDOMTestObj* self, glong int void webkit_dom_test_obj_with_dynamic_frame_and_optional_arg(WebKitDOMTestObj* self, glong int_arg, glong optional_arg) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->withDynamicFrameAndOptionalArg(int_arg, optional_arg); } @@ -211,7 +212,7 @@ webkit_dom_test_obj_with_dynamic_frame_and_optional_arg(WebKitDOMTestObj* self, void webkit_dom_test_obj_with_dynamic_frame_and_user_gesture(WebKitDOMTestObj* self, glong int_arg) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->withDynamicFrameAndUserGesture(int_arg); } @@ -219,7 +220,7 @@ webkit_dom_test_obj_with_dynamic_frame_and_user_gesture(WebKitDOMTestObj* self, void webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad(WebKitDOMTestObj* self, glong int_arg, glong optional_arg) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->withDynamicFrameAndUserGestureASAD(int_arg, optional_arg); } @@ -227,7 +228,7 @@ webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad(WebKitDOMTestObj* s void webkit_dom_test_obj_with_script_state_void(WebKitDOMTestObj* self) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->withScriptStateVoid(); } @@ -235,7 +236,7 @@ webkit_dom_test_obj_with_script_state_void(WebKitDOMTestObj* self) WebKitDOMTestObj* webkit_dom_test_obj_with_script_state_obj(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->withScriptStateObj()); WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get())); @@ -245,7 +246,7 @@ webkit_dom_test_obj_with_script_state_obj(WebKitDOMTestObj* self) void webkit_dom_test_obj_with_script_state_void_exception(WebKitDOMTestObj* self, GError **error) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); WebCore::ExceptionCode ec = 0; item->withScriptStateVoidException(ec); @@ -259,7 +260,7 @@ webkit_dom_test_obj_with_script_state_void_exception(WebKitDOMTestObj* self, GEr WebKitDOMTestObj* webkit_dom_test_obj_with_script_state_obj_exception(WebKitDOMTestObj* self, GError **error) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); WebCore::ExceptionCode ec = 0; PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->withScriptStateObjException(ec)); @@ -275,7 +276,7 @@ webkit_dom_test_obj_with_script_state_obj_exception(WebKitDOMTestObj* self, GErr void webkit_dom_test_obj_with_script_execution_context(WebKitDOMTestObj* self) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->withScriptExecutionContext(); } @@ -283,7 +284,7 @@ webkit_dom_test_obj_with_script_execution_context(WebKitDOMTestObj* self) void webkit_dom_test_obj_method_with_optional_arg(WebKitDOMTestObj* self, glong opt) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->methodWithOptionalArg(opt); } @@ -291,7 +292,7 @@ webkit_dom_test_obj_method_with_optional_arg(WebKitDOMTestObj* self, glong opt) void webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg(WebKitDOMTestObj* self, glong non_opt, glong opt) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->methodWithNonOptionalArgAndOptionalArg(non_opt, opt); } @@ -299,7 +300,7 @@ webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg(WebKitDOMTestO void webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args(WebKitDOMTestObj* self, glong non_opt, glong opt1, glong opt2) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->methodWithNonOptionalArgAndTwoOptionalArgs(non_opt, opt1, opt2); } @@ -307,7 +308,7 @@ webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args(WebKitDOM glong webkit_dom_test_obj_get_read_only_int_attr(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); glong res = item->readOnlyIntAttr(); return res; @@ -316,7 +317,7 @@ webkit_dom_test_obj_get_read_only_int_attr(WebKitDOMTestObj* self) gchar* webkit_dom_test_obj_get_read_only_string_attr(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); gchar* res = convertToUTF8String(item->readOnlyStringAttr()); return res; @@ -325,7 +326,7 @@ webkit_dom_test_obj_get_read_only_string_attr(WebKitDOMTestObj* self) WebKitDOMTestObj* webkit_dom_test_obj_get_read_only_test_obj_attr(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->readOnlyTestObjAttr()); WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get())); @@ -335,7 +336,7 @@ webkit_dom_test_obj_get_read_only_test_obj_attr(WebKitDOMTestObj* self) glong webkit_dom_test_obj_get_int_attr(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); glong res = item->intAttr(); return res; @@ -344,7 +345,7 @@ webkit_dom_test_obj_get_int_attr(WebKitDOMTestObj* self) void webkit_dom_test_obj_set_int_attr(WebKitDOMTestObj* self, glong value) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->setIntAttr(value); } @@ -352,7 +353,7 @@ webkit_dom_test_obj_set_int_attr(WebKitDOMTestObj* self, glong value) gint64 webkit_dom_test_obj_get_long_long_attr(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); gint64 res = item->longLongAttr(); return res; @@ -361,7 +362,7 @@ webkit_dom_test_obj_get_long_long_attr(WebKitDOMTestObj* self) void webkit_dom_test_obj_set_long_long_attr(WebKitDOMTestObj* self, gint64 value) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->setLongLongAttr(value); } @@ -369,7 +370,7 @@ webkit_dom_test_obj_set_long_long_attr(WebKitDOMTestObj* self, gint64 value) guint64 webkit_dom_test_obj_get_unsigned_long_long_attr(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); guint64 res = item->unsignedLongLongAttr(); return res; @@ -378,7 +379,7 @@ webkit_dom_test_obj_get_unsigned_long_long_attr(WebKitDOMTestObj* self) void webkit_dom_test_obj_set_unsigned_long_long_attr(WebKitDOMTestObj* self, guint64 value) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->setUnsignedLongLongAttr(value); } @@ -386,7 +387,7 @@ webkit_dom_test_obj_set_unsigned_long_long_attr(WebKitDOMTestObj* self, guint64 gchar* webkit_dom_test_obj_get_string_attr(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); gchar* res = convertToUTF8String(item->stringAttr()); return res; @@ -395,17 +396,17 @@ webkit_dom_test_obj_get_string_attr(WebKitDOMTestObj* self) void webkit_dom_test_obj_set_string_attr(WebKitDOMTestObj* self, gchar* value) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); - g_return_if_fail (value); - WebCore::String _g_value = WebCore::String::fromUTF8(value); - item->setStringAttr(_g_value); + g_return_if_fail(value); + WebCore::String converted_value = WebCore::String::fromUTF8(value); + item->setStringAttr(converted_value); } WebKitDOMTestObj* webkit_dom_test_obj_get_test_obj_attr(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->testObjAttr()); WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get())); @@ -415,38 +416,165 @@ webkit_dom_test_obj_get_test_obj_attr(WebKitDOMTestObj* self) void webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); - g_return_if_fail (value); - WebCore::TestObj * _g_value = WebKit::core(value); - g_return_if_fail (_g_value); - item->setTestObjAttr(_g_value); + g_return_if_fail(value); + WebCore::TestObj * converted_value = WebKit::core(value); + g_return_if_fail(converted_value); + item->setTestObjAttr(converted_value); +} + +gchar* +webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self) +{ + g_return_val_if_fail(self, 0); + WebCore::TestObj * item = WebKit::core(self); + gchar* res = convertToUTF8String(item->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr)); + return res; +} + +void +webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value) +{ + g_return_if_fail(self); + WebCore::TestObj * item = WebKit::core(self); + g_return_if_fail(value); + WebCore::String converted_value = WebCore::String::fromUTF8(value); + item->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, converted_value); } glong -webkit_dom_test_obj_get_attr_with_exception(WebKitDOMTestObj* self) +webkit_dom_test_obj_get_reflected_integral_attr(WebKitDOMTestObj* self) +{ + g_return_val_if_fail(self, 0); + WebCore::TestObj * item = WebKit::core(self); + glong res = item->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr); + return res; +} + +void +webkit_dom_test_obj_set_reflected_integral_attr(WebKitDOMTestObj* self, glong value) +{ + g_return_if_fail(self); + WebCore::TestObj * item = WebKit::core(self); + item->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, value); +} + +gboolean +webkit_dom_test_obj_get_reflected_boolean_attr(WebKitDOMTestObj* self) +{ + g_return_val_if_fail(self, 0); + WebCore::TestObj * item = WebKit::core(self); + gboolean res = item->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr); + return res; +} + +void +webkit_dom_test_obj_set_reflected_boolean_attr(WebKitDOMTestObj* self, gboolean value) { - g_return_val_if_fail (self, 0); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); - glong res = item->attrWithException(); + item->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value); +} + +gchar* +webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self) +{ + g_return_val_if_fail(self, 0); + WebCore::TestObj * item = WebKit::core(self); + gchar* res = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr)); return res; } void -webkit_dom_test_obj_set_attr_with_exception(WebKitDOMTestObj* self, glong value) +webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); - item->setAttrWithException(value); + g_return_if_fail(value); + WebCore::String converted_value = WebCore::String::fromUTF8(value); + item->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, converted_value); +} + +gchar* +webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self) +{ + g_return_val_if_fail(self, 0); + WebCore::TestObj * item = WebKit::core(self); + gchar* res = convertToUTF8String(item->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr)); + return res; +} + +void +webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value) +{ + g_return_if_fail(self); + WebCore::TestObj * item = WebKit::core(self); + g_return_if_fail(value); + WebCore::String converted_value = WebCore::String::fromUTF8(value); + item->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, converted_value); } glong -webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self, GError **error) +webkit_dom_test_obj_get_reflected_custom_integral_attr(WebKitDOMTestObj* self) +{ + g_return_val_if_fail(self, 0); + WebCore::TestObj * item = WebKit::core(self); + glong res = item->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr); + return res; +} + +void +webkit_dom_test_obj_set_reflected_custom_integral_attr(WebKitDOMTestObj* self, glong value) { - g_return_val_if_fail (self, 0); + g_return_if_fail(self); + WebCore::TestObj * item = WebKit::core(self); + item->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, value); +} + +gboolean +webkit_dom_test_obj_get_reflected_custom_boolean_attr(WebKitDOMTestObj* self) +{ + g_return_val_if_fail(self, 0); + WebCore::TestObj * item = WebKit::core(self); + gboolean res = item->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr); + return res; +} + +void +webkit_dom_test_obj_set_reflected_custom_boolean_attr(WebKitDOMTestObj* self, gboolean value) +{ + g_return_if_fail(self); + WebCore::TestObj * item = WebKit::core(self); + item->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value); +} + +gchar* +webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self) +{ + g_return_val_if_fail(self, 0); + WebCore::TestObj * item = WebKit::core(self); + gchar* res = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr)); + return res; +} + +void +webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value) +{ + g_return_if_fail(self); + WebCore::TestObj * item = WebKit::core(self); + g_return_if_fail(value); + WebCore::String converted_value = WebCore::String::fromUTF8(value); + item->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, converted_value); +} + +glong +webkit_dom_test_obj_get_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error) +{ + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); WebCore::ExceptionCode ec = 0; - glong res = item->attrWithSetterException(ec); + glong res = item->attrWithGetterException(ec); if (ec) { WebCore::ExceptionCodeDescription ecdesc; WebCore::getExceptionCodeDescription(ec, ecdesc); @@ -456,9 +584,32 @@ webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self, GErro } void +webkit_dom_test_obj_set_attr_with_getter_exception(WebKitDOMTestObj* self, glong value, GError **error) +{ + g_return_if_fail(self); + WebCore::TestObj * item = WebKit::core(self); + WebCore::ExceptionCode ec = 0; + item->setAttrWithGetterException(value, ec); + if (ec) { + WebCore::ExceptionCodeDescription ecdesc; + WebCore::getExceptionCodeDescription(ec, ecdesc); + g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name); + } +} + +glong +webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self) +{ + g_return_val_if_fail(self, 0); + WebCore::TestObj * item = WebKit::core(self); + glong res = item->attrWithSetterException(); + return res; +} + +void webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong value, GError **error) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); WebCore::ExceptionCode ec = 0; item->setAttrWithSetterException(value, ec); @@ -469,22 +620,50 @@ webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong } } -glong -webkit_dom_test_obj_get_attr_with_getter_exception(WebKitDOMTestObj* self) +gchar* +webkit_dom_test_obj_get_string_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); - glong res = item->attrWithGetterException(); + WebCore::ExceptionCode ec = 0; + gchar* res = convertToUTF8String(item->stringAttrWithGetterException(ec)); return res; } void -webkit_dom_test_obj_set_attr_with_getter_exception(WebKitDOMTestObj* self, glong value, GError **error) +webkit_dom_test_obj_set_string_attr_with_getter_exception(WebKitDOMTestObj* self, gchar* value, GError **error) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); + g_return_if_fail(value); + WebCore::String converted_value = WebCore::String::fromUTF8(value); WebCore::ExceptionCode ec = 0; - item->setAttrWithGetterException(value, ec); + item->setStringAttrWithGetterException(converted_value, ec); + if (ec) { + WebCore::ExceptionCodeDescription ecdesc; + WebCore::getExceptionCodeDescription(ec, ecdesc); + g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name); + } +} + +gchar* +webkit_dom_test_obj_get_string_attr_with_setter_exception(WebKitDOMTestObj* self) +{ + g_return_val_if_fail(self, 0); + WebCore::TestObj * item = WebKit::core(self); + gchar* res = convertToUTF8String(item->stringAttrWithSetterException()); + return res; +} + +void +webkit_dom_test_obj_set_string_attr_with_setter_exception(WebKitDOMTestObj* self, gchar* value, GError **error) +{ + g_return_if_fail(self); + WebCore::TestObj * item = WebKit::core(self); + g_return_if_fail(value); + WebCore::String converted_value = WebCore::String::fromUTF8(value); + WebCore::ExceptionCode ec = 0; + item->setStringAttrWithSetterException(converted_value, ec); if (ec) { WebCore::ExceptionCodeDescription ecdesc; WebCore::getExceptionCodeDescription(ec, ecdesc); @@ -495,16 +674,79 @@ webkit_dom_test_obj_set_attr_with_getter_exception(WebKitDOMTestObj* self, glong gchar* webkit_dom_test_obj_get_script_string_attr(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); gchar* res = convertToUTF8String(item->scriptStringAttr()); return res; } +#if ENABLE(Condition1) +glong +webkit_dom_test_obj_get_conditional_attr1(WebKitDOMTestObj* self) +{ + g_return_val_if_fail(self, 0); + WebCore::TestObj * item = WebKit::core(self); + glong res = item->conditionalAttr1(); + return res; +} +#endif /* ENABLE(Condition1) */ + +#if ENABLE(Condition1) +void +webkit_dom_test_obj_set_conditional_attr1(WebKitDOMTestObj* self, glong value) +{ + g_return_if_fail(self); + WebCore::TestObj * item = WebKit::core(self); + item->setConditionalAttr1(value); +} +#endif /* ENABLE(Condition1) */ + +#if ENABLE(Condition1) && ENABLE(Condition2) +glong +webkit_dom_test_obj_get_conditional_attr2(WebKitDOMTestObj* self) +{ + g_return_val_if_fail(self, 0); + WebCore::TestObj * item = WebKit::core(self); + glong res = item->conditionalAttr2(); + return res; +} +#endif /* ENABLE(Condition1) && ENABLE(Condition2) */ + +#if ENABLE(Condition1) && ENABLE(Condition2) +void +webkit_dom_test_obj_set_conditional_attr2(WebKitDOMTestObj* self, glong value) +{ + g_return_if_fail(self); + WebCore::TestObj * item = WebKit::core(self); + item->setConditionalAttr2(value); +} +#endif /* ENABLE(Condition1) && ENABLE(Condition2) */ + +#if ENABLE(Condition1) || ENABLE(Condition2) +glong +webkit_dom_test_obj_get_conditional_attr3(WebKitDOMTestObj* self) +{ + g_return_val_if_fail(self, 0); + WebCore::TestObj * item = WebKit::core(self); + glong res = item->conditionalAttr3(); + return res; +} +#endif /* ENABLE(Condition1) || ENABLE(Condition2) */ + +#if ENABLE(Condition1) || ENABLE(Condition2) +void +webkit_dom_test_obj_set_conditional_attr3(WebKitDOMTestObj* self, glong value) +{ + g_return_if_fail(self); + WebCore::TestObj * item = WebKit::core(self); + item->setConditionalAttr3(value); +} +#endif /* ENABLE(Condition1) || ENABLE(Condition2) */ + glong webkit_dom_test_obj_get_description(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); glong res = item->description(); return res; @@ -513,7 +755,7 @@ webkit_dom_test_obj_get_description(WebKitDOMTestObj* self) glong webkit_dom_test_obj_get_id(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); glong res = item->id(); return res; @@ -522,7 +764,7 @@ webkit_dom_test_obj_get_id(WebKitDOMTestObj* self) void webkit_dom_test_obj_set_id(WebKitDOMTestObj* self, glong value) { - g_return_if_fail (self); + g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); item->setId(value); } @@ -530,7 +772,7 @@ webkit_dom_test_obj_set_id(WebKitDOMTestObj* self, glong value) gchar* webkit_dom_test_obj_get_hash(WebKitDOMTestObj* self) { - g_return_val_if_fail (self, 0); + g_return_val_if_fail(self, 0); WebCore::TestObj * item = WebKit::core(self); gchar* res = convertToUTF8String(item->hash()); return res; @@ -562,11 +804,29 @@ enum { PROP_UNSIGNED_LONG_LONG_ATTR, PROP_STRING_ATTR, PROP_TEST_OBJ_ATTR, - PROP_ATTR_WITH_EXCEPTION, - PROP_ATTR_WITH_SETTER_EXCEPTION, + PROP_REFLECTED_STRING_ATTR, + PROP_REFLECTED_INTEGRAL_ATTR, + PROP_REFLECTED_BOOLEAN_ATTR, + PROP_REFLECTED_URL_ATTR, + PROP_REFLECTED_STRING_ATTR, + PROP_REFLECTED_CUSTOM_INTEGRAL_ATTR, + PROP_REFLECTED_CUSTOM_BOOLEAN_ATTR, + PROP_REFLECTED_URL_ATTR, PROP_ATTR_WITH_GETTER_EXCEPTION, + PROP_ATTR_WITH_SETTER_EXCEPTION, + PROP_STRING_ATTR_WITH_GETTER_EXCEPTION, + PROP_STRING_ATTR_WITH_SETTER_EXCEPTION, PROP_CUSTOM_ATTR, PROP_SCRIPT_STRING_ATTR, +#if ENABLE(Condition1) + PROP_CONDITIONAL_ATTR1, +#endif /* ENABLE(Condition1) */ +#if ENABLE(Condition1) && ENABLE(Condition2) + PROP_CONDITIONAL_ATTR2, +#endif /* ENABLE(Condition1) && ENABLE(Condition2) */ +#if ENABLE(Condition1) || ENABLE(Condition2) + PROP_CONDITIONAL_ATTR3, +#endif /* ENABLE(Condition1) || ENABLE(Condition2) */ PROP_DESCRIPTION, PROP_ID, PROP_HASH, @@ -609,9 +869,50 @@ static void webkit_dom_test_obj_set_property(GObject* object, guint prop_id, con coreSelf->setStringAttr(WebCore::String::fromUTF8(g_value_get_string(value))); break; } - case PROP_ATTR_WITH_EXCEPTION: + case PROP_REFLECTED_STRING_ATTR: + { + coreSelf->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, WebCore::String::fromUTF8(g_value_get_string(value))); + break; + } + case PROP_REFLECTED_INTEGRAL_ATTR: + { + coreSelf->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, (g_value_get_long(value))); + break; + } + case PROP_REFLECTED_BOOLEAN_ATTR: + { + coreSelf->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, (g_value_get_boolean(value))); + break; + } + case PROP_REFLECTED_URL_ATTR: + { + coreSelf->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, WebCore::String::fromUTF8(g_value_get_string(value))); + break; + } + case PROP_REFLECTED_STRING_ATTR: + { + coreSelf->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, WebCore::String::fromUTF8(g_value_get_string(value))); + break; + } + case PROP_REFLECTED_CUSTOM_INTEGRAL_ATTR: + { + coreSelf->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, (g_value_get_long(value))); + break; + } + case PROP_REFLECTED_CUSTOM_BOOLEAN_ATTR: { - coreSelf->setAttrWithException((g_value_get_long(value))); + coreSelf->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, (g_value_get_boolean(value))); + break; + } + case PROP_REFLECTED_URL_ATTR: + { + coreSelf->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, WebCore::String::fromUTF8(g_value_get_string(value))); + break; + } + case PROP_ATTR_WITH_GETTER_EXCEPTION: + { + WebCore::ExceptionCode ec = 0; + coreSelf->setAttrWithGetterException((g_value_get_long(value)), ec); break; } case PROP_ATTR_WITH_SETTER_EXCEPTION: @@ -620,12 +921,39 @@ static void webkit_dom_test_obj_set_property(GObject* object, guint prop_id, con coreSelf->setAttrWithSetterException((g_value_get_long(value)), ec); break; } - case PROP_ATTR_WITH_GETTER_EXCEPTION: + case PROP_STRING_ATTR_WITH_GETTER_EXCEPTION: { WebCore::ExceptionCode ec = 0; - coreSelf->setAttrWithGetterException((g_value_get_long(value)), ec); + coreSelf->setStringAttrWithGetterException(WebCore::String::fromUTF8(g_value_get_string(value)), ec); + break; + } + case PROP_STRING_ATTR_WITH_SETTER_EXCEPTION: + { + WebCore::ExceptionCode ec = 0; + coreSelf->setStringAttrWithSetterException(WebCore::String::fromUTF8(g_value_get_string(value)), ec); + break; + } +#if ENABLE(Condition1) + case PROP_CONDITIONAL_ATTR1: + { + coreSelf->setConditionalAttr1((g_value_get_long(value))); break; } +#endif /* ENABLE(Condition1) */ +#if ENABLE(Condition1) && ENABLE(Condition2) + case PROP_CONDITIONAL_ATTR2: + { + coreSelf->setConditionalAttr2((g_value_get_long(value))); + break; + } +#endif /* ENABLE(Condition1) && ENABLE(Condition2) */ +#if ENABLE(Condition1) || ENABLE(Condition2) + case PROP_CONDITIONAL_ATTR3: + { + coreSelf->setConditionalAttr3((g_value_get_long(value))); + break; + } +#endif /* ENABLE(Condition1) || ENABLE(Condition2) */ case PROP_ID: { coreSelf->setId((g_value_get_long(value))); @@ -685,20 +1013,66 @@ 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_ATTR_WITH_EXCEPTION: + case PROP_REFLECTED_STRING_ATTR: { - g_value_set_long(value, coreSelf->attrWithException()); + g_value_take_string(value, convertToUTF8String(coreSelf->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr))); + break; + } + case PROP_REFLECTED_INTEGRAL_ATTR: + { + g_value_set_long(value, coreSelf->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr)); + break; + } + case PROP_REFLECTED_BOOLEAN_ATTR: + { + g_value_set_boolean(value, coreSelf->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr)); + break; + } + case PROP_REFLECTED_URL_ATTR: + { + g_value_take_string(value, convertToUTF8String(coreSelf->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr))); + break; + } + case PROP_REFLECTED_STRING_ATTR: + { + g_value_take_string(value, convertToUTF8String(coreSelf->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr))); + break; + } + case PROP_REFLECTED_CUSTOM_INTEGRAL_ATTR: + { + g_value_set_long(value, coreSelf->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr)); + break; + } + case PROP_REFLECTED_CUSTOM_BOOLEAN_ATTR: + { + g_value_set_boolean(value, coreSelf->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr)); + break; + } + case PROP_REFLECTED_URL_ATTR: + { + g_value_take_string(value, convertToUTF8String(coreSelf->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr))); + break; + } + case PROP_ATTR_WITH_GETTER_EXCEPTION: + { + WebCore::ExceptionCode ec = 0; + g_value_set_long(value, coreSelf->attrWithGetterException(ec)); break; } case PROP_ATTR_WITH_SETTER_EXCEPTION: { + g_value_set_long(value, coreSelf->attrWithSetterException()); + break; + } + case PROP_STRING_ATTR_WITH_GETTER_EXCEPTION: + { WebCore::ExceptionCode ec = 0; - g_value_set_long(value, coreSelf->attrWithSetterException(ec)); + g_value_take_string(value, convertToUTF8String(coreSelf->stringAttrWithGetterException(ec))); break; } - case PROP_ATTR_WITH_GETTER_EXCEPTION: + case PROP_STRING_ATTR_WITH_SETTER_EXCEPTION: { - g_value_set_long(value, coreSelf->attrWithGetterException()); + g_value_take_string(value, convertToUTF8String(coreSelf->stringAttrWithSetterException())); break; } case PROP_SCRIPT_STRING_ATTR: @@ -706,6 +1080,27 @@ static void webkit_dom_test_obj_get_property(GObject* object, guint prop_id, GVa g_value_take_string(value, convertToUTF8String(coreSelf->scriptStringAttr())); break; } +#if ENABLE(Condition1) + case PROP_CONDITIONAL_ATTR1: + { + g_value_set_long(value, coreSelf->conditionalAttr1()); + break; + } +#endif /* ENABLE(Condition1) */ +#if ENABLE(Condition1) && ENABLE(Condition2) + case PROP_CONDITIONAL_ATTR2: + { + g_value_set_long(value, coreSelf->conditionalAttr2()); + break; + } +#endif /* ENABLE(Condition1) && ENABLE(Condition2) */ +#if ENABLE(Condition1) || ENABLE(Condition2) + case PROP_CONDITIONAL_ATTR3: + { + g_value_set_long(value, coreSelf->conditionalAttr3()); + break; + } +#endif /* ENABLE(Condition1) || ENABLE(Condition2) */ case PROP_DESCRIPTION: { g_value_set_long(value, coreSelf->description()); @@ -800,24 +1195,66 @@ G_MAXUINT64, /* min */ WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */ WEBKIT_PARAM_READWRITE)); g_object_class_install_property(gobjectClass, - PROP_ATTR_WITH_EXCEPTION, - g_param_spec_long("attr-with-exception", /* name */ - "test_obj_attr-with-exception", /* short description */ - "read-write glong TestObj.attr-with-exception", /* longer - could do with some extra doc stuff here */ + PROP_REFLECTED_STRING_ATTR, + g_param_spec_string("reflected-string-attr", /* name */ + "test_obj_reflected-string-attr", /* short description */ + "read-write gchar* TestObj.reflected-string-attr", /* longer - could do with some extra doc stuff here */ + "", /* default */ + WEBKIT_PARAM_READWRITE)); + g_object_class_install_property(gobjectClass, + PROP_REFLECTED_INTEGRAL_ATTR, + g_param_spec_long("reflected-integral-attr", /* name */ + "test_obj_reflected-integral-attr", /* short description */ + "read-write glong TestObj.reflected-integral-attr", /* longer - could do with some extra doc stuff here */ G_MINLONG, /* min */ G_MAXLONG, /* max */ 0, /* default */ WEBKIT_PARAM_READWRITE)); g_object_class_install_property(gobjectClass, - PROP_ATTR_WITH_SETTER_EXCEPTION, - g_param_spec_long("attr-with-setter-exception", /* name */ - "test_obj_attr-with-setter-exception", /* short description */ - "read-write glong TestObj.attr-with-setter-exception", /* longer - could do with some extra doc stuff here */ + PROP_REFLECTED_BOOLEAN_ATTR, + g_param_spec_boolean("reflected-boolean-attr", /* name */ + "test_obj_reflected-boolean-attr", /* short description */ + "read-write gboolean TestObj.reflected-boolean-attr", /* longer - could do with some extra doc stuff here */ + FALSE, /* default */ + WEBKIT_PARAM_READWRITE)); + g_object_class_install_property(gobjectClass, + PROP_REFLECTED_URL_ATTR, + g_param_spec_string("reflected-url-attr", /* name */ + "test_obj_reflected-url-attr", /* short description */ + "read-write gchar* TestObj.reflected-url-attr", /* longer - could do with some extra doc stuff here */ + "", /* default */ + WEBKIT_PARAM_READWRITE)); + g_object_class_install_property(gobjectClass, + PROP_REFLECTED_STRING_ATTR, + g_param_spec_string("reflected-string-attr", /* name */ + "test_obj_reflected-string-attr", /* short description */ + "read-write gchar* TestObj.reflected-string-attr", /* longer - could do with some extra doc stuff here */ + "", /* default */ + WEBKIT_PARAM_READWRITE)); + g_object_class_install_property(gobjectClass, + PROP_REFLECTED_CUSTOM_INTEGRAL_ATTR, + g_param_spec_long("reflected-custom-integral-attr", /* name */ + "test_obj_reflected-custom-integral-attr", /* short description */ + "read-write glong TestObj.reflected-custom-integral-attr", /* longer - could do with some extra doc stuff here */ G_MINLONG, /* min */ G_MAXLONG, /* max */ 0, /* default */ WEBKIT_PARAM_READWRITE)); g_object_class_install_property(gobjectClass, + PROP_REFLECTED_CUSTOM_BOOLEAN_ATTR, + g_param_spec_boolean("reflected-custom-boolean-attr", /* name */ + "test_obj_reflected-custom-boolean-attr", /* short description */ + "read-write gboolean TestObj.reflected-custom-boolean-attr", /* longer - could do with some extra doc stuff here */ + FALSE, /* default */ + WEBKIT_PARAM_READWRITE)); + g_object_class_install_property(gobjectClass, + PROP_REFLECTED_URL_ATTR, + g_param_spec_string("reflected-url-attr", /* name */ + "test_obj_reflected-url-attr", /* short description */ + "read-write gchar* TestObj.reflected-url-attr", /* longer - could do with some extra doc stuff here */ + "", /* default */ + WEBKIT_PARAM_READWRITE)); + g_object_class_install_property(gobjectClass, PROP_ATTR_WITH_GETTER_EXCEPTION, g_param_spec_long("attr-with-getter-exception", /* name */ "test_obj_attr-with-getter-exception", /* short description */ @@ -827,12 +1264,68 @@ G_MAXLONG, /* max */ 0, /* default */ WEBKIT_PARAM_READWRITE)); g_object_class_install_property(gobjectClass, + PROP_ATTR_WITH_SETTER_EXCEPTION, + g_param_spec_long("attr-with-setter-exception", /* name */ + "test_obj_attr-with-setter-exception", /* short description */ + "read-write glong TestObj.attr-with-setter-exception", /* longer - could do with some extra doc stuff here */ + G_MINLONG, /* min */ +G_MAXLONG, /* max */ +0, /* default */ + WEBKIT_PARAM_READWRITE)); + g_object_class_install_property(gobjectClass, + PROP_STRING_ATTR_WITH_GETTER_EXCEPTION, + g_param_spec_string("string-attr-with-getter-exception", /* name */ + "test_obj_string-attr-with-getter-exception", /* short description */ + "read-write gchar* TestObj.string-attr-with-getter-exception", /* longer - could do with some extra doc stuff here */ + "", /* default */ + WEBKIT_PARAM_READWRITE)); + g_object_class_install_property(gobjectClass, + PROP_STRING_ATTR_WITH_SETTER_EXCEPTION, + g_param_spec_string("string-attr-with-setter-exception", /* name */ + "test_obj_string-attr-with-setter-exception", /* short description */ + "read-write gchar* TestObj.string-attr-with-setter-exception", /* longer - could do with some extra doc stuff here */ + "", /* default */ + 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, + g_param_spec_long("conditional-attr1", /* name */ + "test_obj_conditional-attr1", /* short description */ + "read-write glong TestObj.conditional-attr1", /* longer - could do with some extra doc stuff here */ + G_MINLONG, /* min */ +G_MAXLONG, /* max */ +0, /* default */ + WEBKIT_PARAM_READWRITE)); +#endif /* ENABLE(Condition1) */ +#if ENABLE(Condition1) && ENABLE(Condition2) + g_object_class_install_property(gobjectClass, + PROP_CONDITIONAL_ATTR2, + g_param_spec_long("conditional-attr2", /* name */ + "test_obj_conditional-attr2", /* short description */ + "read-write glong TestObj.conditional-attr2", /* longer - could do with some extra doc stuff here */ + G_MINLONG, /* min */ +G_MAXLONG, /* max */ +0, /* default */ + WEBKIT_PARAM_READWRITE)); +#endif /* ENABLE(Condition1) && ENABLE(Condition2) */ +#if ENABLE(Condition1) || ENABLE(Condition2) + g_object_class_install_property(gobjectClass, + PROP_CONDITIONAL_ATTR3, + g_param_spec_long("conditional-attr3", /* name */ + "test_obj_conditional-attr3", /* short description */ + "read-write glong TestObj.conditional-attr3", /* longer - could do with some extra doc stuff here */ + G_MINLONG, /* min */ +G_MAXLONG, /* max */ +0, /* default */ + WEBKIT_PARAM_READWRITE)); +#endif /* ENABLE(Condition1) || ENABLE(Condition2) */ g_object_class_install_property(gobjectClass, PROP_DESCRIPTION, g_param_spec_long("description", /* name */ diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h index ef5ccb8..8dcd8c3 100644 --- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h +++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h @@ -160,27 +160,111 @@ webkit_dom_test_obj_get_test_obj_attr(WebKitDOMTestObj* self); WEBKIT_API void webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value); +WEBKIT_API gchar* +webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self); + +WEBKIT_API void +webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value); + WEBKIT_API glong -webkit_dom_test_obj_get_attr_with_exception(WebKitDOMTestObj* self); +webkit_dom_test_obj_get_reflected_integral_attr(WebKitDOMTestObj* self); + +WEBKIT_API void +webkit_dom_test_obj_set_reflected_integral_attr(WebKitDOMTestObj* self, glong value); + +WEBKIT_API gboolean +webkit_dom_test_obj_get_reflected_boolean_attr(WebKitDOMTestObj* self); + +WEBKIT_API void +webkit_dom_test_obj_set_reflected_boolean_attr(WebKitDOMTestObj* self, gboolean value); + +WEBKIT_API gchar* +webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self); + +WEBKIT_API void +webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value); + +WEBKIT_API gchar* +webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self); WEBKIT_API void -webkit_dom_test_obj_set_attr_with_exception(WebKitDOMTestObj* self, glong value); +webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value); WEBKIT_API glong -webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self, GError **error); +webkit_dom_test_obj_get_reflected_custom_integral_attr(WebKitDOMTestObj* self); WEBKIT_API void -webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong value, GError **error); +webkit_dom_test_obj_set_reflected_custom_integral_attr(WebKitDOMTestObj* self, glong value); + +WEBKIT_API gboolean +webkit_dom_test_obj_get_reflected_custom_boolean_attr(WebKitDOMTestObj* self); + +WEBKIT_API void +webkit_dom_test_obj_set_reflected_custom_boolean_attr(WebKitDOMTestObj* self, gboolean value); + +WEBKIT_API gchar* +webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self); + +WEBKIT_API void +webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value); WEBKIT_API glong -webkit_dom_test_obj_get_attr_with_getter_exception(WebKitDOMTestObj* self); +webkit_dom_test_obj_get_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error); WEBKIT_API void webkit_dom_test_obj_set_attr_with_getter_exception(WebKitDOMTestObj* self, glong value, GError **error); +WEBKIT_API glong +webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self); + +WEBKIT_API void +webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong value, GError **error); + +WEBKIT_API gchar* +webkit_dom_test_obj_get_string_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error); + +WEBKIT_API void +webkit_dom_test_obj_set_string_attr_with_getter_exception(WebKitDOMTestObj* self, gchar* value, GError **error); + +WEBKIT_API gchar* +webkit_dom_test_obj_get_string_attr_with_setter_exception(WebKitDOMTestObj* self); + +WEBKIT_API void +webkit_dom_test_obj_set_string_attr_with_setter_exception(WebKitDOMTestObj* self, gchar* value, GError **error); + WEBKIT_API gchar* webkit_dom_test_obj_get_script_string_attr(WebKitDOMTestObj* self); +#if ENABLE(Condition1) +WEBKIT_API glong +webkit_dom_test_obj_get_conditional_attr1(WebKitDOMTestObj* self); +#endif /* ENABLE(Condition1) */ + +#if ENABLE(Condition1) +WEBKIT_API void +webkit_dom_test_obj_set_conditional_attr1(WebKitDOMTestObj* self, glong value); +#endif /* ENABLE(Condition1) */ + +#if ENABLE(Condition1) && ENABLE(Condition2) +WEBKIT_API glong +webkit_dom_test_obj_get_conditional_attr2(WebKitDOMTestObj* self); +#endif /* ENABLE(Condition1) && ENABLE(Condition2) */ + +#if ENABLE(Condition1) && ENABLE(Condition2) +WEBKIT_API void +webkit_dom_test_obj_set_conditional_attr2(WebKitDOMTestObj* self, glong value); +#endif /* ENABLE(Condition1) && ENABLE(Condition2) */ + +#if ENABLE(Condition1) || ENABLE(Condition2) +WEBKIT_API glong +webkit_dom_test_obj_get_conditional_attr3(WebKitDOMTestObj* self); +#endif /* ENABLE(Condition1) || ENABLE(Condition2) */ + +#if ENABLE(Condition1) || ENABLE(Condition2) +WEBKIT_API void +webkit_dom_test_obj_set_conditional_attr3(WebKitDOMTestObj* self, glong value); +#endif /* ENABLE(Condition1) || ENABLE(Condition2) */ + WEBKIT_API glong webkit_dom_test_obj_get_description(WebKitDOMTestObj* self); diff --git a/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp b/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp index 693a48b..8e71df1 100644 --- a/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp +++ b/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp @@ -19,6 +19,9 @@ */ #include "config.h" + +#if ENABLE(Condition1) || ENABLE(Condition2) + #include "JSTestInterface.h" #include "TestInterface.h" @@ -61,39 +64,30 @@ static const HashTableValue JSTestInterfaceConstructorTableValues[1] = static JSC_CONST_HASHTABLE HashTable JSTestInterfaceConstructorTable = { 1, 0, JSTestInterfaceConstructorTableValues, 0 }; class JSTestInterfaceConstructor : public DOMConstructorObject { public: - JSTestInterfaceConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) - : DOMConstructorObject(JSTestInterfaceConstructor::createStructure(globalObject->objectPrototype()), globalObject) + JSTestInterfaceConstructor(JSC::ExecState*, JSDOMGlobalObject*); + + virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); + virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); + virtual const JSC::ClassInfo* classInfo() const { return &s_info; } + static const JSC::ClassInfo s_info; + static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) { - putDirect(exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly); + return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); } - virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); - virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); - virtual const ClassInfo* classInfo() const { return &s_info; } - static const ClassInfo s_info; - - static PassRefPtr<Structure> createStructure(JSValue proto) - { - return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount); - } - protected: - static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags; - static EncodedJSValue JSC_HOST_CALL constructTestInterface(ExecState* exec) - { - ScriptExecutionContext* context = static_cast<JSTestInterfaceConstructor*>(exec->callee())->scriptExecutionContext(); - if (!context) - return throwVMError(exec, createReferenceError(exec, "Reference error")); - return JSValue::encode(asObject(toJS(exec, static_cast<JSTestInterfaceConstructor*>(exec->callee())->globalObject(), TestInterface::create(context)))); - } - virtual ConstructType getConstructData(ConstructData& constructData) - { - constructData.native.function = constructTestInterface; - return ConstructTypeHost; - } + static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; + static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestInterface(JSC::ExecState*); + virtual JSC::ConstructType getConstructData(JSC::ConstructData&); }; const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", 0, &JSTestInterfaceConstructorTable, 0 }; +JSTestInterfaceConstructor::JSTestInterfaceConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) + : DOMConstructorObject(JSTestInterfaceConstructor::createStructure(globalObject->objectPrototype()), globalObject) +{ + putDirect(exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly); +} + bool JSTestInterfaceConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSTestInterfaceConstructor, DOMObject>(exec, &JSTestInterfaceConstructorTable, this, propertyName, slot); @@ -104,6 +98,20 @@ bool JSTestInterfaceConstructor::getOwnPropertyDescriptor(ExecState* exec, const return getStaticValueDescriptor<JSTestInterfaceConstructor, DOMObject>(exec, &JSTestInterfaceConstructorTable, this, propertyName, descriptor); } +EncodedJSValue JSC_HOST_CALL JSTestInterfaceConstructor::constructJSTestInterface(ExecState* exec) +{ + ScriptExecutionContext* context = static_cast<JSTestInterfaceConstructor*>(exec->callee())->scriptExecutionContext(); + if (!context) + return throwVMError(exec, createReferenceError(exec, "Reference error")); + return JSValue::encode(asObject(toJS(exec, static_cast<JSTestInterfaceConstructor*>(exec->callee())->globalObject(), TestInterface::create(context)))); +} + +ConstructType JSTestInterfaceConstructor::getConstructData(ConstructData& constructData) +{ + constructData.native.function = constructJSTestInterface; + return ConstructTypeHost; +} + /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator @@ -173,3 +181,5 @@ TestInterface* toTestInterface(JSC::JSValue value) } } + +#endif // ENABLE(Condition1) || ENABLE(Condition2) diff --git a/WebCore/bindings/scripts/test/JS/JSTestInterface.h b/WebCore/bindings/scripts/test/JS/JSTestInterface.h index 23b183b..09d7d7c 100644 --- a/WebCore/bindings/scripts/test/JS/JSTestInterface.h +++ b/WebCore/bindings/scripts/test/JS/JSTestInterface.h @@ -21,6 +21,8 @@ #ifndef JSTestInterface_h #define JSTestInterface_h +#if ENABLE(Condition1) || ENABLE(Condition2) + #include "JSDOMBinding.h" #include <runtime/JSGlobalObject.h> #include <runtime/JSObjectWithGlobalObject.h> @@ -79,4 +81,6 @@ JSC::JSValue jsTestInterfaceConstructor(JSC::ExecState*, JSC::JSValue, const JSC } // namespace WebCore +#endif // ENABLE(Condition1) || ENABLE(Condition2) + #endif diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp index 09b69cd..360782d 100644 --- a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp +++ b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp @@ -21,6 +21,7 @@ #include "config.h" #include "JSTestObj.h" +#include "HTMLNames.h" #include "JSEventListener.h" #include "JSTestObj.h" #include "JSlog.h" @@ -46,7 +47,7 @@ ASSERT_CLASS_FITS_IN_CELL(JSTestObj); #define THUNK_GENERATOR(generator) #endif -static const HashTableValue JSTestObjTableValues[18] = +static const HashTableValue JSTestObjTableValues[30] = { { "readOnlyIntAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyIntAttr), (intptr_t)0 THUNK_GENERATOR(0) }, { "readOnlyStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyStringAttr), (intptr_t)0 THUNK_GENERATOR(0) }, @@ -56,11 +57,29 @@ static const HashTableValue JSTestObjTableValues[18] = { "unsignedLongLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedLongLongAttr), (intptr_t)setJSTestObjUnsignedLongLongAttr THUNK_GENERATOR(0) }, { "stringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t)setJSTestObjStringAttr THUNK_GENERATOR(0) }, { "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr THUNK_GENERATOR(0) }, - { "attrWithException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithException), (intptr_t)setJSTestObjAttrWithException THUNK_GENERATOR(0) }, - { "attrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t)setJSTestObjAttrWithSetterException THUNK_GENERATOR(0) }, + { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) }, + { "reflectedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t)setJSTestObjReflectedIntegralAttr THUNK_GENERATOR(0) }, + { "reflectedBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedBooleanAttr), (intptr_t)setJSTestObjReflectedBooleanAttr THUNK_GENERATOR(0) }, + { "reflectedURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedURLAttr), (intptr_t)setJSTestObjReflectedURLAttr THUNK_GENERATOR(0) }, + { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) }, + { "reflectedCustomIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomIntegralAttr), (intptr_t)setJSTestObjReflectedCustomIntegralAttr THUNK_GENERATOR(0) }, + { "reflectedCustomBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomBooleanAttr), (intptr_t)setJSTestObjReflectedCustomBooleanAttr THUNK_GENERATOR(0) }, + { "reflectedURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedURLAttr), (intptr_t)setJSTestObjReflectedURLAttr THUNK_GENERATOR(0) }, { "attrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterException), (intptr_t)setJSTestObjAttrWithGetterException THUNK_GENERATOR(0) }, + { "attrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t)setJSTestObjAttrWithSetterException THUNK_GENERATOR(0) }, + { "stringAttrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t)setJSTestObjStringAttrWithGetterException THUNK_GENERATOR(0) }, + { "stringAttrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t)setJSTestObjStringAttrWithSetterException THUNK_GENERATOR(0) }, { "customAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t)setJSTestObjCustomAttr THUNK_GENERATOR(0) }, { "scriptStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjScriptStringAttr), (intptr_t)0 THUNK_GENERATOR(0) }, +#if ENABLE(Condition1) + { "conditionalAttr1", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr1), (intptr_t)setJSTestObjConditionalAttr1 THUNK_GENERATOR(0) }, +#endif +#if ENABLE(Condition1) && ENABLE(Condition2) + { "conditionalAttr2", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr2), (intptr_t)setJSTestObjConditionalAttr2 THUNK_GENERATOR(0) }, +#endif +#if ENABLE(Condition1) || ENABLE(Condition2) + { "conditionalAttr3", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr3), (intptr_t)setJSTestObjConditionalAttr3 THUNK_GENERATOR(0) }, +#endif { "description", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjDescription), (intptr_t)0 THUNK_GENERATOR(0) }, { "id", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjId), (intptr_t)setJSTestObjId THUNK_GENERATOR(0) }, { "hash", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjHash), (intptr_t)0 THUNK_GENERATOR(0) }, @@ -69,7 +88,7 @@ static const HashTableValue JSTestObjTableValues[18] = }; #undef THUNK_GENERATOR -static JSC_CONST_HASHTABLE HashTable JSTestObjTable = { 65, 63, JSTestObjTableValues, 0 }; +static JSC_CONST_HASHTABLE HashTable JSTestObjTable = { 69, 63, JSTestObjTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator @@ -86,27 +105,28 @@ static const HashTableValue JSTestObjConstructorTableValues[1] = static JSC_CONST_HASHTABLE HashTable JSTestObjConstructorTable = { 1, 0, JSTestObjConstructorTableValues, 0 }; class JSTestObjConstructor : public DOMConstructorObject { public: - JSTestObjConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) - : DOMConstructorObject(JSTestObjConstructor::createStructure(globalObject->objectPrototype()), globalObject) + JSTestObjConstructor(JSC::ExecState*, JSDOMGlobalObject*); + + virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); + virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); + virtual const JSC::ClassInfo* classInfo() const { return &s_info; } + static const JSC::ClassInfo s_info; + static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) { - putDirect(exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly); + return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); } - virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); - virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); - virtual const ClassInfo* classInfo() const { return &s_info; } - static const ClassInfo s_info; - - static PassRefPtr<Structure> createStructure(JSValue proto) - { - return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount); - } - protected: - static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags; + static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", 0, &JSTestObjConstructorTable, 0 }; +JSTestObjConstructor::JSTestObjConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) + : DOMConstructorObject(JSTestObjConstructor::createStructure(globalObject->objectPrototype()), globalObject) +{ + putDirect(exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly); +} + bool JSTestObjConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSTestObjConstructor, DOMObject>(exec, &JSTestObjConstructorTable, this, propertyName, slot); @@ -277,31 +297,113 @@ JSValue jsTestObjTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier return result; } -JSValue jsTestObjAttrWithException(ExecState* exec, JSValue slotBase, const Identifier&) +JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); + UNUSED_PARAM(exec); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr)); + return result; +} + +JSValue jsTestObjReflectedIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); + UNUSED_PARAM(exec); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + JSValue result = jsNumber(exec, imp->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr)); + return result; +} + +JSValue jsTestObjReflectedBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); + UNUSED_PARAM(exec); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr)); + return result; +} + +JSValue jsTestObjReflectedURLAttr(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); + UNUSED_PARAM(exec); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr)); + return result; +} + +JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); + UNUSED_PARAM(exec); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr)); + return result; +} + +JSValue jsTestObjReflectedCustomIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); + UNUSED_PARAM(exec); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + JSValue result = jsNumber(exec, imp->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr)); + return result; +} + +JSValue jsTestObjReflectedCustomBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); + UNUSED_PARAM(exec); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr)); + return result; +} + +JSValue jsTestObjReflectedURLAttr(ExecState* exec, JSValue slotBase, const Identifier&) { JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); UNUSED_PARAM(exec); TestObj* imp = static_cast<TestObj*>(castedThis->impl()); - JSValue result = jsNumber(exec, imp->attrWithException()); + JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr)); + return result; +} + +JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); + ExceptionCode ec = 0; + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + JSC::JSValue result = jsNumber(exec, imp->attrWithGetterException(ec)); + setDOMException(exec, ec); return result; } JSValue jsTestObjAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&) { JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); + UNUSED_PARAM(exec); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + JSValue result = jsNumber(exec, imp->attrWithSetterException()); + return result; +} + +JSValue jsTestObjStringAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); ExceptionCode ec = 0; TestObj* imp = static_cast<TestObj*>(castedThis->impl()); - JSC::JSValue result = jsNumber(exec, imp->attrWithSetterException(ec)); + JSC::JSValue result = jsString(exec, imp->stringAttrWithGetterException(ec)); setDOMException(exec, ec); return result; } -JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&) +JSValue jsTestObjStringAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&) { JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); UNUSED_PARAM(exec); TestObj* imp = static_cast<TestObj*>(castedThis->impl()); - JSValue result = jsNumber(exec, imp->attrWithGetterException()); + JSValue result = jsString(exec, imp->stringAttrWithSetterException()); return result; } @@ -320,6 +422,39 @@ JSValue jsTestObjScriptStringAttr(ExecState* exec, JSValue slotBase, const Ident return result; } +#if ENABLE(Condition1) +JSValue jsTestObjConditionalAttr1(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); + UNUSED_PARAM(exec); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + JSValue result = jsNumber(exec, imp->conditionalAttr1()); + return result; +} +#endif + +#if ENABLE(Condition1) && ENABLE(Condition2) +JSValue jsTestObjConditionalAttr2(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); + UNUSED_PARAM(exec); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + JSValue result = jsNumber(exec, imp->conditionalAttr2()); + return result; +} +#endif + +#if ENABLE(Condition1) || ENABLE(Condition2) +JSValue jsTestObjConditionalAttr3(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); + UNUSED_PARAM(exec); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + JSValue result = jsNumber(exec, imp->conditionalAttr3()); + return result; +} +#endif + JSValue jsTestObjDescription(ExecState* exec, JSValue slotBase, const Identifier&) { JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); @@ -392,11 +527,69 @@ void setJSTestObjTestObjAttr(ExecState* exec, JSObject* thisObject, JSValue valu imp->setTestObjAttr(toTestObj(value)); } -void setJSTestObjAttrWithException(ExecState* exec, JSObject* thisObject, JSValue value) +void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value) { JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); TestObj* imp = static_cast<TestObj*>(castedThis->impl()); - imp->setAttrWithException(value.toInt32(exec)); + imp->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, valueToStringWithNullCheck(exec, value)); +} + +void setJSTestObjReflectedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + imp->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, value.toInt32(exec)); +} + +void setJSTestObjReflectedBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + imp->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value.toBoolean(exec)); +} + +void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + imp->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, valueToStringWithNullCheck(exec, value)); +} + +void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + imp->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, valueToStringWithNullCheck(exec, value)); +} + +void setJSTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + imp->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, value.toInt32(exec)); +} + +void setJSTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + imp->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value.toBoolean(exec)); +} + +void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + imp->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, valueToStringWithNullCheck(exec, value)); +} + +void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + ExceptionCode ec = 0; + imp->setAttrWithGetterException(value.toInt32(exec), ec); + setDOMException(exec, ec); } void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value) @@ -408,12 +601,21 @@ void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject, setDOMException(exec, ec); } -void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value) +void setJSTestObjStringAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value) { JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); TestObj* imp = static_cast<TestObj*>(castedThis->impl()); ExceptionCode ec = 0; - imp->setAttrWithGetterException(value.toInt32(exec), ec); + imp->setStringAttrWithGetterException(ustringToString(value.toString(exec)), ec); + setDOMException(exec, ec); +} + +void setJSTestObjStringAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + ExceptionCode ec = 0; + imp->setStringAttrWithSetterException(ustringToString(value.toString(exec)), ec); setDOMException(exec, ec); } @@ -422,6 +624,33 @@ void setJSTestObjCustomAttr(ExecState* exec, JSObject* thisObject, JSValue value static_cast<JSTestObj*>(thisObject)->setCustomAttr(exec, value); } +#if ENABLE(Condition1) +void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + imp->setConditionalAttr1(value.toInt32(exec)); +} +#endif + +#if ENABLE(Condition1) && ENABLE(Condition2) +void setJSTestObjConditionalAttr2(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + imp->setConditionalAttr2(value.toInt32(exec)); +} +#endif + +#if ENABLE(Condition1) || ENABLE(Condition2) +void setJSTestObjConditionalAttr3(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); + TestObj* imp = static_cast<TestObj*>(castedThis->impl()); + imp->setConditionalAttr3(value.toInt32(exec)); +} +#endif + void setJSTestObjId(ExecState* exec, JSObject* thisObject, JSValue value) { JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); @@ -875,7 +1104,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgA return JSValue::encode(jsUndefined()); } -EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec) +static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSTestObj::s_info)) @@ -889,7 +1118,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecSta return JSValue::encode(jsUndefined()); } -EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exec) +static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSTestObj::s_info)) @@ -910,7 +1139,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecSta return JSValue::encode(jsUndefined()); } -EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecState* exec) +static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSTestObj::s_info)) @@ -923,7 +1152,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecSta return JSValue::encode(jsUndefined()); } -EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecState* exec) +static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSTestObj::s_info)) @@ -938,15 +1167,15 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecSta EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecState* exec) { - if ((exec->argumentCount() == 2 && (exec->argument(0).isNull() || asObject(exec->argument(0))->inherits(&JSTestObj::s_info)) && (exec->argument(1).isNull() || exec->argument(1).isUndefined() || exec->argument(1).isString() || exec->argument(1).isObject()))) + if ((exec->argumentCount() == 2 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info)) && (exec->argument(1).isNull() || exec->argument(1).isUndefined() || exec->argument(1).isString() || exec->argument(1).isObject()))) return jsTestObjPrototypeFunctionOverloadedMethod1(exec); - if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || asObject(exec->argument(0))->inherits(&JSTestObj::s_info))) || (exec->argumentCount() == 2 && (exec->argument(0).isNull() || asObject(exec->argument(0))->inherits(&JSTestObj::s_info)))) + if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))) || (exec->argumentCount() == 2 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info)))) return jsTestObjPrototypeFunctionOverloadedMethod2(exec); if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || exec->argument(0).isUndefined() || exec->argument(0).isString() || exec->argument(0).isObject()))) return jsTestObjPrototypeFunctionOverloadedMethod3(exec); if (exec->argumentCount() == 1) return jsTestObjPrototypeFunctionOverloadedMethod4(exec); - return throwTypeError(exec); + return throwVMTypeError(exec); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* object) diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.h b/WebCore/bindings/scripts/test/JS/JSTestObj.h index dd84005..3b21c85 100644 --- a/WebCore/bindings/scripts/test/JS/JSTestObj.h +++ b/WebCore/bindings/scripts/test/JS/JSTestObj.h @@ -130,15 +130,39 @@ JSC::JSValue jsTestObjStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Ident void setJSTestObjStringAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); JSC::JSValue jsTestObjTestObjAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); void setJSTestObjTestObjAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); -JSC::JSValue jsTestObjAttrWithException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); -void setJSTestObjAttrWithException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); -JSC::JSValue jsTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); -void setJSTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); +JSC::JSValue jsTestObjReflectedStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +void setJSTestObjReflectedStringAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); +JSC::JSValue jsTestObjReflectedIntegralAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +void setJSTestObjReflectedIntegralAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); +JSC::JSValue jsTestObjReflectedBooleanAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +void setJSTestObjReflectedBooleanAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); +JSC::JSValue jsTestObjReflectedURLAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +void setJSTestObjReflectedURLAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); +JSC::JSValue jsTestObjReflectedStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +void setJSTestObjReflectedStringAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); +JSC::JSValue jsTestObjReflectedCustomIntegralAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +void setJSTestObjReflectedCustomIntegralAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); +JSC::JSValue jsTestObjReflectedCustomBooleanAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +void setJSTestObjReflectedCustomBooleanAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); +JSC::JSValue jsTestObjReflectedURLAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +void setJSTestObjReflectedURLAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); JSC::JSValue jsTestObjAttrWithGetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); void setJSTestObjAttrWithGetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); +JSC::JSValue jsTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +void setJSTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); +JSC::JSValue jsTestObjStringAttrWithGetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +void setJSTestObjStringAttrWithGetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); +JSC::JSValue jsTestObjStringAttrWithSetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +void setJSTestObjStringAttrWithSetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); JSC::JSValue jsTestObjCustomAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); void setJSTestObjCustomAttr(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 setJSTestObjConditionalAttr2(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); +JSC::JSValue jsTestObjConditionalAttr3(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); +void setJSTestObjConditionalAttr3(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); JSC::JSValue jsTestObjDescription(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); JSC::JSValue jsTestObjId(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); void setJSTestObjId(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm b/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm index 8fd7791..ab59333 100644 --- a/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm +++ b/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm @@ -25,6 +25,9 @@ */ #import "config.h" + +#if ENABLE(Condition1) || ENABLE(Condition2) + #import "DOMInternal.h" #import "DOMTestInterface.h" @@ -85,3 +88,5 @@ DOMTestInterface *kit(WebCore::TestInterface* value) addDOMWrapper(wrapper, value); return [wrapper autorelease]; } + +#endif // ENABLE(Condition1) || ENABLE(Condition2) diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h index 6b50246..d8862da 100644 --- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h +++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h @@ -47,15 +47,45 @@ - (void)setStringAttr:(NSString *)newStringAttr; - (DOMTestObj *)testObjAttr; - (void)setTestObjAttr:(DOMTestObj *)newTestObjAttr; -- (int)attrWithException; -- (void)setAttrWithException:(int)newAttrWithException; -- (int)attrWithSetterException; -- (void)setAttrWithSetterException:(int)newAttrWithSetterException; +- (NSString *)reflectedStringAttr; +- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr; +- (int)reflectedIntegralAttr; +- (void)setReflectedIntegralAttr:(int)newReflectedIntegralAttr; +- (BOOL)reflectedBooleanAttr; +- (void)setReflectedBooleanAttr:(BOOL)newReflectedBooleanAttr; +- (NSString *)reflectedURLAttr; +- (void)setReflectedURLAttr:(NSString *)newReflectedURLAttr; +- (NSString *)reflectedStringAttr; +- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr; +- (int)reflectedCustomIntegralAttr; +- (void)setReflectedCustomIntegralAttr:(int)newReflectedCustomIntegralAttr; +- (BOOL)reflectedCustomBooleanAttr; +- (void)setReflectedCustomBooleanAttr:(BOOL)newReflectedCustomBooleanAttr; +- (NSString *)reflectedURLAttr; +- (void)setReflectedURLAttr:(NSString *)newReflectedURLAttr; - (int)attrWithGetterException; - (void)setAttrWithGetterException:(int)newAttrWithGetterException; +- (int)attrWithSetterException; +- (void)setAttrWithSetterException:(int)newAttrWithSetterException; +- (NSString *)stringAttrWithGetterException; +- (void)setStringAttrWithGetterException:(NSString *)newStringAttrWithGetterException; +- (NSString *)stringAttrWithSetterException; +- (void)setStringAttrWithSetterException:(NSString *)newStringAttrWithSetterException; - (int)customAttr; - (void)setCustomAttr:(int)newCustomAttr; - (NSString *)scriptStringAttr; +#if ENABLE(Condition1) +- (int)conditionalAttr1; +- (void)setConditionalAttr1:(int)newConditionalAttr1; +#endif +#if ENABLE(Condition1) && ENABLE(Condition2) +- (int)conditionalAttr2; +- (void)setConditionalAttr2:(int)newConditionalAttr2; +#endif +#if ENABLE(Condition1) || ENABLE(Condition2) +- (int)conditionalAttr3; +- (void)setConditionalAttr3:(int)newConditionalAttr3; +#endif - (int)descriptionName; - (int)idName; - (void)setIdName:(int)newIdName; diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm index e57ed87..9bbbf14 100644 --- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm +++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm @@ -39,6 +39,7 @@ #import "DOMlogInternal.h" #import "EventListener.h" #import "ExceptionHandlers.h" +#import "HTMLNames.h" #import "JSMainThreadExecState.h" #import "KURL.h" #import "ObjCEventListener.h" @@ -151,27 +152,125 @@ IMPL->setTestObjAttr(core(newTestObjAttr)); } -- (int)attrWithException +- (NSString *)reflectedStringAttr { WebCore::JSMainThreadNullState state; - return IMPL->attrWithException(); + return IMPL->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr); } -- (void)setAttrWithException:(int)newAttrWithException +- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr { WebCore::JSMainThreadNullState state; - IMPL->setAttrWithException(newAttrWithException); + IMPL->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, newReflectedStringAttr); } -- (int)attrWithSetterException +- (int)reflectedIntegralAttr +{ + WebCore::JSMainThreadNullState state; + return IMPL->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr); +} + +- (void)setReflectedIntegralAttr:(int)newReflectedIntegralAttr +{ + WebCore::JSMainThreadNullState state; + IMPL->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, newReflectedIntegralAttr); +} + +- (BOOL)reflectedBooleanAttr +{ + WebCore::JSMainThreadNullState state; + return IMPL->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr); +} + +- (void)setReflectedBooleanAttr:(BOOL)newReflectedBooleanAttr +{ + WebCore::JSMainThreadNullState state; + IMPL->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, newReflectedBooleanAttr); +} + +- (NSString *)reflectedURLAttr +{ + WebCore::JSMainThreadNullState state; + return IMPL->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr); +} + +- (void)setReflectedURLAttr:(NSString *)newReflectedURLAttr +{ + WebCore::JSMainThreadNullState state; + IMPL->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, newReflectedURLAttr); +} + +- (NSString *)reflectedStringAttr +{ + WebCore::JSMainThreadNullState state; + return IMPL->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr); +} + +- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr +{ + WebCore::JSMainThreadNullState state; + IMPL->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, newReflectedStringAttr); +} + +- (int)reflectedCustomIntegralAttr +{ + WebCore::JSMainThreadNullState state; + return IMPL->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr); +} + +- (void)setReflectedCustomIntegralAttr:(int)newReflectedCustomIntegralAttr +{ + WebCore::JSMainThreadNullState state; + IMPL->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, newReflectedCustomIntegralAttr); +} + +- (BOOL)reflectedCustomBooleanAttr +{ + WebCore::JSMainThreadNullState state; + return IMPL->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr); +} + +- (void)setReflectedCustomBooleanAttr:(BOOL)newReflectedCustomBooleanAttr +{ + WebCore::JSMainThreadNullState state; + IMPL->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, newReflectedCustomBooleanAttr); +} + +- (NSString *)reflectedURLAttr +{ + WebCore::JSMainThreadNullState state; + return IMPL->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr); +} + +- (void)setReflectedURLAttr:(NSString *)newReflectedURLAttr +{ + WebCore::JSMainThreadNullState state; + IMPL->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, newReflectedURLAttr); +} + +- (int)attrWithGetterException { WebCore::JSMainThreadNullState state; WebCore::ExceptionCode ec = 0; - int result = IMPL->attrWithSetterException(ec); + int result = IMPL->attrWithGetterException(ec); WebCore::raiseOnDOMError(ec); return result; } +- (void)setAttrWithGetterException:(int)newAttrWithGetterException +{ + WebCore::JSMainThreadNullState state; + WebCore::ExceptionCode ec = 0; + IMPL->setAttrWithGetterException(newAttrWithGetterException, ec); + WebCore::raiseOnDOMError(ec); +} + +- (int)attrWithSetterException +{ + WebCore::JSMainThreadNullState state; + return IMPL->attrWithSetterException(); +} + - (void)setAttrWithSetterException:(int)newAttrWithSetterException { WebCore::JSMainThreadNullState state; @@ -180,17 +279,34 @@ WebCore::raiseOnDOMError(ec); } -- (int)attrWithGetterException +- (NSString *)stringAttrWithGetterException { WebCore::JSMainThreadNullState state; - return IMPL->attrWithGetterException(); + WebCore::ExceptionCode ec = 0; + NSString *result = IMPL->stringAttrWithGetterException(ec); + WebCore::raiseOnDOMError(ec); + return result; } -- (void)setAttrWithGetterException:(int)newAttrWithGetterException +- (void)setStringAttrWithGetterException:(NSString *)newStringAttrWithGetterException { WebCore::JSMainThreadNullState state; WebCore::ExceptionCode ec = 0; - IMPL->setAttrWithGetterException(newAttrWithGetterException, ec); + IMPL->setStringAttrWithGetterException(newStringAttrWithGetterException, ec); + WebCore::raiseOnDOMError(ec); +} + +- (NSString *)stringAttrWithSetterException +{ + WebCore::JSMainThreadNullState state; + return IMPL->stringAttrWithSetterException(); +} + +- (void)setStringAttrWithSetterException:(NSString *)newStringAttrWithSetterException +{ + WebCore::JSMainThreadNullState state; + WebCore::ExceptionCode ec = 0; + IMPL->setStringAttrWithSetterException(newStringAttrWithSetterException, ec); WebCore::raiseOnDOMError(ec); } @@ -212,6 +328,48 @@ return IMPL->scriptStringAttr(); } +#if ENABLE(Condition1) +- (int)conditionalAttr1 +{ + WebCore::JSMainThreadNullState state; + return IMPL->conditionalAttr1(); +} + +- (void)setConditionalAttr1:(int)newConditionalAttr1 +{ + WebCore::JSMainThreadNullState state; + IMPL->setConditionalAttr1(newConditionalAttr1); +} +#endif + +#if ENABLE(Condition1) && ENABLE(Condition2) +- (int)conditionalAttr2 +{ + WebCore::JSMainThreadNullState state; + return IMPL->conditionalAttr2(); +} + +- (void)setConditionalAttr2:(int)newConditionalAttr2 +{ + WebCore::JSMainThreadNullState state; + IMPL->setConditionalAttr2(newConditionalAttr2); +} +#endif + +#if ENABLE(Condition1) || ENABLE(Condition2) +- (int)conditionalAttr3 +{ + WebCore::JSMainThreadNullState state; + return IMPL->conditionalAttr3(); +} + +- (void)setConditionalAttr3:(int)newConditionalAttr3 +{ + WebCore::JSMainThreadNullState state; + IMPL->setConditionalAttr3(newConditionalAttr3); +} +#endif + - (int)descriptionName { WebCore::JSMainThreadNullState state; diff --git a/WebCore/bindings/scripts/test/TestInterface.idl b/WebCore/bindings/scripts/test/TestInterface.idl index 5a8b008..1f0aa18 100644 --- a/WebCore/bindings/scripts/test/TestInterface.idl +++ b/WebCore/bindings/scripts/test/TestInterface.idl @@ -30,6 +30,7 @@ // changes in its ouput. module test { interface [ + Conditional=Condition1|Condition2, CanBeConstructed, CallWith=ScriptExecutionContext ] TestInterface { diff --git a/WebCore/bindings/scripts/test/TestObj.idl b/WebCore/bindings/scripts/test/TestObj.idl index 1cb004c..ef4db10 100644 --- a/WebCore/bindings/scripts/test/TestObj.idl +++ b/WebCore/bindings/scripts/test/TestObj.idl @@ -40,6 +40,16 @@ module test { attribute DOMString stringAttr; attribute TestObj testObjAttr; + // Reflected DOM attributes + attribute [Reflect] DOMString reflectedStringAttr; + attribute [Reflect] long reflectedIntegralAttr; + attribute [Reflect] boolean reflectedBooleanAttr; + attribute [ReflectURL] DOMString reflectedURLAttr; + attribute [Reflect=customContentStringAttr] DOMString reflectedStringAttr; + attribute [Reflect=customContentIntegralAttr] long reflectedCustomIntegralAttr; + attribute [Reflect=customContentBooleanAttr] boolean reflectedCustomBooleanAttr; + attribute [ReflectURL=customContentURLAttr] DOMString reflectedURLAttr; + // Methods void voidMethod(); void voidMethodWithArgs(in long intArg, in DOMString strArg, in TestObj objArg); @@ -55,10 +65,11 @@ module test { void serializedValue(in SerializedScriptValue serializedArg); // Exceptions - void methodWithException() raises(DOMException); - attribute long attrWithException raises(DOMException); - attribute long attrWithSetterException getter raises(DOMException); - attribute long attrWithGetterException setter raises(DOMException); + void methodWithException() raises(DOMException); + attribute long attrWithGetterException getter raises(DOMException); + attribute long attrWithSetterException setter raises(DOMException); + attribute DOMString stringAttrWithGetterException getter raises(DOMException); + attribute DOMString stringAttrWithSetterException setter raises(DOMException); // 'Custom' extended attribute attribute [Custom] long customAttr; @@ -97,6 +108,11 @@ module test { // 'ConvertScriptString' extended attribute readonly attribute [ConvertScriptString] DOMString scriptStringAttr; + // 'Conditional' extended attribute + attribute [Conditional=Condition1] long conditionalAttr1; + attribute [Conditional=Condition1&Condition2] long conditionalAttr2; + attribute [Conditional=Condition1|Condition2] long conditionalAttr3; + #if defined(TESTING_V8) || defined(TESTING_JS) // Overloads void overloadedMethod(in TestObj objArg, in DOMString strArg); diff --git a/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp b/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp index fef199a..eff4ebd 100644 --- a/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp +++ b/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp @@ -28,6 +28,7 @@ #include "V8Class2.h" #include "V8CustomVoidCallback.h" #include "V8DOMString.h" +#include "V8Proxy.h" #include <wtf/Assertions.h> diff --git a/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp b/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp index f0bfb86..340dca7 100644 --- a/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp +++ b/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp @@ -21,6 +21,8 @@ #include "config.h" #include "V8TestInterface.h" +#if ENABLE(Condition1) || ENABLE(Condition2) + #include "RuntimeEnabledFeatures.h" #include "V8Binding.h" #include "V8BindingState.h" @@ -113,3 +115,5 @@ void V8TestInterface::derefObject(void* object) } } // namespace WebCore + +#endif // ENABLE(Condition1) || ENABLE(Condition2) diff --git a/WebCore/bindings/scripts/test/V8/V8TestInterface.h b/WebCore/bindings/scripts/test/V8/V8TestInterface.h index ce1310e..d2192ca 100644 --- a/WebCore/bindings/scripts/test/V8/V8TestInterface.h +++ b/WebCore/bindings/scripts/test/V8/V8TestInterface.h @@ -18,6 +18,8 @@ Boston, MA 02111-1307, USA. */ +#if ENABLE(Condition1) || ENABLE(Condition2) + #ifndef V8TestInterface_h #define V8TestInterface_h @@ -48,3 +50,5 @@ v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface >); } #endif // V8TestInterface_h +#endif // ENABLE(Condition1) || ENABLE(Condition2) + diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp index 69c57bb..4a54ae3 100644 --- a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp +++ b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp @@ -22,6 +22,7 @@ #include "V8TestObj.h" #include "ExceptionCode.h" +#include "HTMLNames.h" #include "RuntimeEnabledFeatures.h" #include "ScriptCallStack.h" #include "SerializedScriptValue.h" @@ -151,28 +152,140 @@ static void testObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Valu return; } -static v8::Handle<v8::Value> attrWithExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { - INC_STATS("DOM.TestObj.attrWithException._get"); + INC_STATS("DOM.TestObj.reflectedStringAttr._get"); TestObj* imp = V8TestObj::toNative(info.Holder()); - return v8::Integer::New(imp->attrWithException()); + return v8String(imp->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr)); } -static void attrWithExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { - INC_STATS("DOM.TestObj.attrWithException._set"); + INC_STATS("DOM.TestObj.reflectedStringAttr._set"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + V8Parameter<WithNullCheck> v = value; + imp->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, v); + return; +} + +static v8::Handle<v8::Value> reflectedIntegralAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.reflectedIntegralAttr._get"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + return v8::Integer::New(imp->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr)); +} + +static void reflectedIntegralAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.reflectedIntegralAttr._set"); TestObj* imp = V8TestObj::toNative(info.Holder()); int v = toInt32(value); - imp->setAttrWithException(v); + imp->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, v); return; } -static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +static v8::Handle<v8::Value> reflectedBooleanAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { - INC_STATS("DOM.TestObj.attrWithSetterException._get"); + INC_STATS("DOM.TestObj.reflectedBooleanAttr._get"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + return v8Boolean(imp->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr)); +} + +static void reflectedBooleanAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.reflectedBooleanAttr._set"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + bool v = value->BooleanValue(); + imp->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, v); + return; +} + +static v8::Handle<v8::Value> reflectedURLAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.reflectedURLAttr._get"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + return v8String(imp->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr)); +} + +static void reflectedURLAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.reflectedURLAttr._set"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + V8Parameter<WithNullCheck> v = value; + imp->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, v); + return; +} + +static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.reflectedStringAttr._get"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + return v8String(imp->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr)); +} + +static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.reflectedStringAttr._set"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + V8Parameter<WithNullCheck> v = value; + imp->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, v); + return; +} + +static v8::Handle<v8::Value> reflectedCustomIntegralAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.reflectedCustomIntegralAttr._get"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + return v8::Integer::New(imp->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr)); +} + +static void reflectedCustomIntegralAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.reflectedCustomIntegralAttr._set"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + int v = toInt32(value); + imp->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, v); + return; +} + +static v8::Handle<v8::Value> reflectedCustomBooleanAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.reflectedCustomBooleanAttr._get"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + return v8Boolean(imp->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr)); +} + +static void reflectedCustomBooleanAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.reflectedCustomBooleanAttr._set"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + bool v = value->BooleanValue(); + imp->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, v); + return; +} + +static v8::Handle<v8::Value> reflectedURLAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.reflectedURLAttr._get"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + return v8String(imp->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr)); +} + +static void reflectedURLAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.reflectedURLAttr._set"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + V8Parameter<WithNullCheck> v = value; + imp->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, v); + return; +} + +static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.attrWithGetterException._get"); TestObj* imp = V8TestObj::toNative(info.Holder()); ExceptionCode ec = 0; - int v = imp->attrWithSetterException(ec); + int v = imp->attrWithGetterException(ec); if (UNLIKELY(ec)) { V8Proxy::setDOMException(ec); return v8::Handle<v8::Value>(); @@ -180,6 +293,25 @@ static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::Str return v8::Integer::New(v); } +static void attrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.attrWithGetterException._set"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + int v = toInt32(value); + ExceptionCode ec = 0; + imp->setAttrWithGetterException(v, ec); + if (UNLIKELY(ec)) + V8Proxy::setDOMException(ec); + return; +} + +static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.attrWithSetterException._get"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + return v8::Integer::New(imp->attrWithSetterException()); +} + static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { INC_STATS("DOM.TestObj.attrWithSetterException._set"); @@ -192,20 +324,45 @@ static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Lo return; } -static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +static v8::Handle<v8::Value> stringAttrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { - INC_STATS("DOM.TestObj.attrWithGetterException._get"); + INC_STATS("DOM.TestObj.stringAttrWithGetterException._get"); TestObj* imp = V8TestObj::toNative(info.Holder()); - return v8::Integer::New(imp->attrWithGetterException()); + ExceptionCode ec = 0; + String v = imp->stringAttrWithGetterException(ec); + if (UNLIKELY(ec)) { + V8Proxy::setDOMException(ec); + return v8::Handle<v8::Value>(); + } + return v8String(v); } -static void attrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +static void stringAttrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { - INC_STATS("DOM.TestObj.attrWithGetterException._set"); + INC_STATS("DOM.TestObj.stringAttrWithGetterException._set"); TestObj* imp = V8TestObj::toNative(info.Holder()); - int v = toInt32(value); + V8Parameter<> v = value; ExceptionCode ec = 0; - imp->setAttrWithGetterException(v, ec); + imp->setStringAttrWithGetterException(v, ec); + if (UNLIKELY(ec)) + V8Proxy::setDOMException(ec); + return; +} + +static v8::Handle<v8::Value> stringAttrWithSetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.stringAttrWithSetterException._get"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + return v8String(imp->stringAttrWithSetterException()); +} + +static void stringAttrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.stringAttrWithSetterException._set"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + V8Parameter<> v = value; + ExceptionCode ec = 0; + imp->setStringAttrWithSetterException(v, ec); if (UNLIKELY(ec)) V8Proxy::setDOMException(ec); return; @@ -218,6 +375,78 @@ static v8::Handle<v8::Value> scriptStringAttrAttrGetter(v8::Local<v8::String> na return v8StringOrNull(imp->scriptStringAttr()); } +#if ENABLE(Condition1) + +static v8::Handle<v8::Value> conditionalAttr1AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.conditionalAttr1._get"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + return v8::Integer::New(imp->conditionalAttr1()); +} + +#endif // ENABLE(Condition1) + +#if ENABLE(Condition1) + +static void conditionalAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.conditionalAttr1._set"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + int v = toInt32(value); + imp->setConditionalAttr1(v); + return; +} + +#endif // ENABLE(Condition1) + +#if ENABLE(Condition1) && ENABLE(Condition2) + +static v8::Handle<v8::Value> conditionalAttr2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.conditionalAttr2._get"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + return v8::Integer::New(imp->conditionalAttr2()); +} + +#endif // ENABLE(Condition1) && ENABLE(Condition2) + +#if ENABLE(Condition1) && ENABLE(Condition2) + +static void conditionalAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.conditionalAttr2._set"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + int v = toInt32(value); + imp->setConditionalAttr2(v); + return; +} + +#endif // ENABLE(Condition1) && ENABLE(Condition2) + +#if ENABLE(Condition1) || ENABLE(Condition2) + +static v8::Handle<v8::Value> conditionalAttr3AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.conditionalAttr3._get"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + return v8::Integer::New(imp->conditionalAttr3()); +} + +#endif // ENABLE(Condition1) || ENABLE(Condition2) + +#if ENABLE(Condition1) || ENABLE(Condition2) + +static void conditionalAttr3AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.TestObj.conditionalAttr3._set"); + TestObj* imp = V8TestObj::toNative(info.Holder()); + int v = toInt32(value); + imp->setConditionalAttr3(v); + return; +} + +#endif // ENABLE(Condition1) || ENABLE(Condition2) + static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.TestObj.description._get"); @@ -643,7 +872,7 @@ static v8::Handle<v8::Value> overloadedMethodCallback(const v8::Arguments& args) return overloadedMethod3Callback(args); if (args.Length() == 1) return overloadedMethod4Callback(args); - V8Proxy::setDOMException(SYNTAX_ERR); + V8Proxy::throwTypeError(); return notHandledByInterceptor(); } @@ -666,16 +895,46 @@ static const BatchedAttribute TestObjAttrs[] = { {"stringAttr", TestObjInternal::stringAttrAttrGetter, TestObjInternal::stringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, // Attribute 'testObjAttr' (Type: 'attribute' ExtAttr: '') {"testObjAttr", TestObjInternal::testObjAttrAttrGetter, TestObjInternal::testObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, - // Attribute 'attrWithException' (Type: 'attribute' ExtAttr: '') - {"attrWithException", TestObjInternal::attrWithExceptionAttrGetter, TestObjInternal::attrWithExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, - // Attribute 'attrWithSetterException' (Type: 'attribute' ExtAttr: '') - {"attrWithSetterException", TestObjInternal::attrWithSetterExceptionAttrGetter, TestObjInternal::attrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, + // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect') + {"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, + // Attribute 'reflectedIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect') + {"reflectedIntegralAttr", TestObjInternal::reflectedIntegralAttrAttrGetter, TestObjInternal::reflectedIntegralAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, + // Attribute 'reflectedBooleanAttr' (Type: 'attribute' ExtAttr: 'Reflect') + {"reflectedBooleanAttr", TestObjInternal::reflectedBooleanAttrAttrGetter, TestObjInternal::reflectedBooleanAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, + // Attribute 'reflectedURLAttr' (Type: 'attribute' ExtAttr: 'ReflectURL') + {"reflectedURLAttr", TestObjInternal::reflectedURLAttrAttrGetter, TestObjInternal::reflectedURLAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, + // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect') + {"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, + // Attribute 'reflectedCustomIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect') + {"reflectedCustomIntegralAttr", TestObjInternal::reflectedCustomIntegralAttrAttrGetter, TestObjInternal::reflectedCustomIntegralAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, + // Attribute 'reflectedCustomBooleanAttr' (Type: 'attribute' ExtAttr: 'Reflect') + {"reflectedCustomBooleanAttr", TestObjInternal::reflectedCustomBooleanAttrAttrGetter, TestObjInternal::reflectedCustomBooleanAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, + // Attribute 'reflectedURLAttr' (Type: 'attribute' ExtAttr: 'ReflectURL') + {"reflectedURLAttr", TestObjInternal::reflectedURLAttrAttrGetter, TestObjInternal::reflectedURLAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, // Attribute 'attrWithGetterException' (Type: 'attribute' ExtAttr: '') {"attrWithGetterException", TestObjInternal::attrWithGetterExceptionAttrGetter, TestObjInternal::attrWithGetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, + // Attribute 'attrWithSetterException' (Type: 'attribute' ExtAttr: '') + {"attrWithSetterException", TestObjInternal::attrWithSetterExceptionAttrGetter, TestObjInternal::attrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, + // Attribute 'stringAttrWithGetterException' (Type: 'attribute' ExtAttr: '') + {"stringAttrWithGetterException", TestObjInternal::stringAttrWithGetterExceptionAttrGetter, TestObjInternal::stringAttrWithGetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, + // Attribute 'stringAttrWithSetterException' (Type: 'attribute' ExtAttr: '') + {"stringAttrWithSetterException", TestObjInternal::stringAttrWithSetterExceptionAttrGetter, TestObjInternal::stringAttrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, // Attribute 'customAttr' (Type: 'attribute' ExtAttr: 'Custom') {"customAttr", V8TestObj::customAttrAccessorGetter, V8TestObj::customAttrAccessorSetter, 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 */}, +#endif // ENABLE(Condition1) +#if ENABLE(Condition1) && ENABLE(Condition2) + // Attribute 'conditionalAttr2' (Type: 'attribute' ExtAttr: 'Conditional') + {"conditionalAttr2", TestObjInternal::conditionalAttr2AttrGetter, TestObjInternal::conditionalAttr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, +#endif // ENABLE(Condition1) && ENABLE(Condition2) +#if ENABLE(Condition1) || ENABLE(Condition2) + // Attribute 'conditionalAttr3' (Type: 'attribute' ExtAttr: 'Conditional') + {"conditionalAttr3", TestObjInternal::conditionalAttr3AttrGetter, TestObjInternal::conditionalAttr3AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, +#endif // ENABLE(Condition1) || ENABLE(Condition2) // Attribute 'description' (Type: 'readonly attribute' ExtAttr: '') {"description", TestObjInternal::descriptionAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, // Attribute 'id' (Type: 'attribute' ExtAttr: '') |