https://bugs.webkit.org/show_bug.cgi?id=79357
Reviewed by Adam Barth.
[Supplemental] on static methods does not work in CodeGeneratorJS.pm
and CodeGeneratorV8.pm due to mis-ordered if-elsif statements.
This patch fixes it and supports [Supplemental] on static methods.
Test: bindings/scripts/test/TestSupplemental.idl
* bindings/scripts/CodeGeneratorJS.pm: Modified as described above.
(GenerateParametersCheck):
* bindings/scripts/CodeGeneratorV8.pm: Ditto.
(GenerateFunctionCallString):
* bindings/scripts/test/TestSupplemental.idl: Added a test case.
* bindings/scripts/test/CPP/WebDOMTestInterface.cpp: Updated run-bindings-tests results.
(WebDOMTestInterface::supplementalMethod4):
* bindings/scripts/test/CPP/WebDOMTestInterface.h: Ditto.
* bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp: Ditto.
(webkit_dom_test_interface_supplemental_method4):
* bindings/scripts/test/GObject/WebKitDOMTestInterface.h: Ditto.
* bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
(WebCore):
(WebCore::JSTestInterfaceConstructor::getOwnPropertySlot):
(WebCore::JSTestInterfaceConstructor::getOwnPropertyDescriptor):
(WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4):
* bindings/scripts/test/JS/JSTestInterface.h: Ditto.
(WebCore):
* bindings/scripts/test/ObjC/DOMTestInterface.h: Ditto.
* bindings/scripts/test/ObjC/DOMTestInterface.mm: Ditto.
(-[DOMTestInterface supplementalMethod4]):
* bindings/scripts/test/V8/V8TestInterface.cpp: Ditto.
(TestInterfaceInternal):
(WebCore::TestInterfaceInternal::supplementalMethod4Callback):
(WebCore::ConfigureV8TestInterfaceTemplate):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108757
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-24 Kentaro Hara <haraken@chromium.org>
+
+ Support [Supplemental] on static methods
+ https://bugs.webkit.org/show_bug.cgi?id=79357
+
+ Reviewed by Adam Barth.
+
+ [Supplemental] on static methods does not work in CodeGeneratorJS.pm
+ and CodeGeneratorV8.pm due to mis-ordered if-elsif statements.
+ This patch fixes it and supports [Supplemental] on static methods.
+
+ Test: bindings/scripts/test/TestSupplemental.idl
+
+ * bindings/scripts/CodeGeneratorJS.pm: Modified as described above.
+ (GenerateParametersCheck):
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ (GenerateFunctionCallString):
+
+ * bindings/scripts/test/TestSupplemental.idl: Added a test case.
+
+ * bindings/scripts/test/CPP/WebDOMTestInterface.cpp: Updated run-bindings-tests results.
+ (WebDOMTestInterface::supplementalMethod4):
+ * bindings/scripts/test/CPP/WebDOMTestInterface.h: Ditto.
+ * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp: Ditto.
+ (webkit_dom_test_interface_supplemental_method4):
+ * bindings/scripts/test/GObject/WebKitDOMTestInterface.h: Ditto.
+ * bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
+ (WebCore):
+ (WebCore::JSTestInterfaceConstructor::getOwnPropertySlot):
+ (WebCore::JSTestInterfaceConstructor::getOwnPropertyDescriptor):
+ (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4):
+ * bindings/scripts/test/JS/JSTestInterface.h: Ditto.
+ (WebCore):
+ * bindings/scripts/test/ObjC/DOMTestInterface.h: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestInterface.mm: Ditto.
+ (-[DOMTestInterface supplementalMethod4]):
+ * bindings/scripts/test/V8/V8TestInterface.cpp: Ditto.
+ (TestInterfaceInternal):
+ (WebCore::TestInterfaceInternal::supplementalMethod4Callback):
+ (WebCore::ConfigureV8TestInterfaceTemplate):
+
2012-02-24 Tony Chang <tony@chromium.org>
Small refactor in RenderFlexibleBox::layoutAndPlaceChildren
my @arguments;
my $functionName;
- if ($function->isStatic) {
- $functionName = "${implClassName}::${functionImplementationName}";
- } elsif ($function->signature->extendedAttributes->{"ImplementedBy"}) {
- my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"};
+ my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"};
+ if ($implementedBy) {
AddToImplIncludes("${implementedBy}.h");
- unshift(@arguments, "impl");
+ unshift(@arguments, "impl") if !$function->isStatic;
$functionName = "${implementedBy}::${functionImplementationName}";
+ } elsif ($function->isStatic) {
+ $functionName = "${implClassName}::${functionImplementationName}";
} elsif ($svgPropertyOrListPropertyType and !$svgListPropertyType) {
$functionName = "podImpl.${functionImplementationName}";
} else {
my @arguments;
my $functionName;
- if ($function->isStatic) {
- $functionName = "${implClassName}::${name}";
- } elsif ($function->signature->extendedAttributes->{"ImplementedBy"}) {
- my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"};
+ my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"};
+ if ($implementedBy) {
AddToImplIncludes("${implementedBy}.h");
- unshift(@arguments, "imp");
+ unshift(@arguments, "imp") if !$function->isStatic;
$functionName = "${implementedBy}::${name}";
+ } elsif ($function->isStatic) {
+ $functionName = "${implClassName}::${name}";
} else {
$functionName = "imp->${name}";
}
#endif
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+void WebDOMTestInterface::supplementalMethod4()
+{
+ if (!impl())
+ return;
+
+ WebCore::TestSupplemental::supplementalMethod4(impl());
+}
+
+#endif
+
WebCore::TestInterface* toWebCore(const WebDOMTestInterface& wrapper)
{
return wrapper.impl();
#endif
void supplementalMethod1();
+ void supplementalMethod4();
WebCore::TestInterface* impl() const;
#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
}
+void
+webkit_dom_test_interface_supplemental_method4(WebKitDOMTestInterface* self)
+{
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestInterface * item = WebKit::core(self);
+ TestSupplemental::supplementalMethod4(item);
+#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
+}
+
gchar*
webkit_dom_test_interface_get_supplemental_str1(WebKitDOMTestInterface* self)
{
webkit_dom_test_interface_supplemental_method2(WebKitDOMTestInterface* self, const gchar* str_arg, WebKitDOMTestObj* obj_arg, GError **error);
/**
+ * webkit_dom_test_interface_supplemental_method4:
+ * @self: A #WebKitDOMTestInterface
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_interface_supplemental_method4(WebKitDOMTestInterface* self);
+
+/**
* webkit_dom_test_interface_get_supplemental_str1:
* @self: A #WebKitDOMTestInterface
*
#if ENABLE(Condition11) || ENABLE(Condition12)
{ "SUPPLEMENTALCONSTANT2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSUPPLEMENTALCONSTANT2), (intptr_t)0, NoIntrinsic },
#endif
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ { "supplementalMethod4", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestInterfaceConstructorFunctionSupplementalMethod4), (intptr_t)0, NoIntrinsic },
+#endif
{ 0, 0, 0, 0, NoIntrinsic }
};
bool JSTestInterfaceConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
- return getStaticValueSlot<JSTestInterfaceConstructor, JSDOMWrapper>(exec, &JSTestInterfaceConstructorTable, static_cast<JSTestInterfaceConstructor*>(cell), propertyName, slot);
+ return getStaticPropertySlot<JSTestInterfaceConstructor, JSDOMWrapper>(exec, &JSTestInterfaceConstructorTable, static_cast<JSTestInterfaceConstructor*>(cell), propertyName, slot);
}
bool JSTestInterfaceConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
- return getStaticValueDescriptor<JSTestInterfaceConstructor, JSDOMWrapper>(exec, &JSTestInterfaceConstructorTable, static_cast<JSTestInterfaceConstructor*>(object), propertyName, descriptor);
+ return getStaticPropertyDescriptor<JSTestInterfaceConstructor, JSDOMWrapper>(exec, &JSTestInterfaceConstructorTable, static_cast<JSTestInterfaceConstructor*>(object), propertyName, descriptor);
}
EncodedJSValue JSC_HOST_CALL JSTestInterfaceConstructor::constructJSTestInterface(ExecState* exec)
#endif
+#if ENABLE(Condition11) || ENABLE(Condition12)
+EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionSupplementalMethod4(ExecState* exec)
+{
+ TestSupplemental::supplementalMethod4();
+ return JSValue::encode(jsUndefined());
+}
+
+#endif
+
// Constant getters
#if ENABLE(Condition11) || ENABLE(Condition12)
JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod1(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod3(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionSupplementalMethod4(JSC::ExecState*);
// Attributes
JSC::JSValue jsTestInterfaceSupplementalStr1(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
- (void)supplementalMethod1;
- (DOMTestObj *)supplementalMethod2:(NSString *)strArg objArg:(DOMTestObj *)objArg;
- (void)supplementalMethod3;
+- (void)supplementalMethod4;
@end
#endif
#endif
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+- (void)supplementalMethod4
+{
+ WebCore::JSMainThreadNullState state;
+ TestSupplemental::supplementalMethod4(IMPL);
+}
+
+#endif
+
@end
WebCore::TestInterface* core(DOMTestInterface *wrapper)
void supplementalMethod1();
[CallWith=ScriptExecutionContext] TestObj supplementalMethod2(in DOMString strArg, in TestObj objArg) raises(DOMException);
[Custom] void supplementalMethod3();
+ static void supplementalMethod4();
const unsigned short SUPPLEMENTALCONSTANT1 = 1;
const [Reflect=CONST_IMPL] unsigned short SUPPLEMENTALCONSTANT2 = 2;
#endif // ENABLE(Condition11) || ENABLE(Condition12)
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static v8::Handle<v8::Value> supplementalMethod4Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestInterface.supplementalMethod4");
+ TestSupplemental::supplementalMethod4();
+ return v8::Handle<v8::Value>();
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
} // namespace TestInterfaceInternal
static const BatchedAttribute TestInterfaceAttrs[] = {
#if ENABLE(Condition11) || ENABLE(Condition12)
proto->Set(v8::String::New("supplementalMethod2"), v8::FunctionTemplate::New(TestInterfaceInternal::supplementalMethod2Callback, v8::Handle<v8::Value>(), supplementalMethod2Signature));
#endif // ENABLE(Condition11) || ENABLE(Condition12)
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ desc->Set(v8::String::New("supplementalMethod4"), v8::FunctionTemplate::New(TestInterfaceInternal::supplementalMethod4Callback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
batchConfigureConstants(desc, proto, TestInterfaceConsts, WTF_ARRAY_LENGTH(TestInterfaceConsts));
// Custom toString template