Use constructor operations in WebIDL
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jun 2020 16:56:19 +0000 (16:56 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jun 2020 16:56:19 +0000 (16:56 +0000)
commit5626403a00dc7cca06957d3c6c1b0085ed0f050e
treecc48b666b0485ed47f8833428f707b5489aeefbe
parent1f5bd050b1157a40e8c6dd86b156e94321ca1e0e
Use constructor operations in WebIDL
https://bugs.webkit.org/show_bug.cgi?id=201397

Reviewed by Eric Carlson.

Add support for constructor syntax in WebIDL (https://heycam.github.io/webidl/#idl-constructors)

- [Constructor(...)] extended attributes become constructor(...) operations
- [JSBuiltinConstructor] becomes [JSBuiltin] constructor(...)
- [CustomConstructor] becomes [Custom] constructor(...)
- [ConstructorMayThrowException] becomes [MayThrowException] constructor(...) and can
  now be unique per-overload
- [ConstructorCallWith=Foo] becomes [CallWith=Foo] constructor(...) and can now also be
  unique per-overload

This change leaves NamedConstructor as is, but a subsequent change will replace it with the
specified LegacyFactoryFunction extended attribute.

* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl:
* Modules/applepay/ApplePayError.idl:
* Modules/applepay/ApplePaySession.idl:
* Modules/applepay/ApplePaySetup.idl:
* Modules/async-clipboard/ClipboardItem.idl:
* Modules/encryptedmedia/MediaKeyMessageEvent.idl:
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl:
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.idl:
* Modules/fetch/FetchHeaders.idl:
* Modules/fetch/FetchRequest.idl:
* Modules/fetch/FetchResponse.idl:
* Modules/gamepad/GamepadEvent.idl:
* Modules/highlight/HighlightMap.idl:
* Modules/highlight/HighlightRangeGroup.idl:
* Modules/indexeddb/IDBVersionChangeEvent.idl:
* Modules/mediarecorder/BlobEvent.idl:
* Modules/mediarecorder/MediaRecorder.idl:
* Modules/mediarecorder/MediaRecorderErrorEvent.idl:
* Modules/mediasession/MediaRemoteControls.idl:
* Modules/mediasession/MediaSession.idl:
* Modules/mediasource/MediaSource.idl:
* Modules/mediastream/MediaStream.idl:
* Modules/mediastream/MediaStreamTrackEvent.idl:
* Modules/mediastream/OverconstrainedError.idl:
* Modules/mediastream/OverconstrainedErrorEvent.idl:
* Modules/mediastream/RTCDTMFToneChangeEvent.idl:
* Modules/mediastream/RTCDataChannelEvent.idl:
* Modules/mediastream/RTCIceCandidate.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCPeerConnectionIceEvent.idl:
* Modules/mediastream/RTCSessionDescription.idl:
* Modules/mediastream/RTCTrackEvent.idl:
* Modules/notifications/Notification.idl:
* Modules/paymentrequest/MerchantValidationEvent.idl:
* Modules/paymentrequest/PaymentMethodChangeEvent.idl:
* Modules/paymentrequest/PaymentRequest.idl:
* Modules/paymentrequest/PaymentRequestUpdateEvent.idl:
* Modules/pictureinpicture/EnterPictureInPictureEvent.idl:
* Modules/speech/SpeechSynthesisUtterance.idl:
* Modules/streams/ByteLengthQueuingStrategy.idl:
* Modules/streams/CountQueuingStrategy.idl:
* Modules/streams/ReadableByteStreamController.idl:
* Modules/streams/ReadableStream.idl:
* Modules/streams/ReadableStreamBYOBReader.idl:
* Modules/streams/ReadableStreamBYOBRequest.idl:
* Modules/streams/ReadableStreamDefaultController.idl:
* Modules/streams/ReadableStreamDefaultReader.idl:
* Modules/streams/WritableStream.idl:
* Modules/webaudio/AudioContext.idl:
* Modules/webaudio/OfflineAudioContext.idl:
* Modules/webgpu/GPUOutOfMemoryError.idl:
* Modules/webgpu/GPUUncapturedErrorEvent.idl:
* Modules/webgpu/GPUValidationError.idl:
* Modules/websockets/CloseEvent.idl:
* Modules/websockets/WebSocket.idl:
* Modules/webxr/WebXRRigidTransform.idl:
* Modules/webxr/WebXRWebGLLayer.idl:
* Modules/webxr/XRInputSourceEvent.idl:
* Modules/webxr/XRInputSourcesChangeEvent.idl:
* Modules/webxr/XRReferenceSpaceEvent.idl:
* Modules/webxr/XRSessionEvent.idl:
* animation/AnimationPlaybackEvent.idl:
* animation/DocumentTimeline.idl:
* animation/KeyframeEffect.idl:
* animation/WebAnimation.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(ShouldGenerateToJSDeclaration):
(GetFullyQualifiedImplementationCallName):
(GenerateParametersCheck):
(GetConstructorTemplateClassName):
(GenerateConstructorDefinition):
(GenerateConstructorHelperMethods):
(HasCustomConstructor):
(IsConstructable):
(HasJSBuiltinConstructor):
(AddJSBuiltinIncludesIfNeeded):
(IsJSBuiltinConstructor): Deleted.
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/IDLParser.pm:
(assertExtendedAttributesValidForContext):
(copyExtendedAttributes):
(cloneOperation):
(applyTypedefs):
(parseInterfaceMember):
(parseConstructor):
(parseExtendedAttributeRest):
(applyMemberList):
(applyExtendedAttributeList):
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorConstructor::initializeProperties):
(WebCore::JSTestNamedConstructorNamedConstructor::construct):
(WebCore::JSTestNamedConstructorNamedConstructor::initializeProperties):
* bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl:
* bindings/scripts/test/TestEventConstructor.idl:
* bindings/scripts/test/TestInterface.idl:
* bindings/scripts/test/TestJSBuiltinConstructor.idl:
* bindings/scripts/test/TestNamedConstructor.idl:
* bindings/scripts/test/TestNode.idl:
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestOverloadedConstructors.idl:
* bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl:
* bindings/scripts/test/TestPromiseRejectionEvent.idl:
* bindings/scripts/test/TestTypedefs.idl:
* css/DOMMatrix.idl:
* css/DOMMatrixReadOnly.idl:
* css/FontFace.idl:
* css/FontFaceSet.idl:
* css/MediaQueryListEvent.idl:
* css/WebKitCSSMatrix.idl:
* css/typedom/TypedOMCSSUnitValue.idl:
* css/typedom/TypedOMCSSUnparsedValue.idl:
* dom/AbortController.idl:
* dom/AnimationEvent.idl:
* dom/BeforeLoadEvent.idl:
* dom/ClipboardEvent.idl:
* dom/Comment.idl:
* dom/CompositionEvent.idl:
* dom/CustomEvent.idl:
* dom/DOMException.idl:
* dom/DOMPoint.idl:
* dom/DOMPointReadOnly.idl:
* dom/DOMQuad.idl:
* dom/DOMRect.idl:
* dom/DOMRectReadOnly.idl:
* dom/Document.idl:
* dom/DocumentFragment.idl:
* dom/DragEvent.idl:
* dom/ErrorEvent.idl:
* dom/Event.idl:
* dom/EventTarget.idl:
* dom/FocusEvent.idl:
* dom/HashChangeEvent.idl:
* dom/InputEvent.idl:
* dom/KeyboardEvent.idl:
* dom/MessageChannel.idl:
* dom/MessageEvent.idl:
* dom/MouseEvent.idl:
* dom/MutationObserver.idl:
* dom/OverflowEvent.idl:
* dom/PageTransitionEvent.idl:
* dom/PointerEvent.idl:
* dom/PopStateEvent.idl:
* dom/ProgressEvent.idl:
* dom/PromiseRejectionEvent.idl:
* dom/Range.idl:
* dom/SecurityPolicyViolationEvent.idl:
* dom/StaticRange.idl:
* dom/Text.idl:
* dom/TextDecoder.idl:
* dom/TextEncoder.idl:
* dom/TransitionEvent.idl:
* dom/UIEvent.idl:
* dom/WebKitAnimationEvent.idl:
* dom/WebKitTransitionEvent.idl:
* dom/WheelEvent.idl:
* fileapi/Blob.idl:
* fileapi/File.idl:
* fileapi/FileReader.idl:
* fileapi/FileReaderSync.idl:
* html/DOMFormData.idl:
* html/DOMURL.idl:
* html/HTMLElement.idl:
* html/HTMLOptionElement.idl:
* html/ImageData.idl:
* html/MediaController.idl:
* html/MediaEncryptedEvent.idl:
* html/OffscreenCanvas.idl:
* html/URLSearchParams.idl:
* html/canvas/Path2D.idl:
* html/canvas/WebGLContextEvent.idl:
* html/track/DataCue.idl:
* html/track/TextTrackCue.idl:
* html/track/TrackEvent.idl:
* html/track/VTTCue.idl:
* html/track/VTTRegion.idl:
* page/EventSource.idl:
* page/IntersectionObserver.idl:
* page/IntersectionObserverEntry.idl:
* page/PerformanceObserver.idl:
* page/ResizeObserver.idl:
* page/UndoItem.idl:
* page/WebKitPoint.idl:
* storage/StorageEvent.idl:
* workers/Worker.idl:
* workers/service/ExtendableEvent.idl:
* workers/service/ExtendableMessageEvent.idl:
* workers/service/FetchEvent.idl:
* xml/DOMParser.idl:
* xml/XMLHttpRequest.idl:
* xml/XMLSerializer.idl:
* xml/XPathEvaluator.idl:
* xml/XSLTProcessor.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
172 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl
Source/WebCore/Modules/applepay/ApplePayError.idl
Source/WebCore/Modules/applepay/ApplePaySession.idl
Source/WebCore/Modules/applepay/ApplePaySetup.idl
Source/WebCore/Modules/async-clipboard/ClipboardItem.idl
Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl
Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl
Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl
Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.idl
Source/WebCore/Modules/fetch/FetchHeaders.idl
Source/WebCore/Modules/fetch/FetchRequest.idl
Source/WebCore/Modules/fetch/FetchResponse.idl
Source/WebCore/Modules/gamepad/GamepadEvent.idl
Source/WebCore/Modules/highlight/HighlightMap.idl
Source/WebCore/Modules/highlight/HighlightRangeGroup.idl
Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.idl
Source/WebCore/Modules/mediarecorder/BlobEvent.idl
Source/WebCore/Modules/mediarecorder/MediaRecorder.idl
Source/WebCore/Modules/mediarecorder/MediaRecorderErrorEvent.idl
Source/WebCore/Modules/mediasession/MediaRemoteControls.idl
Source/WebCore/Modules/mediasession/MediaSession.idl
Source/WebCore/Modules/mediasource/MediaSource.idl
Source/WebCore/Modules/mediastream/MediaStream.idl
Source/WebCore/Modules/mediastream/MediaStreamTrackEvent.idl
Source/WebCore/Modules/mediastream/OverconstrainedError.idl
Source/WebCore/Modules/mediastream/OverconstrainedErrorEvent.idl
Source/WebCore/Modules/mediastream/RTCDTMFToneChangeEvent.idl
Source/WebCore/Modules/mediastream/RTCDataChannelEvent.idl
Source/WebCore/Modules/mediastream/RTCIceCandidate.idl
Source/WebCore/Modules/mediastream/RTCPeerConnection.idl
Source/WebCore/Modules/mediastream/RTCPeerConnectionIceEvent.idl
Source/WebCore/Modules/mediastream/RTCSessionDescription.idl
Source/WebCore/Modules/mediastream/RTCTrackEvent.idl
Source/WebCore/Modules/notifications/Notification.idl
Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.idl
Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.idl
Source/WebCore/Modules/paymentrequest/PaymentRequest.idl
Source/WebCore/Modules/paymentrequest/PaymentRequestUpdateEvent.idl
Source/WebCore/Modules/pictureinpicture/EnterPictureInPictureEvent.idl
Source/WebCore/Modules/speech/SpeechSynthesisUtterance.idl
Source/WebCore/Modules/streams/ByteLengthQueuingStrategy.idl
Source/WebCore/Modules/streams/CountQueuingStrategy.idl
Source/WebCore/Modules/streams/ReadableByteStreamController.idl
Source/WebCore/Modules/streams/ReadableStream.idl
Source/WebCore/Modules/streams/ReadableStreamBYOBReader.idl
Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.idl
Source/WebCore/Modules/streams/ReadableStreamDefaultController.idl
Source/WebCore/Modules/streams/ReadableStreamDefaultReader.idl
Source/WebCore/Modules/streams/WritableStream.idl
Source/WebCore/Modules/webaudio/AudioContext.idl
Source/WebCore/Modules/webaudio/OfflineAudioContext.idl
Source/WebCore/Modules/webgpu/GPUOutOfMemoryError.idl
Source/WebCore/Modules/webgpu/GPUUncapturedErrorEvent.idl
Source/WebCore/Modules/webgpu/GPUValidationError.idl
Source/WebCore/Modules/websockets/CloseEvent.idl
Source/WebCore/Modules/websockets/WebSocket.idl
Source/WebCore/Modules/webxr/WebXRRigidTransform.idl
Source/WebCore/Modules/webxr/WebXRWebGLLayer.idl
Source/WebCore/Modules/webxr/XRInputSourceEvent.idl
Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.idl
Source/WebCore/Modules/webxr/XRReferenceSpaceEvent.idl
Source/WebCore/Modules/webxr/XRSessionEvent.idl
Source/WebCore/animation/AnimationPlaybackEvent.idl
Source/WebCore/animation/DocumentTimeline.idl
Source/WebCore/animation/KeyframeEffect.idl
Source/WebCore/animation/WebAnimation.idl
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.json
Source/WebCore/bindings/scripts/IDLParser.pm
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl
Source/WebCore/bindings/scripts/test/TestEventConstructor.idl
Source/WebCore/bindings/scripts/test/TestInterface.idl
Source/WebCore/bindings/scripts/test/TestJSBuiltinConstructor.idl
Source/WebCore/bindings/scripts/test/TestNamedConstructor.idl
Source/WebCore/bindings/scripts/test/TestNode.idl
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/bindings/scripts/test/TestOverloadedConstructors.idl
Source/WebCore/bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl
Source/WebCore/bindings/scripts/test/TestPromiseRejectionEvent.idl
Source/WebCore/bindings/scripts/test/TestTypedefs.idl
Source/WebCore/css/DOMMatrix.idl
Source/WebCore/css/DOMMatrixReadOnly.idl
Source/WebCore/css/FontFace.idl
Source/WebCore/css/FontFaceSet.idl
Source/WebCore/css/MediaQueryListEvent.idl
Source/WebCore/css/WebKitCSSMatrix.idl
Source/WebCore/css/typedom/TypedOMCSSUnitValue.idl
Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.idl
Source/WebCore/dom/AbortController.idl
Source/WebCore/dom/AnimationEvent.idl
Source/WebCore/dom/BeforeLoadEvent.idl
Source/WebCore/dom/ClipboardEvent.idl
Source/WebCore/dom/Comment.idl
Source/WebCore/dom/CompositionEvent.idl
Source/WebCore/dom/CustomEvent.idl
Source/WebCore/dom/DOMException.idl
Source/WebCore/dom/DOMPoint.idl
Source/WebCore/dom/DOMPointReadOnly.idl
Source/WebCore/dom/DOMQuad.idl
Source/WebCore/dom/DOMRect.idl
Source/WebCore/dom/DOMRectReadOnly.idl
Source/WebCore/dom/Document.idl
Source/WebCore/dom/DocumentFragment.idl
Source/WebCore/dom/DragEvent.idl
Source/WebCore/dom/ErrorEvent.idl
Source/WebCore/dom/Event.idl
Source/WebCore/dom/EventTarget.idl
Source/WebCore/dom/FocusEvent.idl
Source/WebCore/dom/HashChangeEvent.idl
Source/WebCore/dom/InputEvent.idl
Source/WebCore/dom/KeyboardEvent.idl
Source/WebCore/dom/MessageChannel.idl
Source/WebCore/dom/MessageEvent.idl
Source/WebCore/dom/MouseEvent.idl
Source/WebCore/dom/MutationObserver.idl
Source/WebCore/dom/OverflowEvent.idl
Source/WebCore/dom/PageTransitionEvent.idl
Source/WebCore/dom/PointerEvent.idl
Source/WebCore/dom/PopStateEvent.idl
Source/WebCore/dom/ProgressEvent.idl
Source/WebCore/dom/PromiseRejectionEvent.idl
Source/WebCore/dom/Range.idl
Source/WebCore/dom/SecurityPolicyViolationEvent.idl
Source/WebCore/dom/StaticRange.idl
Source/WebCore/dom/Text.idl
Source/WebCore/dom/TextDecoder.idl
Source/WebCore/dom/TextEncoder.idl
Source/WebCore/dom/TransitionEvent.idl
Source/WebCore/dom/UIEvent.idl
Source/WebCore/dom/WebKitAnimationEvent.idl
Source/WebCore/dom/WebKitTransitionEvent.idl
Source/WebCore/dom/WheelEvent.idl
Source/WebCore/fileapi/Blob.idl
Source/WebCore/fileapi/File.idl
Source/WebCore/fileapi/FileReader.idl
Source/WebCore/fileapi/FileReaderSync.idl
Source/WebCore/html/DOMFormData.idl
Source/WebCore/html/DOMURL.idl
Source/WebCore/html/HTMLElement.idl
Source/WebCore/html/HTMLOptionElement.idl
Source/WebCore/html/ImageData.idl
Source/WebCore/html/MediaController.idl
Source/WebCore/html/MediaEncryptedEvent.idl
Source/WebCore/html/OffscreenCanvas.idl
Source/WebCore/html/URLSearchParams.idl
Source/WebCore/html/canvas/Path2D.idl
Source/WebCore/html/canvas/WebGLContextEvent.idl
Source/WebCore/html/track/DataCue.idl
Source/WebCore/html/track/TextTrackCue.idl
Source/WebCore/html/track/TrackEvent.idl
Source/WebCore/html/track/VTTCue.idl
Source/WebCore/html/track/VTTRegion.idl
Source/WebCore/page/EventSource.idl
Source/WebCore/page/IntersectionObserver.idl
Source/WebCore/page/IntersectionObserverEntry.idl
Source/WebCore/page/PerformanceObserver.idl
Source/WebCore/page/ResizeObserver.idl
Source/WebCore/page/UndoItem.idl
Source/WebCore/page/WebKitPoint.idl
Source/WebCore/storage/StorageEvent.idl
Source/WebCore/workers/Worker.idl
Source/WebCore/workers/service/ExtendableEvent.idl
Source/WebCore/workers/service/ExtendableMessageEvent.idl
Source/WebCore/workers/service/FetchEvent.idl
Source/WebCore/xml/DOMParser.idl
Source/WebCore/xml/XMLHttpRequest.idl
Source/WebCore/xml/XMLSerializer.idl
Source/WebCore/xml/XPathEvaluator.idl
Source/WebCore/xml/XSLTProcessor.idl