# 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'], }, 'BaseAudioContext': { 'inRealms': ['DecodeAudioData', 'Resume', 'ParseFromString', 'GetBounds', 'GetClientRects'], }, 'Blob': { 'weakReferenceable': True, }, 'Bluetooth': { 'inRealms': ['GetAvailability', 'RequestDevice'], }, 'BluetoothDevice': { 'inRealms': ['WatchAdvertisements'], }, 'BluetoothRemoteGATTCharacteristic': { 'inRealms': ['ReadValue', 'StartNotifications', 'StopNotifications', 'WriteValue'], }, 'BluetoothRemoteGATTDescriptor': { 'inRealms': ['ReadValue', 'WriteValue'], }, 'BluetoothRemoteGATTServer': { 'inRealms': ['Connect'], }, 'CustomElementRegistry': { 'inRealms': ['WhenDefined'], }, 'DOMImplementation': { 'canGc': ['CreateDocument', 'CreateHTMLDocument'], }, 'DOMParser': { 'canGc': ['ParseFromString'], }, 'Document': { 'canGc': ['Close', 'CreateElement', 'CreateElementNS', 'ImportNode', 'SetTitle', 'Write', 'Writeln'], }, 'DynamicModuleOwner': { 'inRealms': ['PromiseAttribute'], }, 'Element': { 'canGc': ['SetInnerHTML', 'SetOuterHTML', 'InsertAdjacentHTML', 'GetClientRects', 'GetBoundingClientRect'], }, 'EventSource': { 'weakReferenceable': True, }, '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'] }, 'HTMLMediaElement': { 'canGc': ['Load', 'Pause', 'Play', 'SetSrcObject'], 'inRealms': ['Play'], }, 'HTMLTemplateElement': { 'canGc': ['Content'], }, 'MediaDevices': { 'inRealms': ['GetUserMedia', 'GetClientRects', 'GetBoundingClientRect'], }, 'MediaQueryList': { 'weakReferenceable': True, }, 'MessagePort': { 'weakReferenceable': True, }, 'NavigationPreloadManager': { 'inRealms': ['Disable', 'Enable', 'GetState', 'SetHeaderValue'], }, 'Navigator': { 'inRealms': ['GetVRDisplays'], }, 'Node': { 'canGc': ['CloneNode'], }, 'OfflineAudioContext': { 'inRealms': ['StartRendering'], }, 'Promise': { 'spiderMonkeyInterface': True, }, 'RTCPeerConnection': { 'inRealms': ['AddIceCandidate', 'CreateAnswer', 'CreateOffer', 'SetLocalDescription', 'SetRemoteDescription'], }, 'Range': { 'canGc': ['CloneContents', 'CloneRange', 'CreateContextualFragment', 'ExtractContents', 'SurroundContents'], 'weakReferenceable': True, }, 'Selection': { 'canGc': ['Collapse', 'CollapseToEnd', 'CollapseToStart', 'Extend', 'SelectAllChildren', 'SetBaseAndExtent', 'SetPosition'], }, 'ServiceWorkerContainer': { 'inRealms': ['Register'], }, 'StaticRange': { 'weakReferenceable': True, }, #FIXME(jdm): This should be 'register': False, but then we don't generate enum types 'TestBinding': { 'inRealms': ['PromiseAttribute', 'PromiseNativeHandler'], }, 'TestWorklet': { 'inRealms': ['AddModule'], }, 'URL': { 'weakReferenceable': True, }, 'VRDisplay': { 'inRealms': ['ExitPresent', 'RequestPresent'], }, 'Window': { 'canGc': ['Stop'], 'inRealms': ['Fetch', 'GetOpener'], }, 'WindowProxy' : { 'path': 'crate::dom::windowproxy::WindowProxy', 'register': False, }, 'WorkerGlobalScope': { 'inRealms': ['Fetch'], }, 'Worklet': { 'inRealms': ['AddModule'], }, 'XMLHttpRequest': { 'canGc': ['GetResponseXML', 'Response'], }, 'XRSession': { 'inRealms': ['RequestReferenceSpace', 'UpdateRenderState', 'UpdateTargetFrameRate'], }, 'XRSystem': { 'inRealms': ['RequestSession', 'SupportsSessionMode'], }, 'SubtleCrypto': { 'inRealms': ['GenerateKey', 'ExportKey'] } }