# 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'], }, 'BaseAudioContext': { 'inRealms': ['DecodeAudioData', 'Resume', 'ParseFromString', 'GetBounds', 'GetClientRects'], 'canGc': ['CreateChannelMerger', 'CreateOscillator', 'CreateStereoPanner', 'CreateGain', 'CreateIIRFilter', 'CreateBiquadFilter', 'CreateBufferSource', 'CreateAnalyser', 'CreatePanner', 'CreateChannelSplitter', 'CreateBuffer', 'CreateConstantSource'], }, 'Blob': { 'weakReferenceable': True, 'canGc': ['Slice'], }, 'Bluetooth': { 'inRealms': ['GetAvailability', 'RequestDevice'], }, 'BluetoothDevice': { 'inRealms': ['WatchAdvertisements'], }, 'BluetoothRemoteGATTCharacteristic': { 'inRealms': ['ReadValue', 'StartNotifications', 'StopNotifications', 'WriteValue'], }, 'BluetoothRemoteGATTDescriptor': { 'inRealms': ['ReadValue', 'WriteValue'], }, 'BluetoothRemoteGATTServer': { 'inRealms': ['Connect'], }, 'CustomElementRegistry': { 'inRealms': ['WhenDefined'], }, 'CanvasRenderingContext2D': { 'canGc': ['GetTransform','GetImageData', 'CreateImageData', 'CreateImageData_', 'SetFont', 'FillText', 'MeasureText', 'SetStrokeStyle', 'SetFillStyle', 'SetShadowColor'], }, 'CanvasGradient': { 'canGc': ['AddColorStop'], }, 'DOMImplementation': { 'canGc': ['CreateDocument', 'CreateHTMLDocument'], }, 'DOMParser': { 'canGc': ['ParseFromString'], }, 'DOMMatrix': { 'canGc': ['FromMatrix', 'FromFloat32Array', 'FromFloat64Array'], }, 'DOMQuad': { 'canGc': ['FromRect', 'FromQuad', 'GetBounds'], }, 'DOMPoint': { 'canGc': ['FromPoint'], }, 'DOMPointReadOnly': { 'canGc': ['FromPoint'], }, 'DOMMatrixReadOnly': { 'canGc': ['Multiply', 'Inverse', 'Scale', 'Translate', 'Rotate', 'RotateFromVector','FlipY', 'ScaleNonUniform', 'Scale3d', 'RotateAxisAngle', 'SkewX', 'SkewY', 'FlipX', 'TransformPoint', 'FromFloat32Array', 'FromFloat64Array','FromMatrix'], }, 'Document': { 'canGc': ['Close', 'CreateElement', 'CreateElementNS', 'ImportNode', 'SetTitle', 'Write', 'Writeln', 'CreateEvent', 'CreateRange', 'Open', 'Open_', 'Fonts', 'ElementFromPoint', 'ElementsFromPoint'], }, 'DynamicModuleOwner': { 'inRealms': ['PromiseAttribute'], }, 'Element': { 'canGc': ['SetInnerHTML', 'SetOuterHTML', 'InsertAdjacentHTML', 'GetClientRects', 'GetBoundingClientRect', 'SetScrollTop', 'SetScrollLeft', 'Scroll', 'Scroll_', 'ScrollBy', 'ScrollBy_', 'ScrollWidth', 'ScrollHeight', 'ScrollTop', 'ScrollLeft', 'ClientTop', 'ClientLeft', 'ClientWidth', 'ClientHeight'], }, 'ElementInternals': { 'canGc': ['ReportValidity'], }, 'EventSource': { 'weakReferenceable': True, }, 'EventTarget': { 'canGc': ['DispatchEvent'], }, 'File': { 'weakReferenceable': True, }, 'GPU': { 'inRealms': ['RequestAdapter'], }, 'GPUAdapter': { 'inRealms': ['RequestAdapterInfo', 'RequestDevice'], }, 'GPUBuffer': { 'inRealms': ['MapAsync'], }, 'GPUDevice': { 'inRealms': [ 'CreateComputePipelineAsync', 'CreateRenderPipelineAsync', 'CreateShaderModule', # Creates promise for compilation info 'PopErrorScope' ], 'weakReferenceable': True, # for usage in GlobalScope https://github.com/servo/servo/issues/32519 }, 'GamepadHapticActuator': { 'inRealms': ['PlayEffect', 'Reset'] }, 'History': { 'canGc': ['Go'], }, 'HTMLButtonElement': { 'canGc': ['ReportValidity'], }, 'HTMLElement': { 'canGc': ['Focus', 'Blur', 'Click'], }, 'HTMLFieldSetElement': { 'canGc': ['ReportValidity'], }, 'HTMLFormElement': { 'canGc': ['RequestSubmit', 'ReportValidity'], }, 'HTMLInputElement': { 'canGc': ['ReportValidity'], }, 'HTMLMediaElement': { 'canGc': ['Load', 'Pause', 'Play', 'SetSrcObject'], 'inRealms': ['Play'], }, 'HTMLObjectElement': { 'canGc': ['ReportValidity'], }, 'HTMLOutputElement': { 'canGc': ['ReportValidity'], }, 'HTMLCanvasElement': { 'canGc': ['CaptureStream', 'GetContext'], }, 'HTMLSelectElement': { 'canGc': ['ReportValidity'], }, 'HTMLTemplateElement': { 'canGc': ['Content'], }, 'HTMLElement': { 'canGc': ['GetOffsetParent', 'OffsetTop', 'OffsetLeft', 'OffsetWidth', 'OffsetHeight', 'InnerText', 'GetOuterText', 'Focus', 'Blur', 'Click'], }, 'HTMLImageElement': { 'canGc': ['Width', 'Height'], }, 'HTMLTextAreaElement': { 'canGc': ['ReportValidity'], }, 'Location': { 'canGc': ['Assign', 'Reload', 'Replace', 'SetHash', 'SetHost', 'SetHostname', 'SetHref', 'SetPathname', 'SetPort', 'SetProtocol', 'SetSearch'], }, 'MediaDevices': { 'canGc': ['GetUserMedia'], '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'], }, 'Navigator': { 'inRealms': ['GetVRDisplays'], }, 'Node': { 'canGc': ['CloneNode'], }, 'OfflineAudioContext': { 'inRealms': ['StartRendering'], }, 'OffscreenCanvasRenderingContext2D': { 'canGc': ['CreateImageData', 'CreateImageData_', 'GetImageData', 'GetTransform', 'SetFont', 'FillText', 'MeasureText', 'SetStrokeStyle', 'SetFillStyle', 'SetShadowColor'], }, 'PaintRenderingContext2D': { 'canGc': ['GetTransform', 'SetStrokeStyle', 'SetFillStyle', 'SetShadowColor'], }, 'Promise': { 'spiderMonkeyInterface': True, }, 'RTCPeerConnection': { 'inRealms': ['AddIceCandidate', 'CreateAnswer', 'CreateOffer', 'SetLocalDescription', 'SetRemoteDescription'], 'canGc': ['Close'], }, 'Range': { 'canGc': ['CloneContents', 'CloneRange', 'CreateContextualFragment', 'ExtractContents', 'SurroundContents'], 'weakReferenceable': True, }, 'Response': { 'canGc': ['Error', 'Redirect', 'Clone', 'Text', 'Blob', 'FormData', 'Json', 'ArrayBuffer'], }, 'Request': { 'canGc': ['Headers', 'Text', 'Blob', 'FormData', 'Json', 'ArrayBuffer', 'Clone'], }, 'Selection': { 'canGc': ['Collapse', 'CollapseToEnd', 'CollapseToStart', 'Extend', 'SelectAllChildren', 'SetBaseAndExtent', 'SetPosition'], }, 'ServiceWorkerContainer': { 'inRealms': ['Register'], }, 'StaticRange': { 'weakReferenceable': True, }, 'ShadowRoot': { 'canGc': ['ElementFromPoint', 'ElementsFromPoint'], }, 'SubtleCrypto': { 'inRealms': ['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'], }, 'TestWorklet': { 'inRealms': ['AddModule'], }, 'URL': { 'weakReferenceable': True, 'canGc': ['Parse', 'SearchParams'], }, 'VRDisplay': { 'inRealms': ['ExitPresent', 'RequestPresent'], }, 'Window': { 'canGc': ['Stop', 'Fetch', 'Scroll', 'Scroll_','ScrollBy', 'ScrollBy_', 'Stop', 'Fetch', 'Open'], 'inRealms': ['Fetch', 'GetOpener'], }, 'WindowProxy' : { 'path': 'crate::dom::windowproxy::WindowProxy', 'register': False, }, 'WorkerGlobalScope': { 'inRealms': ['Fetch'], 'canGc': ['Fetch'], }, 'Worklet': { 'inRealms': ['AddModule'], }, 'XMLHttpRequest': { 'canGc': ['Abort', 'GetResponseXML', 'Response'], }, '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'], }, 'XRSystem': { 'inRealms': ['RequestSession', 'SupportsSessionMode'], }, }