servo/components/script/dom/bindings/codegen/Bindings.conf
Josh Matthews 575e885529
Mark promise creation methods with CanGc (#33928)
* Add CanGc annotations to promise constructor.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Propagate CanGc arguments for Promise::new_in_current_realm.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix out-of-order entries.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Propagate CanGc from Promise::new.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Suppress clippy warning.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-10-22 09:35:20 +00:00

433 lines
11 KiB
Text

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# DOM Bindings Configuration.
#
# The WebIDL interfaces are defined in dom/webidls. For each such interface,
# there is a corresponding entry in the configuration table below.
# The configuration table maps each interface name to a |descriptor|.
#
# Valid fields for all descriptors:
# * outerObjectHook: string to use in place of default value for outerObject and thisObject
# JS class hooks
DOMInterfaces = {
'AbstractRange': {
'weakReferenceable': True,
},
'AudioContext': {
'inRealms': ['Close', 'Suspend'],
'canGc':['CreateMediaStreamDestination', 'CreateMediaElementSource', 'CreateMediaStreamSource', 'CreateMediaStreamTrackSource', 'Suspend', 'Close'],
},
'BaseAudioContext': {
'inRealms': ['DecodeAudioData', 'Resume', 'ParseFromString', 'GetBounds', 'GetClientRects'],
'canGc': ['CreateChannelMerger', 'CreateOscillator', 'CreateStereoPanner', 'CreateGain', 'CreateIIRFilter', 'CreateBiquadFilter', 'CreateBufferSource', 'CreateAnalyser', 'CreatePanner', 'CreateChannelSplitter', 'CreateBuffer', 'CreateConstantSource', 'Resume', 'DecodeAudioData'],
},
'Blob': {
'weakReferenceable': True,
'canGc': ['Slice', 'Text', 'ArrayBuffer'],
},
'Bluetooth': {
'inRealms': ['GetAvailability', 'RequestDevice'],
'canGc': ['RequestDevice', 'GetAvailability'],
},
'BluetoothDevice': {
'inRealms': ['WatchAdvertisements'],
'canGc': ['WatchAdvertisements'],
},
'BluetoothRemoteGATTCharacteristic': {
'inRealms': ['ReadValue', 'StartNotifications', 'StopNotifications', 'WriteValue'],
'canGc': ['GetDescriptor', 'GetDescriptors', 'ReadValue', 'StartNotifications', 'StopNotifications', 'WriteValue'],
},
'BluetoothRemoteGATTDescriptor': {
'inRealms': ['ReadValue', 'WriteValue'],
'canGc': ['ReadValue', 'WriteValue'],
},
'BluetoothRemoteGATTServer': {
'inRealms': ['Connect'],
'canGc': ['GetPrimaryService', 'GetPrimaryServices', 'Connect'],
},
'BluetoothRemoteGATTService': {
'canGc': ['GetCharacteristic', 'GetCharacteristics', 'GetIncludedService', 'GetIncludedServices'],
},
'CanvasRenderingContext2D': {
'canGc': ['GetTransform','GetImageData', 'CreateImageData', 'CreateImageData_', 'SetFont', 'FillText', 'MeasureText', 'SetStrokeStyle', 'SetFillStyle', 'SetShadowColor'],
},
'CanvasGradient': {
'canGc': ['AddColorStop'],
},
'CustomElementRegistry': {
'inRealms': ['WhenDefined'],
'canGc': ['WhenDefined'],
},
'DOMImplementation': {
'canGc': ['CreateDocument', 'CreateHTMLDocument'],
},
'DOMMatrix': {
'canGc': ['FromMatrix', 'FromFloat32Array', 'FromFloat64Array'],
},
'DOMMatrixReadOnly': {
'canGc': ['Multiply', 'Inverse', 'Scale', 'Translate', 'Rotate', 'RotateFromVector','FlipY', 'ScaleNonUniform', 'Scale3d', 'RotateAxisAngle', 'SkewX', 'SkewY', 'FlipX', 'TransformPoint', 'FromFloat32Array', 'FromFloat64Array','FromMatrix'],
},
'DOMParser': {
'canGc': ['ParseFromString'],
},
'DOMPoint': {
'canGc': ['FromPoint'],
},
'DOMPointReadOnly': {
'canGc': ['FromPoint'],
},
'DOMQuad': {
'canGc': ['FromRect', 'FromQuad', 'GetBounds'],
},
'Document': {
'canGc': ['Close', 'CreateElement', 'CreateElementNS', 'ImportNode', 'SetTitle', 'Write', 'Writeln', 'CreateEvent', 'CreateRange', 'Open', 'Open_', 'Fonts', 'ElementFromPoint', 'ElementsFromPoint', 'ExitFullscreen'],
},
'DynamicModuleOwner': {
'inRealms': ['PromiseAttribute'],
},
'Element': {
'canGc': ['SetInnerHTML', 'SetOuterHTML', 'InsertAdjacentHTML', 'GetClientRects', 'GetBoundingClientRect', 'SetScrollTop', 'SetScrollLeft', 'Scroll', 'Scroll_', 'ScrollBy', 'ScrollBy_', 'ScrollWidth', 'ScrollHeight', 'ScrollTop', 'ScrollLeft', 'ClientTop', 'ClientLeft', 'ClientWidth', 'ClientHeight', 'RequestFullscreen'],
},
'ElementInternals': {
'canGc': ['ReportValidity'],
},
'EventSource': {
'weakReferenceable': True,
},
'EventTarget': {
'canGc': ['DispatchEvent'],
},
'FakeXRDevice': {
'canGc': ['Disconnect'],
},
'File': {
'weakReferenceable': True,
},
'FileReader': {
'canGc': ['Abort'],
},
'GPU': {
'inRealms': ['RequestAdapter'],
'canGc': ['RequestAdapter'],
},
'GPUAdapter': {
'inRealms': ['RequestAdapterInfo', 'RequestDevice'],
'canGc': ['RequestAdapterInfo', 'RequestDevice'],
},
'GPUBuffer': {
'inRealms': ['MapAsync'],
'canGc': ['MapAsync'],
},
'GPUDevice': {
'inRealms': [
'CreateComputePipelineAsync',
'CreateRenderPipelineAsync',
'CreateShaderModule', # Creates promise for compilation info
'PopErrorScope'
],
'canGc': [
'CreateComputePipelineAsync',
'CreateRenderPipelineAsync',
'CreateShaderModule',
'PopErrorScope'
],
'weakReferenceable': True, # for usage in GlobalScope https://github.com/servo/servo/issues/32519
},
'GPUQueue': {
'canGc': ['OnSubmittedWorkDone'],
},
'GamepadHapticActuator': {
'inRealms': ['PlayEffect', 'Reset'],
'canGc': ['PlayEffect', 'Reset'],
},
'History': {
'canGc': ['Go'],
},
'HTMLButtonElement': {
'canGc': ['ReportValidity'],
},
'HTMLCanvasElement': {
'canGc': ['CaptureStream', 'GetContext'],
},
'HTMLElement': {
'canGc': ['GetOffsetParent', 'OffsetTop', 'OffsetLeft', 'OffsetWidth', 'OffsetHeight', 'InnerText', 'GetOuterText', 'Focus', 'Blur', 'Click'],
},
'HTMLFieldSetElement': {
'canGc': ['ReportValidity'],
},
'HTMLFormElement': {
'canGc': ['RequestSubmit', 'ReportValidity', 'Submit'],
},
'HTMLInputElement': {
'canGc': ['ReportValidity', 'SelectFiles'],
},
'HTMLImageElement': {
'canGc': ['Width', 'Height', 'Decode'],
},
'HTMLMediaElement': {
'canGc': ['Load', 'Pause', 'Play', 'SetSrcObject'],
'inRealms': ['Play'],
},
'HTMLObjectElement': {
'canGc': ['ReportValidity'],
},
'HTMLOutputElement': {
'canGc': ['ReportValidity'],
},
'HTMLSelectElement': {
'canGc': ['ReportValidity'],
},
'HTMLTemplateElement': {
'canGc': ['Content'],
},
'HTMLTextAreaElement': {
'canGc': ['ReportValidity'],
},
'Location': {
'canGc': ['Assign', 'Reload', 'Replace', 'SetHash', 'SetHost', 'SetHostname', 'SetHref', 'SetPathname', 'SetPort', 'SetProtocol', 'SetSearch'],
},
'MediaDevices': {
'canGc': ['GetUserMedia', 'EnumerateDevices'],
'inRealms': ['GetUserMedia', 'GetClientRects', 'GetBoundingClientRect'],
},
'MediaStream': {
'canGc': ['Clone'],
},
'MediaSession': {
'canGc': ['GetMetadata'],
},
'MouseEvent': {
'canGc': ['OffsetX', 'OffsetY'],
},
'MediaQueryList': {
'weakReferenceable': True,
},
'MessagePort': {
'weakReferenceable': True,
},
'NavigationPreloadManager': {
'inRealms': ['Disable', 'Enable', 'GetState', 'SetHeaderValue'],
'canGc': ['Disable', 'Enable', 'GetState', 'SetHeaderValue'],
},
'Navigator': {
'inRealms': ['GetVRDisplays'],
},
'Node': {
'canGc': ['CloneNode'],
},
'OfflineAudioContext': {
'inRealms': ['StartRendering'],
'canGc': ['StartRendering'],
},
'OffscreenCanvasRenderingContext2D': {
'canGc': ['CreateImageData', 'CreateImageData_', 'GetImageData', 'GetTransform', 'SetFont', 'FillText', 'MeasureText', 'SetStrokeStyle', 'SetFillStyle', 'SetShadowColor'],
},
'PaintRenderingContext2D': {
'canGc': ['GetTransform', 'SetStrokeStyle', 'SetFillStyle', 'SetShadowColor'],
},
'Permissions': {
'canGc': ['Query', 'Request', 'Revoke'],
},
'Promise': {
'spiderMonkeyInterface': True,
},
'RTCPeerConnection': {
'inRealms': ['AddIceCandidate', 'CreateAnswer', 'CreateOffer', 'SetLocalDescription', 'SetRemoteDescription'],
'canGc': ['Close', 'AddIceCandidate', 'CreateAnswer', 'CreateOffer', 'SetLocalDescription', 'SetRemoteDescription'],
},
'RTCRtpSender': {
'canGc': ['SetParameters'],
},
'Range': {
'canGc': ['CloneContents', 'CloneRange', 'CreateContextualFragment', 'ExtractContents', 'SurroundContents'],
'weakReferenceable': True,
},
'Request': {
'canGc': ['Headers', 'Text', 'Blob', 'FormData', 'Json', 'ArrayBuffer', 'Clone'],
},
'Response': {
'canGc': ['Error', 'Redirect', 'Clone', 'Text', 'Blob', 'FormData', 'Json', 'ArrayBuffer', 'Headers'],
},
'Selection': {
'canGc': ['Collapse', 'CollapseToEnd', 'CollapseToStart', 'Extend', 'SelectAllChildren', 'SetBaseAndExtent', 'SetPosition'],
},
'ServiceWorkerContainer': {
'inRealms': ['Register'],
'canGc': ['Register'],
},
'ShadowRoot': {
'canGc': ['ElementFromPoint', 'ElementsFromPoint'],
},
'StaticRange': {
'weakReferenceable': True,
},
'SubtleCrypto': {
'inRealms': ['Encrypt', 'Decrypt', 'GenerateKey', 'ImportKey', 'ExportKey'],
'canGc': ['Encrypt', 'Decrypt', 'GenerateKey', 'ImportKey', 'ExportKey'],
},
#FIXME(jdm): This should be 'register': False, but then we don't generate enum types
'TestBinding': {
'inRealms': ['PromiseAttribute', 'PromiseNativeHandler'],
'canGc': ['InterfaceAttribute', 'GetInterfaceAttributeNullable', 'ReceiveInterface', 'ReceiveInterfaceSequence', 'ReceiveNullableInterface', 'PromiseAttribute', 'PromiseNativeHandler'],
},
'TestWorklet': {
'inRealms': ['AddModule'],
'canGc': ['AddModule'],
},
'URL': {
'weakReferenceable': True,
'canGc': ['Parse', 'SearchParams'],
},
'WebGLRenderingContext': {
'canGc': ['MakeXRCompatible'],
},
'WebGL2RenderingContext': {
'canGc': ['MakeXRCompatible'],
},
'Window': {
'canGc': ['Stop', 'Fetch', 'Scroll', 'Scroll_','ScrollBy', 'ScrollBy_', 'Stop', 'Fetch', 'Open', 'CreateImageBitmap'],
'inRealms': ['Fetch', 'GetOpener'],
},
'WindowProxy' : {
'path': 'crate::dom::windowproxy::WindowProxy',
'register': False,
},
'WorkerGlobalScope': {
'inRealms': ['Fetch'],
'canGc': ['Fetch', 'CreateImageBitmap'],
},
'Worklet': {
'inRealms': ['AddModule'],
'canGc': ['AddModule'],
},
'XMLHttpRequest': {
'canGc': ['Abort', 'GetResponseXML', 'Response', 'Send'],
},
'XRBoundedReferenceSpace': {
'canGc': ['BoundsGeometry'],
},
'XRFrame': {
'canGc': ['GetViewerPose', 'GetPose', 'GetJointPose'],
},
'XRHitTestResult': {
'canGc': ['GetPose'],
},
'XRRay': {
'canGc': ['Origin', 'Direction'],
},
'XRReferenceSpace': {
'canGc': ['GetOffsetReferenceSpace'],
},
'XRRigidTransform': {
'canGc': ['Position', 'Orientation', 'Inverse'],
},
'XRSession': {
'inRealms': ['RequestReferenceSpace', 'UpdateRenderState', 'UpdateTargetFrameRate'],
'canGc': ['End', 'RequestReferenceSpace', 'UpdateTargetFrameRate', 'RequestHitTestSource'],
},
'XRSystem': {
'inRealms': ['RequestSession'],
'canGc': ['RequestSession', 'IsSessionSupported'],
},
'XRTest': {
'canGc': ['SimulateDeviceConnection', 'DisconnectAllDevices'],
},
}