Changeset 194100 in webkit
- Timestamp:
- Dec 15, 2015 12:55:23 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 added
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r194057 r194100 1 2015-12-15 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 3 WebIDL generator should support the possibility for C++ classes to have a JS Builtin constructor 4 https://bugs.webkit.org/show_bug.cgi?id=152171 5 6 Reviewed by Darin Adler. 7 8 Reintroducing JSBuiltinConstructor keyword as a way to run automatically a JS builtin initialization function 9 to process the arguments passed to the DOM C++ constructor. 10 11 Specialized createJSObject for those classes. 12 13 Fixing typo in TestCustomConstructor.idl. 14 15 Covered by binding tests. 16 17 * bindings/scripts/CodeGeneratorJS.pm: 18 (GenerateConstructorDefinition): 19 (IsConstructable): 20 (IsJSBuiltinConstructor): 21 (AddJSBuiltinIncludesIfNeeded): 22 * bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructor.cpp: Added. 23 * bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructor.h: Added. 24 * bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorPrivate.h: Added. 25 * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: Added. 26 * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h: Added. 27 * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructor.h: Added. 28 * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructor.mm: Added. 29 * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorInternal.h: Added. 30 * bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl: Copied from Source/WebCore/bindings/scripts/test/TestCustomConstructor.idl. 31 * bindings/scripts/test/TestCustomConstructor.idl: 32 1 33 2015-12-14 Andreas Kling <akling@apple.com> 2 34 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r193101 r194100 4728 4728 my $function = shift; 4729 4729 4730 return if IsJSBuiltinConstructor($interface); 4730 4731 if (IsJSBuiltinConstructor($interface)) { 4732 if ($interface->extendedAttributes->{"JSBuiltinConstructor"}) { 4733 # FIXME: Add support for ConstructorCallWith 4734 push(@$outputArray, <<END); 4735 template<> JSC::JSObject* ${className}Constructor::createJSObject() 4736 { 4737 return ${className}::create(getDOMStructure<${className}>(globalObject()->vm(), *globalObject()), globalObject(), ${interfaceName}::create()); 4738 } 4739 4740 END 4741 } 4742 return; 4743 } 4731 4744 4732 4745 my $constructorClassName = $generatingNamedConstructor ? "${className}NamedConstructor" : "${className}Constructor"; … … 5035 5048 my $interface = shift; 5036 5049 5037 return HasCustomConstructor($interface) || $interface->extendedAttributes->{"Constructor"} || $interface->extendedAttributes->{"NamedConstructor"} || $interface->extendedAttributes->{"ConstructorTemplate"} ;5050 return HasCustomConstructor($interface) || $interface->extendedAttributes->{"Constructor"} || $interface->extendedAttributes->{"NamedConstructor"} || $interface->extendedAttributes->{"ConstructorTemplate"} || $interface->extendedAttributes->{"JSBuiltinConstructor"}; 5038 5051 } 5039 5052 … … 5083 5096 return 0 if $interface->extendedAttributes->{"CustomConstructor"}; 5084 5097 return 1 if $interface->extendedAttributes->{"JSBuiltin"}; 5098 return 1 if $interface->extendedAttributes->{"JSBuiltinConstructor"}; 5085 5099 return 0; 5086 5100 } … … 5113 5127 my $interface = shift; 5114 5128 5115 if ($interface->extendedAttributes->{"JSBuiltin"} ) {5129 if ($interface->extendedAttributes->{"JSBuiltin"} || $interface->extendedAttributes->{"JSBuiltinConstructor"}) { 5116 5130 AddToImplIncludes($interface->name . "Builtins.h"); 5117 5131 return; -
trunk/Source/WebCore/bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl
r194095 r194100 28 28 29 29 [ 30 CustomConstructor, 31 JSBuiltIn, 32 NoInterfaceObject 33 ] interface TestCustomConstructorWithNoInterfaceObject { 30 JSBuiltinConstructor 31 ] interface TestClassWithJSBuiltinConstructor { 34 32 }; 35 -
trunk/Source/WebCore/bindings/scripts/test/TestCustomConstructor.idl
r191885 r194100 29 29 [ 30 30 CustomConstructor, 31 JSBuiltIn,32 31 NoInterfaceObject 33 32 ] interface TestCustomConstructorWithNoInterfaceObject { 34 33 }; 35
Note: See TracChangeset
for help on using the changeset viewer.