Binding generator should support interfaces with CustomConstructor and NoInterfaceObject
[WebKit-https.git] / Source / WebCore / ChangeLog
index e20d5e6..8f424ff 100644 (file)
@@ -1,3 +1,71 @@
+2015-05-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
+
+        Binding generator should support interfaces with CustomConstructor and NoInterfaceObject
+        https://bugs.webkit.org/show_bug.cgi?id=145016
+
+        Reviewed by Darin Adler.
+
+        Updated code generator to generate the necessary declarations (constructor property in the prototype, the constructor class).
+        In the case of CustomConstructor with NoInterfaceObject, the implementation of the constructor property related JS function is changed as follow:
+        It creates a constructor object and shadows the constructor property JS function with this object.
+        This ensures that only one constructor object is created per prototype.
+        The constructor is not exposed as it is not added to the global object constructor map.
+
+        NoInterfaceObject is asking to not make the interface visible, which is contradictory with having a visible constructor of the interface.
+        The case for having NoInterfaceObject and CustomConstructor is the following:
+        We do not want to expose the interface but we still want to have a constructor property on the prototype of objects implementing the interface.
+        One such case is https://streams.spec.whatwg.org/#globals
+
+        Added TestCustomConstructorWithNoInterfaceObject.idl to check that case.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        (GenerateAttributesHashTable):
+        (GenerateImplementation):
+        (HasConstructorProperty):
+        * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.cpp: Added.
+        (WebKit::kit):
+        (WebKit::core):
+        (WebKit::wrapTestCustomConstructorWithNoInterfaceObject):
+        (webkit_dom_test_custom_constructor_with_no_interface_object_finalize):
+        (webkit_dom_test_custom_constructor_with_no_interface_object_constructor):
+        (webkit_dom_test_custom_constructor_with_no_interface_object_class_init):
+        (webkit_dom_test_custom_constructor_with_no_interface_object_init):
+        * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.h: Added.
+        * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate.h: Added.
+        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Added.
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::create):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::createStructure):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::JSTestCustomConstructorWithNoInterfaceObjectPrototype):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::create):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::createStructure):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::getConstructData):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::createPrototype):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getPrototype):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::destroy):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
+        (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getConstructor):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
+        (WebCore::toJS):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
+        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Added.
+        (WebCore::wrapperOwner):
+        (WebCore::toJS):
+        * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h: Added.
+        * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm: Added.
+        (-[DOMTestCustomConstructorWithNoInterfaceObject dealloc]):
+        (-[DOMTestCustomConstructorWithNoInterfaceObject finalize]):
+        (core):
+        (kit):
+        * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h: Added.
+        * bindings/scripts/test/TestCustomConstructor.idl: Added.
+
 2015-05-26  Joseph Pecoraro  <pecoraro@apple.com>
 
         CSS properties (font-synthesis, column-fill) are missing in getComputedStyles