A WebIDL callback interface is allowed to have constants
https://bugs.webkit.org/show_bug.cgi?id=148449

Reviewed by Geoffrey Garen.

Our JS bindings generator is now able to:
1. Handle IDL constants [1] on a callback interfaces [2] and generate
   a DOMConstructorObject subclass with static properties for
   these constants [3].
2. Generate a property on the global object for callback interfaces
   that have constants and do not have the [NoInterfaceObject] IDL
   extended attribute [4].

This is a pre-requirement for Bug 148415 as NodeFilter [5] has constants
and should be a callback interface. Once NodeFilter is ported to be
a callback interface, the JS still needs to be able to access
window.NodeFilter.SHOW_ALL for e.g.

[1] https://heycam.github.io/webidl/#dfn-constant
[2] https://heycam.github.io/webidl/#dfn-callback-interface
[3] https://heycam.github.io/webidl/#NoInterfaceObject
[4] https://heycam.github.io/webidl/#es-interfaces
[5] https://dom.spec.whatwg.org/#interface-nodefilter

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackHeader):
(GenerateCallbackImplementation):
(GenerateConstructorHelperMethods):
(ConstructorHasProperties): Deleted.
* bindings/scripts/preprocess-idls.pl:
(getInterfaceExtendedAttributesFromIDL):
(interfaceHasConstantAttribute):
* bindings/scripts/test/GObject/WebKitDOMTestCallback.h:
* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallbackConstructor::create):
(WebCore::JSTestCallbackConstructor::createStructure):
(WebCore::JSTestCallbackConstructor::JSTestCallbackConstructor):
(WebCore::JSTestCallbackConstructor::finishCreation):
(WebCore::JSTestCallback::getConstructor):
* bindings/scripts/test/JS/JSTestCallback.h:
* bindings/scripts/test/ObjC/DOMTestCallback.h:
* bindings/scripts/test/TestCallback.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@189063 268f45cc-cd09-0410-ab3c-d52691b4dbfc
8 files changed