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)
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

index b60f358..14fd01b 100644 (file)
@@ -1,3 +1,218 @@
+2020-06-17  Sam Weinig  <weinig@apple.com>
+
+        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:
+
 2020-06-17  Darryl Pogue  <darryl@dpogue.ca>
 
         IndexedDB: Support IDBFactory databases method
index 10b88b2..9381165 100644 (file)
@@ -26,8 +26,9 @@
 
 [
     Conditional=WIRELESS_PLAYBACK_TARGET,
-    Constructor(DOMString type, optional WebKitPlaybackTargetAvailabilityEventInit eventInitDict),
 ] interface WebKitPlaybackTargetAvailabilityEvent : Event {
+    constructor(DOMString type, optional WebKitPlaybackTargetAvailabilityEventInit eventInitDict);
+
     readonly attribute DOMString availability;
 };
 
index 480bf33..b833c47 100644 (file)
  */
 
 [
-    Constructor(ApplePayErrorCode errorCode, optional ApplePayErrorContactField contactField, optional DOMString message = ""),
-    Conditional=APPLE_PAY,
+    Conditional=APPLE_PAY
 ] interface ApplePayError {
+    constructor(ApplePayErrorCode errorCode, optional ApplePayErrorContactField contactField, optional DOMString message = "");
+
     attribute ApplePayErrorCode code;
     attribute ApplePayErrorContactField? contactField;
     attribute DOMString message;
index 5ce0150..faccb8a 100644 (file)
 [
     ActiveDOMObject,
     Conditional=APPLE_PAY,
-    Constructor(unsigned long version, ApplePayPaymentRequest paymentRequest),
-    ConstructorCallWith=Document,
-    ConstructorMayThrowException,
     EnabledBySetting=ApplePay,
     EnabledForContext,
 ] interface ApplePaySession : EventTarget {
+    [CallWith=Document, MayThrowException] constructor(unsigned long version, ApplePayPaymentRequest paymentRequest);
+
     const unsigned short STATUS_SUCCESS = 0;
     const unsigned short STATUS_FAILURE = 1;
     const unsigned short STATUS_INVALID_BILLING_POSTAL_ADDRESS = 2;
index a67e141..06e8d4d 100644 (file)
 [
     ActiveDOMObject,
     Conditional=APPLE_PAY,
-    Constructor(ApplePaySetupConfiguration configuration),
-    ConstructorCallWith=ScriptExecutionContext,
     EnabledBySetting=ApplePay,
     SecureContext,
 ] interface ApplePaySetup {
+    [CallWith=ScriptExecutionContext] constructor(ApplePaySetupConfiguration configuration);
+
     [CallWith=Document] Promise<sequence<ApplePaySetupFeature>> getSetupFeatures();
     [CallWith=Document] Promise<boolean> begin(sequence<ApplePaySetupFeature> setupFeatures);
 };
index ec5b34f..0ecc0ff 100644 (file)
@@ -33,12 +33,13 @@ dictionary ClipboardItemOptions {
 };
 
 [
-    Constructor(record<DOMString, ClipboardItemData> items, optional ClipboardItemOptions options),
     Exposed=Window,
     EnabledBySetting=AsyncClipboardAPI,
     ImplementationLacksVTable,
     GenerateIsReachable=ReachableFromNavigator
 ] interface ClipboardItem {
+    constructor(record<DOMString, ClipboardItemData> items, optional ClipboardItemOptions options);
+
     readonly attribute FrozenArray<DOMString> types;
     [NewObject] Promise<Blob> getType(DOMString type);
     readonly attribute PresentationStyle presentationStyle;
index 1012e4c..46385e2 100644 (file)
@@ -40,10 +40,11 @@ dictionary MediaKeyMessageEventInit : EventInit {
 
 [
     Conditional=ENCRYPTED_MEDIA,
-    Constructor(DOMString type, MediaKeyMessageEventInit eventInitDict),
     EnabledAtRuntime=EncryptedMediaAPI,
     DisabledByQuirk=hasBrokenEncryptedMediaAPISupport,
 ] interface MediaKeyMessageEvent : Event {
+    constructor(DOMString type, MediaKeyMessageEventInit eventInitDict);
+
     readonly attribute MediaKeyMessageType messageType;
     readonly attribute ArrayBuffer message;
 };
index fb2a71a..f393b2a 100644 (file)
 
 [
     Conditional=LEGACY_ENCRYPTED_MEDIA,
-    Constructor(DOMString type, optional WebKitMediaKeyMessageEventInit eventInitDict),
     EnabledAtRuntime=LegacyEncryptedMediaAPI,
 ] interface WebKitMediaKeyMessageEvent : Event {
+    constructor(DOMString type, optional WebKitMediaKeyMessageEventInit eventInitDict);
+
     readonly attribute Uint8Array message;
     readonly attribute DOMString destinationURL;
 };
index 22a3d41..05e72f6 100644 (file)
 
 [
     Conditional=LEGACY_ENCRYPTED_MEDIA,
-    Constructor(DOMString type, optional WebKitMediaKeyNeededEventInit eventInitDict),
     EnabledAtRuntime=LegacyEncryptedMediaAPI,
 ] interface WebKitMediaKeyNeededEvent : Event {
+    constructor(DOMString type, optional WebKitMediaKeyNeededEventInit eventInitDict);
+
     readonly attribute Uint8Array initData;
 };
 
index b909329..4b1fa09 100644 (file)
  
 [
     Conditional=LEGACY_ENCRYPTED_MEDIA,
-    Constructor(DOMString keySystem),
-    ConstructorMayThrowException,
     EnabledAtRuntime=LegacyEncryptedMediaAPI,
 ] interface WebKitMediaKeys {
+    [MayThrowException] constructor(DOMString keySystem);
+
     [CallWith=ScriptExecutionContext, MayThrowException] WebKitMediaKeySession createSession(DOMString type, Uint8Array initData);
     static boolean isTypeSupported(DOMString keySystem, optional DOMString type);
     readonly attribute DOMString keySystem;
index fe1f1e8..e470550 100644 (file)
@@ -33,9 +33,9 @@ typedef (sequence<sequence<ByteString>> or record<ByteString, ByteString>) Heade
     Exposed=(Window,Worker),
     ImplementationLacksVTable,
     InterfaceName=Headers,
-    Constructor(optional HeadersInit init),
-    ConstructorMayThrowException,
 ] interface FetchHeaders {
+    [MayThrowException] constructor(optional HeadersInit init);
+
     [MayThrowException] void append(ByteString name, ByteString value);
     [MayThrowException, ImplementedAs=remove] void delete(ByteString name);
     [MayThrowException] ByteString? get(ByteString name);
index dd2ec8f..bd4b371 100644 (file)
@@ -34,14 +34,13 @@ typedef (Blob or BufferSource or DOMFormData or URLSearchParams or ReadableStrea
 
 [
     ActiveDOMObject,
-    Constructor(RequestInfo input, optional FetchRequestInit init),
-    ConstructorMayThrowException,
-    ConstructorCallWith=ScriptExecutionContext,
     EnabledAtRuntime=FetchAPI,
     Exposed=(Window,Worker),
     GenerateIsReachable=Impl,
     InterfaceName=Request,
 ] interface FetchRequest {
+    [CallWith=ScriptExecutionContext, MayThrowException] constructor(RequestInfo input, optional FetchRequestInit init);
+
     readonly attribute ByteString method;
     [ImplementedAs=urlString] readonly attribute USVString url;
     readonly attribute FetchHeaders headers; // FIXME: Should be [SameObject].
index 43989c3..60bdeb1 100644 (file)
@@ -39,14 +39,13 @@ dictionary FetchResponseInit {
 
 [
     ActiveDOMObject,
-    Constructor(optional BodyInit? body = null, optional FetchResponseInit init),
-    ConstructorCallWith=ScriptExecutionContext,
-    ConstructorMayThrowException,
     EnabledAtRuntime=FetchAPI,
     ExportMacro=WEBCORE_EXPORT,
     Exposed=(Window,Worker),
     InterfaceName=Response,
 ] interface FetchResponse {
+    [CallWith=ScriptExecutionContext, MayThrowException] constructor(optional BodyInit? body = null, optional FetchResponseInit init);
+
     [CallWith=ScriptExecutionContext, NewObject] static FetchResponse error();
     [CallWith=ScriptExecutionContext, MayThrowException, NewObject] static FetchResponse redirect(USVString url, optional unsigned short status = 302);
 
index 87766e5..9661876 100644 (file)
 
 [
     Conditional=GAMEPAD,
-    Constructor(DOMString type, optional GamepadEventInit eventInitDict),
     EnabledAtRuntime=Gamepads,
 ] interface GamepadEvent : Event {
+    constructor(DOMString type, optional GamepadEventInit eventInitDict);
+
     readonly attribute Gamepad? gamepad;
 };
 
index d897a78..4fa934f 100644 (file)
  */
 
 [
-    Constructor(),
     EnabledAtRuntime=HighlightAPI,
     ImplementationLacksVTable
 ] interface HighlightMap {
+    constructor();
+
     maplike<DOMString, HighlightRangeGroup>;
 };
index 4fc0013..1b082bd 100644 (file)
  */
 
 [
-    Constructor(StaticRange range),
     EnabledAtRuntime=HighlightAPI,
     ImplementationLacksVTable
 ] interface HighlightRangeGroup {
+    constructor(StaticRange range);
+
     setlike<StaticRange>;
     // FIXME: Add readonly attribute CSSStyleDeclaration style;
 };
index e696e53..0fe1ca3 100644 (file)
@@ -26,8 +26,9 @@
 // FIXME: This should be exposed to workers as well.
 [
     Conditional=INDEXED_DATABASE,
-    Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict),
 ] interface IDBVersionChangeEvent : Event {
+    constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict);
+
     readonly attribute unsigned long long oldVersion;
     readonly attribute unsigned long long? newVersion;
 };
index c87a0b2..9296069 100644 (file)
@@ -26,10 +26,11 @@ typedef double DOMHighResTimeStamp;
 
 [
     Conditional=MEDIA_STREAM,
-    Constructor(DOMString type, BlobEventInit eventInitDict),
     EnabledAtRuntime=MediaRecorder,
     Exposed=Window
 ]  interface BlobEvent : Event {
+    constructor(DOMString type, BlobEventInit eventInitDict);
+
     // FIXME: Implement these:
     [SameObject] readonly attribute Blob data;
     // readonly attribute DOMHighResTimeStamp timecode;
index 9781e24..4baebf2 100644 (file)
@@ -27,12 +27,11 @@ enum RecordingState { "inactive", "recording", "paused" };
 [
     ActiveDOMObject,
     Conditional=MEDIA_STREAM,
-    Constructor(MediaStream stream, optional MediaRecorderOptions options),
-    ConstructorCallWith=Document,
-    ConstructorMayThrowException,
     EnabledAtRuntime=MediaRecorder,
     Exposed=Window
 ] interface MediaRecorder : EventTarget {
+    [CallWith=Document, MayThrowException] constructor(MediaStream stream, optional MediaRecorderOptions options);
+
     readonly attribute RecordingState state;
     readonly attribute MediaStream stream;
     // FIXME: Implement these:
index b3d191d..add0d10 100644 (file)
@@ -28,9 +28,10 @@ dictionary MediaRecorderErrorEventInit : EventInit {
 
 [
     Conditional=MEDIA_STREAM,
-    Constructor(DOMString type, MediaRecorderErrorEventInit eventInitDict),
     Exposed=Window,
     EnabledAtRuntime=MediaRecorder
 ] interface MediaRecorderErrorEvent : Event {
+    constructor(DOMString type, MediaRecorderErrorEventInit eventInitDict);
+
     [SameObject] readonly attribute DOMException error;
 };
index 0ac9007..0210314 100644 (file)
@@ -25,9 +25,9 @@
 
 [
     Conditional=MEDIA_SESSION,
-    Constructor,
-    ConstructorCallWith=ScriptExecutionContext,
 ] interface MediaRemoteControls : EventTarget {
+    [CallWith=ScriptExecutionContext] constructor();
+
     attribute boolean previousTrackEnabled;
     attribute boolean nextTrackEnabled;
 
index 1743061..75fae90 100644 (file)
 
 [
     Conditional=MEDIA_SESSION,
-    ConstructorCallWith=ScriptExecutionContext,
-    CustomConstructor(optional MediaSessionKind kind = "content"),
     ExportMacro=WEBCORE_EXPORT,
     ImplementationLacksVTable,
 ] interface MediaSession {
+    [CallWith=ScriptExecutionContext] constructor(optional MediaSessionKind kind = "content");
+
     readonly attribute MediaSessionKind kind;
     readonly attribute MediaRemoteControls? controls;
 
index 8479eef..412a73e 100644 (file)
@@ -42,10 +42,10 @@ enum ReadyState {
 [
     ActiveDOMObject,
     Conditional=MEDIA_SOURCE,
-    Constructor,
-    ConstructorCallWith=ScriptExecutionContext,
     EnabledBySetting=MediaSource,
 ] interface MediaSource : EventTarget {
+    [CallWith=ScriptExecutionContext] constructor();
+
     // All the source buffers created by this object.
     readonly attribute SourceBufferList sourceBuffers;
 
index 1bedaf0..95deb74 100644 (file)
 [
     ActiveDOMObject,
     Conditional=MEDIA_STREAM,
-    Constructor,
-    Constructor(MediaStream stream),
-    Constructor(sequence<MediaStreamTrack> tracks),
-    ConstructorCallWith=Document,
     ExportToWrappedFunction,
     PrivateIdentifier,
     PublicIdentifier
 ] interface MediaStream : EventTarget {
+    [CallWith=Document] constructor();
+    [CallWith=Document] constructor(MediaStream stream);
+    [CallWith=Document] constructor(sequence<MediaStreamTrack> tracks);
 
     readonly attribute DOMString id;
 
index e0504b6..1eb9a56 100644 (file)
@@ -24,8 +24,9 @@
 
 [
     Conditional=MEDIA_STREAM,
-    Constructor(DOMString type, MediaStreamTrackEventInit eventInitDict),
 ] interface MediaStreamTrackEvent : Event {
+    constructor(DOMString type, MediaStreamTrackEventInit eventInitDict);
+
     // FIXME: missing [SameObject]
     readonly attribute MediaStreamTrack track;
 };
index 72fce6a..486c8c0 100644 (file)
  */
 
 [
-    Constructor(optional DOMString constraint = "", optional DOMString message = ""),
     ImplementationLacksVTable,
     Conditional=MEDIA_STREAM,
 ] exception OverconstrainedError {
+    constructor(optional DOMString constraint = "", optional DOMString message = "");
+
     readonly attribute DOMString message;
     readonly attribute DOMString constraint;
     readonly attribute DOMString name;
index ceddfa7..ea7c4a8 100644 (file)
 */
 
 [
-    Conditional=MEDIA_STREAM,
-    Constructor(DOMString type, optional OverconstrainedErrorEventInit eventInitDict),
+    Conditional=MEDIA_STREAM
 ] interface OverconstrainedErrorEvent : Event {
+    constructor(DOMString type, optional OverconstrainedErrorEventInit eventInitDict);
+
     readonly attribute OverconstrainedError? error;
 };
 
index 2e85ee4..8ada070 100644 (file)
 
 [
     Conditional=WEB_RTC,
-    Constructor(DOMString type, optional RTCDTMFToneChangeEventInit eventInitDict),
-    EnabledAtRuntime=PeerConnection,
+    EnabledAtRuntime=PeerConnection
 ] interface RTCDTMFToneChangeEvent : Event {
+    constructor(DOMString type, optional RTCDTMFToneChangeEventInit eventInitDict);
+
     readonly attribute DOMString tone;
 };
 
index 3ced60e..a9b06bd 100644 (file)
 
 [
     Conditional=WEB_RTC,
-    Constructor(DOMString type, RTCDataChannelEventInit eventInitDict),
-    EnabledAtRuntime=PeerConnection,
+    EnabledAtRuntime=PeerConnection
 ] interface RTCDataChannelEvent : Event {
+    constructor(DOMString type, RTCDataChannelEventInit eventInitDict);
+
     readonly attribute RTCDataChannel channel;
 };
 
index 47d44b7..4797fe5 100644 (file)
 
 [
     Conditional=WEB_RTC,
-    Constructor(RTCIceCandidateInit candidateInitDict),
-    ConstructorMayThrowException,
     EnabledAtRuntime=PeerConnection,
     ImplementationLacksVTable,
     PrivateIdentifier,
     PublicIdentifier
 ] interface RTCIceCandidate {
+    [MayThrowException] constructor(RTCIceCandidateInit candidateInitDict);
+
     readonly attribute DOMString candidate;
     readonly attribute DOMString? sdpMid;
     readonly attribute unsigned short? sdpMLineIndex;
index 4bd1dac..b7ac9f5 100644 (file)
@@ -73,11 +73,11 @@ typedef (object or DOMString) AlgorithmIdentifier;
 [
     ActiveDOMObject,
     Conditional=WEB_RTC,
-    ConstructorCallWith=Document,
     EnabledAtRuntime=PeerConnection,
     ExportMacro=WEBCORE_EXPORT,
-    JSBuiltinConstructor
 ] interface RTCPeerConnection : EventTarget {
+    [JSBuiltin, CallWith=Document] constructor();
+
     // JS built-in constructor handles the optional RTCConfiguration
     [PrivateIdentifier, CallWith=Document, MayThrowException] void initializeWith(RTCConfiguration configuration);
 
index a1059b6..76e7d82 100644 (file)
@@ -30,9 +30,10 @@ dictionary RTCPeerConnectionIceEventInit : EventInit {
 
 [
     Conditional=WEB_RTC,
-    Constructor(DOMString type, optional RTCPeerConnectionIceEventInit eventInitDict),
     EnabledAtRuntime=PeerConnection
 ] interface RTCPeerConnectionIceEvent : Event {
+    constructor(DOMString type, optional RTCPeerConnectionIceEventInit eventInitDict);
+
     readonly attribute RTCIceCandidate? candidate;
     readonly attribute DOMString? url;
 };
index 9279055..2950d15 100644 (file)
 
 [
     Conditional=WEB_RTC,
-    Constructor(RTCSessionDescriptionInit descriptionInitDict),
     EnabledAtRuntime=PeerConnection,
     ImplementationLacksVTable,
     PrivateIdentifier,
-    PublicIdentifier,
+    PublicIdentifier
 ] interface RTCSessionDescription {
+    constructor(RTCSessionDescriptionInit descriptionInitDict);
+
     readonly attribute RTCSdpType type;
     readonly attribute DOMString sdp;
 
index 606d20e..720d888 100644 (file)
 
 [
     Conditional=WEB_RTC,
-    Constructor(DOMString type, RTCTrackEventInit eventInitDict),
-    EnabledAtRuntime=PeerConnection,
+    EnabledAtRuntime=PeerConnection
 ] interface RTCTrackEvent : Event {
+    constructor(DOMString type, RTCTrackEventInit eventInitDict);
+
     readonly attribute RTCRtpReceiver receiver;
     readonly attribute MediaStreamTrack track;
     [CachedAttribute, SameObject] readonly attribute FrozenArray<MediaStream> streams;
index 453da29..8c67f77 100644 (file)
@@ -33,9 +33,9 @@
     Conditional=NOTIFICATIONS,
     ActiveDOMObject,
     ExportMacro=WEBCORE_EXPORT,
-    Constructor(DOMString title, optional NotificationOptions options),
-    ConstructorCallWith=Document,
 ] interface Notification : EventTarget {
+    [CallWith=Document] constructor(DOMString title, optional NotificationOptions options);
+
     [CallWith=Document] static readonly attribute NotificationPermission permission;
     [CallWith=Document] static void requestPermission(optional NotificationPermissionCallback? deprecatedCallback); // FIXME: This should return a Promise<NotificationPermission>.
 
index 99a7512..bca6a06 100644 (file)
 
 [
     Conditional=PAYMENT_REQUEST,
-    Constructor(DOMString type, optional MerchantValidationEventInit eventInitDict),
-    ConstructorCallWith=Document,
-    ConstructorMayThrowException,
     EnabledBySetting=PaymentRequest,
     Exposed=Window,
     SecureContext,
 ] interface MerchantValidationEvent : Event {
+    [CallWith=Document, MayThrowException] constructor(DOMString type, optional MerchantValidationEventInit eventInitDict);
+
     readonly attribute DOMString methodName;
     readonly attribute USVString validationURL;
     [MayThrowException] void complete(Promise<any> merchantSessionPromise);
index 8b0e4a1..1e76139 100644 (file)
 
 [
     Conditional=PAYMENT_REQUEST,
-    Constructor(DOMString type, optional PaymentMethodChangeEventInit eventInitDict),
     EnabledBySetting=PaymentRequest,
     Exposed=Window,
     JSCustomMarkFunction,
     SecureContext,
 ] interface PaymentMethodChangeEvent : PaymentRequestUpdateEvent {
+    constructor(DOMString type, optional PaymentMethodChangeEventInit eventInitDict);
+
     readonly attribute DOMString methodName;
     [CustomGetter] readonly attribute object? methodDetails;
 };
index 918c108..3174d57 100644 (file)
 [
     ActiveDOMObject,
     Conditional=PAYMENT_REQUEST,
-    Constructor(sequence<PaymentMethodData> methodData, PaymentDetailsInit details, optional PaymentOptions options),
-    ConstructorCallWith=Document,
-    ConstructorMayThrowException,
     EnabledBySetting=PaymentRequest,
     EnabledForContext,
     SecureContext,
 ] interface PaymentRequest : EventTarget {
+    [CallWith=Document, MayThrowException] constructor(sequence<PaymentMethodData> methodData, PaymentDetailsInit details, optional PaymentOptions options);
+
     [CallWith=Document] Promise<PaymentResponse> show(optional Promise<PaymentDetailsUpdate> detailsPromise);
     Promise<void> abort();
     [CallWith=Document] Promise<boolean> canMakePayment();
index 15f8db9..baf5017 100644 (file)
 
 [
     Conditional=PAYMENT_REQUEST,
-    Constructor(DOMString type, optional PaymentRequestUpdateEventInit eventInitDict),
     EnabledBySetting=PaymentRequest,
     Exposed=Window,
     SecureContext
 ] interface PaymentRequestUpdateEvent : Event {
+    constructor(DOMString type, optional PaymentRequestUpdateEventInit eventInitDict);
+
     [MayThrowException] void updateWith(Promise<PaymentDetailsUpdate> detailsPromise);
 };
index ad36c49..c0d2913 100644 (file)
@@ -34,8 +34,9 @@
 [
     Conditional=PICTURE_IN_PICTURE_API,
     EnabledBySetting=PictureInPictureAPI,
-    Constructor(DOMString type, EnterPictureInPictureEventInit eventInitDict),
     Exposed=Window
 ] interface EnterPictureInPictureEvent : Event {
+    constructor(DOMString type, EnterPictureInPictureEventInit eventInitDict);
+
     [SameObject] readonly attribute PictureInPictureWindow pictureInPictureWindow;
 };
index e781f52..5b8d293 100644 (file)
@@ -25,9 +25,9 @@
  
 [
     Conditional=SPEECH_SYNTHESIS,
-    ConstructorCallWith=ScriptExecutionContext,
-    Constructor(optional DOMString text)
 ] interface SpeechSynthesisUtterance : EventTarget {
+    [CallWith=ScriptExecutionContext] constructor(optional DOMString text);
+
     attribute DOMString text;
     attribute DOMString lang;
     attribute SpeechSynthesisVoice? voice; // FIXME: should not be nullable.
index f8d0cf7..9b55d31 100644 (file)
 
 [
     JSBuiltin,
-    Constructor,
     Conditional=STREAMS_API,
     Exposed=(Window,Worker),
 ] interface ByteLengthQueuingStrategy {
+    constructor();
+
     double size();
 };
index 11cba39..1c690d9 100644 (file)
 
 [
     JSBuiltin,
-    Constructor,
     Conditional=STREAMS_API,
     Exposed=(Window,Worker),
 ] interface CountQueuingStrategy {
+    constructor();
+
     double size();
 };
index 002c1af..3da8057 100644 (file)
 
 [
     Conditional=STREAMS_API,
-    Constructor(ReadableStream stream, any underlyingByteSource, unsigned long highWaterMark),
     Exposed=(Window,Worker),
     JSBuiltin,
     PrivateIdentifier
 ] interface ReadableByteStreamController {
+    constructor(ReadableStream stream, any underlyingByteSource, unsigned long highWaterMark);
+
     [NotEnumerable] void enqueue(optional any chunk);
     [NotEnumerable] void close();
     [NotEnumerable] void error(optional any error);
index 227897c..1d49d2e 100644 (file)
 
 [
     Conditional=STREAMS_API,
-    Constructor(optional any underlyingSource, optional any options),
     Exposed=(Window,Worker),
     JSBuiltin,
     PrivateIdentifier,
     PublicIdentifier
 ] interface ReadableStream {
+    constructor(optional any underlyingSource, optional any options);
+
     [NotEnumerable] Promise<any> cancel(optional any reason);
     [NotEnumerable] Object getReader(optional any options);
     [NotEnumerable] Promise<any> pipeTo(any streams, optional any options);
index 4b1a522..27edad7 100644 (file)
 
 [
     Conditional=STREAMS_API,
-    Constructor(ReadableStream stream),
     Exposed=(Window,Worker),
     JSBuiltin,
     PrivateIdentifier
 ] interface ReadableStreamBYOBReader {
+    constructor(ReadableStream stream);
+
     [NotEnumerable] Promise<any> read(optional any view);
     [NotEnumerable] Promise<any> cancel(optional any reason);
     [NotEnumerable] void releaseLock();
index bb67065..70d9774 100644 (file)
 
 [
     Conditional=STREAMS_API,
-    Constructor(ReadableByteStreamController controller, TypedArray view),
     Exposed=(Window,Worker),
     JSBuiltin,
     PrivateIdentifier
 ] interface ReadableStreamBYOBRequest {
+    constructor(ReadableByteStreamController controller, TypedArray view);
+
     [NotEnumerable] void respond(optional any bytesWritten);
     [NotEnumerable] void respondWithNewView(optional any view);
 
index 14c0422..56ef764 100644 (file)
 
 [
     Conditional=STREAMS_API,
-    Constructor(ReadableStream stream, any underlyingSource, unsigned long size, unsigned long highWaterMark),
     Exposed=(Window,Worker),
     JSBuiltin,
     PrivateIdentifier
 ] interface ReadableStreamDefaultController {
+    constructor(ReadableStream stream, any underlyingSource, unsigned long size, unsigned long highWaterMark);
+
     [NotEnumerable] void enqueue(optional any chunk);
     [NotEnumerable] void close();
     [NotEnumerable] void error(optional any error);
index 1fa2b79..94c5c19 100644 (file)
 
 [
     Conditional=STREAMS_API,
-    Constructor(ReadableStream stream),
     Exposed=(Window,Worker),
     JSBuiltin,
     PrivateIdentifier
 ] interface ReadableStreamDefaultReader {
+    constructor(ReadableStream stream);
+
     [NotEnumerable] Promise<any> read();
     [NotEnumerable] Promise<any> cancel(optional any reason);
     [NotEnumerable] void releaseLock();
index b200b33..376820c 100644 (file)
 
 [
     Conditional=STREAMS_API,
-    Constructor,
     EnabledAtRuntime=WritableStreamAPI,
     JSBuiltin
 ] interface WritableStream {
+    constructor();
+
     Promise<any> abort(optional any reason);
     Promise<any> close();
     Promise<any> write(any chunk);
index 12124a3..e711839 100644 (file)
@@ -33,13 +33,12 @@ enum AudioContextState {
 [
     ActiveDOMObject,
     Conditional=WEB_AUDIO,
-    Constructor,
-    ConstructorCallWith=Document,
-    ConstructorMayThrowException,
     EnabledBySetting=WebAudio,
     ExportMacro=WEBCORE_EXPORT,
     InterfaceName=webkitAudioContext,
 ] interface AudioContext : EventTarget {
+    [CallWith=Document, MayThrowException] constructor();
+
     // All rendered audio ultimately connects to destination, which represents the audio hardware.
     readonly attribute AudioDestinationNode destination;
 
index c6e0d74..f6ecb1a 100644 (file)
@@ -25,9 +25,7 @@
 [
     Conditional=WEB_AUDIO,
     JSGenerateToJSObject,
-    Constructor(unsigned long numberOfChannels, unsigned long numberOfFrames, unrestricted float sampleRate),
-    ConstructorMayThrowException,
-    ConstructorCallWith=ScriptExecutionContext,
     InterfaceName=webkitOfflineAudioContext
 ] interface OfflineAudioContext : AudioContext {
+    [CallWith=ScriptExecutionContext, MayThrowException] constructor(unsigned long numberOfChannels, unsigned long numberOfFrames, unrestricted float sampleRate);
 };
index d4d3d00..5d429b8 100644 (file)
@@ -26,7 +26,8 @@
 
 [
     Conditional=WEBGPU,
-    Constructor(),
     EnabledAtRuntime=WebGPU,
     ImplementationLacksVTable
-] interface GPUOutOfMemoryError {};
+] interface GPUOutOfMemoryError {
+    constructor();
+};
index 2d3c6a1..ed85c11 100644 (file)
@@ -35,9 +35,10 @@ typedef (GPUOutOfMemoryError or GPUValidationError) GPUError;
 
 [
     Conditional=WEBGPU,
-    Constructor(DOMString type, GPUUncapturedErrorEventInit gpuUncapturedErrorEventInitDict),
     EnabledAtRuntime=WebGPU,
     Exposed=Window
 ] interface GPUUncapturedErrorEvent : Event {
+    constructor(DOMString type, GPUUncapturedErrorEventInit gpuUncapturedErrorEventInitDict);
+
     readonly attribute GPUError error;
 };
index 5e13c18..6200750 100644 (file)
 
 [
     Conditional=WEBGPU,
-    Constructor(DOMString message),
     EnabledAtRuntime=WebGPU,
     ImplementationLacksVTable
 ] interface GPUValidationError {
+    constructor(DOMString message);
+
     readonly attribute DOMString message;
 };
index eeccfeb..1d6c8a5 100644 (file)
  */
 
 [
-    Constructor(DOMString type, optional CloseEventInit eventInitDict),
     Exposed=(Window,Worker),
 ] interface CloseEvent : Event {
+    constructor(DOMString type, optional CloseEventInit eventInitDict);
+
     readonly attribute boolean wasClean;
     readonly attribute unsigned short code;
     readonly attribute USVString reason;
index 6570c24..e0192c8 100644 (file)
 
 [
     ActiveDOMObject,
-    Constructor(USVString url, optional sequence<DOMString> protocols = []),
-    Constructor(USVString url, DOMString protocol),
-    ConstructorMayThrowException,
-    ConstructorCallWith=ScriptExecutionContext,
     Exposed=(Window,Worker),
     EnabledAtRuntime=WebSocket
 ] interface WebSocket : EventTarget {
+    [CallWith=ScriptExecutionContext, MayThrowException] constructor(USVString url, optional sequence<DOMString> protocols = []);
+    [CallWith=ScriptExecutionContext, MayThrowException] constructor(USVString url, DOMString protocol);
+
     readonly attribute USVString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
     readonly attribute USVString url;
 
index e00cad7..ccbe8e4 100644 (file)
     Conditional=WEBXR,
     SecureContext,
     Exposed=Window,
-    Constructor(optional DOMPointInit position, optional DOMPointInit orientation),
-    ConstructorMayThrowException,
     ImplementationLacksVTable,
     InterfaceName=XRRigidTransform
 ] interface WebXRRigidTransform {
+    [MayThrowException] constructor(optional DOMPointInit position, optional DOMPointInit orientation);
+
     [SameObject] readonly attribute DOMPointReadOnly position;
     [SameObject] readonly attribute DOMPointReadOnly orientation;
     readonly attribute Float32Array matrix;
index dba0810..727d43f 100644 (file)
@@ -34,11 +34,11 @@ typedef (WebGLRenderingContext) WebXRWebGLRenderingContext;
     Conditional=WEBXR,
     SecureContext,
     Exposed=Window,
-    Constructor(WebXRSession session, WebXRWebGLRenderingContext context, optional XRWebGLLayerInit layerInit),
-    ConstructorMayThrowException,
     ImplementationLacksVTable,
     InterfaceName=XRWebGLLayer
 ] interface WebXRWebGLLayer {
+    [MayThrowException] constructor(WebXRSession session, WebXRWebGLRenderingContext context, optional XRWebGLLayerInit layerInit);
+
     // Attributes
     readonly attribute boolean antialias;
     readonly attribute boolean ignoreDepthValues;
index 9b48a60..739cc19 100644 (file)
@@ -36,8 +36,9 @@
     Conditional=WEBXR,
     SecureContext,
     Exposed=Window,
-    Constructor(DOMString type, XRInputSourceEventInit eventInitDict),
 ] interface XRInputSourceEvent : Event {
+    constructor(DOMString type, XRInputSourceEventInit eventInitDict);
+
     [SameObject] readonly attribute WebXRFrame frame;
     [SameObject] readonly attribute WebXRInputSource inputSource;
 };
index 68a4659..b170bac 100644 (file)
@@ -37,8 +37,9 @@
     Conditional=WEBXR,
     SecureContext,
     Exposed=Window,
-    Constructor(DOMString type, XRInputSourcesChangeEventInit eventInitDict),
 ] interface XRInputSourcesChangeEvent : Event {
+    constructor(DOMString type, XRInputSourcesChangeEventInit eventInitDict);
+
     [SameObject] readonly attribute WebXRSession session;
     [SameObject] readonly attribute FrozenArray<WebXRInputSource> added;
     [SameObject] readonly attribute FrozenArray<WebXRInputSource> removed;
index 169c14c..c91e8fb 100644 (file)
@@ -36,8 +36,9 @@
     Conditional=WEBXR,
     SecureContext,
     Exposed=Window,
-    Constructor(DOMString type, XRReferenceSpaceEventInit eventInitDict),
 ] interface XRReferenceSpaceEvent : Event {
+    constructor(DOMString type, XRReferenceSpaceEventInit eventInitDict);
+
     [SameObject] readonly attribute WebXRReferenceSpace referenceSpace;
     [SameObject] readonly attribute WebXRRigidTransform transform;
 };
index 471933f..0694b02 100644 (file)
@@ -35,7 +35,8 @@
     Conditional=WEBXR,
     SecureContext,
     Exposed=Window,
-    Constructor(DOMString type, XRSessionEventInit eventInitDict),
 ] interface XRSessionEvent : Event {
+    constructor(DOMString type, XRSessionEventInit eventInitDict);
+
     [SameObject] readonly attribute WebXRSession session;
 };
index 9200996..b9691b4 100644 (file)
@@ -26,8 +26,9 @@
 [
     EnabledAtRuntime=WebAnimations,
     Exposed=Window,
-    Constructor(DOMString type, optional AnimationPlaybackEventInit eventInitDict)
 ] interface AnimationPlaybackEvent : Event {
+    constructor(DOMString type, optional AnimationPlaybackEventInit eventInitDict);
+
     [ImplementedAs=bindingsCurrentTime] readonly attribute double? currentTime;
     [ImplementedAs=bindingsTimelineTime] readonly attribute double? timelineTime;
 };
index 678448b..b086b2a 100644 (file)
@@ -26,7 +26,6 @@
 [
     EnabledAtRuntime=WebAnimations,
     Exposed=Window,
-    ConstructorCallWith=Document,
-    Constructor (optional DocumentTimelineOptions options)
 ] interface DocumentTimeline : AnimationTimeline {
+    [CallWith=Document] constructor(optional DocumentTimelineOptions options);
 };
index ddae894..9ec20d4 100644 (file)
@@ -29,11 +29,10 @@ typedef USVString CSSOMString;
     EnabledAtRuntime=WebAnimations,
     Exposed=Window,
     JSGenerateToNativeObject,
-    ConstructorMayThrowException,
-    ConstructorCallWith=GlobalObject,
-    Constructor(Element? target, object? keyframes, optional (unrestricted double or KeyframeEffectOptions) options),
-    Constructor(KeyframeEffect source)
 ] interface KeyframeEffect : AnimationEffect {
+    [CallWith=GlobalObject, MayThrowException] constructor(Element? target, object? keyframes, optional (unrestricted double or KeyframeEffectOptions) options);
+    [CallWith=GlobalObject, MayThrowException] constructor(KeyframeEffect source);
+
     attribute Element? target;
     [MayThrowException] attribute CSSOMString? pseudoElement;
     [EnabledAtRuntime=WebAnimationsCompositeOperations] attribute IterationCompositeOperation iterationComposite;
index 0ce381a..14c7917 100644 (file)
@@ -40,10 +40,11 @@ enum AnimationReplaceState {
     ActiveDOMObject,
     EnabledAtRuntime=WebAnimations,
     InterfaceName=Animation,
-    CustomConstructor(),
     CustomToJSObject,
     ExportMacro=WEBCORE_EXPORT
 ] interface WebAnimation : EventTarget {
+    [Custom] constructor();
+
     attribute DOMString id;
     [ImplementedAs=bindingsEffect] attribute AnimationEffect? effect;
     [RuntimeConditionallyReadWrite=WebAnimationsMutableTimelines] attribute AnimationTimeline? timeline;
index 65739b2..b7862bd 100644 (file)
@@ -1474,7 +1474,7 @@ sub ShouldGenerateToJSDeclaration
     return 0 if $interface->extendedAttributes->{CustomProxyToJSObject};
     return 1 if (!$hasParent or $interface->extendedAttributes->{JSGenerateToJSObject} or $interface->extendedAttributes->{CustomToJSObject});
     return 1 if $interface->parentType && $interface->parentType->name eq "EventTarget";
-    return 1 if $interface->extendedAttributes->{Constructor} or $interface->extendedAttributes->{NamedConstructor};
+    return 1 if @{$interface->constructors} > 0 && !HasCustomConstructor($interface);
     return 0;
 }
 
@@ -1610,7 +1610,7 @@ sub GetFullyQualifiedImplementationCallName
         return "WebCore::${implementedBy}::${implementationName}";
     }
     
-    if ($property->isStatic || $property->extendedAttributes->{Constructor} || $property->extendedAttributes->{NamedConstructor}) {
+    if ($property->isStatic || $property->isConstructor) {
         return $interface->type->name . "::${implementationName}";
     }
     
@@ -5877,21 +5877,25 @@ sub GenerateParametersCheck
     my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interface);
     my $numArguments = @{$operation->arguments};
     my $conditional = $operation->extendedAttributes->{Conditional};
-    my $isConstructor = $operation->extendedAttributes->{Constructor} || $operation->extendedAttributes->{NamedConstructor};
+    my $isConstructor = $operation->isConstructor;
 
     my $functionName = GetFullyQualifiedImplementationCallName($interface, $operation, $functionImplementationName, "impl", $conditional);
     
     my @arguments = ();
     AddAdditionalArgumentsForImplementationCall(\@arguments, $interface, $operation, "impl", "*lexicalGlobalObject", "*callFrame", "*castedThis");
     
+    my $callWith = $operation->extendedAttributes->{CallWith};
     my $quotedFunctionName;
     if (!$isConstructor) {
         my $name = $operation->name;
         $quotedFunctionName = "\"$name\"";
-        push(@arguments, GenerateCallWithUsingPointers($operation->extendedAttributes->{CallWith}, \@$outputArray, "JSValue::encode(jsUndefined())", "*castedThis"));
+        push(@arguments, GenerateCallWithUsingPointers($callWith, \@$outputArray, "JSValue::encode(jsUndefined())", "*castedThis"));
     } else {
         $quotedFunctionName = "nullptr";
-        push(@arguments, GenerateConstructorCallWithUsingPointers($operation->extendedAttributes->{ConstructorCallWith}, \@$outputArray, $visibleInterfaceName, "*castedThis"));
+        unless ($callWith) {
+            $callWith = $operation->extendedAttributes->{ConstructorCallWith};
+        }
+        push(@arguments, GenerateConstructorCallWithUsingPointers($callWith, \@$outputArray, $visibleInterfaceName, "*castedThis"));
     }
 
     my $argumentIndex = 0;
@@ -7371,9 +7375,9 @@ sub GeneratePrototypeDeclaration
 sub GetConstructorTemplateClassName
 {
     my $interface = shift;
+    return "JSDOMBuiltinConstructor" if HasJSBuiltinConstructor($interface);
     return "JSDOMConstructorNotConstructable" if $interface->extendedAttributes->{NamedConstructor};
     return "JSDOMConstructorNotConstructable" unless IsConstructable($interface);
-    return "JSDOMBuiltinConstructor" if IsJSBuiltinConstructor($interface);
     return "JSDOMConstructor";
 }
 
@@ -7429,13 +7433,13 @@ sub GenerateConstructorDefinition
 {
     my ($outputArray, $className, $protoClassName, $visibleInterfaceName, $interface, $generatingNamedConstructor, $operation) = @_;
 
-    return if IsJSBuiltinConstructor($interface);
+    return if HasJSBuiltinConstructor($interface);
 
     my $interfaceName = $interface->type->name;
     my $constructorClassName = $generatingNamedConstructor ? "${className}NamedConstructor" : "${className}Constructor";
 
     if (IsConstructable($interface)) {
-        if ($interface->extendedAttributes->{CustomConstructor}) {
+        if (HasCustomConstructor($interface)) {
             push(@$outputArray, "template<> JSC::EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)\n");
             push(@$outputArray, "{\n");
             push(@$outputArray, "    ASSERT(callFrame);\n");
@@ -7455,7 +7459,7 @@ sub GenerateConstructorDefinition
             push(@$outputArray, "    auto* castedThis = jsCast<${constructorClassName}*>(callFrame->jsCallee());\n");
             push(@$outputArray, "    ASSERT(castedThis);\n");
 
-             if ($interface->extendedAttributes->{ConstructorEnabledBySetting}) {
+             if ($operation->extendedAttributes->{EnabledBySetting}) {
                  my $runtimeEnableConditionalString = GenerateRuntimeEnableConditionalString($interface, $operation, "lexicalGlobalObject");
                  push(@$outputArray, "    if (!${runtimeEnableConditionalString}) {\n");
                  push(@$outputArray, "        throwTypeError(lexicalGlobalObject, throwScope, \"Illegal constructor\"_s);\n");
@@ -7469,8 +7473,8 @@ sub GenerateConstructorDefinition
             my $functionString = GenerateParametersCheck($outputArray, $operation, $interface, $functionImplementationName, "    ");
 
             push(@$outputArray, "    auto object = ${functionString};\n");
-            push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $codeGenerator->ExtendedAttributeContains($interface->extendedAttributes->{ConstructorCallWith}, "ExecState");
-            if ($interface->extendedAttributes->{ConstructorMayThrowException}) {
+            push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $codeGenerator->ExtendedAttributeContains($interface->extendedAttributes->{CallWith}, "ExecState");
+            if ($interface->extendedAttributes->{ConstructorMayThrowException} || $operation->extendedAttributes->{MayThrowException}) {
                 push(@$outputArray, "    static_assert(IsExceptionOr<decltype(object)>::value);\n");
                 push(@$outputArray, "    static_assert(decltype(object)::ReturnType::isRef);\n");
             } else {
@@ -7485,12 +7489,12 @@ sub GenerateConstructorDefinition
             my @constructionConversionArguments = ();
             push(@constructionConversionArguments, "*lexicalGlobalObject");
             push(@constructionConversionArguments, "*castedThis->globalObject()");
-            push(@constructionConversionArguments, "throwScope") if $interface->extendedAttributes->{ConstructorMayThrowException};
+            push(@constructionConversionArguments, "throwScope") if $interface->extendedAttributes->{ConstructorMayThrowException} || $operation->extendedAttributes->{MayThrowException};
             push(@constructionConversionArguments, "WTFMove(object)");
 
             # FIXME: toJSNewlyCreated should return JSObject* instead of JSValue.
             push(@$outputArray, "    auto jsValue = toJSNewlyCreated<${IDLType}>(" . join(", ", @constructionConversionArguments) . ");\n");
-            push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, { });\n") if $interface->extendedAttributes->{ConstructorMayThrowException};
+            push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, { });\n") if $interface->extendedAttributes->{ConstructorMayThrowException} || $operation->extendedAttributes->{MayThrowException};
             push(@$outputArray, "    setSubclassStructureIfNeeded<${implType}>(lexicalGlobalObject, callFrame, asObject(jsValue));\n");
             push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, { });\n");
             push(@$outputArray, "    return JSValue::encode(jsValue);\n");
@@ -7565,11 +7569,9 @@ sub GenerateConstructorHelperMethods
 
     my $constructorClassName = $generatingNamedConstructor ? "${className}NamedConstructor" : "${className}Constructor";
     my $leastConstructorLength = 0;
-    if ($interface->extendedAttributes->{Constructor} || $interface->extendedAttributes->{CustomConstructor}) {
-        my @constructors = @{$interface->constructors};
-        my @customConstructors = @{$interface->customConstructors};
+    if (@{$interface->constructors} > 0) {
         $leastConstructorLength = 255;
-        foreach my $constructor (@constructors, @customConstructors) {
+        foreach my $constructor (@{$interface->constructors}) {
             my $constructorLength = GetFunctionLength($constructor);
             $leastConstructorLength = $constructorLength if ($constructorLength < $leastConstructorLength);
         }
@@ -7646,7 +7648,7 @@ sub GenerateConstructorHelperMethods
 
     push(@$outputArray, "}\n\n");
 
-    if (IsJSBuiltinConstructor($interface)) {
+    if (HasJSBuiltinConstructor($interface)) {
         push(@$outputArray, "template<> FunctionExecutable* ${constructorClassName}::initializeExecutable(VM& vm)\n");
         push(@$outputArray, "{\n");
         push(@$outputArray, "    return " . GetJSBuiltinFunctionNameFromString($interface->type->name, "initialize" . $interface->type->name) . "(vm);\n");
@@ -7658,8 +7660,22 @@ sub GenerateConstructorHelperMethods
 
 sub HasCustomConstructor
 {
-    my $interface = shift;
-    return $interface->extendedAttributes->{CustomConstructor};
+    my ($interface) = @_;
+
+    my $hasCustomConstuctor = 0;
+    my $hasNonCustomConstuctor = 0;
+    
+    foreach my $constructor (@{$interface->constructors}) {
+        if ($constructor->extendedAttributes->{Custom}) {
+            $hasCustomConstuctor = 1;
+        } else {
+            $hasNonCustomConstuctor = 1;
+        }
+    }
+
+    assert("Using both Custom and non-Custom constructors on the same interface is not supported at this time") if $hasCustomConstuctor && $hasNonCustomConstuctor;
+
+    return $hasCustomConstuctor;
 }
 
 sub HasCustomGetter
@@ -7690,10 +7706,7 @@ sub NeedsConstructorProperty
 sub IsConstructable
 {
     my $interface = shift;
-    return HasCustomConstructor($interface)
-        || $interface->extendedAttributes->{Constructor}
-        || $interface->extendedAttributes->{NamedConstructor}
-        || $interface->extendedAttributes->{JSBuiltinConstructor};
+    return @{$interface->constructors} > 0;
 }
 
 sub InstanceOverridesGetCallData
@@ -7749,14 +7762,26 @@ sub IsJSBuiltin
     return 0;
 }
 
-sub IsJSBuiltinConstructor
+sub HasJSBuiltinConstructor
 {
     my ($interface) = @_;
 
-    return 0 if $interface->extendedAttributes->{CustomConstructor};
     return 1 if $interface->extendedAttributes->{JSBuiltin};
-    return 1 if $interface->extendedAttributes->{JSBuiltinConstructor};
-    return 0;
+
+    my $hasJSBuiltinConstuctor = 0;
+    my $hasNonJSBuiltinConstuctor = 0;
+    
+    foreach my $constructor (@{$interface->constructors}) {
+        if ($constructor->extendedAttributes->{JSBuiltin}) {
+            $hasJSBuiltinConstuctor = 1;
+        } else {
+            $hasNonJSBuiltinConstuctor = 1;
+        }
+    }
+
+    assert("Using both JSBuiltin and non-JSBuiltin constructors on the same interface is not supported at this time") if $hasJSBuiltinConstuctor && $hasNonJSBuiltinConstuctor;
+
+    return $hasJSBuiltinConstuctor;
 }
 
 sub GetJSBuiltinFunctionName
@@ -7785,7 +7810,7 @@ sub AddJSBuiltinIncludesIfNeeded()
 {
     my $interface = shift;
 
-    if ($interface->extendedAttributes->{JSBuiltin} || $interface->extendedAttributes->{JSBuiltinConstructor}) {
+    if ($interface->extendedAttributes->{JSBuiltin} || HasJSBuiltinConstructor($interface)) {
         AddToImplIncludes($interface->type->name . "Builtins.h");
         return;
     }
index fabee1b..f573838 100644 (file)
@@ -95,9 +95,6 @@
         "Custom": {
             "contextsAllowed": ["attribute", "operation"]
         },
-        "CustomConstructor": {
-            "contextsAllowed": ["interface"]
-        },
         "CustomDefineOwnProperty": {
             "contextsAllowed": ["interface"]
         },
index 896dd54..dce35ca 100644 (file)
@@ -63,7 +63,6 @@ struct( IDLInterface => {
     anonymousOperations => '@', # List of 'IDLOperation'
     attributes => '@',    # List of 'IDLAttribute'
     constructors => '@', # Constructors, list of 'IDLOperation'
-    customConstructors => '@', # Custom constructors, list of 'IDLOperation'
     isException => '$', # Used for exception interfaces
     isCallback => '$', # Used for callback interfaces
     isPartial => '$', # Used for partial interfaces
@@ -89,6 +88,7 @@ struct( IDLOperation => {
     name => '$',
     type => 'IDLType', # Return type
     arguments => '@', # List of 'IDLArgument'
+    isConstructor => '$',
     isStatic => '$',
     isIterable => '$',
     isSerializer => '$',
@@ -104,6 +104,7 @@ struct( IDLOperation => {
 struct( IDLAttribute => {
     name => '$',
     type => 'IDLType',
+    isConstructor => '$',
     isStatic => '$',
     isMapLike => '$',
     isSetLike => '$',
@@ -279,16 +280,6 @@ sub assertExtendedAttributesValidForContext
         # FIXME: Should this be done here, or when parsing the exteded attribute itself?
         # Either way, we should add validation of the values, if any, at the same place.
 
-        # Extended attribute parsing collapses multiple 'Constructor' or 'CustomConstructor'
-        # attributes into a single plural version. Eventually, it would be nice if that conversion
-        # hapened later, and the parser kept things relatively simply, but for now, we just undo
-        # this transformation for the type check.
-        if ($extendedAttribute eq "Constructors") {
-            $extendedAttribute = "Constructor";
-        } elsif ($extendedAttribute eq "CustomConstructors") {
-            $extendedAttribute = "CustomConstructor";
-        }
-
         if (!exists $self->{ExtendedAttributeMap}->{$extendedAttribute}) {
             assert "Unknown extended attribute: '${extendedAttribute}'";
         }
@@ -480,23 +471,7 @@ sub copyExtendedAttributes
     my $attr = shift;
 
     for my $key (keys %{$attr}) {
-        if ($key eq "Constructor") {
-            push(@{$extendedAttributeList->{"Constructors"}}, $attr->{$key});
-        } elsif ($key eq "Constructors") {
-            my @constructors = @{$attr->{$key}};
-            foreach my $constructor (@constructors) {
-                push(@{$extendedAttributeList->{"Constructors"}}, $constructor);
-            }
-        } elsif ($key eq "CustomConstructor") {
-            push(@{$extendedAttributeList->{"CustomConstructors"}}, $attr->{$key});
-        } elsif ($key eq "CustomConstructors") {
-           my @customConstructors = @{$attr->{$key}};
-            foreach my $customConstructor (@customConstructors) {
-                push(@{$extendedAttributeList->{"CustomConstructors"}}, $customConstructor);
-            }
-        } else {
-            $extendedAttributeList->{$key} = $attr->{$key};
-        }
+        $extendedAttributeList->{$key} = $attr->{$key};
     }
 }
 
@@ -590,6 +565,7 @@ sub cloneOperation
         push(@{$clonedOperation->arguments}, cloneArgument($argument));
     }
 
+    $clonedOperation->isConstructor($operation->isConstructor);
     $clonedOperation->isStatic($operation->isStatic);
     $clonedOperation->isIterable($operation->isIterable);
     $clonedOperation->isSerializer($operation->isSerializer);
@@ -645,7 +621,7 @@ my $nextType_1 = '^(ByteString|DOMString|USVString|Date|any|boolean|byte|double|
 my $nextSpecials_1 = '^(deleter|getter|legacycaller|setter)$';
 my $nextDefinitions_1 = '^(callback|dictionary|enum|exception|interface|partial|typedef)$';
 my $nextExceptionMembers_1 = '^(\(|ByteString|DOMString|USVString|Date|\[|any|boolean|byte|const|double|float|long|object|octet|optional|sequence|short|unrestricted|unsigned)$';
-my $nextInterfaceMembers_1 = '^(\(|ByteString|DOMString|USVString|Date|any|attribute|boolean|byte|const|deleter|double|float|getter|inherit|legacycaller|long|object|octet|readonly|sequence|serializer|setter|short|static|stringifier|unrestricted|unsigned|void)$';
+my $nextInterfaceMembers_1 = '^(\(|ByteString|DOMString|USVString|Date|any|attribute|boolean|byte|const|constructor|deleter|double|float|getter|inherit|legacycaller|long|object|octet|readonly|sequence|serializer|setter|short|static|stringifier|unrestricted|unsigned|void)$';
 my $nextSingleType_1 = '^(ByteString|DOMString|USVString|Date|boolean|byte|double|float|long|object|octet|sequence|short|unrestricted|unsigned)$';
 my $nextArgumentName_1 = '^(attribute|callback|const|deleter|dictionary|enum|exception|getter|implements|inherit|interface|legacycaller|partial|serializer|setter|static|stringifier|typedef|unrestricted)$';
 my $nextConstValue_1 = '^(false|true)$';
@@ -695,7 +671,7 @@ sub applyTypedefs
             foreach my $attribute (@{$definition->attributes}) {
                 $attribute->type($self->typeByApplyingTypedefs($attribute->type));
             }
-            foreach my $operation (@{$definition->operations}, @{$definition->anonymousOperations}, @{$definition->constructors}, @{$definition->customConstructors}) {
+            foreach my $operation (@{$definition->operations}, @{$definition->anonymousOperations}, @{$definition->constructors}) {
                 $self->applyTypedefsToOperation($operation);
             }
             if ($definition->iterable) {
@@ -947,6 +923,10 @@ sub parseInterfaceMember
     my $extendedAttributeList = shift;
 
     my $next = $self->nextToken();
+    if ($next->value() eq "constructor") {
+        return $self->parseConstructor($extendedAttributeList);
+    }
+
     if ($next->value() eq "const") {
         return $self->parseConst($extendedAttributeList);
     }
@@ -1435,6 +1415,33 @@ sub parseReadOnlyMember
     $self->assertUnexpectedToken($next->value(), __LINE__);
 }
 
+sub parseConstructor
+{
+    my $self = shift;
+    my $extendedAttributeList = shift;
+
+    my $next = $self->nextToken();
+    if ($next->value() eq "constructor") {
+        $self->assertTokenValue($self->getToken(), "constructor", __LINE__);
+
+        my $operation = IDLOperation->new();
+        $operation->isConstructor(1);
+
+        $self->assertTokenValue($self->getToken(), "(", __LINE__);
+
+        push(@{$operation->arguments}, @{$self->parseArgumentList()});
+
+        $self->assertTokenValue($self->getToken(), ")", __LINE__);
+        $self->assertTokenValue($self->getToken(), ";", __LINE__);
+
+        $self->assertExtendedAttributesValidForContext($extendedAttributeList, "operation"); #FIXME: This should be "constructor"
+        $operation->extendedAttributes($extendedAttributeList);
+
+        return $operation;
+    }
+    $self->assertUnexpectedToken($next->value(), __LINE__);
+}
+
 sub parseSerializer
 {
     my $self = shift;
@@ -2436,11 +2443,7 @@ sub parseExtendedAttributeRest
         return $attrs;
     }
 
-    if ($name eq "Constructor" || $name eq "CustomConstructor") {
-        $attrs->{$name} = [];
-    } else {
-        $attrs->{$name} = "VALUE_IS_MISSING";
-    }
+    $attrs->{$name} = "VALUE_IS_MISSING";
     return $attrs;
 }
 
@@ -3020,7 +3023,9 @@ sub applyMemberList
             next;
         }
         if (ref($item) eq "IDLOperation") {
-            if ($item->name eq "") {
+            if ($item->isConstructor) {
+                push(@{$interface->constructors}, $item);
+            } elsif ($item->name eq "") {
                 push(@{$interface->anonymousOperations}, $item);
             } else {
                 push(@{$interface->operations}, $item);
@@ -3052,20 +3057,9 @@ sub applyExtendedAttributeList
     my $interface = shift;
     my $extendedAttributeList = shift;
 
-    if (defined $extendedAttributeList->{"Constructors"}) {
-        my @constructorParams = @{$extendedAttributeList->{"Constructors"}};
-        my $index = (@constructorParams == 1) ? 0 : 1;
-        foreach my $param (@constructorParams) {
-            my $constructor = IDLOperation->new();
-            $constructor->name("Constructor");
-            $constructor->extendedAttributes($extendedAttributeList);
-            $constructor->arguments($param);
-            push(@{$interface->constructors}, $constructor);
-        }
-        delete $extendedAttributeList->{"Constructors"};
-        $extendedAttributeList->{"Constructor"} = "VALUE_IS_MISSING";
-    } elsif (defined $extendedAttributeList->{"NamedConstructor"}) {
+    if (defined $extendedAttributeList->{"NamedConstructor"}) {
         my $newDataNode = IDLOperation->new();
+        $newDataNode->isConstructor(1);
         $newDataNode->name("NamedConstructor");
         $newDataNode->extendedAttributes($extendedAttributeList);
         my %attributes = %{$extendedAttributeList->{"NamedConstructor"}};
@@ -3075,19 +3069,6 @@ sub applyExtendedAttributeList
         $extendedAttributeList->{"NamedConstructor"} = $constructorName;
         push(@{$interface->constructors}, $newDataNode);
     }
-    if (defined $extendedAttributeList->{"CustomConstructors"}) {
-        my @customConstructorParams = @{$extendedAttributeList->{"CustomConstructors"}};
-        my $index = (@customConstructorParams == 1) ? 0 : 1;
-        foreach my $param (@customConstructorParams) {
-            my $customConstructor = IDLOperation->new();
-            $customConstructor->name("CustomConstructor");
-            $customConstructor->extendedAttributes($extendedAttributeList);
-            $customConstructor->arguments($param);
-            push(@{$interface->customConstructors}, $customConstructor);
-        }
-        delete $extendedAttributeList->{"CustomConstructors"};
-        $extendedAttributeList->{"CustomConstructor"} = "VALUE_IS_MISSING";
-    }
     
     $interface->extendedAttributes($extendedAttributeList);
 }
index becec0f..fbe7447 100644 (file)
@@ -31,6 +31,7 @@
 #include "JSDOMBinding.h"
 #include "JSDOMConstructor.h"
 #include "JSDOMConvertInterface.h"
+#include "JSDOMConvertStrings.h"
 #include "JSDOMExceptionHandling.h"
 #include "JSDOMIterator.h"
 #include "JSDOMOperation.h"
 #include <wtf/PointerPreparations.h>
 #include <wtf/URL.h>
 
-#if ENABLE(Condition1) || ENABLE(Condition11) || ENABLE(Condition12) || ENABLE(Condition2) || ENABLE(Condition22) || ENABLE(Condition23)
-#include "JSDOMConvertStrings.h"
-#endif
-
 #if ENABLE(Condition11) || ENABLE(Condition12)
 #include "TestSupplementalBuiltins.h"
 #endif
index 21003c3..2d443d0 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "ActiveDOMObject.h"
 #include "DOMIsoSubspaces.h"
+#include "Document.h"
 #include "JSDOMBinding.h"
 #include "JSDOMConstructorNotConstructable.h"
 #include "JSDOMConvertInterface.h"
@@ -95,7 +96,7 @@ template<> void JSTestNamedConstructorConstructor::initializeProperties(VM& vm,
 {
     putDirect(vm, vm.propertyNames->prototype, JSTestNamedConstructor::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
     putDirect(vm, vm.propertyNames->name, jsNontrivialString(vm, "TestNamedConstructor"_s), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
-    putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(1), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
 }
 
 template<> const ClassInfo JSTestNamedConstructorConstructor::s_info = { "TestNamedConstructor", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedConstructorConstructor) };
@@ -108,6 +109,11 @@ template<> EncodedJSValue JSC_HOST_CALL JSTestNamedConstructorNamedConstructor::
     ASSERT(castedThis);
     if (UNLIKELY(callFrame->argumentCount() < 1))
         return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject));
+    auto* context = castedThis->scriptExecutionContext();
+    if (UNLIKELY(!context))
+        return throwConstructorScriptExecutionContextUnavailableError(*lexicalGlobalObject, throwScope, "TestNamedConstructor");
+    ASSERT(context->isDocument());
+    auto& document = downcast<Document>(*context);
     EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0);
     auto str1 = convert<IDLDOMString>(*lexicalGlobalObject, argument0.value());
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
@@ -117,7 +123,7 @@ template<> EncodedJSValue JSC_HOST_CALL JSTestNamedConstructorNamedConstructor::
     EnsureStillAliveScope argument2 = callFrame->argument(2);
     auto str3 = argument2.value().isUndefined() ? String() : convert<IDLDOMString>(*lexicalGlobalObject, argument2.value());
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    auto object = TestNamedConstructor::createForJSConstructor(WTFMove(str1), WTFMove(str2), WTFMove(str3));
+    auto object = TestNamedConstructor::createForJSConstructor(document, WTFMove(str1), WTFMove(str2), WTFMove(str3));
     static_assert(IsExceptionOr<decltype(object)>::value);
     static_assert(decltype(object)::ReturnType::isRef);
     auto jsValue = toJSNewlyCreated<IDLInterface<TestNamedConstructor>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object));
@@ -137,7 +143,7 @@ template<> void JSTestNamedConstructorNamedConstructor::initializeProperties(VM&
 {
     putDirect(vm, vm.propertyNames->prototype, JSTestNamedConstructor::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
     putDirect(vm, vm.propertyNames->name, jsNontrivialString(vm, "Audio"_s), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
-    putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
+    putDirect(vm, vm.propertyNames->length, jsNumber(1), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
 }
 
 template<> const ClassInfo JSTestNamedConstructorNamedConstructor::s_info = { "Audio", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedConstructorNamedConstructor) };
index f7703e6..f09215d 100644 (file)
@@ -26,7 +26,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    JSBuiltinConstructor
-] interface TestClassWithJSBuiltinConstructor {
+interface TestClassWithJSBuiltinConstructor {
+    [JSBuiltin] constructor();
 };
index 1237414..34098a3 100644 (file)
@@ -28,9 +28,9 @@
 
 // This IDL file is for testing the bindings code generator and for tracking
 // changes in its ouput.
-[
-    Constructor(DOMString type, optional TestEventConstructorInit eventInitDict),
-] interface TestEventConstructor : Event {
+interface TestEventConstructor : Event {
+    constructor(DOMString type, optional TestEventConstructorInit eventInitDict);
+
     // Attributes
     readonly attribute DOMString attr1;
     readonly attribute DOMString attr2;
index 2fbbb8f..07a1103 100644 (file)
     ActiveDOMObject,
     CustomPut,
     Conditional=Condition1|Condition2,
-    ConstructorCallWith=ScriptExecutionContext,
-    Constructor(DOMString str1, optional DOMString str2 = "defaultString"),
-    ConstructorMayThrowException,
     ExportMacro=WEBCORE_EXPORT,
     ImplementationLacksVTable
 ] interface TestInterface {
+    [MayThrowException, CallWith=ScriptExecutionContext] constructor(DOMString str1, optional DOMString str2 = "defaultString");
+
     iterable<TestNode, TestObj>;
 };
 
index 1dd918e..f8b2e0e 100644 (file)
@@ -27,9 +27,9 @@
  */
 
 [
-    JSBuiltin,
-    Constructor
+    JSBuiltin
 ] interface TestJSBuiltinConstructor {
+    constructor();
 
     void testFunction();
     attribute boolean testAttribute;
index dface48..b569d57 100644 (file)
@@ -31,6 +31,7 @@
 [
     ActiveDOMObject,
     NamedConstructor=Audio(DOMString str1, optional DOMString str2 = "defaultString", optional DOMString str3),
+    ConstructorCallWith=Document,
     ConstructorMayThrowException
 ] interface TestNamedConstructor {
 };
index ba045e4..931ee0f 100644 (file)
  */
 
 [
-    Constructor,
     ExportMacro=WEBCORE_EXPORT,
     Exposed=(Window,Worker)
 ] interface TestNode : Node {
+    constructor();
+
     attribute DOMString name;
 
     [EnabledAtRuntime=DOMIterator] iterable<TestNode>;
index f2898d2..51023fc 100644 (file)
@@ -46,11 +46,11 @@ enum ObjSize { "small", "much-much-larger" };
 enum TestConfidence { "high", "kinda-low" };
 
 [
-    ConstructorCallWith=Document,
-    Constructor(TestCallbackInterface testCallback, TestCallbackFunction testCallbackFunction),
     InterfaceName=TestObject,
     Exposed=(Window,Worker)
 ] interface TestObj {
+    [CallWith=Document] constructor(TestCallbackInterface testCallback, TestCallbackFunction testCallbackFunction);
+
     // Attributes
     readonly attribute long            readOnlyLongAttr;
     readonly attribute DOMString       readOnlyStringAttr;
index 7e744ac..535a17f 100644 (file)
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-[
-    Constructor(ArrayBuffer arrayBuffer),
-    Constructor(ArrayBufferView arrayBufferView),
-    Constructor(Blob blob),
-    Constructor(DOMString string),
-    Constructor(long... longArgs)
-] interface TestOverloadedConstructors {
+
+interface TestOverloadedConstructors {
+    constructor(ArrayBuffer arrayBuffer);
+    constructor(ArrayBufferView arrayBufferView);
+    constructor(Blob blob);
+    constructor(DOMString string);
+    constructor(long... longArgs);
 };
index 483c2da..a86d139 100644 (file)
@@ -23,8 +23,7 @@
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-[
-    Constructor(optional sequence<DOMString> sequenceOfStrings = []),
-    Constructor(DOMString string),
-] interface TestOverloadedConstructorsWithSequence {
+interface TestOverloadedConstructorsWithSequence {
+    constructor(optional sequence<DOMString> sequenceOfStrings = []);
+    constructor(DOMString string);
 };
index dc9831d..0b1938f 100644 (file)
  */
 
 [
-    Constructor(DOMString type, TestPromiseRejectionEventInit eventInitDict),
-    ConstructorCallWith=GlobalObject,
     Exposed=(Window,Worker),
 ] interface TestPromiseRejectionEvent : Event {
+    [CallWith=GlobalObject] constructor(DOMString type, TestPromiseRejectionEventInit eventInitDict);
     readonly attribute Promise<any> promise;
     readonly attribute any reason;
 };
index 547c4d6..d880881 100644 (file)
@@ -31,9 +31,9 @@
 // This IDL file is for testing the bindings code generator and for tracking
 // changes in its output.
 
-[
-    Constructor(STRING hello, TEST_CALLBACK_FUNCTION testCallbackFunction, TEST_CALLBACK_INTERFACE testCallbackInterface),
-] interface TestTypedefs {
+interface TestTypedefs {
+    constructor(STRING hello, TEST_CALLBACK_FUNCTION testCallbackFunction, TEST_CALLBACK_INTERFACE testCallbackInterface);
+
     attribute ULONGLONG unsignedLongLongAttr;
 
     attribute SCRIPT_VALUE serializedScriptValue;
index 17ef951..b5789bd 100644 (file)
 
 // FIXME: Should be [LegacyWindowAlias=(SVGMatrix, WebKitCSSMatrix)].
 [
-    Constructor(optional (DOMString or sequence<unrestricted double>) init),
-    ConstructorMayThrowException,
-    ConstructorCallWith=ScriptExecutionContext,
     ExportMacro=WEBCORE_EXPORT,
     Exposed=(Window,Worker),
     ImplementationLacksVTable
- ] interface DOMMatrix : DOMMatrixReadOnly {
+] interface DOMMatrix : DOMMatrixReadOnly {
+    [CallWith=ScriptExecutionContext, MayThrowException] constructor(optional (DOMString or sequence<unrestricted double>) init);
+
     [MayThrowException, NewObject] static DOMMatrix fromMatrix(optional DOMMatrixInit other);
     [MayThrowException, NewObject] static DOMMatrix fromFloat32Array(Float32Array array32);
     [MayThrowException, NewObject] static DOMMatrix fromFloat64Array(Float64Array array64);
index e07143c..fe13211 100644 (file)
  */
 
 [
-    Constructor(optional (DOMString or sequence<unrestricted double>) init),
-    ConstructorMayThrowException,
-    ConstructorCallWith=ScriptExecutionContext,
     ExportMacro=WEBCORE_EXPORT,
     Exposed=(Window,Worker),
     ImplementationLacksVTable
 ] interface DOMMatrixReadOnly {
+    [CallWith=ScriptExecutionContext, MayThrowException] constructor(optional (DOMString or sequence<unrestricted double>) init);
+
     [MayThrowException, NewObject] static DOMMatrixReadOnly fromMatrix(optional DOMMatrixInit other);
     [MayThrowException, NewObject] static DOMMatrixReadOnly fromFloat32Array(Float32Array array32);
     [MayThrowException, NewObject] static DOMMatrixReadOnly fromFloat64Array(Float64Array array64);
index 15fcea8..37a2f61 100644 (file)
@@ -43,9 +43,9 @@ dictionary FontFaceDescriptors {
 
 [
     ActiveDOMObject,
-    ConstructorCallWith=Document,
-    Constructor(DOMString family, (DOMString or BinaryData) source, optional FontFaceDescriptors descriptors)
 ] interface FontFace {
+    [CallWith=Document] constructor(DOMString family, (DOMString or BinaryData) source, optional FontFaceDescriptors descriptors);
+
     [SetterCallWith=Document] attribute DOMString family;
     attribute DOMString style;
     attribute DOMString weight;
index 96dc7b1..56709f3 100644 (file)
@@ -30,9 +30,9 @@ enum FontFaceSetLoadStatus {
 
 [
     ActiveDOMObject,
-    ConstructorCallWith=Document,
-    Constructor(sequence<FontFace> initialFaces),
 ] interface FontFaceSet : EventTarget {
+    [CallWith=Document] constructor(sequence<FontFace> initialFaces);
+
     boolean has(FontFace font);
 
     // FIXME: We should add support for the setlike declaration.
index 9c320c8..5027985 100644 (file)
@@ -23,9 +23,9 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    Constructor(DOMString type, optional MediaQueryListEventInit mediaQueryListEventInit),
-] interface MediaQueryListEvent : Event {
+interface MediaQueryListEvent : Event {
+    constructor(DOMString type, optional MediaQueryListEventInit mediaQueryListEventInit);
+
     readonly attribute DOMString media;
     readonly attribute boolean matches;
 };
index 0351167..681c148 100644 (file)
 
 // FIXME: This should be removed and made an alias to DOMRect.
 [
-    Constructor(optional DOMString cssValue),
-    ConstructorMayThrowException,
     ImplementationLacksVTable,
 ] interface WebKitCSSMatrix {
+    [MayThrowException] constructor(optional DOMString cssValue);
 
     // These attributes are simple aliases for certain elements of the 4x4 matrix
     attribute unrestricted double a; // alias for m11
index 456f1ef..e69f13b 100644 (file)
@@ -28,8 +28,9 @@
     EnabledAtRuntime=CSSTypedOM,
     Conditional=CSS_TYPED_OM,
     Exposed=(Window,Worker,PaintWorklet),
-    Constructor(double value, USVString unit),
 ] interface TypedOMCSSUnitValue : TypedOMCSSNumericValue {
+    constructor(double value, USVString unit);
+
     attribute double value;
     readonly attribute USVString unit;
 };
index 1df6f56..0199cae 100644 (file)
@@ -29,6 +29,6 @@
     EnabledAtRuntime=CSSTypedOM,
     Conditional=CSS_TYPED_OM,
     Exposed=(Window,Worker,PaintWorklet),
-    Constructor(USVString serializedValue),
 ] interface TypedOMCSSUnparsedValue : TypedOMCSSStyleValue {
+    constructor(USVString serializedValue);
 };
index 7f4ce59..f5e7d5f 100644 (file)
  */
 
 [
-    Constructor,
-    ConstructorCallWith=ScriptExecutionContext,
     Exposed=(Window,Worker),
     ImplementationLacksVTable,
     JSCustomMarkFunction
 ] interface AbortController {
+    [CallWith=ScriptExecutionContext] constructor();
+
     [SameObject] readonly attribute AbortSignal signal;
 
     void abort();
index cf596b0..50c8a8d 100644 (file)
@@ -23,9 +23,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-[
-    Constructor(DOMString type, optional AnimationEventInit animationEventInitDict),
-] interface AnimationEvent : Event {
+interface AnimationEvent : Event {
+    constructor(DOMString type, optional AnimationEventInit animationEventInitDict);
+
     readonly attribute DOMString animationName;
     readonly attribute double elapsedTime;
     readonly attribute DOMString pseudoElement;
index 733ec3e..b1f0c5e 100644 (file)
  */
 
 [
-    Constructor(DOMString type, optional BeforeLoadEventInit eventInitDict),
     EnabledAtRuntime=LegacyBeforeLoadEvent
 ] interface BeforeLoadEvent : Event {
+    constructor(DOMString type, optional BeforeLoadEventInit eventInitDict);
+
     readonly attribute DOMString url;
 };
 
index 4a41992..6df8259 100644 (file)
@@ -24,9 +24,9 @@
  *
  */
 
-[
-    Constructor(DOMString type, optional ClipboardEventInit eventInitDict)
-] interface ClipboardEvent : Event {
+interface ClipboardEvent : Event {
+    constructor(DOMString type, optional ClipboardEventInit eventInitDict);
+
     readonly attribute DataTransfer? clipboardData;
 };
 
index fd45912..17271b0 100644 (file)
@@ -18,9 +18,8 @@
  */
 
 [
-    Constructor(optional DOMString data = ""),
-    ConstructorCallWith=Document,
     JSGenerateToJSObject
 ] interface Comment : CharacterData {
+    [CallWith=Document] constructor(optional DOMString data = "");
 };
 
index 20aac7e..b65b6f7 100644 (file)
@@ -23,9 +23,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-[
-    Constructor(DOMString type, optional CompositionEventInit eventInitDict),
-] interface CompositionEvent : UIEvent {
+interface CompositionEvent : UIEvent {
+    constructor(DOMString type, optional CompositionEventInit eventInitDict);
 
     readonly attribute DOMString data;
 
index 78fcea2..03e409a 100644 (file)
  */
 
 [
-    Constructor(DOMString type, optional CustomEventInit eventInitDict),
     Exposed=(Window,Worker),
     JSCustomMarkFunction,
 ] interface CustomEvent : Event {
+    constructor(DOMString type, optional CustomEventInit eventInitDict);
+
     [CustomGetter] readonly attribute any detail;
 
     void initCustomEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false, optional any detail = null);
index f95e803..98e61cc 100644 (file)
  */
 
 [
-    Constructor(optional DOMString message = "", optional DOMString name = "Error"),
     DoNotCheckConstants,
     Exposed=(Window,Worker),
     ImplementationLacksVTable,
 ] exception DOMException {
+    constructor(optional DOMString message = "", optional DOMString name = "Error");
 
     [ImplementedAs=legacyCode] readonly attribute unsigned short   code;
     readonly attribute DOMString        name;
index 69bbc2d..333c5c3 100644 (file)
 
 // The DOMPointInit constructor exists in https://www.w3.org/TR/geometry-1/ but is removed in https://drafts.fxtf.org/geometry/
 [
-    Constructor(DOMPointInit point),
-    Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
-        optional unrestricted double z = 0, optional unrestricted double w = 1),
     Exposed=(Window,Worker),
     GenerateIsReachable=Impl,
     ImplementationLacksVTable
-]
-interface DOMPoint : DOMPointReadOnly {
+] interface DOMPoint : DOMPointReadOnly {
+    constructor(DOMPointInit point);
+    constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, optional unrestricted double z = 0, optional unrestricted double w = 1);
+
     [NewObject] static DOMPoint fromPoint(optional DOMPointInit other);
 
     inherit attribute unrestricted double x;
index 3ffd66f..f5ee1b8 100644 (file)
 
 // The DOMPointInit constructor exists in https://www.w3.org/TR/geometry-1/ but is removed in https://drafts.fxtf.org/geometry/
 [
-    Constructor(DOMPointInit point),
-    Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
-        optional unrestricted double z = 0, optional unrestricted double w = 1),
     Exposed=(Window,Worker),
     ImplementationLacksVTable
-]
-interface DOMPointReadOnly {
+] interface DOMPointReadOnly {
+    constructor(DOMPointInit point);
+    constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, optional unrestricted double z = 0, optional unrestricted double w = 1);
+
     [NewObject] static DOMPointReadOnly fromPoint(optional DOMPointInit other);
 
     readonly attribute unrestricted double x;
index de7c6f2..b5e49d2 100644 (file)
 // https://drafts.fxtf.org/geometry/#dictdef-domquadinit
 
 [
-    Constructor(optional DOMPointInit p1, optional DOMPointInit p2, optional DOMPointInit p3, optional DOMPointInit p4),
     Exposed=(Window,Worker),
     ImplementationLacksVTable,
     JSCustomMarkFunction
 ] interface DOMQuad {
+    constructor(optional DOMPointInit p1, optional DOMPointInit p2, optional DOMPointInit p3, optional DOMPointInit p4);
+
     [NewObject] static DOMQuad fromRect(optional DOMRectInit other);
     [NewObject] static DOMQuad fromQuad(optional DOMQuadInit other);
 
index 23bc6aa..fcad9fb 100644 (file)
 // https://drafts.fxtf.org/geometry-1/#DOMRect
 
 [
-    Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
-        optional unrestricted double width = 0, optional unrestricted double height = 0),
     ExportMacro=WEBCORE_EXPORT,
     Exposed=(Window,Worker),
     ImplementationLacksVTable
-]
-interface DOMRect : DOMRectReadOnly {
+] interface DOMRect : DOMRectReadOnly {
+    constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, optional unrestricted double width = 0, optional unrestricted double height = 0);
+
     [NewObject] static DOMRect fromRect(optional DOMRectInit other);
 
     inherit attribute unrestricted double x;
index 58721fd..78c2191 100644 (file)
 // https://drafts.fxtf.org/geometry-1/#DOMRect
 
 [
-    Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
-        optional unrestricted double width = 0, optional unrestricted double height = 0),
     ExportMacro=WEBCORE_EXPORT,
     Exposed=(Window,Worker),
     GenerateIsReachable=Impl,
     ImplementationLacksVTable
-]
-interface DOMRectReadOnly {
+] interface DOMRectReadOnly {
+    constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, optional unrestricted double width = 0, optional unrestricted double height = 0);
+
     [NewObject] static DOMRectReadOnly fromRect(optional DOMRectInit other);
 
     readonly attribute unrestricted double x;
index 81442ee..459fc16 100644 (file)
@@ -34,8 +34,6 @@ typedef (
 typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
 
 [
-    Constructor,
-    ConstructorCallWith=Document,
     CustomToJSObject,
     CustomHeapSnapshot,
     DOMJIT,
@@ -44,6 +42,8 @@ typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
     JSCustomMarkFunction,
     JSGenerateToNativeObject,
 ] interface Document : Node {
+    [CallWith=Document] constructor();
+
     readonly attribute DOMImplementation implementation; // FIXME: Should be [SameObject].
     [ImplementedAs=urlForBindings] readonly attribute USVString URL;
     [ImplementedAs=urlForBindings] readonly attribute USVString documentURI;
index 3011993..24f6023 100644 (file)
  */
 
 [
-    Constructor,
-    ConstructorCallWith=Document,
     CustomToJSObject,
     JSGenerateToNativeObject,
     DOMJIT,
 ] interface DocumentFragment : Node {
+    [CallWith=Document] constructor();
 };
 
 DocumentFragment implements ParentNode;
index b6e1813..84e283e 100644 (file)
@@ -23,9 +23,9 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    Constructor(DOMString type, optional DragEventInit eventInitDict)
-] interface DragEvent : MouseEvent {
+interface DragEvent : MouseEvent {
+    constructor(DOMString type, optional DragEventInit eventInitDict);
+
     readonly attribute DataTransfer? dataTransfer;
 };
 
index 90131c5..119f12e 100644 (file)
  */
 
 [
-    Constructor(DOMString type, optional ErrorEventInit eventInitDict),
     Exposed=(Window,Worker),
     JSCustomMarkFunction,
 ] interface ErrorEvent : Event {
+    constructor(DOMString type, optional ErrorEventInit eventInitDict);
+
     readonly attribute DOMString message;
     readonly attribute USVString filename;
     readonly attribute unsigned long lineno;
index 1e6a26a..6ebe6b8 100644 (file)
 typedef double DOMHighResTimeStamp;
 
 [
-    Constructor(DOMString type, optional EventInit eventInitDict),
     CustomToJSObject,
     DOMJIT,
     ExportToWrappedFunction,
     Exposed=(Window,Worker),
     JSCustomHeader,
 ] interface Event {
+    constructor(DOMString type, optional EventInit eventInitDict);
+
     readonly attribute DOMString type;
     readonly attribute EventTarget? target;
     readonly attribute EventTarget? currentTarget;
index c17edef..b2c3523 100644 (file)
@@ -19,8 +19,6 @@
  */
 
 [
-    Constructor,
-    ConstructorCallWith=ScriptExecutionContext,
     CustomToJSObject,
     Exposed=(Window,Worker),
     IsImmutablePrototypeExoticObjectOnPrototype,
@@ -28,6 +26,8 @@
     JSCustomMarkFunction,
     JSCustomToNativeObject,
 ] interface EventTarget {
+    [CallWith=ScriptExecutionContext] constructor();
+
     [ImplementedAs=addEventListenerForBindings] void addEventListener([AtomString] DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options = false);
     [ImplementedAs=removeEventListenerForBindings] void removeEventListener([AtomString] DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options = false);
     [ImplementedAs=dispatchEventForBindings, MayThrowException] boolean dispatchEvent(Event event);
index 48a68f0..5b118c6 100644 (file)
@@ -23,9 +23,9 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    Constructor(DOMString type, optional FocusEventInit eventInitDict),
-] interface FocusEvent : UIEvent {
+interface FocusEvent : UIEvent {
+    constructor(DOMString type, optional FocusEventInit eventInitDict);
+
     readonly attribute EventTarget? relatedTarget;
 };
 
index e72ff8d..da6c71c 100644 (file)
@@ -18,9 +18,9 @@
  */
 
 // Introduced in http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-hashchange
-[
-    Constructor(DOMString type, optional HashChangeEventInit eventInitDict),
-] interface HashChangeEvent : Event {
+interface HashChangeEvent : Event {
+    constructor(DOMString type, optional HashChangeEventInit eventInitDict);
+
     // FIXME: Using "undefined" as default parameter value is wrong.
     void initHashChangeEvent(optional DOMString type = "undefined",
                              optional boolean canBubble = false,
index 1f765de..f903e90 100644 (file)
 */
 
 [
-    Constructor(DOMString type, optional InputEventInit eventInitDict),
     EnabledAtRuntime=InputEvents,
 ] interface InputEvent : UIEvent {
+    constructor(DOMString type, optional InputEventInit eventInitDict);
+
     readonly attribute DOMString inputType;
     readonly attribute DOMString? data;
     readonly attribute DataTransfer? dataTransfer;
index eca2afd..af4616c 100644 (file)
@@ -18,9 +18,8 @@
  * Boston, MA 02110-1301, USA.
  */
 
-[
-    Constructor(DOMString type, optional KeyboardEventInit eventInitDict),
-] interface KeyboardEvent : UIEvent {
+interface KeyboardEvent : UIEvent {
+    constructor(DOMString type, optional KeyboardEventInit eventInitDict);
 
     const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00;
     const unsigned long DOM_KEY_LOCATION_LEFT = 0x01;
index 285afc9..002fa63 100644 (file)
 [
     Exposed=(Window,Worker),
     Conditional=CHANNEL_MESSAGING,
-    Constructor,
-    ConstructorCallWith=ScriptExecutionContext,
     JSCustomMarkFunction,
     ImplementationLacksVTable
 ] interface MessageChannel {
+    [CallWith=ScriptExecutionContext] constructor();
 
     readonly attribute MessagePort port1;
     readonly attribute MessagePort port2;
index dee5e2f..245017d 100644 (file)
@@ -33,11 +33,12 @@ typedef (WindowProxy or MessagePort) MessageEventSource;
 #endif
 
 [
-    Constructor(DOMString type, optional MessageEventInit eventInitDict),
     Exposed=(Window,Worker),
     JSCustomMarkFunction,
     ReportExtraMemoryCost,
 ] interface MessageEvent : Event {
+    constructor(DOMString type, optional MessageEventInit eventInitDict);
+
     readonly attribute USVString origin;
     readonly attribute DOMString lastEventId;
     readonly attribute MessageEventSource? source;
index 7a0748f..912790b 100644 (file)
  */
 
 [
-    Constructor(DOMString type, optional MouseEventInit eventInitDict),
     DoNotCheckConstants,
 ] interface MouseEvent : UIEvent {
+    constructor(DOMString type, optional MouseEventInit eventInitDict);
+
     [Conditional=MOUSE_FORCE_EVENTS] const double WEBKIT_FORCE_AT_MOUSE_DOWN = 1;
     [Conditional=MOUSE_FORCE_EVENTS] const double WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN = 2;
 
index e9994fc..ab4a254 100644 (file)
  */
 
 [
-    Constructor(MutationCallback callback),
     CustomIsReachable,
     ImplementationLacksVTable,
     LegacyWindowAlias=WebKitMutationObserver,
     JSCustomMarkFunction
 ] interface MutationObserver {
+    constructor(MutationCallback callback);
+
     [MayThrowException] void observe(Node target, optional MutationObserverInit options);
     void disconnect();
     [ResultField=records] sequence<MutationRecord> takeRecords();
index 9fe025f..09f8570 100644 (file)
@@ -23,9 +23,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-[
-    Constructor(DOMString type, optional OverflowEventInit eventInitDict),
-] interface OverflowEvent : Event {
+interface OverflowEvent : Event {
+    constructor(DOMString type, optional OverflowEventInit eventInitDict);
+
     const unsigned short HORIZONTAL = 0;
     const unsigned short VERTICAL   = 1;
     const unsigned short BOTH       = 2;
index 7f0491e..e13f2a8 100644 (file)
@@ -23,9 +23,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-[
-    Constructor(DOMString type, optional PageTransitionEventInit eventInitDict),
-] interface PageTransitionEvent : Event {
+interface PageTransitionEvent : Event {
+    constructor(DOMString type, optional PageTransitionEventInit eventInitDict);
+
     readonly attribute boolean persisted;
 };
 
index fffafe3..8a41772 100644 (file)
@@ -38,9 +38,10 @@ dictionary PointerEventInit : MouseEventInit {
 
 [
     DisabledByQuirk=shouldDisablePointerEvents,
-    Constructor(DOMString type, optional PointerEventInit eventInitDict),
     Exposed=Window
 ] interface PointerEvent : MouseEvent {
+    constructor(DOMString type, optional PointerEventInit eventInitDict);
+
     readonly attribute long pointerId;
     readonly attribute double width;
     readonly attribute double height;
index f658ac6..470674e 100644 (file)
  */
 
 [
-    Constructor(DOMString type, optional PopStateEventInit eventInitDict),
     JSCustomMarkFunction,
 ] interface PopStateEvent : Event {
+    constructor(DOMString type, optional PopStateEventInit eventInitDict);
+
     [CachedAttribute, CustomGetter] readonly attribute any state;
 };
 
index dfb9048..6b7813f 100644 (file)
  */
 
 [
-    Constructor(DOMString type, optional ProgressEventInit eventInitDict),
     Exposed=(Window,Worker),
 ] interface ProgressEvent : Event {
+    constructor(DOMString type, optional ProgressEventInit eventInitDict);
+
     readonly attribute boolean lengthComputable;
     readonly attribute unsigned long long loaded;
     readonly attribute unsigned long long total;
index 5a20803..0a095bc 100644 (file)
 */
 
 [
-    Constructor(DOMString type, PromiseRejectionEventInit eventInitDict),
     Exposed=(Window,Worker),
     JSCustomMarkFunction,
 ] interface PromiseRejectionEvent : Event {
+    constructor(DOMString type, PromiseRejectionEventInit eventInitDict);
+
     readonly attribute Promise<any> promise;
     readonly attribute any reason;
 };
index 8557029..154e89c 100644 (file)
  */
 
 [
-    Constructor,
-    ConstructorCallWith=Document,
     ImplementationLacksVTable,
     ExportMacro=WEBCORE_EXPORT,
 ] interface Range {
+    [CallWith=Document] constructor();
+
     readonly attribute Node startContainer;
     readonly attribute long startOffset; // FIXME: Should be unsigned long.
     readonly attribute Node endContainer;
index cab6c52..8c87730 100644 (file)
@@ -23,9 +23,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    Constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict),
-] interface SecurityPolicyViolationEvent : Event {
+interface SecurityPolicyViolationEvent : Event {
+    constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict);
+
     readonly attribute USVString documentURI;
     readonly attribute DOMString referrer;
     readonly attribute USVString blockedURI;
index d8b9479..eaec2fd 100644 (file)
@@ -27,9 +27,9 @@
     EnabledAtRuntime=InputEvents,
     ImplementationLacksVTable,
     Exposed=Window,
-    ConstructorMayThrowException,
-    Constructor(StaticRangeInit staticRangeInitDict),
 ] interface StaticRange {
+    [MayThrowException] constructor(StaticRangeInit staticRangeInitDict);
+
     readonly attribute unsigned long startOffset;
     readonly attribute unsigned long endOffset;
     readonly attribute Node startContainer;
index 3bf5339..6a6b62a 100644 (file)
  */
 
 [
-    Constructor(optional DOMString data = ""),
-    ConstructorCallWith=Document,
     CustomToJSObject,
 ] interface Text : CharacterData {
+    [CallWith=Document] constructor(optional DOMString data = "");
+
     [MayThrowException] Text splitText(unsigned long offset);
     readonly attribute DOMString wholeText;
 };
index 08bb522..ba7712f 100644 (file)
@@ -33,11 +33,11 @@ dictionary TextDecodeOptions {
 };
 
 [
-    Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
     Exposed=(Window,Worker),
     ImplementationLacksVTable,
-    ConstructorMayThrowException
 ] interface TextDecoder {
+    [MayThrowException] constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options);
+
     readonly attribute DOMString encoding;
     readonly attribute boolean fatal;
     readonly attribute boolean ignoreBOM;
index d453fbd..cff1b7c 100644 (file)
 */
 
 [
-    Constructor,
     Exposed=(Window,Worker),
     ImplementationLacksVTable
 ] interface TextEncoder {
+    constructor();
+
     readonly attribute DOMString encoding;
 
     // FIXME: This should have [NewObject]
index 03f8ae9..cc685ed 100644 (file)
@@ -24,9 +24,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-[
-    Constructor(DOMString type, optional TransitionEventInit transitionEventInitDict),
-] interface TransitionEvent : Event {
+interface TransitionEvent : Event {
+    constructor(DOMString type, optional TransitionEventInit transitionEventInitDict);
+
     readonly attribute DOMString propertyName;
     readonly attribute double elapsedTime;
     readonly attribute DOMString pseudoElement;
index 6a35c57..f5ba3c6 100644 (file)
@@ -17,9 +17,9 @@
  * Boston, MA 02110-1301, USA.
  */
 
-[
-    Constructor(DOMString type, optional UIEventInit eventInitDict)
-] interface UIEvent : Event {
+interface UIEvent : Event {
+    constructor(DOMString type, optional UIEventInit eventInitDict);
+
     readonly attribute WindowProxy view;
     readonly attribute long detail;
     
index f7470e6..4c93017 100644 (file)
@@ -23,9 +23,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-[
-    Constructor(DOMString type, optional WebKitAnimationEventInit eventInitDict),
-] interface WebKitAnimationEvent : Event {
+interface WebKitAnimationEvent : Event {
+    constructor(DOMString type, optional WebKitAnimationEventInit eventInitDict);
+
     readonly attribute DOMString animationName;
     readonly attribute double elapsedTime;
     readonly attribute DOMString pseudoElement;
index 3d57e46..b670359 100644 (file)
@@ -23,9 +23,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-[
-    Constructor(DOMString type, optional WebKitTransitionEventInit eventInitDict),
-] interface WebKitTransitionEvent : Event {
+interface WebKitTransitionEvent : Event {
+    constructor(DOMString type, optional WebKitTransitionEventInit eventInitDict);
+
     readonly attribute DOMString propertyName;
     readonly attribute double elapsedTime;
     readonly attribute DOMString pseudoElement;
index b281da1..a0ef6a5 100644 (file)
@@ -19,9 +19,9 @@
  * Boston, MA 02110-1301, USA.
  */
 
-[
-    Constructor(DOMString type, optional WheelEventInit eventInitDict),
-] interface WheelEvent : MouseEvent {
+interface WheelEvent : MouseEvent {
+    constructor(DOMString type, optional WheelEventInit eventInitDict);
+
     // DeltaModeCode
     const unsigned long DOM_DELTA_PIXEL = 0x00;
     const unsigned long DOM_DELTA_LINE = 0x01;
index 69d0f15..118b91e 100644 (file)
@@ -34,8 +34,9 @@ typedef (BufferSource or Blob or USVString) BlobPart;
     Exposed=(Window,Worker),
     GenerateIsReachable=Impl,
     CustomToJSObject,
-    Constructor(optional sequence<BlobPart> blobParts, optional BlobPropertyBag options),
 ] interface Blob {
+    constructor(optional sequence<BlobPart> blobParts, optional BlobPropertyBag options);
+
     readonly attribute unsigned long long size;
     readonly attribute DOMString type;
 
index 246d4ae..e177e11 100644 (file)
 typedef (BufferSource or Blob or USVString) BlobPart;
 
 [
-    Constructor(sequence<BlobPart> fileBits, USVString fileName, optional FilePropertyBag options),
     ExportMacro=WEBCORE_EXPORT,
     Exposed=(Window,Worker),
     JSGenerateToJSObject,
     JSGenerateToNativeObject,
 ] interface File : Blob {
+    constructor(sequence<BlobPart> fileBits, USVString fileName, optional FilePropertyBag options);
+
     readonly attribute DOMString name;
     readonly attribute long long lastModified;
 
index 93c19aa..ec6b562 100644 (file)
@@ -32,9 +32,9 @@
 [
     Exposed=(Window,Worker),
     ActiveDOMObject,
-    Constructor,
-    ConstructorCallWith=ScriptExecutionContext,
 ] interface FileReader : EventTarget {
+    [CallWith=ScriptExecutionContext] constructor();
+
     // ready states
     const unsigned short EMPTY = 0;
     const unsigned short LOADING = 1;
index 411e686..70c34ac 100644 (file)
  */
 
 [
-    Constructor,
     Exposed=DedicatedWorker,
     ImplementationLacksVTable,
 ] interface FileReaderSync {
+    constructor();
+
     [CallWith=ScriptExecutionContext, MayThrowException] ArrayBuffer readAsArrayBuffer(Blob blob);
     [CallWith=ScriptExecutionContext, MayThrowException] DOMString readAsBinaryString(Blob blob);
     [CallWith=ScriptExecutionContext, MayThrowException] DOMString readAsText(Blob blob, optional DOMString encoding = "");
index daecda1..4ed5af7 100644 (file)
 typedef (File or USVString) FormDataEntryValue;
 
 [
-    Constructor(optional HTMLFormElement? form),
     Exposed=(Window,Worker),
     JSGenerateToNativeObject,
     JSGenerateToJSObject,
     InterfaceName=FormData,
     ImplementationLacksVTable,
 ] interface DOMFormData {
+    constructor(optional HTMLFormElement? form);
+
     void append(USVString name, USVString value);
     void append(USVString name, Blob blobValue, optional USVString filename);
     [ImplementedAs=remove] void delete(USVString name);
index a690c93..565ac6c 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// FIXME: Constructor should be Constructor(USVString url, optional USVString base).
 [
-    Constructor(USVString url),
-    Constructor(USVString url, USVString base),
-    Constructor(USVString url, DOMURL base),
-    ConstructorMayThrowException,
     ExportMacro=WEBCORE_EXPORT,
     Exposed=(Window,Worker),
     InterfaceName=URL,
     JSGenerateToNativeObject,
     LegacyWindowAlias=webkitURL,
 ] interface DOMURL {
+    // FIXME: Constructor should be constructor(USVString url, optional USVString base).
+    [MayThrowException] constructor(USVString url);
+    [MayThrowException] constructor(USVString url, USVString base);
+    [MayThrowException] constructor(USVString url, DOMURL base);
+
     [URL] stringifier attribute USVString href;
     readonly attribute USVString origin;
     attribute USVString protocol;
index 6461423..c616d5d 100644 (file)
  */
 
 [
-    CustomConstructor(),
     CustomPushEventHandlerScope,
     ExportMacro=WEBCORE_EXPORT,
     JSGenerateToNativeObject,
 ] interface HTMLElement : Element {
+    [Custom] constructor();
+
     // Metadata attributes.
     [CEReactions, Reflect] attribute DOMString title;
     [CEReactions, Reflect] attribute DOMString lang;
index 223928a..4219f15 100644 (file)
@@ -19,8 +19,8 @@
  */
 
 [
-    ConstructorMayThrowException,
     JSGenerateToNativeObject,
+    ConstructorMayThrowException,
     ConstructorCallWith=Document,
     NamedConstructor=Option(optional DOMString text = "", optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false),
 ] interface HTMLOptionElement : HTMLElement {
index 9ac6e88..777fdcc 100644 (file)
  */
 
 [
-    Constructor(unsigned long sw, unsigned long sh),
-    Constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh),
-    ConstructorMayThrowException,
     CustomToJSObject,
     ExportMacro=WEBCORE_EXPORT,
     Exposed=(Window,Worker),
     ImplementationLacksVTable
 ] interface ImageData {
+    [MayThrowException] constructor(unsigned long sw, unsigned long sh);
+    [MayThrowException] constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh);
+
     readonly attribute unsigned long width;
     readonly attribute unsigned long height;
     readonly attribute Uint8ClampedArray data;
index b1e0b91..11aab53 100644 (file)
  */
 
 [
-    Conditional=VIDEO,
-    Constructor,
-    ConstructorCallWith=ScriptExecutionContext,
+    Conditional=VIDEO
 ] interface MediaController : EventTarget {
+    [CallWith=ScriptExecutionContext] constructor();
+
     readonly attribute TimeRanges buffered;
     readonly attribute TimeRanges seekable;
 
index bca0f42..83286f9 100644 (file)
@@ -33,10 +33,11 @@ dictionary MediaEncryptedEventInit : EventInit {
 
 [
     Conditional=ENCRYPTED_MEDIA,
-    Constructor(DOMString type, optional MediaEncryptedEventInit eventInitDict),
     EnabledAtRuntime=EncryptedMediaAPI,
     DisabledByQuirk=hasBrokenEncryptedMediaAPISupport,
 ] interface MediaEncryptedEvent : Event {
+    constructor(DOMString type, optional MediaEncryptedEventInit eventInitDict);
+
     readonly attribute DOMString initDataType;
     readonly attribute ArrayBuffer? initData;
 };
index 779031a..fff2bfd 100644 (file)
@@ -42,13 +42,13 @@ enum OffscreenRenderingContextType
 };
 
 [
-    ConstructorCallWith=ScriptExecutionContext,
-    Constructor([EnforceRange] unsigned long width, [EnforceRange] unsigned long height),
     GenerateIsReachable=Impl,
     EnabledAtRuntime=OffscreenCanvas,
     Conditional=OFFSCREEN_CANVAS,
     Exposed=(Window,Worker)
 ] interface OffscreenCanvas : EventTarget {
+    [CallWith=ScriptExecutionContext] constructor([EnforceRange] unsigned long width, [EnforceRange] unsigned long height);
+
     attribute [EnforceRange] unsigned long width;
     attribute [EnforceRange] unsigned long height;
 
index 43bb73a..550f6a1 100644 (file)
  */
 
 [
-    Constructor(optional (sequence<sequence<USVString>> or record<USVString, USVString> or USVString) init = ""),
-    ConstructorMayThrowException,
     Exposed=(Window,Worker),
     ImplementationLacksVTable,
 ] interface URLSearchParams {
+    [MayThrowException] constructor(optional (sequence<sequence<USVString>> or record<USVString, USVString> or USVString) init = "");
+
     void append(USVString name, USVString value);
     [ImplementedAs=remove] void delete(USVString name);
     USVString? get(USVString name);
index 03a62c6..4ef03d8 100644 (file)
  */
 
 [
-    Constructor,
-    Constructor(Path2D path),
-    // FIXME: Implement missing constructor.
-    // Constructor(sequence<Path2D> paths, optional CanvasFillRule fillRule = "nonzero"),
-    Constructor(DOMString d),
     Exposed=(Window,Worker),
     ExportMacro=WEBCORE_EXPORT
 ] interface Path2D {
+    constructor();
+    constructor(Path2D path);
+    // FIXME: Implement missing constructor.
+    // constructor(sequence<Path2D> paths, optional CanvasFillRule fillRule = "nonzero");
+    constructor(DOMString d);
+
     [MayThrowException] void addPath(Path2D path, optional DOMMatrix2DInit transform);
 };
 
index 3cd03b1..718dc97 100644 (file)
@@ -25,8 +25,9 @@
 
 [
     Conditional=WEBGL,
-    Constructor(DOMString type, optional WebGLContextEventInit eventInit),
 ] interface WebGLContextEvent : Event {
+    constructor(DOMString type, optional WebGLContextEventInit eventInit);
+
     readonly attribute DOMString statusMessage;
 };
 
index 1fb1eb8..d552054 100644 (file)
 
 [
     Conditional=VIDEO,
-    Constructor(unrestricted double startTime, unrestricted double endTime, ArrayBuffer data),
-    Constructor(unrestricted double startTime, unrestricted double endTime, any value, optional DOMString type),
-    ConstructorCallWith=Document
 ] interface DataCue : TextTrackCue {
+    [CallWith=Document] constructor(unrestricted double startTime, unrestricted double endTime, ArrayBuffer data);
+    [CallWith=Document] constructor(unrestricted double startTime, unrestricted double endTime, any value, optional DOMString type);
+
     attribute ArrayBuffer data;
 
     // Proposed extensions.
index 517f872..6c5b3b1 100644 (file)
     CustomToJSObject,
     JSCustomMarkFunction,
     SkipVTableValidation,
-    Constructor(double startTime, double endTime, DocumentFragment cueNode),
-    ConstructorCallWith=Document,
-    ConstructorEnabledBySetting=GenericCueAPI,
-    ConstructorMayThrowException,
+    ConstructorEnabledBySetting=GenericCueAPI
 ] interface TextTrackCue : EventTarget {
+    [CallWith=Document, MayThrowException] constructor(double startTime, double endTime, DocumentFragment cueNode);
+
     readonly attribute TextTrack track;
 
     attribute DOMString id;
index 586aa15..ce8a1c7 100644 (file)
@@ -25,8 +25,9 @@
 
 [
     Conditional=VIDEO,
-    Constructor(DOMString type, optional TrackEventInit eventInitDict)
 ] interface TrackEvent : Event {
+    constructor(DOMString type, optional TrackEventInit eventInitDict);
+
     readonly attribute (VideoTrack or AudioTrack or TextTrack)? track;
 };
 
index ecac0f5..407bcc1 100644 (file)
@@ -28,11 +28,11 @@ typedef (double or AutoKeyword) LineAndPositionSetting;
 
 [
     Conditional=VIDEO,
-    Constructor(double startTime, double endTime, DOMString text),
-    ConstructorCallWith=Document,
     JSGenerateToJSObject,
     JSGenerateToNativeObject,
 ] interface VTTCue : TextTrackCue {
+    [CallWith=Document] constructor(double startTime, double endTime, DOMString text);
+
     attribute DOMString vertical;
     attribute boolean snapToLines;
     attribute double line;
index d467e30..144450f 100644 (file)
 
 [
     Conditional=VIDEO,
-    Constructor(),
-    ConstructorCallWith=ScriptExecutionContext,
     JSGenerateToNativeObject,
 ] interface VTTRegion {
+    [CallWith=ScriptExecutionContext] constructor();
+
     readonly attribute TextTrack track;
 
     attribute DOMString id;
index 9624360..92c8642 100644 (file)
 [
     Exposed=(Window,Worker),
     ActiveDOMObject,
-    Constructor(USVString url, optional EventSourceInit eventSourceInitDict),
-    ConstructorCallWith=ScriptExecutionContext,
-    ConstructorMayThrowException,
 ] interface EventSource : EventTarget {
+    [CallWith=ScriptExecutionContext, MayThrowException] constructor(USVString url, optional EventSourceInit eventSourceInitDict);
+
     readonly attribute USVString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
     readonly attribute USVString url;
     readonly attribute boolean withCredentials;
index 3226271..a847d28 100644 (file)
 [
     ActiveDOMObject,
     Conditional=INTERSECTION_OBSERVER,
-    ConstructorCallWith=Document,
-    ConstructorMayThrowException,
-    Constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options),
     EnabledAtRuntime=IntersectionObserver
 ] interface IntersectionObserver {
+    [CallWith=Document, MayThrowException] constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options);
+
     readonly attribute Node? root;
     readonly attribute DOMString rootMargin;
     readonly attribute sequence<double> thresholds;
index 187df5c..b78a6a3 100644 (file)
@@ -29,11 +29,12 @@ typedef double DOMHighResTimeStamp;
 
 [
     Conditional=INTERSECTION_OBSERVER,
-    Constructor(IntersectionObserverEntryInit intersectionObserverEntryInit),
     ImplementationLacksVTable,
     EnabledAtRuntime=IntersectionObserver,
     JSCustomMarkFunction,
 ] interface IntersectionObserverEntry {
+    constructor(IntersectionObserverEntryInit intersectionObserverEntryInit);
+
     readonly attribute DOMHighResTimeStamp time;
     readonly attribute DOMRectReadOnly? rootBounds;
     readonly attribute DOMRectReadOnly boundingClientRect;
index f0f24c5..30e8de1 100644 (file)
 // https://w3c.github.io/performance-timeline/
 
 [
-    Constructor(PerformanceObserverCallback callback),
-    ConstructorCallWith=ScriptExecutionContext,
     CustomIsReachable,
     EnabledAtRuntime=PerformanceTimeline,
     Exposed=(Window,Worker),
     ImplementationLacksVTable,
     JSCustomMarkFunction,
 ] interface PerformanceObserver {
+    [CallWith=ScriptExecutionContext] constructor(PerformanceObserverCallback callback);
+
     [MayThrowException] void observe(PerformanceObserverInit options);
     void disconnect();
     [CallWith=ScriptExecutionContext] static readonly attribute FrozenArray<DOMString> supportedEntryTypes;
index 87f8010..e115ae5 100644 (file)
 [
     ActiveDOMObject,
     Conditional=RESIZE_OBSERVER,
-    Constructor(ResizeObserverCallback callback),
-    ConstructorCallWith=Document,
     EnabledBySetting=ResizeObserver
 ] interface ResizeObserver {
+    [CallWith=Document] constructor(ResizeObserverCallback callback);
+
     void observe(Element target);
     void unobserve(Element target);
     void disconnect();
index 190f9bb..2cb3251 100644 (file)
@@ -36,7 +36,8 @@
     ImplementationLacksVTable,
     JSCustomMarkFunction,
     CustomIsReachable,
-    Constructor(UndoItemInit initDict),
 ] interface UndoItem {
+    constructor(UndoItemInit initDict);
+
     readonly attribute DOMString label;
 };
index d1ec5ed..e07b903 100644 (file)
  */
 
 [
-    Constructor(optional unrestricted float x = 0, optional unrestricted float y = 0),
     ImplementationLacksVTable
 ] interface WebKitPoint {
+    constructor(optional unrestricted float x = 0, optional unrestricted float y = 0);
+
     attribute unrestricted float x;
     attribute unrestricted float y;
 };
index 51dadc0..5c6d2a6 100644 (file)
@@ -23,9 +23,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-[
-    Constructor(DOMString type, optional StorageEventInit eventInitDict)
-] interface StorageEvent : Event {
+interface StorageEvent : Event {
+    constructor(DOMString type, optional StorageEventInit eventInitDict);
+
     readonly attribute DOMString? key;
     readonly attribute DOMString? oldValue;
     readonly attribute DOMString? newValue;
index 9a14100..a9a22ca 100644 (file)
 
 [
     ActiveDOMObject,
-    Constructor(USVString scriptUrl, optional WorkerOptions options),
-    ConstructorCallWith=ScriptExecutionContext&RuntimeFlags,
-    ConstructorMayThrowException
 ] interface Worker : EventTarget {
+    [CallWith=ScriptExecutionContext&RuntimeFlags, MayThrowException] constructor(USVString scriptUrl, optional WorkerOptions options);
+
     void terminate();
 
     [CallWith=GlobalObject, MayThrowException] void postMessage(any message, sequence<object> transfer);
index 630dc81..935808a 100644 (file)
 */
 
 [
-    Constructor(DOMString type, optional ExtendableEventInit eventInitDict),
     Conditional=SERVICE_WORKER,
     EnabledAtRuntime=ServiceWorker,
     Exposed=(ServiceWorker),
     ExportMacro=WEBCORE_EXPORT,
     JSGenerateToNativeObject,
 ] interface ExtendableEvent : Event {
+    constructor(DOMString type, optional ExtendableEventInit eventInitDict);
+
     [MayThrowException] void waitUntil(Promise<any> f);
 };
index 83f32e2..3f8ddc8 100644 (file)
  */
 
 [
-    CustomConstructor(DOMString type, optional ExtendableMessageEventInit eventInitDict),
     Conditional=SERVICE_WORKER,
     EnabledAtRuntime=ServiceWorker,
     Exposed=ServiceWorker,
     JSGenerateToJSObject,
 ] interface ExtendableMessageEvent : ExtendableEvent {
+    [Custom] constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict);
+
     [CachedAttribute, CustomGetter] readonly attribute any data;
     readonly attribute USVString origin;
     readonly attribute DOMString lastEventId;
index e44adbf..63b2b52 100644 (file)
@@ -24,7 +24,6 @@
 */
 
 [
-    Constructor(DOMString type, FetchEventInit eventInitDict),
     Conditional=SERVICE_WORKER,
     JSCustomMarkFunction,
     EnabledAtRuntime=ServiceWorker,
@@ -32,6 +31,8 @@
     Exposed=(ServiceWorker),
     JSGenerateToNativeObject
 ] interface FetchEvent : ExtendableEvent {
+    constructor(DOMString type, FetchEventInit eventInitDict);
+
     [SameObject] readonly attribute FetchRequest request;
     readonly attribute DOMString clientId;
     readonly attribute DOMString reservedClientId;
index 964e4ad..ac52254 100644 (file)
@@ -18,9 +18,9 @@
  */
 
 [
-    Constructor,
-    ConstructorCallWith=Document,
     ImplementationLacksVTable,
 ] interface DOMParser {
+    [CallWith=Document] constructor();
+
     [MayThrowException, NewObject] Document parseFromString(DOMString string, DOMString contentType);
 };
index 72d7adb..1e833b1 100644 (file)
@@ -40,8 +40,6 @@ enum XMLHttpRequestResponseType {
 
 [
     ActiveDOMObject,
-    Constructor,
-    ConstructorCallWith=ScriptExecutionContext,
     ExportMacro=WEBCORE_EXPORT,
     Exposed=(Window,DedicatedWorker),
     JSCustomMarkFunction,
@@ -49,6 +47,8 @@ enum XMLHttpRequestResponseType {
     JSGenerateToNativeObject,
     ReportExtraMemoryCost,
 ] interface XMLHttpRequest : XMLHttpRequestEventTarget {
+    [CallWith=ScriptExecutionContext] constructor();
+
     // event handler
     attribute EventHandler onreadystatechange;
 
index fb4d17c..914529f 100644 (file)
  */
 
 [
-    Constructor,
     ImplementationLacksVTable,
 ] interface XMLSerializer {
+    constructor();
+
     DOMString serializeToString(Node node);
 };
 
index e599c51..79dfaa9 100644 (file)
  */
 
 [
-    Constructor,
     ImplementationLacksVTable,
 ] interface XPathEvaluator {
+    constructor();
+
     [MayThrowException] XPathExpression createExpression(DOMString expression, optional XPathNSResolver? resolver);
 
     XPathNSResolver createNSResolver(Node nodeResolver);
index 2512986..86770b1 100644 (file)
 
 [
     Conditional=XSLT,
-    Constructor,
     ImplementationLacksVTable,
 ] interface XSLTProcessor {
+    constructor();
+
     void importStylesheet(optional Node? stylesheet = null);
     DocumentFragment transformToFragment(optional Node? source = null, optional Document? docVal = null);
     Document transformToDocument(optional Node? source = null);