diff options
Diffstat (limited to 'components/script/dom/webidls')
460 files changed, 7482 insertions, 2523 deletions
diff --git a/components/script/dom/webidls/ANGLEInstancedArrays.webidl b/components/script/dom/webidls/ANGLEInstancedArrays.webidl new file mode 100644 index 00000000000..fc7e5d3efab --- /dev/null +++ b/components/script/dom/webidls/ANGLEInstancedArrays.webidl @@ -0,0 +1,15 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/ + */ + +[NoInterfaceObject, Exposed=Window] +interface ANGLEInstancedArrays { + const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE; + void drawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount); + void drawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei primcount); + void vertexAttribDivisorANGLE(GLuint index, GLuint divisor); +}; diff --git a/components/script/dom/webidls/ActivatableElement.webidl b/components/script/dom/webidls/ActivatableElement.webidl index 2b69baff303..bce7730a833 100644 --- a/components/script/dom/webidls/ActivatableElement.webidl +++ b/components/script/dom/webidls/ActivatableElement.webidl @@ -1,12 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // Interface for testing element activation // This interface is entirely internal to Servo, and should not be accessible to // web pages. -[Exposed=(Window,Worker), NoInterfaceObject] -interface ActivatableElement { +[Exposed=(Window,Worker)] +interface mixin ActivatableElement { [Throws, Pref="dom.testing.element.activation.enabled"] void enterFormalActivationState(); diff --git a/components/script/dom/webidls/AnalyserNode.webidl b/components/script/dom/webidls/AnalyserNode.webidl new file mode 100644 index 00000000000..c1398d56378 --- /dev/null +++ b/components/script/dom/webidls/AnalyserNode.webidl @@ -0,0 +1,28 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#analysernode + */ + +dictionary AnalyserOptions : AudioNodeOptions { + unsigned long fftSize = 2048; + double maxDecibels = -30; + double minDecibels = -100; + double smoothingTimeConstant = 0.8; +}; + +[Exposed=Window] +interface AnalyserNode : AudioNode { + [Throws] constructor(BaseAudioContext context, optional AnalyserOptions options = {}); + void getFloatFrequencyData (Float32Array array); + void getByteFrequencyData (Uint8Array array); + void getFloatTimeDomainData (Float32Array array); + void getByteTimeDomainData (Uint8Array array); + [SetterThrows] attribute unsigned long fftSize; + readonly attribute unsigned long frequencyBinCount; + [SetterThrows] attribute double minDecibels; + [SetterThrows] attribute double maxDecibels; + [SetterThrows] attribute double smoothingTimeConstant; +}; diff --git a/components/script/dom/webidls/AnimationEvent.webidl b/components/script/dom/webidls/AnimationEvent.webidl new file mode 100644 index 00000000000..fd9d6c47f7e --- /dev/null +++ b/components/script/dom/webidls/AnimationEvent.webidl @@ -0,0 +1,26 @@ +/* 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 http://mozilla.org/MPL/2.0/. + * + * The origin of this IDL file is + * http://www.w3.org/TR/css3-animations/#animation-events- + * http://dev.w3.org/csswg/css3-animations/#animation-events- + * + * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C + * liability, trademark and document use rules apply. + */ + +[Exposed=Window] +interface AnimationEvent : Event { + constructor(DOMString type, optional AnimationEventInit eventInitDict = {}); + + readonly attribute DOMString animationName; + readonly attribute float elapsedTime; + readonly attribute DOMString pseudoElement; +}; + +dictionary AnimationEventInit : EventInit { + DOMString animationName = ""; + float elapsedTime = 0; + DOMString pseudoElement = ""; +}; diff --git a/components/script/dom/webidls/Attr.webidl b/components/script/dom/webidls/Attr.webidl index 79449804081..f56f9104e65 100644 --- a/components/script/dom/webidls/Attr.webidl +++ b/components/script/dom/webidls/Attr.webidl @@ -1,13 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://dom.spec.whatwg.org/#interface-attr * */ -interface Attr { +[Exposed=Window] +interface Attr : Node { [Constant] readonly attribute DOMString? namespaceURI; [Constant] @@ -16,14 +17,8 @@ interface Attr { readonly attribute DOMString localName; [Constant] readonly attribute DOMString name; - [Constant] - readonly attribute DOMString nodeName; // historical alias of .name - [Pure] + [CEReactions, Pure] attribute DOMString value; - [Pure] - attribute DOMString textContent; // historical alias of .value - [Pure] - attribute DOMString nodeValue; // historical alias of .value [Pure] readonly attribute Element? ownerElement; diff --git a/components/script/dom/webidls/AudioBuffer.webidl b/components/script/dom/webidls/AudioBuffer.webidl new file mode 100644 index 00000000000..75b3b470838 --- /dev/null +++ b/components/script/dom/webidls/AudioBuffer.webidl @@ -0,0 +1,29 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#audiobuffer + */ + +dictionary AudioBufferOptions { + unsigned long numberOfChannels = 1; + required unsigned long length; + required float sampleRate; +}; + +[Exposed=Window] +interface AudioBuffer { + [Throws] constructor(AudioBufferOptions options); + readonly attribute float sampleRate; + readonly attribute unsigned long length; + readonly attribute double duration; + readonly attribute unsigned long numberOfChannels; + [Throws] Float32Array getChannelData(unsigned long channel); + [Throws] void copyFromChannel(Float32Array destination, + unsigned long channelNumber, + optional unsigned long startInChannel = 0); + [Throws] void copyToChannel(Float32Array source, + unsigned long channelNumber, + optional unsigned long startInChannel = 0); +}; diff --git a/components/script/dom/webidls/AudioBufferSourceNode.webidl b/components/script/dom/webidls/AudioBufferSourceNode.webidl new file mode 100644 index 00000000000..8744a521ddb --- /dev/null +++ b/components/script/dom/webidls/AudioBufferSourceNode.webidl @@ -0,0 +1,30 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#AudioBufferSourceNode + */ + +dictionary AudioBufferSourceOptions { + AudioBuffer? buffer; + float detune = 0; + boolean loop = false; + double loopEnd = 0; + double loopStart = 0; + float playbackRate = 1; +}; + +[Exposed=Window] +interface AudioBufferSourceNode : AudioScheduledSourceNode { + [Throws] constructor(BaseAudioContext context, optional AudioBufferSourceOptions options = {}); + [Throws] attribute AudioBuffer? buffer; + readonly attribute AudioParam playbackRate; + readonly attribute AudioParam detune; + attribute boolean loop; + attribute double loopStart; + attribute double loopEnd; + [Throws] void start(optional double when = 0, + optional double offset, + optional double duration); +}; diff --git a/components/script/dom/webidls/AudioContext.webidl b/components/script/dom/webidls/AudioContext.webidl new file mode 100644 index 00000000000..09d6693b690 --- /dev/null +++ b/components/script/dom/webidls/AudioContext.webidl @@ -0,0 +1,40 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#dom-audiocontext + */ + +enum AudioContextLatencyCategory { + "balanced", + "interactive", + "playback" +}; + +dictionary AudioContextOptions { + (AudioContextLatencyCategory or double) latencyHint = "interactive"; + float sampleRate; +}; + +dictionary AudioTimestamp { + double contextTime; + DOMHighResTimeStamp performanceTime; +}; + +[Exposed=Window] +interface AudioContext : BaseAudioContext { + [Throws] constructor(optional AudioContextOptions contextOptions = {}); + readonly attribute double baseLatency; + readonly attribute double outputLatency; + + AudioTimestamp getOutputTimestamp(); + + Promise<void> suspend(); + Promise<void> close(); + + [Throws] MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement); + [Throws] MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream); + [Throws] MediaStreamTrackAudioSourceNode createMediaStreamTrackSource(MediaStreamTrack mediaStreamTrack); + [Throws] MediaStreamAudioDestinationNode createMediaStreamDestination(); +}; diff --git a/components/script/dom/webidls/AudioDestinationNode.webidl b/components/script/dom/webidls/AudioDestinationNode.webidl new file mode 100644 index 00000000000..572c7d954f0 --- /dev/null +++ b/components/script/dom/webidls/AudioDestinationNode.webidl @@ -0,0 +1,12 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#dom-audiodestinationnode + */ + +[Exposed=Window] +interface AudioDestinationNode : AudioNode { + readonly attribute unsigned long maxChannelCount; +}; diff --git a/components/script/dom/webidls/AudioListener.webidl b/components/script/dom/webidls/AudioListener.webidl new file mode 100644 index 00000000000..d625740802f --- /dev/null +++ b/components/script/dom/webidls/AudioListener.webidl @@ -0,0 +1,22 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#audiolistener + */ + +[Exposed=Window] +interface AudioListener { + readonly attribute AudioParam positionX; + readonly attribute AudioParam positionY; + readonly attribute AudioParam positionZ; + readonly attribute AudioParam forwardX; + readonly attribute AudioParam forwardY; + readonly attribute AudioParam forwardZ; + readonly attribute AudioParam upX; + readonly attribute AudioParam upY; + readonly attribute AudioParam upZ; + [Throws] AudioListener setPosition (float x, float y, float z); + [Throws] AudioListener setOrientation (float x, float y, float z, float xUp, float yUp, float zUp); +}; diff --git a/components/script/dom/webidls/AudioNode.webidl b/components/script/dom/webidls/AudioNode.webidl new file mode 100644 index 00000000000..bf4f88e02b6 --- /dev/null +++ b/components/script/dom/webidls/AudioNode.webidl @@ -0,0 +1,62 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#dom-audionode + */ + +enum ChannelCountMode { + "max", + "clamped-max", + "explicit" +}; + +enum ChannelInterpretation { + "speakers", + "discrete" +}; + +dictionary AudioNodeOptions { + unsigned long channelCount; + ChannelCountMode channelCountMode; + ChannelInterpretation channelInterpretation; +}; + +[Exposed=Window] +interface AudioNode : EventTarget { + [Throws] + AudioNode connect(AudioNode destinationNode, + optional unsigned long output = 0, + optional unsigned long input = 0); + [Throws] + void connect(AudioParam destinationParam, + optional unsigned long output = 0); + [Throws] + void disconnect(); + [Throws] + void disconnect(unsigned long output); + [Throws] + void disconnect(AudioNode destination); + [Throws] + void disconnect(AudioNode destination, unsigned long output); + [Throws] + void disconnect(AudioNode destination, + unsigned long output, + unsigned long input); + [Throws] + void disconnect(AudioParam destination); + [Throws] + void disconnect(AudioParam destination, unsigned long output); + + readonly attribute BaseAudioContext context; + readonly attribute unsigned long numberOfInputs; + readonly attribute unsigned long numberOfOutputs; + + [SetterThrows] + attribute unsigned long channelCount; + [SetterThrows] + attribute ChannelCountMode channelCountMode; + [SetterThrows] + attribute ChannelInterpretation channelInterpretation; +}; diff --git a/components/script/dom/webidls/AudioParam.webidl b/components/script/dom/webidls/AudioParam.webidl new file mode 100644 index 00000000000..42f1012539c --- /dev/null +++ b/components/script/dom/webidls/AudioParam.webidl @@ -0,0 +1,32 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#dom-audioparam + */ + +enum AutomationRate { + "a-rate", + "k-rate" +}; + +[Exposed=Window] +interface AudioParam { + attribute float value; + attribute AutomationRate automationRate; + readonly attribute float defaultValue; + readonly attribute float minValue; + readonly attribute float maxValue; + [Throws] AudioParam setValueAtTime(float value, double startTime); + [Throws] AudioParam linearRampToValueAtTime(float value, double endTime); + [Throws] AudioParam exponentialRampToValueAtTime(float value, double endTime); + [Throws] AudioParam setTargetAtTime(float target, + double startTime, + float timeConstant); + [Throws] AudioParam setValueCurveAtTime(sequence<float> values, + double startTime, + double duration); + [Throws] AudioParam cancelScheduledValues(double cancelTime); + [Throws] AudioParam cancelAndHoldAtTime(double cancelTime); +}; diff --git a/components/script/dom/webidls/AudioScheduledSourceNode.webidl b/components/script/dom/webidls/AudioScheduledSourceNode.webidl new file mode 100644 index 00000000000..6be6373a7ec --- /dev/null +++ b/components/script/dom/webidls/AudioScheduledSourceNode.webidl @@ -0,0 +1,14 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#AudioScheduledSourceNode + */ + +[Exposed=Window] +interface AudioScheduledSourceNode : AudioNode { + attribute EventHandler onended; + [Throws] void start(optional double when = 0); + [Throws] void stop(optional double when = 0); +}; diff --git a/components/script/dom/webidls/AudioTrack.webidl b/components/script/dom/webidls/AudioTrack.webidl new file mode 100644 index 00000000000..2fa2ec9a5fa --- /dev/null +++ b/components/script/dom/webidls/AudioTrack.webidl @@ -0,0 +1,14 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#audiotrack + +[Exposed=Window] +interface AudioTrack { + readonly attribute DOMString id; + readonly attribute DOMString kind; + readonly attribute DOMString label; + readonly attribute DOMString language; + attribute boolean enabled; +}; diff --git a/components/script/dom/webidls/AudioTrackList.webidl b/components/script/dom/webidls/AudioTrackList.webidl new file mode 100644 index 00000000000..4428776972c --- /dev/null +++ b/components/script/dom/webidls/AudioTrackList.webidl @@ -0,0 +1,16 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#audiotracklist + +[Exposed=Window] +interface AudioTrackList : EventTarget { + readonly attribute unsigned long length; + getter AudioTrack (unsigned long index); + AudioTrack? getTrackById(DOMString id); + + attribute EventHandler onchange; + attribute EventHandler onaddtrack; + attribute EventHandler onremovetrack; +}; diff --git a/components/script/dom/webidls/BaseAudioContext.webidl b/components/script/dom/webidls/BaseAudioContext.webidl new file mode 100644 index 00000000000..57fb677defd --- /dev/null +++ b/components/script/dom/webidls/BaseAudioContext.webidl @@ -0,0 +1,55 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#BaseAudioContext + */ + +enum AudioContextState { + "suspended", + "running", + "closed" +}; + +callback DecodeErrorCallback = void (DOMException error); +callback DecodeSuccessCallback = void (AudioBuffer decodedData); + +[Exposed=Window] +interface BaseAudioContext : EventTarget { + readonly attribute AudioDestinationNode destination; + readonly attribute float sampleRate; + readonly attribute double currentTime; + readonly attribute AudioListener listener; + readonly attribute AudioContextState state; + Promise<void> resume(); + attribute EventHandler onstatechange; + [Throws] AudioBuffer createBuffer(unsigned long numberOfChannels, + unsigned long length, + float sampleRate); + Promise<AudioBuffer> decodeAudioData(ArrayBuffer audioData, + optional DecodeSuccessCallback successCallback, + optional DecodeErrorCallback errorCallback); + [Throws] AudioBufferSourceNode createBufferSource(); + [Throws] ConstantSourceNode createConstantSource(); + // ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0, + // optional unsigned long numberOfInputChannels = 2, + // optional unsigned long numberOfOutputChannels = 2); + [Throws] AnalyserNode createAnalyser(); + [Throws] GainNode createGain(); + // DelayNode createDelay(optional double maxDelayTime = 1); + [Throws] BiquadFilterNode createBiquadFilter(); + // IIRFilterNode createIIRFilter(sequence<double> feedforward, + // sequence<double> feedback); + // WaveShaperNode createWaveShaper(); + [Throws] PannerNode createPanner(); + [Throws] StereoPannerNode createStereoPanner(); + // ConvolverNode createConvolver(); + [Throws] ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs = 6); + [Throws] ChannelMergerNode createChannelMerger(optional unsigned long numberOfInputs = 6); + // DynamicsCompressorNode createDynamicsCompressor(); + [Throws] OscillatorNode createOscillator(); + // PeriodicWave createPeriodicWave(sequence<float> real, + // sequence<float> imag, + // optional PeriodicWaveConstraints constraints); +}; diff --git a/components/script/dom/webidls/BeforeUnloadEvent.webidl b/components/script/dom/webidls/BeforeUnloadEvent.webidl index 71fe9396d48..d5aee92901c 100644 --- a/components/script/dom/webidls/BeforeUnloadEvent.webidl +++ b/components/script/dom/webidls/BeforeUnloadEvent.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * For more information on this interface please see * https://html.spec.whatwg.org/multipage/#beforeunloadevent diff --git a/components/script/dom/webidls/BiquadFilterNode.webidl b/components/script/dom/webidls/BiquadFilterNode.webidl new file mode 100644 index 00000000000..d1b5450338c --- /dev/null +++ b/components/script/dom/webidls/BiquadFilterNode.webidl @@ -0,0 +1,39 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#biquadfilternode + */ + +enum BiquadFilterType { + "lowpass", + "highpass", + "bandpass", + "lowshelf", + "highshelf", + "peaking", + "notch", + "allpass" +}; + +dictionary BiquadFilterOptions : AudioNodeOptions { + BiquadFilterType type = "lowpass"; + float Q = 1; + float detune = 0; + float frequency = 350; + float gain = 0; +}; + +[Exposed=Window] +interface BiquadFilterNode : AudioNode { + [Throws] constructor(BaseAudioContext context, optional BiquadFilterOptions options = {}); + attribute BiquadFilterType type; + readonly attribute AudioParam frequency; + readonly attribute AudioParam detune; + readonly attribute AudioParam Q; + readonly attribute AudioParam gain; + // the AudioParam model of https://github.com/servo/servo/issues/21659 needs to + // be implemented before we implement this + // void getFrequencyResponse (Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse); +}; diff --git a/components/script/dom/webidls/Blob.webidl b/components/script/dom/webidls/Blob.webidl index 18a009d39a9..572879ec621 100644 --- a/components/script/dom/webidls/Blob.webidl +++ b/components/script/dom/webidls/Blob.webidl @@ -1,25 +1,29 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/FileAPI/#blob -[Constructor(optional sequence<BlobPart> blobParts, - optional BlobPropertyBag options), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface Blob { + [Throws] constructor(optional sequence<BlobPart> blobParts, + optional BlobPropertyBag options = {}); readonly attribute unsigned long long size; readonly attribute DOMString type; // slice Blob into byte-ranged chunks - Blob slice([Clamp] optional long long start, - [Clamp] optional long long end, + Blob slice(optional [Clamp] long long start, + optional [Clamp] long long end, optional DOMString contentType); + + [NewObject] object stream(); + [NewObject] Promise<DOMString> text(); + [NewObject] Promise<ArrayBuffer> arrayBuffer(); }; dictionary BlobPropertyBag { DOMString type = ""; }; -typedef (/*ArrayBuffer or ArrayBufferView or */Blob or DOMString) BlobPart; +typedef (ArrayBuffer or ArrayBufferView or Blob or DOMString) BlobPart; diff --git a/components/script/dom/webidls/Bluetooth.webidl b/components/script/dom/webidls/Bluetooth.webidl index 6299e661474..e5e135c0577 100644 --- a/components/script/dom/webidls/Bluetooth.webidl +++ b/components/script/dom/webidls/Bluetooth.webidl @@ -1,14 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://webbluetoothcg.github.io/web-bluetooth/#bluetooth dictionary BluetoothDataFilterInit { - // BufferSource dataPrefix; - sequence<octet> dataPrefix; - // BufferSource mask; - sequence<octet> mask; + BufferSource dataPrefix; + BufferSource mask; }; dictionary BluetoothLEScanFilterInit { @@ -16,18 +14,18 @@ dictionary BluetoothLEScanFilterInit { DOMString name; DOMString namePrefix; // Maps unsigned shorts to BluetoothDataFilters. - MozMap<BluetoothDataFilterInit> manufacturerData; + record<DOMString, BluetoothDataFilterInit> manufacturerData; // Maps BluetoothServiceUUIDs to BluetoothDataFilters. - MozMap<BluetoothDataFilterInit> serviceData; + record<DOMString, BluetoothDataFilterInit> serviceData; }; dictionary RequestDeviceOptions { sequence<BluetoothLEScanFilterInit> filters; - sequence<BluetoothServiceUUID> optionalServices /*= []*/; + sequence<BluetoothServiceUUID> optionalServices = []; boolean acceptAllDevices = false; }; -[Pref="dom.bluetooth.enabled"] +[Exposed=Window, Pref="dom.bluetooth.enabled"] interface Bluetooth : EventTarget { [SecureContext] Promise<boolean> getAvailability(); @@ -36,9 +34,9 @@ interface Bluetooth : EventTarget { // [SecureContext, SameObject] // readonly attribute BluetoothDevice? referringDevice; [SecureContext] - Promise<BluetoothDevice> requestDevice(optional RequestDeviceOptions options); + Promise<BluetoothDevice> requestDevice(optional RequestDeviceOptions options = {}); }; -// Bluetooth implements BluetoothDeviceEventHandlers; -// Bluetooth implements CharacteristicEventHandlers; -// Bluetooth implements ServiceEventHandlers; +// Bluetooth includes BluetoothDeviceEventHandlers; +// Bluetooth includes CharacteristicEventHandlers; +// Bluetooth includes ServiceEventHandlers; diff --git a/components/script/dom/webidls/BluetoothAdvertisingEvent.webidl b/components/script/dom/webidls/BluetoothAdvertisingEvent.webidl index a6a86a393a9..a7dd3fe947f 100644 --- a/components/script/dom/webidls/BluetoothAdvertisingEvent.webidl +++ b/components/script/dom/webidls/BluetoothAdvertisingEvent.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://webbluetoothcg.github.io/web-bluetooth/#advertising-events @@ -10,8 +10,9 @@ interface BluetoothServiceDataMap { readonly maplike<UUID, DataView>; };*/ -[Pref="dom.bluetooth.enabled", Constructor(DOMString type, BluetoothAdvertisingEventInit init)] +[Exposed=Window, Pref="dom.bluetooth.enabled"] interface BluetoothAdvertisingEvent : Event { + [Throws] constructor(DOMString type, BluetoothAdvertisingEventInit init); [SameObject] readonly attribute BluetoothDevice device; // readonly attribute FrozenArray<UUID> uuids; diff --git a/components/script/dom/webidls/BluetoothCharacteristicProperties.webidl b/components/script/dom/webidls/BluetoothCharacteristicProperties.webidl index 01079511d84..124f881a2e0 100644 --- a/components/script/dom/webidls/BluetoothCharacteristicProperties.webidl +++ b/components/script/dom/webidls/BluetoothCharacteristicProperties.webidl @@ -1,10 +1,10 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://webbluetoothcg.github.io/web-bluetooth/#characteristicproperties -[Pref="dom.bluetooth.enabled"] +[Exposed=Window, Pref="dom.bluetooth.enabled"] interface BluetoothCharacteristicProperties { readonly attribute boolean broadcast; readonly attribute boolean read; diff --git a/components/script/dom/webidls/BluetoothDevice.webidl b/components/script/dom/webidls/BluetoothDevice.webidl index 1eb9f495ec0..8ead2168146 100644 --- a/components/script/dom/webidls/BluetoothDevice.webidl +++ b/components/script/dom/webidls/BluetoothDevice.webidl @@ -1,10 +1,10 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://webbluetoothcg.github.io/web-bluetooth/#bluetoothdevice -[Pref="dom.bluetooth.enabled"] +[Exposed=Window, Pref="dom.bluetooth.enabled"] interface BluetoothDevice : EventTarget { readonly attribute DOMString id; readonly attribute DOMString? name; @@ -15,12 +15,11 @@ interface BluetoothDevice : EventTarget { readonly attribute boolean watchingAdvertisements; }; -[NoInterfaceObject] -interface BluetoothDeviceEventHandlers { +interface mixin BluetoothDeviceEventHandlers { attribute EventHandler ongattserverdisconnected; }; -// BluetoothDevice implements EventTarget; -BluetoothDevice implements BluetoothDeviceEventHandlers; -// BluetoothDevice implements CharacteristicEventHandlers; -// BluetoothDevice implements ServiceEventHandlers; +// BluetoothDevice includes EventTarget; +BluetoothDevice includes BluetoothDeviceEventHandlers; +// BluetoothDevice includes CharacteristicEventHandlers; +// BluetoothDevice includes ServiceEventHandlers; diff --git a/components/script/dom/webidls/BluetoothPermissionResult.webidl b/components/script/dom/webidls/BluetoothPermissionResult.webidl index 3ac0685b3d0..95c06797aef 100644 --- a/components/script/dom/webidls/BluetoothPermissionResult.webidl +++ b/components/script/dom/webidls/BluetoothPermissionResult.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://webbluetoothcg.github.io/web-bluetooth/#bluetoothpermissionresult @@ -8,11 +8,11 @@ dictionary BluetoothPermissionDescriptor : PermissionDescriptor { DOMString deviceId; // These match RequestDeviceOptions. sequence<BluetoothLEScanFilterInit> filters; - sequence<BluetoothServiceUUID> optionalServices/* = []*/; + sequence<BluetoothServiceUUID> optionalServices = []; boolean acceptAllDevices = false; }; -[Pref="dom.bluetooth.enabled"] +[Exposed=Window, Pref="dom.bluetooth.enabled"] interface BluetoothPermissionResult : PermissionStatus { // attribute FrozenArray<BluetoothDevice> devices; // Workaround until FrozenArray get implemented. diff --git a/components/script/dom/webidls/BluetoothRemoteGATTCharacteristic.webidl b/components/script/dom/webidls/BluetoothRemoteGATTCharacteristic.webidl index 3e086fc21ca..af85d1c1860 100644 --- a/components/script/dom/webidls/BluetoothRemoteGATTCharacteristic.webidl +++ b/components/script/dom/webidls/BluetoothRemoteGATTCharacteristic.webidl @@ -1,10 +1,10 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattcharacteristic -[Pref="dom.bluetooth.enabled"] +[Exposed=Window, Pref="dom.bluetooth.enabled"] interface BluetoothRemoteGATTCharacteristic : EventTarget { [SameObject] readonly attribute BluetoothRemoteGATTService service; @@ -16,16 +16,14 @@ interface BluetoothRemoteGATTCharacteristic : EventTarget { getDescriptors(optional BluetoothDescriptorUUID descriptor); Promise<ByteString> readValue(); //Promise<DataView> readValue(); - Promise<void> writeValue(sequence<octet> value); - //Promise<void> writeValue(BufferSource value); + Promise<void> writeValue(BufferSource value); Promise<BluetoothRemoteGATTCharacteristic> startNotifications(); Promise<BluetoothRemoteGATTCharacteristic> stopNotifications(); }; -[NoInterfaceObject] -interface CharacteristicEventHandlers { +interface mixin CharacteristicEventHandlers { attribute EventHandler oncharacteristicvaluechanged; }; -// BluetoothRemoteGATTCharacteristic implements EventTarget; -BluetoothRemoteGATTCharacteristic implements CharacteristicEventHandlers; +// BluetoothRemoteGATTCharacteristic includes EventTarget; +BluetoothRemoteGATTCharacteristic includes CharacteristicEventHandlers; diff --git a/components/script/dom/webidls/BluetoothRemoteGATTDescriptor.webidl b/components/script/dom/webidls/BluetoothRemoteGATTDescriptor.webidl index a202975013c..37c8722e224 100644 --- a/components/script/dom/webidls/BluetoothRemoteGATTDescriptor.webidl +++ b/components/script/dom/webidls/BluetoothRemoteGATTDescriptor.webidl @@ -1,10 +1,10 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // http://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattdescriptor -[Pref="dom.bluetooth.enabled"] +[Exposed=Window, Pref="dom.bluetooth.enabled"] interface BluetoothRemoteGATTDescriptor { [SameObject] readonly attribute BluetoothRemoteGATTCharacteristic characteristic; @@ -12,6 +12,5 @@ interface BluetoothRemoteGATTDescriptor { readonly attribute ByteString? value; Promise<ByteString> readValue(); //Promise<DataView> readValue(); - Promise<void> writeValue(sequence<octet> value); - //Promise<void> writeValue(BufferSource value); + Promise<void> writeValue(BufferSource value); }; diff --git a/components/script/dom/webidls/BluetoothRemoteGATTServer.webidl b/components/script/dom/webidls/BluetoothRemoteGATTServer.webidl index cb735cdc66d..324750dc39b 100644 --- a/components/script/dom/webidls/BluetoothRemoteGATTServer.webidl +++ b/components/script/dom/webidls/BluetoothRemoteGATTServer.webidl @@ -1,10 +1,10 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ //https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattserver -[Pref="dom.bluetooth.enabled"] +[Exposed=Window, Pref="dom.bluetooth.enabled"] interface BluetoothRemoteGATTServer { [SameObject] readonly attribute BluetoothDevice device; diff --git a/components/script/dom/webidls/BluetoothRemoteGATTService.webidl b/components/script/dom/webidls/BluetoothRemoteGATTService.webidl index 41a6fdfef3a..7e9f624dd1c 100644 --- a/components/script/dom/webidls/BluetoothRemoteGATTService.webidl +++ b/components/script/dom/webidls/BluetoothRemoteGATTService.webidl @@ -1,10 +1,10 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattservice -[Pref="dom.bluetooth.enabled"] +[Exposed=Window, Pref="dom.bluetooth.enabled"] interface BluetoothRemoteGATTService : EventTarget { [SameObject] readonly attribute BluetoothDevice device; @@ -17,13 +17,12 @@ interface BluetoothRemoteGATTService : EventTarget { Promise<sequence<BluetoothRemoteGATTService>> getIncludedServices(optional BluetoothServiceUUID service); }; -[NoInterfaceObject] -interface ServiceEventHandlers { +interface mixin ServiceEventHandlers { attribute EventHandler onserviceadded; attribute EventHandler onservicechanged; attribute EventHandler onserviceremoved; }; -// BluetoothRemoteGATTService implements EventTarget; -// BluetoothRemoteGATTService implements CharacteristicEventHandlers; -BluetoothRemoteGATTService implements ServiceEventHandlers; +// BluetoothRemoteGATTService includes EventTarget; +// BluetoothRemoteGATTService includes CharacteristicEventHandlers; +BluetoothRemoteGATTService includes ServiceEventHandlers; diff --git a/components/script/dom/webidls/BluetoothUUID.webidl b/components/script/dom/webidls/BluetoothUUID.webidl index eca9710eeb6..dde82d3acb7 100644 --- a/components/script/dom/webidls/BluetoothUUID.webidl +++ b/components/script/dom/webidls/BluetoothUUID.webidl @@ -1,10 +1,10 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://webbluetoothcg.github.io/web-bluetooth/#bluetoothuuid -[Pref="dom.bluetooth.enabled"] +[Exposed=Window, Pref="dom.bluetooth.enabled"] interface BluetoothUUID { [Throws] static UUID getService(BluetoothServiceUUID name); diff --git a/components/script/dom/webidls/Body.webidl b/components/script/dom/webidls/Body.webidl index bb7aa5c6859..5de4aa36813 100644 --- a/components/script/dom/webidls/Body.webidl +++ b/components/script/dom/webidls/Body.webidl @@ -1,16 +1,15 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://fetch.spec.whatwg.org/#body -[NoInterfaceObject, - Exposed=(Window,Worker)] - -interface Body { +[Exposed=(Window,Worker)] +interface mixin Body { readonly attribute boolean bodyUsed; + readonly attribute object? body; - // [NewObject] Promise<ArrayBuffer> arrayBuffer(); + [NewObject] Promise<ArrayBuffer> arrayBuffer(); [NewObject] Promise<Blob> blob(); [NewObject] Promise<FormData> formData(); [NewObject] Promise<any> json(); diff --git a/components/script/dom/webidls/BroadcastChannel.webidl b/components/script/dom/webidls/BroadcastChannel.webidl new file mode 100644 index 00000000000..6d72f3997cf --- /dev/null +++ b/components/script/dom/webidls/BroadcastChannel.webidl @@ -0,0 +1,18 @@ +/* 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 http://mozilla.org/MPL/2.0/. */ +/* + * The origin of this IDL file is: + * https://html.spec.whatwg.org/multipage/#broadcastchannel + */ + +[Exposed=(Window,Worker)] +interface BroadcastChannel : EventTarget { + constructor(DOMString name); + + readonly attribute DOMString name; + [Throws] void postMessage(any message); + void close(); + attribute EventHandler onmessage; + attribute EventHandler onmessageerror; +}; diff --git a/components/script/dom/webidls/BrowserElement.webidl b/components/script/dom/webidls/BrowserElement.webidl deleted file mode 100644 index 4c6273a1cef..00000000000 --- a/components/script/dom/webidls/BrowserElement.webidl +++ /dev/null @@ -1,227 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -// https://developer.mozilla.org/en-US/docs/Web/API/Using_the_Browser_API - -callback BrowserElementNextPaintEventCallback = void (); - -//enum BrowserFindCaseSensitivity { "case-sensitive", "case-insensitive" }; -//enum BrowserFindDirection { "forward", "backward" }; - -//dictionary BrowserElementDownloadOptions { -// DOMString? filename; -// DOMString? referrer; -//}; - -//dictionary BrowserElementExecuteScriptOptions { -// DOMString? url; -// DOMString? origin; -//}; - -[NoInterfaceObject, Exposed=(Window,Worker)] -interface BrowserElement { -}; - -dictionary BrowserElementSecurityChangeDetail { - - // state: - // "insecure" indicates that the data corresponding to - // the request was received over an insecure channel. - // - // "broken" indicates an unknown security state. This - // may mean that the request is being loaded as part - // of a page in which some content was received over - // an insecure channel. - // - // "secure" indicates that the data corresponding to the - // request was received over a secure channel. - DOMString state; - - // trackingState: - // "loaded_tracking_content": tracking content has been loaded. - // "blocked_tracking_content": tracking content has been blocked from loading. - DOMString trackingState; - - // mixedState: - // "blocked_mixed_active_content": Mixed active content has been blocked from loading. - // "loaded_mixed_active_content": Mixed active content has been loaded. - DOMString mixedState; - - boolean extendedValidation; - boolean trackingContent; - boolean mixedContent; -}; - -dictionary BrowserElementErrorEventDetail { - // https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowsererror - // just requires a "type" field, but we also provide - // an optional human-readable description, and - // an optional machine-readable report (e.g. a backtrace for panics) - DOMString type; - DOMString description; - DOMString report; - DOMString version; -}; - -dictionary BrowserElementLocationChangeEventDetail { - DOMString url; - boolean canGoBack; - boolean canGoForward; -}; - -dictionary BrowserElementIconChangeEventDetail { - DOMString rel; - DOMString href; - DOMString sizes; -}; - -dictionary BrowserShowModalPromptEventDetail { - DOMString promptType; - DOMString title; - DOMString message; - DOMString returnValue; - // TODO(simartin) unblock() callback -}; - -dictionary BrowserElementOpenTabEventDetail { - // https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowseropentab - DOMString url; -}; - -dictionary BrowserElementOpenWindowEventDetail { - // https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowseropenwindow - DOMString url; - DOMString target; - DOMString features; - // Element frameElement; -}; - -dictionary BrowserElementVisibilityChangeEventDetail { - boolean visible; -}; - -BrowserElement implements BrowserElementCommon; -BrowserElement implements BrowserElementPrivileged; - -[NoInterfaceObject, Exposed=(Window,Worker)] -interface BrowserElementCommon { - [Throws, - Pref="dom.mozbrowser.enabled"] - void setVisible(boolean visible); - - [Throws, - Pref="dom.mozbrowser.enabled"] - boolean getVisible(); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //void setActive(boolean active); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //boolean getActive(); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //void addNextPaintListener(BrowserElementNextPaintEventCallback listener); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //void removeNextPaintListener(BrowserElementNextPaintEventCallback listener); -}; - -[NoInterfaceObject, Exposed=(Window,Worker)] -interface BrowserElementPrivileged { - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //void sendMouseEvent(DOMString type, - // unsigned long x, - // unsigned long y, - // unsigned long button, - // unsigned long clickCount, - // unsigned long modifiers); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled", - // Func="TouchEvent::PrefEnabled"] - //void sendTouchEvent(DOMString type, - // sequence<unsigned long> identifiers, - // sequence<long> x, - // sequence<long> y, - // sequence<unsigned long> rx, - // sequence<unsigned long> ry, - // sequence<float> rotationAngles, - // sequence<float> forces, - // unsigned long count, - // unsigned long modifiers); - - [Func="::dom::window::Window::global_is_mozbrowser", Throws] - void goBack(); - - [Func="::dom::window::Window::global_is_mozbrowser", Throws] - void goForward(); - - [Func="::dom::window::Window::global_is_mozbrowser", Throws] - void reload(optional boolean hardReload = false); - - [Func="::dom::window::Window::global_is_mozbrowser", Throws] - void stop(); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //DOMRequest download(DOMString url, - // optional BrowserElementDownloadOptions options); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //DOMRequest purgeHistory(); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //DOMRequest getScreenshot([EnforceRange] unsigned long width, - // [EnforceRange] unsigned long height, - // optional DOMString mimeType=""); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //void zoom(float zoom); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //DOMRequest getCanGoBack(); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //DOMRequest getCanGoForward(); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //DOMRequest getContentDimensions(); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //DOMRequest setInputMethodActive(boolean isActive); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //void setNFCFocus(boolean isFocus); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //void findAll(DOMString searchString, BrowserFindCaseSensitivity caseSensitivity); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //void findNext(BrowserFindDirection direction); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //void clearMatch(); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled"] - //DOMRequest executeScript(DOMString script, - // optional BrowserElementExecuteScriptOptions options); - -}; diff --git a/components/script/dom/webidls/CDATASection.webidl b/components/script/dom/webidls/CDATASection.webidl new file mode 100644 index 00000000000..28cb4a85003 --- /dev/null +++ b/components/script/dom/webidls/CDATASection.webidl @@ -0,0 +1,11 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://dom.spec.whatwg.org/#interface-cdatasection + */ + +[Exposed=Window] +interface CDATASection : Text { +}; diff --git a/components/script/dom/webidls/CSS.webidl b/components/script/dom/webidls/CSS.webidl index 5f4aa4f0bef..15049ae7539 100644 --- a/components/script/dom/webidls/CSS.webidl +++ b/components/script/dom/webidls/CSS.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * http://dev.w3.org/csswg/cssom/#the-css-interface @@ -17,3 +17,8 @@ partial interface CSS { static boolean supports(DOMString property, DOMString value); static boolean supports(DOMString conditionText); }; + +// https://drafts.css-houdini.org/css-paint-api-1/#paint-worklet +partial interface CSS { + [SameObject, Pref="dom.worklet.enabled"] static readonly attribute Worklet paintWorklet; +}; diff --git a/components/script/dom/webidls/CSSConditionRule.webidl b/components/script/dom/webidls/CSSConditionRule.webidl index 889153a085e..daf4258bc88 100644 --- a/components/script/dom/webidls/CSSConditionRule.webidl +++ b/components/script/dom/webidls/CSSConditionRule.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/css-conditional/#cssconditionrule [Abstract, Exposed=Window] diff --git a/components/script/dom/webidls/CSSFontFaceRule.webidl b/components/script/dom/webidls/CSSFontFaceRule.webidl index a0a1b8f950b..0e159a4b4ec 100644 --- a/components/script/dom/webidls/CSSFontFaceRule.webidl +++ b/components/script/dom/webidls/CSSFontFaceRule.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/css-fonts/#cssfontfacerule is unfortunately not web-compatible: // https://github.com/w3c/csswg-drafts/issues/825 diff --git a/components/script/dom/webidls/CSSGroupingRule.webidl b/components/script/dom/webidls/CSSGroupingRule.webidl index 41ac5e8dd57..3e21e85ecc4 100644 --- a/components/script/dom/webidls/CSSGroupingRule.webidl +++ b/components/script/dom/webidls/CSSGroupingRule.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom/#the-cssgroupingrule-interface [Abstract, Exposed=Window] diff --git a/components/script/dom/webidls/CSSImportRule.webidl b/components/script/dom/webidls/CSSImportRule.webidl index b8131a7bb87..1340d90c736 100644 --- a/components/script/dom/webidls/CSSImportRule.webidl +++ b/components/script/dom/webidls/CSSImportRule.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom/#cssimportrule [Exposed=Window] diff --git a/components/script/dom/webidls/CSSKeyframeRule.webidl b/components/script/dom/webidls/CSSKeyframeRule.webidl index 079b88ef231..92195320767 100644 --- a/components/script/dom/webidls/CSSKeyframeRule.webidl +++ b/components/script/dom/webidls/CSSKeyframeRule.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/css-animations/#interface-csskeyframerule [Exposed=Window] diff --git a/components/script/dom/webidls/CSSKeyframesRule.webidl b/components/script/dom/webidls/CSSKeyframesRule.webidl index fc31fc62406..e1f30b19015 100644 --- a/components/script/dom/webidls/CSSKeyframesRule.webidl +++ b/components/script/dom/webidls/CSSKeyframesRule.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/css-animations/#interface-csskeyframesrule [Exposed=Window] diff --git a/components/script/dom/webidls/CSSMediaRule.webidl b/components/script/dom/webidls/CSSMediaRule.webidl index 0f44c382620..13b0cbafe76 100644 --- a/components/script/dom/webidls/CSSMediaRule.webidl +++ b/components/script/dom/webidls/CSSMediaRule.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom/#the-cssmediarule-interface // https://drafts.csswg.org/css-conditional/#cssmediarule diff --git a/components/script/dom/webidls/CSSNamespaceRule.webidl b/components/script/dom/webidls/CSSNamespaceRule.webidl index aa1ce87e289..082d53833e9 100644 --- a/components/script/dom/webidls/CSSNamespaceRule.webidl +++ b/components/script/dom/webidls/CSSNamespaceRule.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom/#the-cssnamespacerule-interface [Exposed=Window] diff --git a/components/script/dom/webidls/CSSRule.webidl b/components/script/dom/webidls/CSSRule.webidl index d36111b0cc0..215f3aaf445 100644 --- a/components/script/dom/webidls/CSSRule.webidl +++ b/components/script/dom/webidls/CSSRule.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom/#the-cssrule-interface [Abstract, Exposed=Window] diff --git a/components/script/dom/webidls/CSSRuleList.webidl b/components/script/dom/webidls/CSSRuleList.webidl index 8ee12004a26..e411930589b 100644 --- a/components/script/dom/webidls/CSSRuleList.webidl +++ b/components/script/dom/webidls/CSSRuleList.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom/#cssrulelist // [LegacyArrayClass] diff --git a/components/script/dom/webidls/CSSStyleDeclaration.webidl b/components/script/dom/webidls/CSSStyleDeclaration.webidl index efe1d57b038..7865195360f 100644 --- a/components/script/dom/webidls/CSSStyleDeclaration.webidl +++ b/components/script/dom/webidls/CSSStyleDeclaration.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface @@ -10,434 +10,20 @@ [Exposed=Window] interface CSSStyleDeclaration { - [SetterThrows] + [CEReactions, SetterThrows] attribute DOMString cssText; readonly attribute unsigned long length; getter DOMString item(unsigned long index); DOMString getPropertyValue(DOMString property); DOMString getPropertyPriority(DOMString property); - [Throws] + [CEReactions, Throws] void setProperty(DOMString property, [TreatNullAs=EmptyString] DOMString value, - [TreatNullAs=EmptyString] optional DOMString priority = ""); - [Throws] - void setPropertyValue(DOMString property, [TreatNullAs=EmptyString] DOMString value); - - [Throws] - void setPropertyPriority(DOMString property, [TreatNullAs=EmptyString] DOMString priority); - - [Throws] + optional [TreatNullAs=EmptyString] DOMString priority = ""); + [CEReactions, Throws] DOMString removeProperty(DOMString property); - //readonly attribute CSSRule? parentRule; - [SetterThrows] + // readonly attribute CSSRule? parentRule; + [CEReactions, SetterThrows] attribute DOMString cssFloat; }; -partial interface CSSStyleDeclaration { - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString all; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString background; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString backgroundColor; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString background-color; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString backgroundPosition; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString background-position; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString backgroundPositionX; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString background-position-x; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString backgroundPositionY; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString background-position-y; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString backgroundRepeat; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString background-repeat; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString backgroundImage; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString background-image; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString backgroundAttachment; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString background-attachment; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString backgroundSize; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString background-size; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString backgroundOrigin; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString background-origin; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString backgroundClip; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString background-clip; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderColor; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-color; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderRadius; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-radius; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderSpacing; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-spacing; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderStyle; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-style; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBottom; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-bottom; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBottomColor; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-bottom-color; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBottomLeftRadius; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-bottom-left-radius; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBottomRightRadius; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-bottom-right-radius; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBottomStyle; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-bottom-style; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBottomWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-bottom-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderLeft; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-left; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderLeftColor; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-left-color; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderLeftStyle; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-left-style; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderLeftWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-left-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderRight; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-right; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderRightColor; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-right-color; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderRightStyle; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-right-style; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderRightWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-right-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderTop; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-top; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderTopColor; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-top-color; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderTopLeftRadius; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-top-left-radius; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderTopRightRadius; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-top-right-radius; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderTopStyle; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-top-style; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderTopWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-top-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-image-source; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderImageSource; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-image-slice; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderImageSlice; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-image-repeat; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderImageRepeat; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-image-outset; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderImageOutset; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-image-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderImageWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-image; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderImage; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-block-start-color; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBlockStartColor; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-block-start-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBlockStartWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-block-start-style; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBlockStartStyle; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-block-end-color; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBlockEndColor; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-block-end-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBlockEndWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-block-end-style; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBlockEndStyle; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-inline-start-color; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderInlineStartColor; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-inline-start-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderInlineStartWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-inline-start-style; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderInlineStartStyle; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-inline-end-color; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderInlineEndColor; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-inline-end-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderInlineEndWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-inline-end-style; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderInlineEndStyle; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-block-start; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBlockStart; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-block-end; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderBlockEnd; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-inline-start; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderInlineStart; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-inline-end; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderInlineEnd; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString content; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString color; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString display; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString opacity; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString visibility; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString cursor; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString boxSizing; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString box-sizing; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString boxShadow; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString box-shadow; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString textShadow; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString text-shadow; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString _float; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString clear; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString clip; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transform; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transformOrigin; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transform-origin; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString perspective; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString perspectiveOrigin; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString perspective-origin; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transformStyle; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transform-style; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString backfaceVisibility; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString backface-visibility; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString direction; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString unicodeBidi; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString unicode-bidi; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString filter; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString lineHeight; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString line-height; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString mixBlendMode; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString mix-blend-mode; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString verticalAlign; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString vertical-align; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString listStyle; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString list-style; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString listStylePosition; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString list-style-position; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString listStyleType; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString list-style-type; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString listStyleImage; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString list-style-image; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString quotes; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString counterIncrement; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString counter-increment; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString counterReset; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString counter-reset; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString overflow; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString overflowX; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString overflow-x; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString overflowY; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString overflow-y; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString overflowWrap; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString overflow-wrap; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString tableLayout; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString table-layout; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString borderCollapse; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString border-collapse; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString emptyCells; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString empty-cells; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString captionSide; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString caption-side; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString whiteSpace; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString white-space; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString writingMode; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString writing-mode; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString letterSpacing; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString letter-spacing; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString wordBreak; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString word-break; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString wordSpacing; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString word-spacing; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString wordWrap; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString word-wrap; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString textOverflow; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString text-overflow; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString textAlign; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString text-align; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString textDecoration; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString text-decoration; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString textDecorationLine; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString text-decoration-line; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString textIndent; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString text-indent; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString textJustify; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString text-justify; - //[SetterThrows, TreatNullAs=EmptyString] attribute DOMString textOrientation; - //[SetterThrows, TreatNullAs=EmptyString] attribute DOMString text-orientation; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString textRendering; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString text-rendering; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString textTransform; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString text-transform; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString font; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString fontFamily; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString font-family; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString fontSize; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString font-size; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString fontStretch; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString font-stretch; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString fontStyle; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString font-style; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString fontVariant; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString font-variant; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString fontVariantCaps; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString font-variant-caps; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString fontWeight; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString font-weight; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString margin; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString marginBottom; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString margin-bottom; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString marginLeft; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString margin-left; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString marginRight; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString margin-right; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString marginTop; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString margin-top; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString margin-block-start; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString marginBlockStart; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString margin-block-end; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString marginBlockEnd; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString margin-inline-start; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString marginInlineStart; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString margin-inline-end; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString marginInlineEnd; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString padding; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString paddingBottom; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString padding-bottom; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString paddingLeft; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString padding-left; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString paddingRight; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString padding-right; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString paddingTop; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString padding-top; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString padding-block-start; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString paddingBlockStart; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString padding-block-end; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString paddingBlockEnd; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString padding-inline-start; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString paddingInlineStart; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString padding-inline-end; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString paddingInlineEnd; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString outline; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString outlineColor; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString outline-color; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString outlineStyle; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString outline-style; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString outlineWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString outline-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString outlineOffset; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString outline-offset; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString position; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString pointerEvents; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString pointer-events; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString top; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString right; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString left; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString bottom; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString offset-block-start; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString offsetBlockStart; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString offset-block-end; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString offsetBlockEnd; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString offset-inline-start; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString offsetInlineStart; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString offset-inline-end; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString offsetInlineEnd; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString height; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString minHeight; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString min-height; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString maxHeight; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString max-height; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString minWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString min-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString maxWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString max-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString block-size; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString blockSize; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString inline-size; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString inlineSize; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString max-block-size; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString maxBlockSize; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString max-inline-size; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString maxInlineSize; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString min-block-size; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString minBlockSize; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString min-inline-size; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString minInlineSize; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString zIndex; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString z-index; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString imageRendering; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString image-rendering; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString columnCount; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString column-count; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString columnWidth; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString column-width; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString columns; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString columnGap; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString column-gap; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transition; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transitionDuration; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transition-duration; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transitionTimingFunction; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transition-timing-function; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transitionProperty; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transition-property; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transitionDelay; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString transition-delay; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString flex; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString flexFlow; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString flex-flow; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString flexDirection; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString flex-direction; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString flexWrap; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString flex-wrap; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString justifyContent; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString justify-content; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString alignItems; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString align-items; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString alignContent; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString align-content; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString order; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString flexBasis; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString flex-basis; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString flexGrow; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString flex-grow; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString flexShrink; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString flex-shrink; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString alignSelf; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString align-self; - - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animation; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animation-name; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animationName; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animation-duration; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animationDuration; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animation-timing-function; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animationTimingFunction; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animation-iteration-count; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animationIterationCount; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animation-direction; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animationDirection; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animation-play-state; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animationPlayState; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animation-fill-mode; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animationFillMode; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animation-delay; - [SetterThrows, TreatNullAs=EmptyString] attribute DOMString animationDelay; -}; +// Auto-generated in GlobalGen.py: accessors for each CSS property diff --git a/components/script/dom/webidls/CSSStyleRule.webidl b/components/script/dom/webidls/CSSStyleRule.webidl index 145650a916c..48bf819bb89 100644 --- a/components/script/dom/webidls/CSSStyleRule.webidl +++ b/components/script/dom/webidls/CSSStyleRule.webidl @@ -1,10 +1,10 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom/#the-cssstylerule-interface [Exposed=Window] interface CSSStyleRule : CSSRule { - // attribute DOMString selectorText; + attribute DOMString selectorText; [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style; }; diff --git a/components/script/dom/webidls/CSSStyleSheet.webidl b/components/script/dom/webidls/CSSStyleSheet.webidl index c616c9d2a10..c09f14a3e8a 100644 --- a/components/script/dom/webidls/CSSStyleSheet.webidl +++ b/components/script/dom/webidls/CSSStyleSheet.webidl @@ -1,12 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom/#the-cssstylesheet-interface [Exposed=Window] interface CSSStyleSheet : StyleSheet { // readonly attribute CSSRule? ownerRule; [Throws, SameObject] readonly attribute CSSRuleList cssRules; - [Throws] unsigned long insertRule(DOMString rule, unsigned long index); + [Throws] unsigned long insertRule(DOMString rule, optional unsigned long index = 0); [Throws] void deleteRule(unsigned long index); }; diff --git a/components/script/dom/webidls/CSSStyleValue.webidl b/components/script/dom/webidls/CSSStyleValue.webidl new file mode 100644 index 00000000000..3cd075b67e8 --- /dev/null +++ b/components/script/dom/webidls/CSSStyleValue.webidl @@ -0,0 +1,10 @@ +/* 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/. */ + +// https://drafts.css-houdini.org/css-typed-om-1/#cssstylevalue +// NOTE: should this be exposed to Window? +[Pref="dom.worklet.enabled", Exposed=(Worklet)] +interface CSSStyleValue { + stringifier; +}; diff --git a/components/script/dom/webidls/CSSSupportsRule.webidl b/components/script/dom/webidls/CSSSupportsRule.webidl index 73f147c6181..a726f101e41 100644 --- a/components/script/dom/webidls/CSSSupportsRule.webidl +++ b/components/script/dom/webidls/CSSSupportsRule.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/css-conditional/#csssupportsrule [Exposed=Window] diff --git a/components/script/dom/webidls/CSSViewportRule.webidl b/components/script/dom/webidls/CSSViewportRule.webidl index b1b73eb9c50..e53b0461358 100644 --- a/components/script/dom/webidls/CSSViewportRule.webidl +++ b/components/script/dom/webidls/CSSViewportRule.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/css-device-adapt/#css-viewport-rule-interface [Exposed=Window] diff --git a/components/script/dom/webidls/CanvasGradient.webidl b/components/script/dom/webidls/CanvasGradient.webidl index 236c077551a..ec00d4a73f2 100644 --- a/components/script/dom/webidls/CanvasGradient.webidl +++ b/components/script/dom/webidls/CanvasGradient.webidl @@ -1,8 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#canvasgradient +[Exposed=(Window, PaintWorklet, Worker)] interface CanvasGradient { // opaque object [Throws] diff --git a/components/script/dom/webidls/CanvasPattern.webidl b/components/script/dom/webidls/CanvasPattern.webidl index eb382b82b1a..bfd33b082f8 100644 --- a/components/script/dom/webidls/CanvasPattern.webidl +++ b/components/script/dom/webidls/CanvasPattern.webidl @@ -1,8 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#canvaspattern +[Exposed=(Window, PaintWorklet, Worker)] interface CanvasPattern { //void setTransform(SVGMatrix matrix); }; diff --git a/components/script/dom/webidls/CanvasRenderingContext2D.webidl b/components/script/dom/webidls/CanvasRenderingContext2D.webidl index ed5f9477476..6216ec50505 100644 --- a/components/script/dom/webidls/CanvasRenderingContext2D.webidl +++ b/components/script/dom/webidls/CanvasRenderingContext2D.webidl @@ -1,55 +1,53 @@ /* 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 http://mozilla.org/MPL/2.0/. */ - -enum CanvasFillRule { "nonzero", "evenodd" }; + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#2dcontext -typedef (HTMLImageElement or - /* HTMLVideoElement or */ + +// typedef (HTMLImageElement or +// SVGImageElement) HTMLOrSVGImageElement; +typedef HTMLImageElement HTMLOrSVGImageElement; + +typedef (HTMLOrSVGImageElement or + /*HTMLVideoElement or*/ HTMLCanvasElement or - CanvasRenderingContext2D /* or - ImageBitmap */) CanvasImageSource; + /*ImageBitmap or*/ + OffscreenCanvas or + /*CSSImageValue*/ CSSStyleValue) CanvasImageSource; -//[Constructor(optional unsigned long width, unsigned long height)] -interface CanvasRenderingContext2D { +enum CanvasFillRule { "nonzero", "evenodd" }; +[Exposed=Window] +interface CanvasRenderingContext2D { // back-reference to the canvas readonly attribute HTMLCanvasElement canvas; - - // canvas dimensions - // attribute unsigned long width; - // attribute unsigned long height; - - // for contexts that aren't directly fixed to a specific canvas - //void commit(); // push the image to the output bitmap }; -CanvasRenderingContext2D implements CanvasState; -CanvasRenderingContext2D implements CanvasTransform; -CanvasRenderingContext2D implements CanvasCompositing; -CanvasRenderingContext2D implements CanvasImageSmoothing; -CanvasRenderingContext2D implements CanvasFillStrokeStyles; -CanvasRenderingContext2D implements CanvasShadowStyles; -CanvasRenderingContext2D implements CanvasRect; -CanvasRenderingContext2D implements CanvasDrawPath; -CanvasRenderingContext2D implements CanvasUserInterface; -CanvasRenderingContext2D implements CanvasText; -CanvasRenderingContext2D implements CanvasDrawImage; -CanvasRenderingContext2D implements CanvasHitRegion; -CanvasRenderingContext2D implements CanvasImageData; -CanvasRenderingContext2D implements CanvasPathDrawingStyles; -CanvasRenderingContext2D implements CanvasTextDrawingStyles; -CanvasRenderingContext2D implements CanvasPath; - -[NoInterfaceObject] -interface CanvasState { +CanvasRenderingContext2D includes CanvasState; +CanvasRenderingContext2D includes CanvasTransform; +CanvasRenderingContext2D includes CanvasCompositing; +CanvasRenderingContext2D includes CanvasImageSmoothing; +CanvasRenderingContext2D includes CanvasFillStrokeStyles; +CanvasRenderingContext2D includes CanvasShadowStyles; +CanvasRenderingContext2D includes CanvasFilters; +CanvasRenderingContext2D includes CanvasRect; +CanvasRenderingContext2D includes CanvasDrawPath; +CanvasRenderingContext2D includes CanvasUserInterface; +CanvasRenderingContext2D includes CanvasText; +CanvasRenderingContext2D includes CanvasDrawImage; +CanvasRenderingContext2D includes CanvasImageData; +CanvasRenderingContext2D includes CanvasPathDrawingStyles; +CanvasRenderingContext2D includes CanvasTextDrawingStyles; +CanvasRenderingContext2D includes CanvasPath; + +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasState { // state void save(); // push state on state stack void restore(); // pop state stack and restore state }; -[NoInterfaceObject] -interface CanvasTransform { +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasTransform { // transformations (default transform is the identity matrix) void scale(unrestricted double x, unrestricted double y); void rotate(unrestricted double angle); @@ -61,7 +59,7 @@ interface CanvasTransform { unrestricted double e, unrestricted double f); - // [NewObject] DOMMatrix getTransform(); + [NewObject] DOMMatrix getTransform(); void setTransform(unrestricted double a, unrestricted double b, unrestricted double c, @@ -72,23 +70,22 @@ interface CanvasTransform { void resetTransform(); }; -[NoInterfaceObject] -interface CanvasCompositing { +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasCompositing { // compositing attribute unrestricted double globalAlpha; // (default 1.0) attribute DOMString globalCompositeOperation; // (default source-over) }; -[NoInterfaceObject] -interface CanvasImageSmoothing { +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasImageSmoothing { // image smoothing attribute boolean imageSmoothingEnabled; // (default true) // attribute ImageSmoothingQuality imageSmoothingQuality; // (default low) }; -[NoInterfaceObject] -interface CanvasFillStrokeStyles { - +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasFillStrokeStyles { // colours and styles (see also the CanvasDrawingStyles interface) attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (default black) attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black) @@ -96,11 +93,11 @@ interface CanvasFillStrokeStyles { [Throws] CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1); [Throws] - CanvasPattern createPattern(CanvasImageSource image, [TreatNullAs=EmptyString] DOMString repetition); + CanvasPattern? createPattern(CanvasImageSource image, [TreatNullAs=EmptyString] DOMString repetition); }; -[NoInterfaceObject] -interface CanvasShadowStyles { +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasShadowStyles { // shadows attribute unrestricted double shadowOffsetX; // (default 0) attribute unrestricted double shadowOffsetY; // (default 0) @@ -108,32 +105,30 @@ interface CanvasShadowStyles { attribute DOMString shadowColor; // (default transparent black) }; -[NoInterfaceObject] -interface CanvasRect { +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasFilters { + // filters + //attribute DOMString filter; // (default "none") +}; + +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasRect { // rects - //[LenientFloat] void clearRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h); - //[LenientFloat] void fillRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h); - //[LenientFloat] void strokeRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h); }; -[NoInterfaceObject] -interface CanvasDrawPath { - // path API (see also CanvasPathMethods) +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasDrawPath { + // path API (see also CanvasPath) void beginPath(); void fill(optional CanvasFillRule fillRule = "nonzero"); //void fill(Path2D path, optional CanvasFillRule fillRule = "nonzero"); void stroke(); //void stroke(Path2D path); - //void drawFocusIfNeeded(Element element); - //void drawFocusIfNeeded(Path2D path, Element element); - //void scrollPathIntoView(); - //void scrollPathIntoView(Path2D path); void clip(optional CanvasFillRule fillRule = "nonzero"); //void clip(Path2D path, optional CanvasFillRule fillRule = "nonzero"); - //void resetClip(); boolean isPointInPath(unrestricted double x, unrestricted double y, optional CanvasFillRule fillRule = "nonzero"); //boolean isPointInPath(Path2D path, unrestricted double x, unrestricted double y, @@ -142,23 +137,28 @@ interface CanvasDrawPath { //boolean isPointInStroke(Path2D path, unrestricted double x, unrestricted double y); }; -[NoInterfaceObject] -interface CanvasUserInterface { - // TODO? +[Exposed=(PaintWorklet, Window)] +interface mixin CanvasUserInterface { + //void drawFocusIfNeeded(Element element); + //void drawFocusIfNeeded(Path2D path, Element element); + //void scrollPathIntoView(); + //void scrollPathIntoView(Path2D path); }; -[NoInterfaceObject] -interface CanvasText { - // text (see also the CanvasDrawingStyles interface) - //void fillText(DOMString text, unrestricted double x, unrestricted double y, - // optional unrestricted double maxWidth); +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasText { + // text (see also the CanvasPathDrawingStyles and CanvasTextDrawingStyles interfaces) + [Pref="dom.canvas_text.enabled"] + void fillText(DOMString text, unrestricted double x, unrestricted double y, + optional unrestricted double maxWidth); //void strokeText(DOMString text, unrestricted double x, unrestricted double y, // optional unrestricted double maxWidth); - //TextMetrics measureText(DOMString text); + [Pref="dom.canvas_text.enabled"] + TextMetrics measureText(DOMString text); }; -[NoInterfaceObject] -interface CanvasDrawImage { +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasDrawImage { // drawing images [Throws] void drawImage(CanvasImageSource image, unrestricted double dx, unrestricted double dy); @@ -172,32 +172,21 @@ interface CanvasDrawImage { unrestricted double dw, unrestricted double dh); }; -[NoInterfaceObject] -interface CanvasHitRegion { - // hit regions - //void addHitRegion(optional HitRegionOptions options); - //void removeHitRegion(DOMString id); - //void clearHitRegions(); -}; - -[NoInterfaceObject] -interface CanvasImageData { +[Exposed=(Window, Worker)] +interface mixin CanvasImageData { // pixel manipulation [Throws] - ImageData createImageData(double sw, double sh); + ImageData createImageData(long sw, long sh); [Throws] ImageData createImageData(ImageData imagedata); [Throws] - ImageData getImageData(double sx, double sy, double sw, double sh); - void putImageData(ImageData imagedata, double dx, double dy); + ImageData getImageData(long sx, long sy, long sw, long sh); + void putImageData(ImageData imagedata, long dx, long dy); void putImageData(ImageData imagedata, - double dx, double dy, - double dirtyX, double dirtyY, - double dirtyWidth, double dirtyHeight); + long dx, long dy, + long dirtyX, long dirtyY, + long dirtyWidth, long dirtyHeight); }; -CanvasRenderingContext2D implements CanvasPathDrawingStyles; -CanvasRenderingContext2D implements CanvasTextDrawingStyles; -CanvasRenderingContext2D implements CanvasPath; enum CanvasLineCap { "butt", "round", "square" }; enum CanvasLineJoin { "round", "bevel", "miter"}; @@ -205,12 +194,12 @@ enum CanvasTextAlign { "start", "end", "left", "right", "center" }; enum CanvasTextBaseline { "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" }; enum CanvasDirection { "ltr", "rtl", "inherit" }; -[NoInterfaceObject] -interface CanvasPathDrawingStyles { +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasPathDrawingStyles { // line caps/joins attribute unrestricted double lineWidth; // (default 1) - attribute CanvasLineCap lineCap; // "butt", "round", "square" (default "butt") - attribute CanvasLineJoin lineJoin; // "round", "bevel", "miter" (default "miter") + attribute CanvasLineCap lineCap; // (default "butt") + attribute CanvasLineJoin lineJoin; // (default "miter") attribute unrestricted double miterLimit; // (default 10) // dashed lines @@ -219,18 +208,18 @@ interface CanvasPathDrawingStyles { //attribute unrestricted double lineDashOffset; }; -[NoInterfaceObject] -interface CanvasTextDrawingStyles { +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasTextDrawingStyles { // text - //attribute DOMString font; // (default 10px sans-serif) - //attribute CanvasTextAlign textAlign; // "start", "end", "left", "right", "center" (default: "start") - //attribute CanvasTextBaseline textBaseline; // "top", "hanging", "middle", "alphabetic", + attribute DOMString font; // (default 10px sans-serif) + attribute CanvasTextAlign textAlign; // "start", "end", "left", "right", "center" (default: "start") + attribute CanvasTextBaseline textBaseline; // "top", "hanging", "middle", "alphabetic", // "ideographic", "bottom" (default: "alphabetic") - //attribute CanvasDirection direction; // "ltr", "rtl", "inherit" (default: "inherit") + attribute CanvasDirection direction; // "ltr", "rtl", "inherit" (default: "inherit") }; -[NoInterfaceObject, Exposed=(Window,Worker)] -interface CanvasPath { +[Exposed=(PaintWorklet, Window, Worker)] +interface mixin CanvasPath { // shared path API methods void closePath(); void moveTo(unrestricted double x, unrestricted double y); @@ -249,16 +238,15 @@ interface CanvasPath { void arcTo(unrestricted double x1, unrestricted double y1, unrestricted double x2, unrestricted double y2, unrestricted double radius); - // [LenientFloat] void arcTo(double x1, double y1, double x2, double y2, - // double radiusX, double radiusY, double rotation); void rect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h); [Throws] void arc(unrestricted double x, unrestricted double y, unrestricted double radius, unrestricted double startAngle, unrestricted double endAngle, optional boolean anticlockwise = false); - // [LenientFloat] void ellipse(double x, double y, double radiusX, double radiusY, - // double rotation, double startAngle, double endAngle, - // boolean anticlockwise); -}; + [Throws] + void ellipse(unrestricted double x, unrestricted double y, unrestricted double radius_x, + unrestricted double radius_y, unrestricted double rotation, unrestricted double startAngle, + unrestricted double endAngle, optional boolean anticlockwise = false); +}; diff --git a/components/script/dom/webidls/ChannelMergerNode.webidl b/components/script/dom/webidls/ChannelMergerNode.webidl new file mode 100644 index 00000000000..c6eaad8bb55 --- /dev/null +++ b/components/script/dom/webidls/ChannelMergerNode.webidl @@ -0,0 +1,16 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#channelmergernode + */ + +dictionary ChannelMergerOptions : AudioNodeOptions { + unsigned long numberOfInputs = 6; +}; + +[Exposed=Window] +interface ChannelMergerNode : AudioNode { + [Throws] constructor(BaseAudioContext context, optional ChannelMergerOptions options = {}); +}; diff --git a/components/script/dom/webidls/ChannelSplitterNode.webidl b/components/script/dom/webidls/ChannelSplitterNode.webidl new file mode 100644 index 00000000000..e867f7a9181 --- /dev/null +++ b/components/script/dom/webidls/ChannelSplitterNode.webidl @@ -0,0 +1,16 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#channelsplitternode + */ + +dictionary ChannelSplitterOptions : AudioNodeOptions { + unsigned long numberOfOutputs = 6; +}; + +[Exposed=Window] +interface ChannelSplitterNode : AudioNode { + [Throws] constructor(BaseAudioContext context, optional ChannelSplitterOptions options = {}); +}; diff --git a/components/script/dom/webidls/CharacterData.webidl b/components/script/dom/webidls/CharacterData.webidl index bd092dfec09..e69f862afc9 100644 --- a/components/script/dom/webidls/CharacterData.webidl +++ b/components/script/dom/webidls/CharacterData.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://dom.spec.whatwg.org/#characterdata @@ -9,9 +9,9 @@ * liability, trademark and document use rules apply. */ -[Abstract] +[Exposed=Window, Abstract] interface CharacterData : Node { - [Pure, TreatNullAs=EmptyString] attribute DOMString data; + [Pure] attribute [TreatNullAs=EmptyString] DOMString data; [Pure] readonly attribute unsigned long length; [Pure, Throws] DOMString substringData(unsigned long offset, unsigned long count); @@ -24,5 +24,5 @@ interface CharacterData : Node { void replaceData(unsigned long offset, unsigned long count, DOMString data); }; -CharacterData implements ChildNode; -CharacterData implements NonDocumentTypeChildNode; +CharacterData includes ChildNode; +CharacterData includes NonDocumentTypeChildNode; diff --git a/components/script/dom/webidls/ChildNode.webidl b/components/script/dom/webidls/ChildNode.webidl index ca642048d11..8964653fffc 100644 --- a/components/script/dom/webidls/ChildNode.webidl +++ b/components/script/dom/webidls/ChildNode.webidl @@ -1,25 +1,23 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is: * https://dom.spec.whatwg.org/#interface-childnode */ -[NoInterfaceObject] -interface ChildNode { - [Throws, Unscopable] +interface mixin ChildNode { + [Throws, CEReactions, Unscopable] void before((Node or DOMString)... nodes); - [Throws, Unscopable] + [Throws, CEReactions, Unscopable] void after((Node or DOMString)... nodes); - [Throws, Unscopable] + [Throws, CEReactions, Unscopable] void replaceWith((Node or DOMString)... nodes); - [Unscopable] + [CEReactions, Unscopable] void remove(); }; -[NoInterfaceObject] -interface NonDocumentTypeChildNode { +interface mixin NonDocumentTypeChildNode { [Pure] readonly attribute Element? previousElementSibling; [Pure] diff --git a/components/script/dom/webidls/Client.webidl b/components/script/dom/webidls/Client.webidl index 8ff045d11ab..f5a9dee934e 100644 --- a/components/script/dom/webidls/Client.webidl +++ b/components/script/dom/webidls/Client.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/ServiceWorker/#client diff --git a/components/script/dom/webidls/CloseEvent.webidl b/components/script/dom/webidls/CloseEvent.webidl index 477ce51445c..712f8848df0 100644 --- a/components/script/dom/webidls/CloseEvent.webidl +++ b/components/script/dom/webidls/CloseEvent.webidl @@ -1,10 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ //https://html.spec.whatwg.org/multipage/#the-closeevent-interfaces -[Constructor(DOMString type, optional CloseEventInit eventInitDict), Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface CloseEvent : Event { + [Throws] constructor(DOMString type, optional CloseEventInit eventInitDict = {}); readonly attribute boolean wasClean; readonly attribute unsigned short code; readonly attribute DOMString reason; diff --git a/components/script/dom/webidls/Comment.webidl b/components/script/dom/webidls/Comment.webidl index d49897f8862..0ccda9ee991 100644 --- a/components/script/dom/webidls/Comment.webidl +++ b/components/script/dom/webidls/Comment.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://dom.spec.whatwg.org/#comment @@ -9,6 +9,7 @@ * liability, trademark and document use rules apply. */ -[Constructor(optional DOMString data = "")] +[Exposed=Window] interface Comment : CharacterData { + [Throws] constructor(optional DOMString data = ""); }; diff --git a/components/script/dom/webidls/CompositionEvent.webidl b/components/script/dom/webidls/CompositionEvent.webidl new file mode 100644 index 00000000000..1ed323d26b3 --- /dev/null +++ b/components/script/dom/webidls/CompositionEvent.webidl @@ -0,0 +1,21 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://w3c.github.io/uievents/#idl-compositionevent + * + */ + +// https://w3c.github.io/uievents/#idl-compositionevent +[Exposed=Window, Pref="dom.composition_event.enabled"] +interface CompositionEvent : UIEvent { + [Throws] constructor(DOMString type, optional CompositionEventInit eventInitDict = {}); + readonly attribute DOMString data; +}; + +// https://w3c.github.io/uievents/#idl-compositioneventinit +dictionary CompositionEventInit : UIEventInit { + DOMString data = ""; +}; + diff --git a/components/script/dom/webidls/Console.webidl b/components/script/dom/webidls/Console.webidl index 90f9bb9f58e..c41e46d8535 100644 --- a/components/script/dom/webidls/Console.webidl +++ b/components/script/dom/webidls/Console.webidl @@ -1,25 +1,28 @@ /* 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 http://mozilla.org/MPL/2.0/. */ -/* - * References: - * MDN Docs - https://developer.mozilla.org/en-US/docs/Web/API/console - * Draft Spec - https://sideshowbarker.github.io/console-spec/ - * - * © Copyright 2014 Mozilla Foundation. - */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +// https://console.spec.whatwg.org/ [ClassString="Console", - Exposed=(Window,Worker), + Exposed=(Window,Worker,Worklet), ProtoObjectHack] namespace console { - // These should be DOMString message, DOMString message2, ... + // Logging void log(DOMString... messages); void debug(DOMString... messages); void info(DOMString... messages); void warn(DOMString... messages); void error(DOMString... messages); void assert(boolean condition, optional DOMString message); + void clear(); + + // Grouping + void group(DOMString... data); + void groupCollapsed(DOMString... data); + void groupEnd(); + + // Timing void time(DOMString message); void timeEnd(DOMString message); }; diff --git a/components/script/dom/webidls/ConstantSourceNode.webidl b/components/script/dom/webidls/ConstantSourceNode.webidl new file mode 100644 index 00000000000..e3a5a174250 --- /dev/null +++ b/components/script/dom/webidls/ConstantSourceNode.webidl @@ -0,0 +1,17 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#ConstantSourceNode + */ + +dictionary ConstantSourceOptions: AudioNodeOptions { + float offset = 1; +}; + +[Exposed=Window] +interface ConstantSourceNode : AudioScheduledSourceNode { + [Throws] constructor(BaseAudioContext context, optional ConstantSourceOptions options = {}); + readonly attribute AudioParam offset; +}; diff --git a/components/script/dom/webidls/Crypto.webidl b/components/script/dom/webidls/Crypto.webidl index 94611750e8f..8a92d425d89 100644 --- a/components/script/dom/webidls/Crypto.webidl +++ b/components/script/dom/webidls/Crypto.webidl @@ -1,24 +1,23 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#crypto-interface * */ -[NoInterfaceObject, Exposed=(Window,Worker)] -interface GlobalCrypto { +[Exposed=(Window,Worker)] +interface mixin GlobalCrypto { readonly attribute Crypto crypto; }; -Window implements GlobalCrypto; -WorkerGlobalScope implements GlobalCrypto; +Window includes GlobalCrypto; +WorkerGlobalScope includes GlobalCrypto; [Exposed=(Window,Worker)] interface Crypto { //readonly attribute SubtleCrypto subtle; - //ArrayBufferView getRandomValues(ArrayBufferView array); [Throws] - ArrayBufferView getRandomValues(object array); + ArrayBufferView getRandomValues(ArrayBufferView array); }; diff --git a/components/script/dom/webidls/CustomElementRegistry.webidl b/components/script/dom/webidls/CustomElementRegistry.webidl new file mode 100644 index 00000000000..1d6f638d67e --- /dev/null +++ b/components/script/dom/webidls/CustomElementRegistry.webidl @@ -0,0 +1,22 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#customelementregistry +[Exposed=Window, Pref="dom.custom_elements.enabled"] +interface CustomElementRegistry { + [Throws, CEReactions] + void define(DOMString name, CustomElementConstructor constructor_, optional ElementDefinitionOptions options = {}); + + any get(DOMString name); + + Promise<CustomElementConstructor> whenDefined(DOMString name); + + [CEReactions] void upgrade(Node root); +}; + +callback CustomElementConstructor = HTMLElement(); + +dictionary ElementDefinitionOptions { + DOMString extends; +}; diff --git a/components/script/dom/webidls/CustomEvent.webidl b/components/script/dom/webidls/CustomEvent.webidl index d9c5c189b5f..604286881df 100644 --- a/components/script/dom/webidls/CustomEvent.webidl +++ b/components/script/dom/webidls/CustomEvent.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * For more information on this interface please see * https://dom.spec.whatwg.org/#interface-customevent @@ -13,9 +13,9 @@ * http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0. */ -[Constructor(DOMString type, optional CustomEventInit eventInitDict), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface CustomEvent : Event { + [Throws] constructor(DOMString type, optional CustomEventInit eventInitDict = {}); readonly attribute any detail; void initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, any detail); diff --git a/components/script/dom/webidls/DOMException.webidl b/components/script/dom/webidls/DOMException.webidl index 69866372cb6..d61d30151fa 100644 --- a/components/script/dom/webidls/DOMException.webidl +++ b/components/script/dom/webidls/DOMException.webidl @@ -1,14 +1,18 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* /* https://heycam.github.io/webidl/#es-DOMException * https://heycam.github.io/webidl/#es-DOMException-constructor-object */ -[ExceptionClass, Exposed=(Window,Worker)] +[ + ExceptionClass, + Exposed=(Window,Worker,Worklet,DissimilarOriginWindow) +] interface DOMException { + [Throws] constructor(optional DOMString message="", optional DOMString name="Error"); const unsigned short INDEX_SIZE_ERR = 1; const unsigned short DOMSTRING_SIZE_ERR = 2; // historical const unsigned short HIERARCHY_REQUEST_ERR = 3; @@ -43,6 +47,4 @@ interface DOMException { // A custom message set by the thrower. readonly attribute DOMString message; - - stringifier; }; diff --git a/components/script/dom/webidls/DOMImplementation.webidl b/components/script/dom/webidls/DOMImplementation.webidl index bfee277416a..cf809b30f1a 100644 --- a/components/script/dom/webidls/DOMImplementation.webidl +++ b/components/script/dom/webidls/DOMImplementation.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://dom.spec.whatwg.org/#interface-domimplementation @@ -10,6 +10,7 @@ * related or neighboring rights to this work. */ +[Exposed=Window] interface DOMImplementation { [NewObject, Throws] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, diff --git a/components/script/dom/webidls/DOMMatrix.webidl b/components/script/dom/webidls/DOMMatrix.webidl index d1dd65e8a63..eaef16c3906 100644 --- a/components/script/dom/webidls/DOMMatrix.webidl +++ b/components/script/dom/webidls/DOMMatrix.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://drafts.fxtf.org/geometry-1/#DOMMatrix @@ -10,15 +10,14 @@ * related or neighboring rights to this work. */ -[Constructor, - // Constructor(DOMString transformList), - Constructor(sequence<unrestricted double> numberSequence), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker,PaintWorklet), + LegacyWindowAlias=WebKitCSSMatrix] interface DOMMatrix : DOMMatrixReadOnly { + [Throws] constructor(optional (DOMString or sequence<unrestricted double>) init); - [NewObject, Throws] static DOMMatrix fromMatrix(optional DOMMatrixInit other); -// [NewObject] static DOMMatrix fromFloat32Array(Float32Array array32); -// [NewObject] static DOMMatrix fromFloat64Array(Float64Array array64); + [NewObject, Throws] static DOMMatrix fromMatrix(optional DOMMatrixInit other = {}); + [NewObject, Throws] static DOMMatrix fromFloat32Array(Float32Array array32); + [NewObject, Throws] static DOMMatrix fromFloat64Array(Float64Array array64); // These attributes are simple aliases for certain elements of the 4x4 matrix inherit attribute unrestricted double a; @@ -46,8 +45,8 @@ interface DOMMatrix : DOMMatrixReadOnly { inherit attribute unrestricted double m44; // Mutable transform methods - [Throws] DOMMatrix multiplySelf(optional DOMMatrixInit other); - [Throws] DOMMatrix preMultiplySelf(optional DOMMatrixInit other); + [Throws] DOMMatrix multiplySelf(optional DOMMatrixInit other = {}); + [Throws] DOMMatrix preMultiplySelf(optional DOMMatrixInit other = {}); DOMMatrix translateSelf(optional unrestricted double tx = 0, optional unrestricted double ty = 0, optional unrestricted double tz = 0); diff --git a/components/script/dom/webidls/DOMMatrixReadOnly.webidl b/components/script/dom/webidls/DOMMatrixReadOnly.webidl index 9261002e348..689b83ddc58 100644 --- a/components/script/dom/webidls/DOMMatrixReadOnly.webidl +++ b/components/script/dom/webidls/DOMMatrixReadOnly.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://drafts.fxtf.org/geometry-1/#DOMMatrix @@ -10,15 +10,13 @@ * related or neighboring rights to this work. */ -[Constructor, - // Constructor(DOMString transformList) - Constructor(sequence<unrestricted double> numberSequence), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker,PaintWorklet)] interface DOMMatrixReadOnly { + [Throws] constructor(optional (DOMString or sequence<unrestricted double>) init); - [NewObject, Throws] static DOMMatrixReadOnly fromMatrix(optional DOMMatrixInit other); -// [NewObject] static DOMMatrixReadOnly fromFloat32Array(Float32Array array32); -// [NewObject] static DOMMatrixReadOnly fromFloat64Array(Float64Array array64); + [NewObject, Throws] static DOMMatrixReadOnly fromMatrix(optional DOMMatrixInit other = {}); + [NewObject, Throws] static DOMMatrixReadOnly fromFloat32Array(Float32Array array32); + [NewObject, Throws] static DOMMatrixReadOnly fromFloat64Array(Float64Array array64); // These attributes are simple aliases for certain elements of the 4x4 matrix readonly attribute unrestricted double a; @@ -58,6 +56,8 @@ interface DOMMatrixReadOnly { optional unrestricted double originX = 0, optional unrestricted double originY = 0, optional unrestricted double originZ = 0); + [NewObject] DOMMatrix scaleNonUniform(optional unrestricted double scaleX = 1, + optional unrestricted double scaleY = 1); DOMMatrix scale3d(optional unrestricted double scale = 1, optional unrestricted double originX = 0, optional unrestricted double originY = 0, @@ -73,15 +73,14 @@ interface DOMMatrixReadOnly { optional unrestricted double angle = 0); DOMMatrix skewX(optional unrestricted double sx = 0); DOMMatrix skewY(optional unrestricted double sy = 0); - [Throws] DOMMatrix multiply(optional DOMMatrixInit other); + [Throws] DOMMatrix multiply(optional DOMMatrixInit other = {}); DOMMatrix flipX(); DOMMatrix flipY(); DOMMatrix inverse(); - DOMPoint transformPoint(optional DOMPointInit point); -// Float32Array toFloat32Array(); -// Float64Array toFloat64Array(); -// stringifier; -// serializer = { attribute }; - + DOMPoint transformPoint(optional DOMPointInit point = {}); + Float32Array toFloat32Array(); + Float64Array toFloat64Array(); +// [Exposed=Window] stringifier; + [Default] object toJSON(); }; diff --git a/components/script/dom/webidls/DOMParser.webidl b/components/script/dom/webidls/DOMParser.webidl index 6381f01e449..8af1f309c78 100644 --- a/components/script/dom/webidls/DOMParser.webidl +++ b/components/script/dom/webidls/DOMParser.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://w3c.github.io/DOM-Parsing/#the-domparser-interface @@ -14,8 +14,9 @@ enum SupportedType { "image/svg+xml"*/ }; -[Constructor] +[Exposed=Window] interface DOMParser { + [Throws] constructor(); [Throws] Document parseFromString(DOMString str, SupportedType type); }; diff --git a/components/script/dom/webidls/DOMPoint.webidl b/components/script/dom/webidls/DOMPoint.webidl index 4afc98ba3d6..765c62df573 100644 --- a/components/script/dom/webidls/DOMPoint.webidl +++ b/components/script/dom/webidls/DOMPoint.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * http://dev.w3.org/fxtf/geometry/ @@ -10,10 +10,12 @@ */ // http://dev.w3.org/fxtf/geometry/Overview.html#dompoint -[Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, - optional unrestricted double z = 0, optional unrestricted double w = 1), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker,PaintWorklet)] interface DOMPoint : DOMPointReadOnly { + [Throws] 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; inherit attribute unrestricted double y; inherit attribute unrestricted double z; diff --git a/components/script/dom/webidls/DOMPointReadOnly.webidl b/components/script/dom/webidls/DOMPointReadOnly.webidl index 358a1129a82..98940ed3f08 100644 --- a/components/script/dom/webidls/DOMPointReadOnly.webidl +++ b/components/script/dom/webidls/DOMPointReadOnly.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * http://dev.w3.org/fxtf/geometry/ @@ -10,12 +10,16 @@ */ // http://dev.w3.org/fxtf/geometry/Overview.html#dompointreadonly -[Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, - optional unrestricted double z = 0, optional unrestricted double w = 1), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker,PaintWorklet)] interface DOMPointReadOnly { + [Throws] 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; readonly attribute unrestricted double y; readonly attribute unrestricted double z; readonly attribute unrestricted double w; + + [Default] object toJSON(); }; diff --git a/components/script/dom/webidls/DOMQuad.webidl b/components/script/dom/webidls/DOMQuad.webidl index 51a3693093b..ba58ccffc48 100644 --- a/components/script/dom/webidls/DOMQuad.webidl +++ b/components/script/dom/webidls/DOMQuad.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://drafts.fxtf.org/geometry/#DOMQuad @@ -10,23 +10,25 @@ * related or neighboring rights to this work. */ -[Constructor(optional DOMPointInit p1, optional DOMPointInit p2, - optional DOMPointInit p3, optional DOMPointInit p4), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface DOMQuad { - [NewObject] static DOMQuad fromRect(optional DOMRectInit other); - [NewObject] static DOMQuad fromQuad(optional DOMQuadInit other); + [Throws] 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 = {}); [SameObject] readonly attribute DOMPoint p1; [SameObject] readonly attribute DOMPoint p2; [SameObject] readonly attribute DOMPoint p3; [SameObject] readonly attribute DOMPoint p4; [NewObject] DOMRect getBounds(); + + [Default] object toJSON(); }; dictionary DOMQuadInit { - DOMPointInit p1; - DOMPointInit p2; - DOMPointInit p3; - DOMPointInit p4; + DOMPointInit p1 = {}; + DOMPointInit p2 = {}; + DOMPointInit p3 = {}; + DOMPointInit p4 = {}; }; diff --git a/components/script/dom/webidls/DOMRect.webidl b/components/script/dom/webidls/DOMRect.webidl index 56e67ec976c..0aabed6d93f 100644 --- a/components/script/dom/webidls/DOMRect.webidl +++ b/components/script/dom/webidls/DOMRect.webidl @@ -1,12 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -[Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, - optional unrestricted double width = 0, optional unrestricted double height = 0), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] // https://drafts.fxtf.org/geometry/#domrect interface DOMRect : DOMRectReadOnly { + [Throws] constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, + optional unrestricted double width = 0, optional unrestricted double height = 0); inherit attribute unrestricted double x; inherit attribute unrestricted double y; inherit attribute unrestricted double width; diff --git a/components/script/dom/webidls/DOMRectReadOnly.webidl b/components/script/dom/webidls/DOMRectReadOnly.webidl index 6df1e50a02b..9885841c73a 100644 --- a/components/script/dom/webidls/DOMRectReadOnly.webidl +++ b/components/script/dom/webidls/DOMRectReadOnly.webidl @@ -1,12 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -[Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0, - optional unrestricted double width = 0, optional unrestricted double height = 0), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] // https://drafts.fxtf.org/geometry/#domrect interface DOMRectReadOnly { + [Throws] 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; @@ -17,6 +17,8 @@ interface DOMRectReadOnly { readonly attribute unrestricted double right; readonly attribute unrestricted double bottom; readonly attribute unrestricted double left; + + [Default] object toJSON(); }; // https://drafts.fxtf.org/geometry/#dictdef-domrectinit diff --git a/components/script/dom/webidls/DOMStringList.webidl b/components/script/dom/webidls/DOMStringList.webidl new file mode 100644 index 00000000000..c2d1f235b63 --- /dev/null +++ b/components/script/dom/webidls/DOMStringList.webidl @@ -0,0 +1,18 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://html.spec.whatwg.org/multipage/#domstringlist + * + * Copyright: + * To the extent possible under law, the editors have waived all copyright and + * related or neighboring rights to this work. + */ + +[Exposed=(Window,Worker)] +interface DOMStringList { + readonly attribute unsigned long length; + getter DOMString? item(unsigned long index); + boolean contains(DOMString string); +}; diff --git a/components/script/dom/webidls/DOMStringMap.webidl b/components/script/dom/webidls/DOMStringMap.webidl index f9801a45174..0acf6f70228 100644 --- a/components/script/dom/webidls/DOMStringMap.webidl +++ b/components/script/dom/webidls/DOMStringMap.webidl @@ -1,12 +1,13 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#the-domstringmap-interface -[OverrideBuiltins] +[Exposed=Window, OverrideBuiltins] interface DOMStringMap { getter DOMString (DOMString name); - [Throws] + [CEReactions, Throws] setter void (DOMString name, DOMString value); + [CEReactions] deleter void (DOMString name); }; diff --git a/components/script/dom/webidls/DOMTokenList.webidl b/components/script/dom/webidls/DOMTokenList.webidl index 4d2b9f691a4..b67dbb1a1dc 100644 --- a/components/script/dom/webidls/DOMTokenList.webidl +++ b/components/script/dom/webidls/DOMTokenList.webidl @@ -1,8 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://dom.spec.whatwg.org/#domtokenlist +[Exposed=Window] interface DOMTokenList { [Pure] readonly attribute unsigned long length; @@ -11,18 +12,19 @@ interface DOMTokenList { [Pure] boolean contains(DOMString token); - [Throws] + [CEReactions, Throws] void add(DOMString... tokens); - [Throws] + [CEReactions, Throws] void remove(DOMString... tokens); - [Throws] + [CEReactions, Throws] boolean toggle(DOMString token, optional boolean force); - [Throws] - void replace(DOMString token, DOMString newToken); + [CEReactions, Throws] + boolean replace(DOMString token, DOMString newToken); + [Pure, Throws] + boolean supports(DOMString token); - [Pure] - attribute DOMString value; + [CEReactions, Pure] + stringifier attribute DOMString value; - stringifier; iterable<DOMString?>; }; diff --git a/components/script/dom/webidls/DedicatedWorkerGlobalScope.webidl b/components/script/dom/webidls/DedicatedWorkerGlobalScope.webidl index 53996ee3965..2df97dbacfe 100644 --- a/components/script/dom/webidls/DedicatedWorkerGlobalScope.webidl +++ b/components/script/dom/webidls/DedicatedWorkerGlobalScope.webidl @@ -1,13 +1,13 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#dedicatedworkerglobalscope [Global=(Worker,DedicatedWorker), Exposed=DedicatedWorker] /*sealed*/ interface DedicatedWorkerGlobalScope : WorkerGlobalScope { - [Throws] - void postMessage(any message/*, optional sequence<Transferable> transfer*/); - attribute EventHandler onmessage; + [Throws] void postMessage(any message, sequence<object> transfer); + [Throws] void postMessage(any message, optional PostMessageOptions options = {}); + attribute EventHandler onmessage; void close(); }; diff --git a/components/script/dom/webidls/DissimilarOriginLocation.webidl b/components/script/dom/webidls/DissimilarOriginLocation.webidl index 8eca6a790ac..8c077665704 100644 --- a/components/script/dom/webidls/DissimilarOriginLocation.webidl +++ b/components/script/dom/webidls/DissimilarOriginLocation.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // This is a Servo-specific interface, used to represent locations @@ -14,7 +14,8 @@ // way to enforce security policy. // https://html.spec.whatwg.org/multipage/#location -[Unforgeable, NoInterfaceObject] interface DissimilarOriginLocation { +[Exposed=(Window,DissimilarOriginWindow), Unforgeable, NoInterfaceObject] +interface DissimilarOriginLocation { [Throws] attribute USVString href; [Throws] void assign(USVString url); [Throws] void replace(USVString url); diff --git a/components/script/dom/webidls/DissimilarOriginWindow.webidl b/components/script/dom/webidls/DissimilarOriginWindow.webidl index a1f3a2f8b6d..b690736469a 100644 --- a/components/script/dom/webidls/DissimilarOriginWindow.webidl +++ b/components/script/dom/webidls/DissimilarOriginWindow.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // This is a Servo-specific interface, used to represent windows // that are not similar-origin, so live in another script thread. @@ -13,7 +13,7 @@ // way to enforce security policy. // https://html.spec.whatwg.org/multipage/#window -[Global, NoInterfaceObject] +[Global, Exposed=(Window,DissimilarOriginWindow), NoInterfaceObject] interface DissimilarOriginWindow : GlobalScope { [Unforgeable] readonly attribute WindowProxy window; [BinaryName="Self_", Replaceable] readonly attribute WindowProxy self; @@ -25,7 +25,8 @@ interface DissimilarOriginWindow : GlobalScope { void close(); readonly attribute boolean closed; - [Throws] void postMessage(any message, DOMString targetOrigin); + [Throws] void postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []); + [Throws] void postMessage(any message, optional WindowPostMessageOptions options = {}); attribute any opener; void blur(); void focus(); diff --git a/components/script/dom/webidls/Document.webidl b/components/script/dom/webidls/Document.webidl index e3c67851011..d2429e51489 100644 --- a/components/script/dom/webidls/Document.webidl +++ b/components/script/dom/webidls/Document.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is: * https://dom.spec.whatwg.org/#interface-document @@ -8,8 +8,9 @@ */ // https://dom.spec.whatwg.org/#interface-document -[Constructor] +[Exposed=Window] interface Document : Node { + [Throws] constructor(); [SameObject] readonly attribute DOMImplementation implementation; [Constant] @@ -32,22 +33,25 @@ interface Document : Node { HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString qualifiedName); HTMLCollection getElementsByClassName(DOMString classNames); - [NewObject, Throws] - Element createElement(DOMString localName); - [NewObject, Throws] - Element createElementNS(DOMString? namespace, DOMString qualifiedName); + [CEReactions, NewObject, Throws] + Element createElement(DOMString localName, optional (DOMString or ElementCreationOptions) options = {}); + [CEReactions, NewObject, Throws] + Element createElementNS(DOMString? namespace, DOMString qualifiedName, + optional (DOMString or ElementCreationOptions) options = {}); [NewObject] DocumentFragment createDocumentFragment(); [NewObject] Text createTextNode(DOMString data); + [NewObject, Throws] + CDATASection createCDATASection(DOMString data); [NewObject] Comment createComment(DOMString data); [NewObject, Throws] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data); - [NewObject, Throws] + [CEReactions, NewObject, Throws] Node importNode(Node node, optional boolean deep = false); - [Throws] + [CEReactions, Throws] Node adoptNode(Node node); [NewObject, Throws] @@ -70,16 +74,20 @@ interface Document : Node { optional NodeFilter? filter = null); }; -Document implements NonElementParentNode; -Document implements ParentNode; +Document includes NonElementParentNode; +Document includes ParentNode; enum DocumentReadyState { "loading", "interactive", "complete" }; +dictionary ElementCreationOptions { + DOMString is; +}; + // https://html.spec.whatwg.org/multipage/#the-document-object // [OverrideBuiltins] partial /*sealed*/ interface Document { // resource metadata management - [/*PutForwards=href, */Unforgeable] + [PutForwards=href, Unforgeable] readonly attribute Location? location; [SetterThrows] attribute DOMString domain; readonly attribute DOMString referrer; @@ -90,9 +98,11 @@ partial /*sealed*/ interface Document { // DOM tree accessors getter object (DOMString name); + [CEReactions] attribute DOMString title; + // [CEReactions] // attribute DOMString dir; - [SetterThrows] + [CEReactions, SetterThrows] attribute HTMLElement? body; readonly attribute HTMLHeadElement? head; [SameObject] @@ -111,26 +121,28 @@ partial /*sealed*/ interface Document { readonly attribute HTMLScriptElement? currentScript; // dynamic markup insertion - [Throws] - Document open(optional DOMString type = "text/html", optional DOMString replace = ""); - // WindowProxy open(DOMString url, DOMString name, DOMString features, optional boolean replace = false); - [Throws] + [CEReactions, Throws] + Document open(optional DOMString unused1, optional DOMString unused2); + [CEReactions, Throws] + WindowProxy? open(USVString url, DOMString name, DOMString features); + [CEReactions, Throws] void close(); - [Throws] + [CEReactions, Throws] void write(DOMString... text); - [Throws] + [CEReactions, Throws] void writeln(DOMString... text); // user interaction readonly attribute Window?/*Proxy?*/ defaultView; - readonly attribute Element? activeElement; boolean hasFocus(); + // [CEReactions] // attribute DOMString designMode; + // [CEReactions] // boolean execCommand(DOMString commandId, optional boolean showUI = false, optional DOMString value = ""); // boolean queryCommandEnabled(DOMString commandId); // boolean queryCommandIndeterm(DOMString commandId); // boolean queryCommandState(DOMString commandId); - // boolean queryCommandSupported(DOMString commandId); + boolean queryCommandSupported(DOMString commandId); // DOMString queryCommandValue(DOMString commandId); // special event handler IDL attributes that only apply to Document objects @@ -138,26 +150,32 @@ partial /*sealed*/ interface Document { // also has obsolete members }; -Document implements GlobalEventHandlers; -Document implements DocumentAndElementEventHandlers; +Document includes GlobalEventHandlers; +Document includes DocumentAndElementEventHandlers; // https://html.spec.whatwg.org/multipage/#Document-partial partial interface Document { - [TreatNullAs=EmptyString] attribute DOMString fgColor; + [CEReactions] + attribute [TreatNullAs=EmptyString] DOMString fgColor; // https://github.com/servo/servo/issues/8715 - // [TreatNullAs=EmptyString] attribute DOMString linkColor; + // [CEReactions, TreatNullAs=EmptyString] + // attribute DOMString linkColor; // https://github.com/servo/servo/issues/8716 - // [TreatNullAs=EmptyString] attribute DOMString vlinkColor; + // [CEReactions, TreatNullAs=EmptyString] + // attribute DOMString vlinkColor; // https://github.com/servo/servo/issues/8717 - // [TreatNullAs=EmptyString] attribute DOMString alinkColor; + // [CEReactions, TreatNullAs=EmptyString] + // attribute DOMString alinkColor; - [TreatNullAs=EmptyString] attribute DOMString bgColor; + [CEReactions] + attribute [TreatNullAs=EmptyString] DOMString bgColor; [SameObject] readonly attribute HTMLCollection anchors; + [SameObject] readonly attribute HTMLCollection applets; @@ -169,30 +187,6 @@ partial interface Document { // readonly attribute HTMLAllCollection all; }; -// http://w3c.github.io/touch-events/#idl-def-Document -partial interface Document { - Touch createTouch(Window/*Proxy*/ view, - EventTarget target, - long identifier, - double pageX, - double pageY, - double screenX, - double screenY); - - TouchList createTouchList(Touch... touches); -}; - -// https://drafts.csswg.org/cssom-view/#dom-document-elementfrompoint -partial interface Document { - Element? elementFromPoint(double x, double y); - sequence<Element> elementsFromPoint(double x, double y); -}; - -// https://drafts.csswg.org/cssom/#extensions-to-the-document-interface -partial interface Document { - [SameObject] readonly attribute StyleSheetList styleSheets; -}; - // https://fullscreen.spec.whatwg.org/#api partial interface Document { [LenientSetter] readonly attribute boolean fullscreenEnabled; @@ -204,3 +198,17 @@ partial interface Document { attribute EventHandler onfullscreenchange; attribute EventHandler onfullscreenerror; }; + +Document includes DocumentOrShadowRoot; + +// https://w3c.github.io/selection-api/#dom-document +partial interface Document { + Selection? getSelection(); +}; + + +// Servo internal API. +partial interface Document { + [Throws] + ShadowRoot servoGetMediaControls(DOMString id); +}; diff --git a/components/script/dom/webidls/DocumentFragment.webidl b/components/script/dom/webidls/DocumentFragment.webidl index 7573dd9f22b..ec97caecf93 100644 --- a/components/script/dom/webidls/DocumentFragment.webidl +++ b/components/script/dom/webidls/DocumentFragment.webidl @@ -1,11 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://dom.spec.whatwg.org/#interface-documentfragment -[Constructor] +[Exposed=Window] interface DocumentFragment : Node { + [Throws] constructor(); }; -DocumentFragment implements NonElementParentNode; -DocumentFragment implements ParentNode; +DocumentFragment includes NonElementParentNode; +DocumentFragment includes ParentNode; diff --git a/components/script/dom/webidls/DocumentOrShadowRoot.webidl b/components/script/dom/webidls/DocumentOrShadowRoot.webidl new file mode 100644 index 00000000000..c833299482b --- /dev/null +++ b/components/script/dom/webidls/DocumentOrShadowRoot.webidl @@ -0,0 +1,17 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://dom.spec.whatwg.org/#documentorshadowroot + * https://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin + */ + +interface mixin DocumentOrShadowRoot { + // Selection? getSelection(); + Element? elementFromPoint (double x, double y); + sequence<Element> elementsFromPoint (double x, double y); + // CaretPosition? caretPositionFromPoint (double x, double y); + readonly attribute Element? activeElement; + readonly attribute StyleSheetList styleSheets; +}; diff --git a/components/script/dom/webidls/DocumentType.webidl b/components/script/dom/webidls/DocumentType.webidl index 1f7b0b83599..8d00b6df451 100644 --- a/components/script/dom/webidls/DocumentType.webidl +++ b/components/script/dom/webidls/DocumentType.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://dom.spec.whatwg.org/#documenttype @@ -9,6 +9,7 @@ * liability, trademark and document use rules apply. */ +[Exposed=Window] interface DocumentType : Node { [Constant] readonly attribute DOMString name; @@ -18,4 +19,4 @@ interface DocumentType : Node { readonly attribute DOMString systemId; }; -DocumentType implements ChildNode; +DocumentType includes ChildNode; diff --git a/components/script/dom/webidls/DynamicModuleOwner.webidl b/components/script/dom/webidls/DynamicModuleOwner.webidl new file mode 100644 index 00000000000..924481d491b --- /dev/null +++ b/components/script/dom/webidls/DynamicModuleOwner.webidl @@ -0,0 +1,13 @@ +/* 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/. */ + +/** + * This is defined for [`Dynamic Module`](https://html.spec.whatwg.org/multipage/#fetch-an-import()-module-script-graph) + * so that we can hold a traceable owner for those dynamic modules which don't hold a owner. + */ + +[NoInterfaceObject, Exposed=Window] +interface DynamicModuleOwner { + readonly attribute Promise<any> promise; +}; diff --git a/components/script/dom/webidls/EXTBlendMinmax.webidl b/components/script/dom/webidls/EXTBlendMinmax.webidl new file mode 100644 index 00000000000..767eace6923 --- /dev/null +++ b/components/script/dom/webidls/EXTBlendMinmax.webidl @@ -0,0 +1,13 @@ +/* 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/. */ +/* + * WebGL IDL definitions scraped from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/ + */ + +[NoInterfaceObject, Exposed=Window] +interface EXTBlendMinmax { + const GLenum MIN_EXT = 0x8007; + const GLenum MAX_EXT = 0x8008; +}; diff --git a/components/script/dom/webidls/EXTColorBufferHalfFloat.webidl b/components/script/dom/webidls/EXTColorBufferHalfFloat.webidl new file mode 100644 index 00000000000..77cf23c6cd0 --- /dev/null +++ b/components/script/dom/webidls/EXTColorBufferHalfFloat.webidl @@ -0,0 +1,15 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float/ + */ + +[NoInterfaceObject, Exposed=Window] +interface EXTColorBufferHalfFloat { + const GLenum RGBA16F_EXT = 0x881A; + const GLenum RGB16F_EXT = 0x881B; + const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211; + const GLenum UNSIGNED_NORMALIZED_EXT = 0x8C17; +}; // interface EXT_color_buffer_half_float diff --git a/components/script/dom/webidls/EXTFragDepth.webidl b/components/script/dom/webidls/EXTFragDepth.webidl new file mode 100644 index 00000000000..7fde7896c4c --- /dev/null +++ b/components/script/dom/webidls/EXTFragDepth.webidl @@ -0,0 +1,11 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/ + */ + +[NoInterfaceObject, Exposed=Window] +interface EXTFragDepth { +}; // interface EXT_frag_depth diff --git a/components/script/dom/webidls/EXTShaderTextureLod.webidl b/components/script/dom/webidls/EXTShaderTextureLod.webidl new file mode 100644 index 00000000000..decb5ba86ac --- /dev/null +++ b/components/script/dom/webidls/EXTShaderTextureLod.webidl @@ -0,0 +1,11 @@ +/* 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/. */ +/* + * WebGL IDL definitions scraped from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/EXT_shader_texture_lod/ + */ + +[NoInterfaceObject, Exposed=Window] +interface EXTShaderTextureLod { +}; diff --git a/components/script/dom/webidls/EXTTextureFilterAnisotropic.webidl b/components/script/dom/webidls/EXTTextureFilterAnisotropic.webidl new file mode 100644 index 00000000000..d2957500844 --- /dev/null +++ b/components/script/dom/webidls/EXTTextureFilterAnisotropic.webidl @@ -0,0 +1,13 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/ + */ + +[NoInterfaceObject, Exposed=Window] +interface EXTTextureFilterAnisotropic { + const GLenum TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE; + const GLenum MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF; +}; diff --git a/components/script/dom/webidls/Element.webidl b/components/script/dom/webidls/Element.webidl index c099b2a04ae..4c44b2cd431 100644 --- a/components/script/dom/webidls/Element.webidl +++ b/components/script/dom/webidls/Element.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://dom.spec.whatwg.org/#element and @@ -12,6 +12,7 @@ * liability, trademark and document use rules apply. */ +[Exposed=Window] interface Element : Node { [Constant] readonly attribute DOMString? namespaceURI; @@ -23,9 +24,9 @@ interface Element : Node { [Pure] readonly attribute DOMString tagName; - [Pure] + [CEReactions, Pure] attribute DOMString id; - [Pure] + [CEReactions, Pure] attribute DOMString className; [SameObject, PutForwards=value] readonly attribute DOMTokenList classList; @@ -40,11 +41,15 @@ interface Element : Node { DOMString? getAttribute(DOMString name); [Pure] DOMString? getAttributeNS(DOMString? namespace, DOMString localName); - [Throws] + [CEReactions, Throws] + boolean toggleAttribute(DOMString name, optional boolean force); + [CEReactions, Throws] void setAttribute(DOMString name, DOMString value); - [Throws] + [CEReactions, Throws] void setAttributeNS(DOMString? namespace, DOMString name, DOMString value); + [CEReactions] void removeAttribute(DOMString name); + [CEReactions] void removeAttributeNS(DOMString? namespace, DOMString localName); boolean hasAttribute(DOMString name); boolean hasAttributeNS(DOMString? namespace, DOMString localName); @@ -53,11 +58,11 @@ interface Element : Node { Attr? getAttributeNode(DOMString name); [Pure] Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName); - [Throws] + [CEReactions, Throws] Attr? setAttributeNode(Attr attr); - [Throws] + [CEReactions, Throws] Attr? setAttributeNodeNS(Attr attr); - [Throws] + [CEReactions, Throws] Attr removeAttributeNode(Attr oldAttr); [Pure, Throws] @@ -71,12 +76,14 @@ interface Element : Node { HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); HTMLCollection getElementsByClassName(DOMString classNames); - [Throws] + [CEReactions, Throws] Element? insertAdjacentElement(DOMString where_, Element element); // historical [Throws] void insertAdjacentText(DOMString where_, DOMString data); - [Throws] + [CEReactions, Throws] void insertAdjacentHTML(DOMString position, DOMString html); + + [Throws, Pref="dom.shadowdom.enabled"] ShadowRoot attachShadow(); }; // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface @@ -85,12 +92,12 @@ partial interface Element { [NewObject] DOMRect getBoundingClientRect(); - void scroll(optional ScrollToOptions options); + void scroll(optional ScrollToOptions options = {}); void scroll(unrestricted double x, unrestricted double y); - void scrollTo(optional ScrollToOptions options); + void scrollTo(optional ScrollToOptions options = {}); void scrollTo(unrestricted double x, unrestricted double y); - void scrollBy(optional ScrollToOptions options); + void scrollBy(optional ScrollToOptions options = {}); void scrollBy(unrestricted double x, unrestricted double y); attribute unrestricted double scrollTop; attribute unrestricted double scrollLeft; @@ -105,10 +112,10 @@ partial interface Element { // https://w3c.github.io/DOM-Parsing/#extensions-to-the-element-interface partial interface Element { - [Throws,TreatNullAs=EmptyString] - attribute DOMString innerHTML; - [Throws,TreatNullAs=EmptyString] - attribute DOMString outerHTML; + [CEReactions, Throws] + attribute [TreatNullAs=EmptyString] DOMString innerHTML; + [CEReactions, Throws] + attribute [TreatNullAs=EmptyString] DOMString outerHTML; }; // https://fullscreen.spec.whatwg.org/#api @@ -116,7 +123,7 @@ partial interface Element { Promise<void> requestFullscreen(); }; -Element implements ChildNode; -Element implements NonDocumentTypeChildNode; -Element implements ParentNode; -Element implements ActivatableElement; +Element includes ChildNode; +Element includes NonDocumentTypeChildNode; +Element includes ParentNode; +Element includes ActivatableElement; diff --git a/components/script/dom/webidls/ElementCSSInlineStyle.webidl b/components/script/dom/webidls/ElementCSSInlineStyle.webidl index 12054f7e65d..3e5696c7e8d 100644 --- a/components/script/dom/webidls/ElementCSSInlineStyle.webidl +++ b/components/script/dom/webidls/ElementCSSInlineStyle.webidl @@ -1,10 +1,10 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ //http://dev.w3.org/csswg/cssom/#elementcssinlinestyle -[NoInterfaceObject, Exposed=Window] -interface ElementCSSInlineStyle { - [SameObject/*, PutForwards=cssText*/] readonly attribute CSSStyleDeclaration style; +[Exposed=Window] +interface mixin ElementCSSInlineStyle { + [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style; }; diff --git a/components/script/dom/webidls/ElementContentEditable.webidl b/components/script/dom/webidls/ElementContentEditable.webidl index e9811eca835..8429700e93e 100644 --- a/components/script/dom/webidls/ElementContentEditable.webidl +++ b/components/script/dom/webidls/ElementContentEditable.webidl @@ -1,10 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#elementcontenteditable -[NoInterfaceObject, Exposed=Window] -interface ElementContentEditable { - // attribute DOMString contentEditable; - // readonly attribute boolean isContentEditable; +[Exposed=Window] +interface mixin ElementContentEditable { + [CEReactions] + attribute DOMString contentEditable; + readonly attribute boolean isContentEditable; }; diff --git a/components/script/dom/webidls/ErrorEvent.webidl b/components/script/dom/webidls/ErrorEvent.webidl index 7507f22410d..6f0782f4653 100644 --- a/components/script/dom/webidls/ErrorEvent.webidl +++ b/components/script/dom/webidls/ErrorEvent.webidl @@ -1,11 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#the-errorevent-interface -[Constructor(DOMString type, optional ErrorEventInit eventInitDict), Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface ErrorEvent : Event { + [Throws] constructor(DOMString type, optional ErrorEventInit eventInitDict = {}); readonly attribute DOMString message; readonly attribute DOMString filename; readonly attribute unsigned long lineno; diff --git a/components/script/dom/webidls/Event.webidl b/components/script/dom/webidls/Event.webidl index c55c2d36cde..0c2c122e044 100644 --- a/components/script/dom/webidls/Event.webidl +++ b/components/script/dom/webidls/Event.webidl @@ -1,16 +1,18 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * For more information on this interface please see * https://dom.spec.whatwg.org/#event */ -[Constructor(DOMString type, optional EventInit eventInitDict), Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface Event { + [Throws] constructor(DOMString type, optional EventInit eventInitDict = {}); [Pure] readonly attribute DOMString type; readonly attribute EventTarget? target; + readonly attribute EventTarget? srcElement; readonly attribute EventTarget? currentTarget; const unsigned short NONE = 0; @@ -20,12 +22,14 @@ interface Event { readonly attribute unsigned short eventPhase; void stopPropagation(); + attribute boolean cancelBubble; void stopImmediatePropagation(); [Pure] readonly attribute boolean bubbles; [Pure] readonly attribute boolean cancelable; + attribute boolean returnValue; // historical void preventDefault(); [Pure] readonly attribute boolean defaultPrevented; @@ -33,9 +37,9 @@ interface Event { [Unforgeable] readonly attribute boolean isTrusted; [Constant] - readonly attribute DOMTimeStamp timeStamp; + readonly attribute DOMHighResTimeStamp timeStamp; - void initEvent(DOMString type, boolean bubbles, boolean cancelable); + void initEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false); }; dictionary EventInit { diff --git a/components/script/dom/webidls/EventHandler.webidl b/components/script/dom/webidls/EventHandler.webidl index 7bd04bf9e89..57138967792 100644 --- a/components/script/dom/webidls/EventHandler.webidl +++ b/components/script/dom/webidls/EventHandler.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://html.spec.whatwg.org/multipage/#eventhandler @@ -25,8 +25,8 @@ callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event); typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler; // https://html.spec.whatwg.org/multipage/#globaleventhandlers -[NoInterfaceObject, Exposed=Window] -interface GlobalEventHandlers { +[Exposed=Window] +interface mixin GlobalEventHandlers { attribute EventHandler onabort; attribute EventHandler onblur; attribute EventHandler oncancel; @@ -51,6 +51,7 @@ interface GlobalEventHandlers { attribute EventHandler onended; attribute OnErrorEventHandler onerror; attribute EventHandler onfocus; + attribute EventHandler onformdata; attribute EventHandler oninput; attribute EventHandler oninvalid; attribute EventHandler onkeydown; @@ -89,20 +90,35 @@ interface GlobalEventHandlers { attribute EventHandler onwaiting; }; +// https://drafts.csswg.org/css-animations/#interface-globaleventhandlers-idl +partial interface mixin GlobalEventHandlers { + attribute EventHandler onanimationend; + attribute EventHandler onanimationiteration; +}; + // https://drafts.csswg.org/css-transitions/#interface-globaleventhandlers-idl -partial interface GlobalEventHandlers { +partial interface mixin GlobalEventHandlers { + attribute EventHandler ontransitionrun; attribute EventHandler ontransitionend; + attribute EventHandler ontransitioncancel; +}; + +// https://w3c.github.io/selection-api/#extensions-to-globaleventhandlers-interface +partial interface mixin GlobalEventHandlers { + attribute EventHandler onselectstart; + attribute EventHandler onselectionchange; }; // https://html.spec.whatwg.org/multipage/#windoweventhandlers -[NoInterfaceObject, Exposed=Window] -interface WindowEventHandlers { +[Exposed=Window] +interface mixin WindowEventHandlers { attribute EventHandler onafterprint; attribute EventHandler onbeforeprint; attribute OnBeforeUnloadEventHandler onbeforeunload; attribute EventHandler onhashchange; attribute EventHandler onlanguagechange; attribute EventHandler onmessage; + attribute EventHandler onmessageerror; attribute EventHandler onoffline; attribute EventHandler ononline; attribute EventHandler onpagehide; @@ -115,8 +131,8 @@ interface WindowEventHandlers { }; // https://html.spec.whatwg.org/multipage/#documentandelementeventhandlers -[NoInterfaceObject, Exposed=Window] -interface DocumentAndElementEventHandlers { +[Exposed=Window] +interface mixin DocumentAndElementEventHandlers { attribute EventHandler oncopy; attribute EventHandler oncut; attribute EventHandler onpaste; diff --git a/components/script/dom/webidls/EventListener.webidl b/components/script/dom/webidls/EventListener.webidl index 9f37b80687c..f384e661c63 100644 --- a/components/script/dom/webidls/EventListener.webidl +++ b/components/script/dom/webidls/EventListener.webidl @@ -1,10 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * https://dom.spec.whatwg.org/#callbackdef-eventlistener */ +[Exposed=Window] callback interface EventListener { void handleEvent(Event event); }; diff --git a/components/script/dom/webidls/EventModifierInit.webidl b/components/script/dom/webidls/EventModifierInit.webidl index f61ba1b8219..c8abfcbddda 100644 --- a/components/script/dom/webidls/EventModifierInit.webidl +++ b/components/script/dom/webidls/EventModifierInit.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/uievents/#dictdef-eventmodifierinit dictionary EventModifierInit : UIEventInit { diff --git a/components/script/dom/webidls/EventSource.webidl b/components/script/dom/webidls/EventSource.webidl index 11c30e959d4..5525970891b 100644 --- a/components/script/dom/webidls/EventSource.webidl +++ b/components/script/dom/webidls/EventSource.webidl @@ -1,14 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is: * https://html.spec.whatwg.org/multipage/#eventsource */ -[Constructor(DOMString url, optional EventSourceInit eventSourceInitDict), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface EventSource : EventTarget { + [Throws] constructor(DOMString url, optional EventSourceInit eventSourceInitDict = {}); readonly attribute DOMString url; readonly attribute boolean withCredentials; diff --git a/components/script/dom/webidls/EventTarget.webidl b/components/script/dom/webidls/EventTarget.webidl index ee6e5d722a8..dd0236c910c 100644 --- a/components/script/dom/webidls/EventTarget.webidl +++ b/components/script/dom/webidls/EventTarget.webidl @@ -1,18 +1,34 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * https://dom.spec.whatwg.org/#interface-eventtarget */ -[Abstract, Exposed=(Window,Worker)] +[Exposed=(Window,Worker,Worklet,DissimilarOriginWindow)] interface EventTarget { - void addEventListener(DOMString type, - EventListener? listener, - optional boolean capture = false); - void removeEventListener(DOMString type, - EventListener? listener, - optional boolean capture = false); + [Throws] constructor(); + void addEventListener( + DOMString type, + EventListener? callback, + optional (AddEventListenerOptions or boolean) options = {} + ); + + void removeEventListener( + DOMString type, + EventListener? callback, + optional (EventListenerOptions or boolean) options = {} + ); + [Throws] boolean dispatchEvent(Event event); }; + +dictionary EventListenerOptions { + boolean capture = false; +}; + +dictionary AddEventListenerOptions : EventListenerOptions { + // boolean passive = false; + boolean once = false; +}; diff --git a/components/script/dom/webidls/ExtendableEvent.webidl b/components/script/dom/webidls/ExtendableEvent.webidl index 09cb253e892..99cafa305a6 100644 --- a/components/script/dom/webidls/ExtendableEvent.webidl +++ b/components/script/dom/webidls/ExtendableEvent.webidl @@ -1,14 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/ServiceWorker/#extendable-event -[Constructor(DOMString type, - optional ExtendableEventInit eventInitDict), - Exposed=ServiceWorker, +[Exposed=ServiceWorker, Pref="dom.serviceworker.enabled"] interface ExtendableEvent : Event { + [Throws] constructor(DOMString type, + optional ExtendableEventInit eventInitDict = {}); [Throws] void waitUntil(/*Promise<*/any/*>*/ f); }; diff --git a/components/script/dom/webidls/ExtendableMessageEvent.webidl b/components/script/dom/webidls/ExtendableMessageEvent.webidl index 4190757d1f2..247c08e7989 100644 --- a/components/script/dom/webidls/ExtendableMessageEvent.webidl +++ b/components/script/dom/webidls/ExtendableMessageEvent.webidl @@ -1,24 +1,24 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/ServiceWorker/#extendablemessage-event-section -[Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict), - Exposed=ServiceWorker, +[Exposed=ServiceWorker, Pref="dom.serviceworker.enabled"] interface ExtendableMessageEvent : ExtendableEvent { + [Throws] constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict = {}); readonly attribute any data; readonly attribute DOMString origin; readonly attribute DOMString lastEventId; // [SameObject] readonly attribute (Client or ServiceWorker /*or MessagePort*/)? source; - // readonly attribute FrozenArray<MessagePort>? ports; + readonly attribute /*FrozenArray<MessagePort>*/any ports; }; dictionary ExtendableMessageEventInit : ExtendableEventInit { - any data; - DOMString origin; - DOMString lastEventId; + any data = null; + DOMString origin = ""; + DOMString lastEventId = ""; // (Client or ServiceWorker /*or MessagePort*/)? source; - // sequence<MessagePort>? ports; + sequence<MessagePort> ports = []; }; diff --git a/components/script/dom/webidls/FakeXRDevice.webidl b/components/script/dom/webidls/FakeXRDevice.webidl new file mode 100644 index 00000000000..6349d70963b --- /dev/null +++ b/components/script/dom/webidls/FakeXRDevice.webidl @@ -0,0 +1,90 @@ +/* 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/. */ + +// https://github.com/immersive-web/webxr-test-api/ + +[Exposed=Window, Pref="dom.webxr.test"] +interface FakeXRDevice { + // Sets the values to be used for subsequent + // requestAnimationFrame() callbacks. + [Throws] void setViews(sequence<FakeXRViewInit> views); + + [Throws] void setViewerOrigin(FakeXRRigidTransformInit origin, optional boolean emulatedPosition = false); + void clearViewerOrigin(); + + [Throws] void setFloorOrigin(FakeXRRigidTransformInit origin); + void clearFloorOrigin(); + + // // Simulates devices focusing and blurring sessions. + void simulateVisibilityChange(XRVisibilityState state); + + // void setBoundsGeometry(sequence<FakeXRBoundsPoint> boundsCoodinates); + + [Throws] FakeXRInputController simulateInputSourceConnection(FakeXRInputSourceInit init); + + // behaves as if device was disconnected + Promise<void> disconnect(); + + // Hit test extensions: + [Throws] void setWorld(FakeXRWorldInit world); + void clearWorld(); +}; + +// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-getviewport +dictionary FakeXRViewInit { + required XREye eye; + // https://immersive-web.github.io/webxr/#view-projection-matrix + required sequence<float> projectionMatrix; + // https://immersive-web.github.io/webxr/#view-offset + required FakeXRRigidTransformInit viewOffset; + // https://immersive-web.github.io/webxr/#dom-xrwebgllayer-getviewport + required FakeXRDeviceResolution resolution; + + FakeXRFieldOfViewInit fieldOfView; +}; + +// https://immersive-web.github.io/webxr/#xrviewport +dictionary FakeXRDeviceResolution { + required long width; + required long height; +}; + +dictionary FakeXRBoundsPoint { + double x; double z; +}; + +dictionary FakeXRRigidTransformInit { + required sequence<float> position; + required sequence<float> orientation; +}; + +dictionary FakeXRFieldOfViewInit { + required float upDegrees; + required float downDegrees; + required float leftDegrees; + required float rightDegrees; +}; + +// hit testing +dictionary FakeXRWorldInit { + required sequence<FakeXRRegionInit> hitTestRegions; +}; + + +dictionary FakeXRRegionInit { + required sequence<FakeXRTriangleInit> faces; + required FakeXRRegionType type; +}; + + +dictionary FakeXRTriangleInit { + required sequence<DOMPointInit> vertices; // size = 3 +}; + + +enum FakeXRRegionType { + "point", + "plane", + "mesh" +}; diff --git a/components/script/dom/webidls/FakeXRInputController.webidl b/components/script/dom/webidls/FakeXRInputController.webidl new file mode 100644 index 00000000000..b8faad1038a --- /dev/null +++ b/components/script/dom/webidls/FakeXRInputController.webidl @@ -0,0 +1,53 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr-test-api/#fakexrinputcontroller + +[Exposed=Window, Pref="dom.webxr.test"] +interface FakeXRInputController { + void setHandedness(XRHandedness handedness); + void setTargetRayMode(XRTargetRayMode targetRayMode); + void setProfiles(sequence<DOMString> profiles); + [Throws] void setGripOrigin(FakeXRRigidTransformInit gripOrigin, optional boolean emulatedPosition = false); + void clearGripOrigin(); + [Throws] void setPointerOrigin(FakeXRRigidTransformInit pointerOrigin, optional boolean emulatedPosition = false); + + void disconnect(); + void reconnect(); + + void startSelection(); + void endSelection(); + void simulateSelect(); + + // void setSupportedButtons(sequence<FakeXRButtonStateInit> supportedButtons); + // void updateButtonState(FakeXRButtonStateInit buttonState); +}; + +dictionary FakeXRInputSourceInit { + required XRHandedness handedness; + required XRTargetRayMode targetRayMode; + required FakeXRRigidTransformInit pointerOrigin; + required sequence<DOMString> profiles; + boolean selectionStarted = false; + boolean selectionClicked = false; + sequence<FakeXRButtonStateInit> supportedButtons; + FakeXRRigidTransformInit gripOrigin; +}; + +enum FakeXRButtonType { + "grip", + "touchpad", + "thumbstick", + "optional-button", + "optional-thumbstick" +}; + +dictionary FakeXRButtonStateInit { + required FakeXRButtonType buttonType; + required boolean pressed; + required boolean touched; + required float pressedValue; + float xValue = 0.0; + float yValue = 0.0; +}; diff --git a/components/script/dom/webidls/Fetch.webidl b/components/script/dom/webidls/Fetch.webidl index fe062994598..abedcf620ea 100644 --- a/components/script/dom/webidls/Fetch.webidl +++ b/components/script/dom/webidls/Fetch.webidl @@ -1,11 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://fetch.spec.whatwg.org/#fetch-method [Exposed=(Window,Worker)] -partial interface WindowOrWorkerGlobalScope { - [NewObject] Promise<Response> fetch(RequestInfo input, optional RequestInit init); +partial interface mixin WindowOrWorkerGlobalScope { + [NewObject] Promise<Response> fetch(RequestInfo input, optional RequestInit init = {}); }; diff --git a/components/script/dom/webidls/File.webidl b/components/script/dom/webidls/File.webidl index 9404abe5034..143df2f8f13 100644 --- a/components/script/dom/webidls/File.webidl +++ b/components/script/dom/webidls/File.webidl @@ -1,14 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/FileAPI/#file -[Constructor(sequence<BlobPart> fileBits, - DOMString fileName, - optional FilePropertyBag options), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface File : Blob { + [Throws] constructor(sequence<BlobPart> fileBits, + DOMString fileName, + optional FilePropertyBag options = {}); readonly attribute DOMString name; readonly attribute long long lastModified; }; diff --git a/components/script/dom/webidls/FileList.webidl b/components/script/dom/webidls/FileList.webidl index 59ebae5de3b..d849bd323ef 100644 --- a/components/script/dom/webidls/FileList.webidl +++ b/components/script/dom/webidls/FileList.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/FileAPI/#dfn-filelist diff --git a/components/script/dom/webidls/FileReader.webidl b/components/script/dom/webidls/FileReader.webidl index be00e39fd77..a1c01fb716c 100644 --- a/components/script/dom/webidls/FileReader.webidl +++ b/components/script/dom/webidls/FileReader.webidl @@ -1,12 +1,13 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // http://dev.w3.org/2006/webapi/FileAPI/#APIASynch typedef (DOMString or object) FileReaderResult; -[Constructor, Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface FileReader: EventTarget { + [Throws] constructor(); // async read methods [Throws] diff --git a/components/script/dom/webidls/FileReaderSync.webidl b/components/script/dom/webidls/FileReaderSync.webidl index cbc18a47921..08248839958 100644 --- a/components/script/dom/webidls/FileReaderSync.webidl +++ b/components/script/dom/webidls/FileReaderSync.webidl @@ -1,15 +1,20 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/FileAPI/#FileReaderSync -[Constructor, Exposed=Worker] +[Exposed=Worker] interface FileReaderSync { + [Throws] constructor(); // Synchronously return strings - // ArrayBuffer readAsArrayBuffer(Blob blob); - // DOMString readAsBinaryString(Blob blob); - // DOMString readAsText(Blob blob, optional DOMString label); - // DOMString readAsDataURL(Blob blob); + [Throws] + ArrayBuffer readAsArrayBuffer(Blob blob); + [Throws] + DOMString readAsBinaryString(Blob blob); + [Throws] + DOMString readAsText(Blob blob, optional DOMString label); + [Throws] + DOMString readAsDataURL(Blob blob); }; diff --git a/components/script/dom/webidls/FocusEvent.webidl b/components/script/dom/webidls/FocusEvent.webidl index 14ec3ae67e9..1d5e4ee4bea 100644 --- a/components/script/dom/webidls/FocusEvent.webidl +++ b/components/script/dom/webidls/FocusEvent.webidl @@ -1,11 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/uievents/#interface-FocusEvent -[Constructor(DOMString typeArg, optional FocusEventInit focusEventInitDict), - Exposed=Window] +[Exposed=Window] interface FocusEvent : UIEvent { + [Throws] constructor(DOMString typeArg, optional FocusEventInit focusEventInitDict = {}); readonly attribute EventTarget? relatedTarget; }; diff --git a/components/script/dom/webidls/ForceTouchEvent.webidl b/components/script/dom/webidls/ForceTouchEvent.webidl deleted file mode 100644 index 4c184214cae..00000000000 --- a/components/script/dom/webidls/ForceTouchEvent.webidl +++ /dev/null @@ -1,34 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -// https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptual/SafariJSProgTopics/RespondingtoForceTouchEventsfromJavaScript.html - -/** - * Events: (copy/paste from apple.com) - * - * webkitmouseforcewillbegin: This event occurs immediately before the mousedown event. It allows you to - * prevent the default system behavior, such as displaying a dictionary window when force clicking on a - * word, in order to perform a custom action instead. To prevent the default system behavior, call the - * preventDefault() method on the event. - * webkitmouseforcedown: This event occurs after the mousedown event, once enough force has been applied - * to register as a force click. The user receives haptic feedback representing the force click when this - * event occurs. - * webkitmouseforceup: This event occurs after a webkitmouseforcedown event, once enough force has been - * released to exit the force click operation. The user receives haptic feedback representing the exit - * from force click when this event occurs. - * webkitmouseforcechanged: This event occurs whenever a change in trackpad force is detected between the - * mousedown and mouseup events. - * - */ - - -[Pref="dom.forcetouch.enabled"] -interface ForceTouchEvent : UIEvent { - // Represents the amount of force required to perform a regular click. - readonly attribute float SERVO_FORCE_AT_MOUSE_DOWN; - // Represents the force required to perform a force click. - readonly attribute float SERVO_FORCE_AT_FORCE_MOUSE_DOWN; - // force level - readonly attribute float servoForce; -}; diff --git a/components/script/dom/webidls/FormData.webidl b/components/script/dom/webidls/FormData.webidl index 3c3b3a8d01a..4e2f5de04ec 100644 --- a/components/script/dom/webidls/FormData.webidl +++ b/components/script/dom/webidls/FormData.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://xhr.spec.whatwg.org/#interface-formdata @@ -8,9 +8,9 @@ typedef (File or USVString) FormDataEntryValue; -[Constructor(optional HTMLFormElement form), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface FormData { + [Throws] constructor(optional HTMLFormElement form); void append(USVString name, USVString value); void append(USVString name, Blob value, optional USVString filename); void delete(USVString name); diff --git a/components/script/dom/webidls/FormDataEvent.webidl b/components/script/dom/webidls/FormDataEvent.webidl new file mode 100644 index 00000000000..0cb81b93962 --- /dev/null +++ b/components/script/dom/webidls/FormDataEvent.webidl @@ -0,0 +1,14 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#the-formdataevent-interface +[Exposed=Window] +interface FormDataEvent : Event { + [Throws] constructor(DOMString type, FormDataEventInit eventInitDict); + readonly attribute FormData formData; +}; + +dictionary FormDataEventInit : EventInit { + required FormData formData; +}; diff --git a/components/script/dom/webidls/Function.webidl b/components/script/dom/webidls/Function.webidl index 08513dfadf3..4694df61999 100644 --- a/components/script/dom/webidls/Function.webidl +++ b/components/script/dom/webidls/Function.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://heycam.github.io/webidl/#common-Function diff --git a/components/script/dom/webidls/GPU.webidl b/components/script/dom/webidls/GPU.webidl new file mode 100644 index 00000000000..e0e6eb57b27 --- /dev/null +++ b/components/script/dom/webidls/GPU.webidl @@ -0,0 +1,20 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpu-interface +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPU { + Promise<GPUAdapter?> requestAdapter(optional GPURequestAdapterOptions options = {}); +}; + +// https://gpuweb.github.io/gpuweb/#dictdef-gpurequestadapteroptions +dictionary GPURequestAdapterOptions { + GPUPowerPreference powerPreference; +}; + +// https://gpuweb.github.io/gpuweb/#enumdef-gpupowerpreference +enum GPUPowerPreference { + "low-power", + "high-performance" +}; diff --git a/components/script/dom/webidls/GPUAdapter.webidl b/components/script/dom/webidls/GPUAdapter.webidl new file mode 100644 index 00000000000..e4e4e86791c --- /dev/null +++ b/components/script/dom/webidls/GPUAdapter.webidl @@ -0,0 +1,39 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpuadapter +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUAdapter { + readonly attribute DOMString name; + readonly attribute object extensions; + //readonly attribute GPULimits limits; Don’t expose higher limits for now. + + Promise<GPUDevice?> requestDevice(optional GPUDeviceDescriptor descriptor = {}); +}; + +dictionary GPUDeviceDescriptor : GPUObjectDescriptorBase { + sequence<GPUExtensionName> extensions = []; + GPULimits limits = {}; +}; + +enum GPUExtensionName { + "depth-clamping", + "depth24unorm-stencil8", + "depth32float-stencil8", + "pipeline-statistics-query", + "texture-compression-bc", + "timestamp-query", +}; + +dictionary GPULimits { + GPUSize32 maxBindGroups = 4; + GPUSize32 maxDynamicUniformBuffersPerPipelineLayout = 8; + GPUSize32 maxDynamicStorageBuffersPerPipelineLayout = 4; + GPUSize32 maxSampledTexturesPerShaderStage = 16; + GPUSize32 maxSamplersPerShaderStage = 16; + GPUSize32 maxStorageBuffersPerShaderStage = 4; + GPUSize32 maxStorageTexturesPerShaderStage = 4; + GPUSize32 maxUniformBuffersPerShaderStage = 12; + GPUSize32 maxUniformBufferBindingSize = 16384; +}; diff --git a/components/script/dom/webidls/GPUBindGroup.webidl b/components/script/dom/webidls/GPUBindGroup.webidl new file mode 100644 index 00000000000..7bfa023acba --- /dev/null +++ b/components/script/dom/webidls/GPUBindGroup.webidl @@ -0,0 +1,29 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpubindgrouplayout +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUBindGroup { +}; +GPUBindGroup includes GPUObjectBase; + +dictionary GPUBindGroupDescriptor : GPUObjectDescriptorBase { + required GPUBindGroupLayout layout; + required sequence<GPUBindGroupEntry> entries; +}; + +typedef (GPUSampler or GPUTextureView or GPUBufferBindings) GPUBindingResource; + +dictionary GPUBindGroupEntry { + required GPUIndex32 binding; + required GPUBindingResource resource; +}; + +// Note: Servo codegen doesn't like the name `GPUBufferBinding` because it's already occupied +// dictionary GPUBufferBinding { +dictionary GPUBufferBindings { + required GPUBuffer buffer; + GPUSize64 offset = 0; + GPUSize64 size; +}; diff --git a/components/script/dom/webidls/GPUBindGroupLayout.webidl b/components/script/dom/webidls/GPUBindGroupLayout.webidl new file mode 100644 index 00000000000..5fc58139b14 --- /dev/null +++ b/components/script/dom/webidls/GPUBindGroupLayout.webidl @@ -0,0 +1,36 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpubindgrouplayout +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUBindGroupLayout { +}; +GPUBindGroupLayout includes GPUObjectBase; + +dictionary GPUBindGroupLayoutDescriptor : GPUObjectDescriptorBase { + required sequence<GPUBindGroupLayoutEntry> entries; +}; + +dictionary GPUBindGroupLayoutEntry { + required GPUIndex32 binding; + required GPUShaderStageFlags visibility; + required GPUBindingType type; + boolean hasDynamicOffset; + GPUSize64 minBufferBindingSize; + GPUTextureViewDimension viewDimension; + GPUTextureComponentType textureComponentType; + GPUTextureFormat storageTextureFormat; +}; + +enum GPUBindingType { + "uniform-buffer", + "storage-buffer", + "readonly-storage-buffer", + "sampler", + "comparison-sampler", + "sampled-texture", + "multisampled-texture", + "readonly-storage-texture", + "writeonly-storage-texture" +}; diff --git a/components/script/dom/webidls/GPUBuffer.webidl b/components/script/dom/webidls/GPUBuffer.webidl new file mode 100644 index 00000000000..2097db233e9 --- /dev/null +++ b/components/script/dom/webidls/GPUBuffer.webidl @@ -0,0 +1,22 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpubuffer +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUBuffer { + Promise<void> mapAsync(GPUMapModeFlags mode, optional GPUSize64 offset = 0, optional GPUSize64 size); + [Throws] ArrayBuffer getMappedRange(optional GPUSize64 offset = 0, optional GPUSize64 size); + void unmap(); + + void destroy(); +}; +GPUBuffer includes GPUObjectBase; + +dictionary GPUBufferDescriptor : GPUObjectDescriptorBase { + required GPUSize64 size; + required GPUBufferUsageFlags usage; + boolean mappedAtCreation = false; +}; + +typedef unsigned long long GPUSize64; diff --git a/components/script/dom/webidls/GPUBufferUsage.webidl b/components/script/dom/webidls/GPUBufferUsage.webidl new file mode 100644 index 00000000000..6db1d029f18 --- /dev/null +++ b/components/script/dom/webidls/GPUBufferUsage.webidl @@ -0,0 +1,20 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#buffer-usage +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUBufferUsage { + const GPUBufferUsageFlags MAP_READ = 0x0001; + const GPUBufferUsageFlags MAP_WRITE = 0x0002; + const GPUBufferUsageFlags COPY_SRC = 0x0004; + const GPUBufferUsageFlags COPY_DST = 0x0008; + const GPUBufferUsageFlags INDEX = 0x0010; + const GPUBufferUsageFlags VERTEX = 0x0020; + const GPUBufferUsageFlags UNIFORM = 0x0040; + const GPUBufferUsageFlags STORAGE = 0x0080; + const GPUBufferUsageFlags INDIRECT = 0x0100; + const GPUBufferUsageFlags QUERY_RESOLVE = 0x0200; +}; + +typedef [EnforceRange] unsigned long GPUBufferUsageFlags; diff --git a/components/script/dom/webidls/GPUCanvasContext.webidl b/components/script/dom/webidls/GPUCanvasContext.webidl new file mode 100644 index 00000000000..5e19f1467e6 --- /dev/null +++ b/components/script/dom/webidls/GPUCanvasContext.webidl @@ -0,0 +1,17 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpucanvascontext +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUCanvasContext { + GPUSwapChain configureSwapChain(GPUSwapChainDescriptor descriptor); + + //Promise<GPUTextureFormat> getSwapChainPreferredFormat(GPUDevice device); +}; + +dictionary GPUSwapChainDescriptor : GPUObjectDescriptorBase { + required GPUDevice device; + required GPUTextureFormat format; + GPUTextureUsageFlags usage = 0x10; // GPUTextureUsage.OUTPUT_ATTACHMENT +}; diff --git a/components/script/dom/webidls/GPUColorWrite.webidl b/components/script/dom/webidls/GPUColorWrite.webidl new file mode 100644 index 00000000000..e4a74fe5f6a --- /dev/null +++ b/components/script/dom/webidls/GPUColorWrite.webidl @@ -0,0 +1,15 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpucolorwrite +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUColorWrite { + const GPUColorWriteFlags RED = 0x1; + const GPUColorWriteFlags GREEN = 0x2; + const GPUColorWriteFlags BLUE = 0x4; + const GPUColorWriteFlags ALPHA = 0x8; + const GPUColorWriteFlags ALL = 0xF; +}; + +typedef [EnforceRange] unsigned long GPUColorWriteFlags; diff --git a/components/script/dom/webidls/GPUCommandBuffer.webidl b/components/script/dom/webidls/GPUCommandBuffer.webidl new file mode 100644 index 00000000000..7fca9a908ac --- /dev/null +++ b/components/script/dom/webidls/GPUCommandBuffer.webidl @@ -0,0 +1,10 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpucommandbuffer +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUCommandBuffer { + //readonly attribute Promise<double> executionTime; +}; +GPUCommandBuffer includes GPUObjectBase; diff --git a/components/script/dom/webidls/GPUCommandEncoder.webidl b/components/script/dom/webidls/GPUCommandEncoder.webidl new file mode 100644 index 00000000000..00a8e1ad537 --- /dev/null +++ b/components/script/dom/webidls/GPUCommandEncoder.webidl @@ -0,0 +1,122 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpucommandencoder +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUCommandEncoder { + GPURenderPassEncoder beginRenderPass(GPURenderPassDescriptor descriptor); + GPUComputePassEncoder beginComputePass(optional GPUComputePassDescriptor descriptor = {}); + + void copyBufferToBuffer( + GPUBuffer source, + GPUSize64 sourceOffset, + GPUBuffer destination, + GPUSize64 destinationOffset, + GPUSize64 size); + + void copyBufferToTexture( + GPUBufferCopyView source, + GPUTextureCopyView destination, + GPUExtent3D copySize); + + void copyTextureToBuffer( + GPUTextureCopyView source, + GPUBufferCopyView destination, + GPUExtent3D copySize); + + void copyTextureToTexture( + GPUTextureCopyView source, + GPUTextureCopyView destination, + GPUExtent3D copySize); + + //void pushDebugGroup(USVString groupLabel); + //void popDebugGroup(); + //void insertDebugMarker(USVString markerLabel); + + //void writeTimestamp(GPUQuerySet querySet, GPUSize32 queryIndex); + + //void resolveQuerySet( + // GPUQuerySet querySet, + // GPUSize32 firstQuery, + // GPUSize32 queryCount, + // GPUBuffer destination, + // GPUSize64 destinationOffset); + + GPUCommandBuffer finish(optional GPUCommandBufferDescriptor descriptor = {}); +}; +GPUCommandEncoder includes GPUObjectBase; + +dictionary GPUComputePassDescriptor : GPUObjectDescriptorBase { +}; + +dictionary GPUCommandBufferDescriptor : GPUObjectDescriptorBase { +}; + +dictionary GPURenderPassDescriptor : GPUObjectDescriptorBase { + required sequence<GPURenderPassColorAttachmentDescriptor> colorAttachments; + GPURenderPassDepthStencilAttachmentDescriptor depthStencilAttachment; + //GPUQuerySet occlusionQuerySet; +}; + +dictionary GPURenderPassColorAttachmentDescriptor { + required GPUTextureView attachment; + GPUTextureView resolveTarget; + + required (GPULoadOp or GPUColor) loadValue; + GPUStoreOp storeOp = "store"; +}; + +dictionary GPURenderPassDepthStencilAttachmentDescriptor { + required GPUTextureView attachment; + + required (GPULoadOp or float) depthLoadValue; + required GPUStoreOp depthStoreOp; + boolean depthReadOnly = false; + + required GPUStencilLoadValue stencilLoadValue; + required GPUStoreOp stencilStoreOp; + boolean stencilReadOnly = false; +}; + +typedef (GPULoadOp or GPUStencilValue) GPUStencilLoadValue; + +enum GPULoadOp { + "load" +}; + +enum GPUStoreOp { + "store", + "clear" +}; + +dictionary GPUColorDict { + required double r; + required double g; + required double b; + required double a; +}; +typedef (sequence<double> or GPUColorDict) GPUColor; + +dictionary GPUTextureDataLayout { + GPUSize64 offset = 0; + required GPUSize32 bytesPerRow; + GPUSize32 rowsPerImage = 0; +}; + +dictionary GPUBufferCopyView : GPUTextureDataLayout { + required GPUBuffer buffer; +}; + +dictionary GPUTextureCopyView { + required GPUTexture texture; + GPUIntegerCoordinate mipLevel = 0; + GPUOrigin3D origin = {}; +}; + +dictionary GPUOrigin3DDict { + GPUIntegerCoordinate x = 0; + GPUIntegerCoordinate y = 0; + GPUIntegerCoordinate z = 0; +}; +typedef (sequence<GPUIntegerCoordinate> or GPUOrigin3DDict) GPUOrigin3D; diff --git a/components/script/dom/webidls/GPUComputePassEncoder.webidl b/components/script/dom/webidls/GPUComputePassEncoder.webidl new file mode 100644 index 00000000000..f7c0eba2138 --- /dev/null +++ b/components/script/dom/webidls/GPUComputePassEncoder.webidl @@ -0,0 +1,22 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpucomputepassencoder +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUComputePassEncoder { + void setPipeline(GPUComputePipeline pipeline); + void dispatch(GPUSize32 x, optional GPUSize32 y = 1, optional GPUSize32 z = 1); + void dispatchIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset); + + //void beginPipelineStatisticsQuery(GPUQuerySet querySet, GPUSize32 queryIndex); + //void endPipelineStatisticsQuery(); + + //void writeTimestamp(GPUQuerySet querySet, GPUSize32 queryIndex); + + void endPass(); +}; +GPUComputePassEncoder includes GPUObjectBase; +GPUComputePassEncoder includes GPUProgrammablePassEncoder; + +typedef [EnforceRange] unsigned long GPUSize32; diff --git a/components/script/dom/webidls/GPUComputePipeline.webidl b/components/script/dom/webidls/GPUComputePipeline.webidl new file mode 100644 index 00000000000..a7599a13803 --- /dev/null +++ b/components/script/dom/webidls/GPUComputePipeline.webidl @@ -0,0 +1,27 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpucomputepipeline +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUComputePipeline { +}; +GPUComputePipeline includes GPUObjectBase; +GPUComputePipeline includes GPUPipelineBase; + +dictionary GPUPipelineDescriptorBase : GPUObjectDescriptorBase { + GPUPipelineLayout layout; +}; + +dictionary GPUProgrammableStageDescriptor { + required GPUShaderModule module; + required DOMString entryPoint; +}; + +dictionary GPUComputePipelineDescriptor : GPUPipelineDescriptorBase { + required GPUProgrammableStageDescriptor computeStage; +}; + +interface mixin GPUPipelineBase { + [Throws] GPUBindGroupLayout getBindGroupLayout(unsigned long index); +}; diff --git a/components/script/dom/webidls/GPUDevice.webidl b/components/script/dom/webidls/GPUDevice.webidl new file mode 100644 index 00000000000..a82bea80ced --- /dev/null +++ b/components/script/dom/webidls/GPUDevice.webidl @@ -0,0 +1,37 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpudevice +[Exposed=(Window, DedicatedWorker), /*Serializable,*/ Pref="dom.webgpu.enabled"] +interface GPUDevice : EventTarget { + [SameObject] readonly attribute GPUAdapter adapter; + readonly attribute object extensions; + readonly attribute object limits; + + [SameObject] readonly attribute GPUQueue defaultQueue; + + GPUBuffer createBuffer(GPUBufferDescriptor descriptor); + GPUTexture createTexture(GPUTextureDescriptor descriptor); + GPUSampler createSampler(optional GPUSamplerDescriptor descriptor = {}); + + GPUBindGroupLayout createBindGroupLayout(GPUBindGroupLayoutDescriptor descriptor); + GPUPipelineLayout createPipelineLayout(GPUPipelineLayoutDescriptor descriptor); + GPUBindGroup createBindGroup(GPUBindGroupDescriptor descriptor); + + GPUShaderModule createShaderModule(GPUShaderModuleDescriptor descriptor); + GPUComputePipeline createComputePipeline(GPUComputePipelineDescriptor descriptor); + GPURenderPipeline createRenderPipeline(GPURenderPipelineDescriptor descriptor); + //Promise<GPUComputePipeline> createReadyComputePipeline(GPUComputePipelineDescriptor descriptor); + //Promise<GPURenderPipeline> createReadyRenderPipeline(GPURenderPipelineDescriptor descriptor); + + GPUCommandEncoder createCommandEncoder(optional GPUCommandEncoderDescriptor descriptor = {}); + GPURenderBundleEncoder createRenderBundleEncoder(GPURenderBundleEncoderDescriptor descriptor); + + //GPUQuerySet createQuerySet(GPUQuerySetDescriptor descriptor); +}; +GPUDevice includes GPUObjectBase; + +dictionary GPUCommandEncoderDescriptor : GPUObjectDescriptorBase { + boolean measureExecutionTime = false; +}; diff --git a/components/script/dom/webidls/GPUDeviceLostInfo.webidl b/components/script/dom/webidls/GPUDeviceLostInfo.webidl new file mode 100644 index 00000000000..cd9ec544408 --- /dev/null +++ b/components/script/dom/webidls/GPUDeviceLostInfo.webidl @@ -0,0 +1,13 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpudevicelostinfo +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUDeviceLostInfo { + readonly attribute DOMString message; +}; + +partial interface GPUDevice { + readonly attribute Promise<GPUDeviceLostInfo> lost; +}; diff --git a/components/script/dom/webidls/GPUMapMode.webidl b/components/script/dom/webidls/GPUMapMode.webidl new file mode 100644 index 00000000000..0dc52c4b448 --- /dev/null +++ b/components/script/dom/webidls/GPUMapMode.webidl @@ -0,0 +1,12 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpumapmode +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUMapMode { + const GPUMapModeFlags READ = 0x0001; + const GPUMapModeFlags WRITE = 0x0002; +}; + +typedef [EnforceRange] unsigned long GPUMapModeFlags; diff --git a/components/script/dom/webidls/GPUObjectBase.webidl b/components/script/dom/webidls/GPUObjectBase.webidl new file mode 100644 index 00000000000..524016d15ce --- /dev/null +++ b/components/script/dom/webidls/GPUObjectBase.webidl @@ -0,0 +1,13 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpuobjectbase +[Exposed=(Window)] +interface mixin GPUObjectBase { + attribute USVString? label; +}; + +dictionary GPUObjectDescriptorBase { + USVString label; +}; diff --git a/components/script/dom/webidls/GPUOutOfMemoryError.webidl b/components/script/dom/webidls/GPUOutOfMemoryError.webidl new file mode 100644 index 00000000000..470684edaab --- /dev/null +++ b/components/script/dom/webidls/GPUOutOfMemoryError.webidl @@ -0,0 +1,9 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpuoutofmemoryerror +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUOutOfMemoryError { + constructor(); +}; diff --git a/components/script/dom/webidls/GPUPipelineLayout.webidl b/components/script/dom/webidls/GPUPipelineLayout.webidl new file mode 100644 index 00000000000..a50c2c60f40 --- /dev/null +++ b/components/script/dom/webidls/GPUPipelineLayout.webidl @@ -0,0 +1,13 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#pipeline-layout +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUPipelineLayout { +}; +GPUPipelineLayout includes GPUObjectBase; + +dictionary GPUPipelineLayoutDescriptor : GPUObjectDescriptorBase { + required sequence<GPUBindGroupLayout> bindGroupLayouts; +}; diff --git a/components/script/dom/webidls/GPUProgrammablePassEncoder.webidl b/components/script/dom/webidls/GPUProgrammablePassEncoder.webidl new file mode 100644 index 00000000000..71bfdcb163e --- /dev/null +++ b/components/script/dom/webidls/GPUProgrammablePassEncoder.webidl @@ -0,0 +1,22 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpuprogrammablepassencoder +[Exposed=(Window, DedicatedWorker)] +interface mixin GPUProgrammablePassEncoder { + void setBindGroup(GPUIndex32 index, GPUBindGroup bindGroup, + optional sequence<GPUBufferDynamicOffset> dynamicOffsets = []); + + // void setBindGroup(GPUIndex32 index, GPUBindGroup bindGroup, + // Uint32Array dynamicOffsetsData, + // GPUSize64 dynamicOffsetsDataStart, + // GPUSize64 dynamicOffsetsDataLength); + + // void pushDebugGroup(DOMString groupLabel); + // void popDebugGroup(); + // void insertDebugMarker(DOMString markerLabel); +}; + +typedef [EnforceRange] unsigned long GPUBufferDynamicOffset; +typedef [EnforceRange] unsigned long GPUIndex32; diff --git a/components/script/dom/webidls/GPUQueue.webidl b/components/script/dom/webidls/GPUQueue.webidl new file mode 100644 index 00000000000..a0fede8415e --- /dev/null +++ b/components/script/dom/webidls/GPUQueue.webidl @@ -0,0 +1,31 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpuqueue +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUQueue { + void submit(sequence<GPUCommandBuffer> commandBuffers); + + //GPUFence createFence(optional GPUFenceDescriptor descriptor = {}); + //void signal(GPUFence fence, GPUFenceValue signalValue); + + [Throws] void writeBuffer( + GPUBuffer buffer, + GPUSize64 bufferOffset, + /*[AllowShared]*/ BufferSource data, + optional GPUSize64 dataOffset = 0, + optional GPUSize64 size); + + [Throws] void writeTexture( + GPUTextureCopyView destination, + /*[AllowShared]*/ BufferSource data, + GPUTextureDataLayout dataLayout, + GPUExtent3D size); + + //void copyImageBitmapToTexture( + // GPUImageBitmapCopyView source, + // GPUTextureCopyView destination, + // GPUExtent3D copySize); +}; +GPUQueue includes GPUObjectBase; diff --git a/components/script/dom/webidls/GPURenderBundle.webidl b/components/script/dom/webidls/GPURenderBundle.webidl new file mode 100644 index 00000000000..52a8e5b0bc8 --- /dev/null +++ b/components/script/dom/webidls/GPURenderBundle.webidl @@ -0,0 +1,12 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpurenderbundle +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPURenderBundle { +}; +GPURenderBundle includes GPUObjectBase; + +dictionary GPURenderBundleDescriptor : GPUObjectDescriptorBase { +}; diff --git a/components/script/dom/webidls/GPURenderBundleEncoder.webidl b/components/script/dom/webidls/GPURenderBundleEncoder.webidl new file mode 100644 index 00000000000..50676b431b9 --- /dev/null +++ b/components/script/dom/webidls/GPURenderBundleEncoder.webidl @@ -0,0 +1,18 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpurenderbundleencoder +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPURenderBundleEncoder { + GPURenderBundle finish(optional GPURenderBundleDescriptor descriptor = {}); +}; +GPURenderBundleEncoder includes GPUObjectBase; +GPURenderBundleEncoder includes GPUProgrammablePassEncoder; +GPURenderBundleEncoder includes GPURenderEncoderBase; + +dictionary GPURenderBundleEncoderDescriptor : GPUObjectDescriptorBase { + required sequence<GPUTextureFormat> colorFormats; + GPUTextureFormat depthStencilFormat; + GPUSize32 sampleCount = 1; +}; diff --git a/components/script/dom/webidls/GPURenderEncoderBase.webidl b/components/script/dom/webidls/GPURenderEncoderBase.webidl new file mode 100644 index 00000000000..f0c4532b446 --- /dev/null +++ b/components/script/dom/webidls/GPURenderEncoderBase.webidl @@ -0,0 +1,24 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpurenderencoderbase +[Exposed=(Window, DedicatedWorker)] +interface mixin GPURenderEncoderBase { + void setPipeline(GPURenderPipeline pipeline); + + void setIndexBuffer(GPUBuffer buffer, optional GPUSize64 offset = 0, optional GPUSize64 size = 0); + void setVertexBuffer(GPUIndex32 slot, GPUBuffer buffer, optional GPUSize64 offset = 0, optional GPUSize64 size = 0); + + void draw(GPUSize32 vertexCount, optional GPUSize32 instanceCount = 1, + optional GPUSize32 firstVertex = 0, optional GPUSize32 firstInstance = 0); + void drawIndexed(GPUSize32 indexCount, optional GPUSize32 instanceCount = 1, + optional GPUSize32 firstIndex = 0, + optional GPUSignedOffset32 baseVertex = 0, + optional GPUSize32 firstInstance = 0); + + void drawIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset); + void drawIndexedIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset); +}; + +typedef [EnforceRange] long GPUSignedOffset32; diff --git a/components/script/dom/webidls/GPURenderPassEncoder.webidl b/components/script/dom/webidls/GPURenderPassEncoder.webidl new file mode 100644 index 00000000000..6261cf89453 --- /dev/null +++ b/components/script/dom/webidls/GPURenderPassEncoder.webidl @@ -0,0 +1,31 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpurenderpassencoder +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPURenderPassEncoder { + void setViewport(float x, float y, + float width, float height, + float minDepth, float maxDepth); + + void setScissorRect(GPUIntegerCoordinate x, GPUIntegerCoordinate y, + GPUIntegerCoordinate width, GPUIntegerCoordinate height); + + void setBlendColor(GPUColor color); + void setStencilReference(GPUStencilValue reference); + + //void beginOcclusionQuery(GPUSize32 queryIndex); + //void endOcclusionQuery(); + + //void beginPipelineStatisticsQuery(GPUQuerySet querySet, GPUSize32 queryIndex); + //void endPipelineStatisticsQuery(); + + //void writeTimestamp(GPUQuerySet querySet, GPUSize32 queryIndex); + + void executeBundles(sequence<GPURenderBundle> bundles); + void endPass(); +}; +GPURenderPassEncoder includes GPUObjectBase; +GPURenderPassEncoder includes GPUProgrammablePassEncoder; +GPURenderPassEncoder includes GPURenderEncoderBase; diff --git a/components/script/dom/webidls/GPURenderPipeline.webidl b/components/script/dom/webidls/GPURenderPipeline.webidl new file mode 100644 index 00000000000..7def381780a --- /dev/null +++ b/components/script/dom/webidls/GPURenderPipeline.webidl @@ -0,0 +1,191 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpurenderpipeline +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPURenderPipeline { +}; +GPURenderPipeline includes GPUObjectBase; +GPURenderPipeline includes GPUPipelineBase; + +dictionary GPURenderPipelineDescriptor : GPUPipelineDescriptorBase { + required GPUProgrammableStageDescriptor vertexStage; + GPUProgrammableStageDescriptor fragmentStage; + + required GPUPrimitiveTopology primitiveTopology; + GPURasterizationStateDescriptor rasterizationState = {}; + required sequence<GPUColorStateDescriptor> colorStates; + GPUDepthStencilStateDescriptor depthStencilState; + GPUVertexStateDescriptor vertexState = {}; + + GPUSize32 sampleCount = 1; + GPUSampleMask sampleMask = 0xFFFFFFFF; + boolean alphaToCoverageEnabled = false; +}; + +typedef [EnforceRange] unsigned long GPUSampleMask; + +enum GPUPrimitiveTopology { + "point-list", + "line-list", + "line-strip", + "triangle-list", + "triangle-strip" +}; + +typedef [EnforceRange] long GPUDepthBias; + +dictionary GPURasterizationStateDescriptor { + GPUFrontFace frontFace = "ccw"; + GPUCullMode cullMode = "none"; + // Enable depth clamping (requires "depth-clamping" extension) + boolean clampDepth = false; + + GPUDepthBias depthBias = 0; + float depthBiasSlopeScale = 0; + float depthBiasClamp = 0; +}; + +enum GPUFrontFace { + "ccw", + "cw" +}; + +enum GPUCullMode { + "none", + "front", + "back" +}; + +dictionary GPUColorStateDescriptor { + required GPUTextureFormat format; + + GPUBlendDescriptor alphaBlend = {}; + GPUBlendDescriptor colorBlend = {}; + GPUColorWriteFlags writeMask = 0xF; // GPUColorWrite.ALL +}; + +dictionary GPUBlendDescriptor { + GPUBlendFactor srcFactor = "one"; + GPUBlendFactor dstFactor = "zero"; + GPUBlendOperation operation = "add"; +}; + +enum GPUBlendFactor { + "zero", + "one", + "src-color", + "one-minus-src-color", + "src-alpha", + "one-minus-src-alpha", + "dst-color", + "one-minus-dst-color", + "dst-alpha", + "one-minus-dst-alpha", + "src-alpha-saturated", + "blend-color", + "one-minus-blend-color" +}; + +enum GPUBlendOperation { + "add", + "subtract", + "reverse-subtract", + "min", + "max" +}; + +enum GPUStencilOperation { + "keep", + "zero", + "replace", + "invert", + "increment-clamp", + "decrement-clamp", + "increment-wrap", + "decrement-wrap" +}; + +typedef [EnforceRange] unsigned long GPUStencilValue; + +dictionary GPUDepthStencilStateDescriptor { + required GPUTextureFormat format; + + boolean depthWriteEnabled = false; + GPUCompareFunction depthCompare = "always"; + + GPUStencilStateFaceDescriptor stencilFront = {}; + GPUStencilStateFaceDescriptor stencilBack = {}; + + GPUStencilValue stencilReadMask = 0xFFFFFFFF; + GPUStencilValue stencilWriteMask = 0xFFFFFFFF; +}; + +dictionary GPUStencilStateFaceDescriptor { + GPUCompareFunction compare = "always"; + GPUStencilOperation failOp = "keep"; + GPUStencilOperation depthFailOp = "keep"; + GPUStencilOperation passOp = "keep"; +}; + +enum GPUIndexFormat { + "uint16", + "uint32" +}; + +enum GPUVertexFormat { + "uchar2", + "uchar4", + "char2", + "char4", + "uchar2norm", + "uchar4norm", + "char2norm", + "char4norm", + "ushort2", + "ushort4", + "short2", + "short4", + "ushort2norm", + "ushort4norm", + "short2norm", + "short4norm", + "half2", + "half4", + "float", + "float2", + "float3", + "float4", + "uint", + "uint2", + "uint3", + "uint4", + "int", + "int2", + "int3", + "int4" +}; + +enum GPUInputStepMode { + "vertex", + "instance" +}; + +dictionary GPUVertexStateDescriptor { + GPUIndexFormat indexFormat = "uint32"; + sequence<GPUVertexBufferLayoutDescriptor?> vertexBuffers = []; +}; + +dictionary GPUVertexBufferLayoutDescriptor { + required GPUSize64 arrayStride; + GPUInputStepMode stepMode = "vertex"; + required sequence<GPUVertexAttributeDescriptor> attributes; +}; + +dictionary GPUVertexAttributeDescriptor { + required GPUVertexFormat format; + required GPUSize64 offset; + + required GPUIndex32 shaderLocation; +}; diff --git a/components/script/dom/webidls/GPUSampler.webidl b/components/script/dom/webidls/GPUSampler.webidl new file mode 100644 index 00000000000..539bc2695de --- /dev/null +++ b/components/script/dom/webidls/GPUSampler.webidl @@ -0,0 +1,44 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpusampler +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUSampler { +}; +GPUSampler includes GPUObjectBase; + +dictionary GPUSamplerDescriptor : GPUObjectDescriptorBase { + GPUAddressMode addressModeU = "clamp-to-edge"; + GPUAddressMode addressModeV = "clamp-to-edge"; + GPUAddressMode addressModeW = "clamp-to-edge"; + GPUFilterMode magFilter = "nearest"; + GPUFilterMode minFilter = "nearest"; + GPUFilterMode mipmapFilter = "nearest"; + float lodMinClamp = 0; + float lodMaxClamp = 0xfffff; // TODO: What should this be? Was Number.MAX_VALUE. + GPUCompareFunction compare; + unsigned short maxAnisotropy = 1; +}; + +enum GPUAddressMode { + "clamp-to-edge", + "repeat", + "mirror-repeat" +}; + +enum GPUFilterMode { + "nearest", + "linear" +}; + +enum GPUCompareFunction { + "never", + "less", + "equal", + "less-equal", + "greater", + "not-equal", + "greater-equal", + "always" +}; diff --git a/components/script/dom/webidls/GPUShaderModule.webidl b/components/script/dom/webidls/GPUShaderModule.webidl new file mode 100644 index 00000000000..0fdfc7c0327 --- /dev/null +++ b/components/script/dom/webidls/GPUShaderModule.webidl @@ -0,0 +1,15 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpushadermodule +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUShaderModule { +}; +GPUShaderModule includes GPUObjectBase; + +typedef (Uint32Array or DOMString) GPUShaderCode; + +dictionary GPUShaderModuleDescriptor : GPUObjectDescriptorBase { + required GPUShaderCode code; +}; diff --git a/components/script/dom/webidls/GPUShaderStage.webidl b/components/script/dom/webidls/GPUShaderStage.webidl new file mode 100644 index 00000000000..27fcb550cc3 --- /dev/null +++ b/components/script/dom/webidls/GPUShaderStage.webidl @@ -0,0 +1,13 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#typedefdef-gpushaderstageflags +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUShaderStage { + const GPUShaderStageFlags VERTEX = 0x1; + const GPUShaderStageFlags FRAGMENT = 0x2; + const GPUShaderStageFlags COMPUTE = 0x4; +}; + +typedef unsigned long GPUShaderStageFlags; diff --git a/components/script/dom/webidls/GPUSwapChain.webidl b/components/script/dom/webidls/GPUSwapChain.webidl new file mode 100644 index 00000000000..aa64e232134 --- /dev/null +++ b/components/script/dom/webidls/GPUSwapChain.webidl @@ -0,0 +1,10 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpuswapchain +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUSwapChain { + GPUTexture getCurrentTexture(); +}; +GPUSwapChain includes GPUObjectBase; diff --git a/components/script/dom/webidls/GPUTexture.webidl b/components/script/dom/webidls/GPUTexture.webidl new file mode 100644 index 00000000000..9a02a98d577 --- /dev/null +++ b/components/script/dom/webidls/GPUTexture.webidl @@ -0,0 +1,122 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gputexture +[Exposed=(Window, DedicatedWorker), Serializable , Pref="dom.webgpu.enabled"] +interface GPUTexture { + GPUTextureView createView(optional GPUTextureViewDescriptor descriptor = {}); + + void destroy(); +}; +GPUTexture includes GPUObjectBase; + +dictionary GPUTextureDescriptor : GPUObjectDescriptorBase { + required GPUExtent3D size; + GPUIntegerCoordinate mipLevelCount = 1; + GPUSize32 sampleCount = 1; + GPUTextureDimension dimension = "2d"; + required GPUTextureFormat format; + required GPUTextureUsageFlags usage; +}; + +enum GPUTextureDimension { + "1d", + "2d", + "3d" +}; + +enum GPUTextureFormat { + // 8-bit formats + "r8unorm", + "r8snorm", + "r8uint", + "r8sint", + + // 16-bit formats + "r16uint", + "r16sint", + "r16float", + "rg8unorm", + "rg8snorm", + "rg8uint", + "rg8sint", + + // 32-bit formats + "r32uint", + "r32sint", + "r32float", + "rg16uint", + "rg16sint", + "rg16float", + "rgba8unorm", + "rgba8unorm-srgb", + "rgba8snorm", + "rgba8uint", + "rgba8sint", + "bgra8unorm", + "bgra8unorm-srgb", + // Packed 32-bit formats + //"rgb9e5ufloat", + "rgb10a2unorm", + //"rg11b10ufloat", + + // 64-bit formats + "rg32uint", + "rg32sint", + "rg32float", + "rgba16uint", + "rgba16sint", + "rgba16float", + + // 128-bit formats + "rgba32uint", + "rgba32sint", + "rgba32float", + + // Depth and stencil formats + //"stencil8", + //"depth16unorm", + "depth24plus", + "depth24plus-stencil8", + "depth32float", + + // BC compressed formats usable if "texture-compression-bc" is both + // supported by the device/user agent and enabled in requestDevice. + "bc1-rgba-unorm", + "bc1-rgba-unorm-srgb", + "bc2-rgba-unorm", + "bc2-rgba-unorm-srgb", + "bc3-rgba-unorm", + "bc3-rgba-unorm-srgb", + "bc4-r-unorm", + "bc4-r-snorm", + "bc5-rg-unorm", + "bc5-rg-snorm", + "bc6h-rgb-ufloat", + //"bc6h-rgb-float", + "bc7-rgba-unorm", + "bc7-rgba-unorm-srgb", + + // "depth24unorm-stencil8" extension + //"depth24unorm-stencil8", + + // "depth32float-stencil8" extension + //"depth32float-stencil8", +}; + +enum GPUTextureComponentType { + "float", + "sint", + "uint", + // Texture is used with comparison sampling only. + "depth-comparison" +}; + +dictionary GPUExtent3DDict { + required GPUIntegerCoordinate width; + required GPUIntegerCoordinate height; + required GPUIntegerCoordinate depth; +}; +typedef [EnforceRange] unsigned long GPUIntegerCoordinate; +typedef (sequence<GPUIntegerCoordinate> or GPUExtent3DDict) GPUExtent3D; diff --git a/components/script/dom/webidls/GPUTextureUsage.webidl b/components/script/dom/webidls/GPUTextureUsage.webidl new file mode 100644 index 00000000000..dbb93c37fa7 --- /dev/null +++ b/components/script/dom/webidls/GPUTextureUsage.webidl @@ -0,0 +1,15 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gputextureusage +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUTextureUsage { + const GPUTextureUsageFlags COPY_SRC = 0x01; + const GPUTextureUsageFlags COPY_DST = 0x02; + const GPUTextureUsageFlags SAMPLED = 0x04; + const GPUTextureUsageFlags STORAGE = 0x08; + const GPUTextureUsageFlags OUTPUT_ATTACHMENT = 0x10; +}; + +typedef [EnforceRange] unsigned long GPUTextureUsageFlags; diff --git a/components/script/dom/webidls/GPUTextureView.webidl b/components/script/dom/webidls/GPUTextureView.webidl new file mode 100644 index 00000000000..f6b8b7d1317 --- /dev/null +++ b/components/script/dom/webidls/GPUTextureView.webidl @@ -0,0 +1,34 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gputextureview +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUTextureView { +}; +GPUTextureView includes GPUObjectBase; + +dictionary GPUTextureViewDescriptor : GPUObjectDescriptorBase { + GPUTextureFormat format; + GPUTextureViewDimension dimension; + GPUTextureAspect aspect = "all"; + GPUIntegerCoordinate baseMipLevel = 0; + GPUIntegerCoordinate mipLevelCount; + GPUIntegerCoordinate baseArrayLayer = 0; + GPUIntegerCoordinate arrayLayerCount; +}; + +enum GPUTextureViewDimension { + "1d", + "2d", + "2d-array", + "cube", + "cube-array", + "3d" +}; + +enum GPUTextureAspect { + "all", + "stencil-only", + "depth-only" +}; diff --git a/components/script/dom/webidls/GPUUncapturedErrorEvent.webidl b/components/script/dom/webidls/GPUUncapturedErrorEvent.webidl new file mode 100644 index 00000000000..565c72ef9be --- /dev/null +++ b/components/script/dom/webidls/GPUUncapturedErrorEvent.webidl @@ -0,0 +1,22 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpuuncapturederrorevent +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUUncapturedErrorEvent : Event { + constructor( + DOMString type, + GPUUncapturedErrorEventInit gpuUncapturedErrorEventInitDict + ); + /*[SameObject]*/ readonly attribute GPUError error; +}; + +dictionary GPUUncapturedErrorEventInit : EventInit { + required GPUError error; +}; + +partial interface GPUDevice { + [Exposed=(Window, DedicatedWorker)] + attribute EventHandler onuncapturederror; +}; diff --git a/components/script/dom/webidls/GPUValidationError.webidl b/components/script/dom/webidls/GPUValidationError.webidl new file mode 100644 index 00000000000..8e5d211d981 --- /dev/null +++ b/components/script/dom/webidls/GPUValidationError.webidl @@ -0,0 +1,22 @@ +/* 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/. */ + +// https://gpuweb.github.io/gpuweb/#gpuvalidationerror +[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"] +interface GPUValidationError { + constructor(DOMString message); + readonly attribute DOMString message; +}; + +typedef (GPUOutOfMemoryError or GPUValidationError) GPUError; + +enum GPUErrorFilter { + "out-of-memory", + "validation" +}; + +partial interface GPUDevice { + void pushErrorScope(GPUErrorFilter filter); + Promise<GPUError?> popErrorScope(); +}; diff --git a/components/script/dom/webidls/GainNode.webidl b/components/script/dom/webidls/GainNode.webidl new file mode 100644 index 00000000000..1247aeda95d --- /dev/null +++ b/components/script/dom/webidls/GainNode.webidl @@ -0,0 +1,17 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#gainnode + */ + +dictionary GainOptions : AudioNodeOptions { + float gain = 1.0; +}; + +[Exposed=Window] + interface GainNode : AudioNode { + [Throws] constructor(BaseAudioContext context, optional GainOptions options = {}); + readonly attribute AudioParam gain; + }; diff --git a/components/script/dom/webidls/Gamepad.webidl b/components/script/dom/webidls/Gamepad.webidl index 0f666a495cf..925eaf2a544 100644 --- a/components/script/dom/webidls/Gamepad.webidl +++ b/components/script/dom/webidls/Gamepad.webidl @@ -1,9 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/gamepad/#gamepad-interface -[Pref="dom.gamepad.enabled"] +[Exposed=Window, Pref="dom.gamepad.enabled"] interface Gamepad { readonly attribute DOMString id; readonly attribute long index; @@ -14,13 +14,16 @@ interface Gamepad { [SameObject] readonly attribute GamepadButtonList buttons; }; -// https://w3c.github.io/gamepad/extensions.html#dom-gamepad +// https://w3c.github.io/gamepad/extensions.html#partial-gamepad-interface partial interface Gamepad { - readonly attribute DOMString hand; - readonly attribute VRPose? pose; + readonly attribute GamepadHand hand; + // readonly attribute FrozenArray<GamepadHapticActuator> hapticActuators; + readonly attribute GamepadPose? pose; }; -// https://w3c.github.io/webvr/spec/1.1/#interface-gamepad -partial interface Gamepad { - readonly attribute unsigned long displayId; +// https://w3c.github.io/gamepad/extensions.html#gamepadhand-enum +enum GamepadHand { + "", /* unknown, both hands, or not applicable */ + "left", + "right" }; diff --git a/components/script/dom/webidls/GamepadButton.webidl b/components/script/dom/webidls/GamepadButton.webidl index 2fa04c8ba3c..748d47232ac 100644 --- a/components/script/dom/webidls/GamepadButton.webidl +++ b/components/script/dom/webidls/GamepadButton.webidl @@ -1,9 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/gamepad/#gamepadbutton-interface -[Pref="dom.gamepad.enabled"] +[Exposed=Window, Pref="dom.gamepad.enabled"] interface GamepadButton { readonly attribute boolean pressed; readonly attribute boolean touched; diff --git a/components/script/dom/webidls/GamepadButtonList.webidl b/components/script/dom/webidls/GamepadButtonList.webidl index c8fb75a4350..34ea9857071 100644 --- a/components/script/dom/webidls/GamepadButtonList.webidl +++ b/components/script/dom/webidls/GamepadButtonList.webidl @@ -1,9 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/gamepad/#dom-gamepad-buttons -[Pref="dom.gamepad.enabled"] +[Exposed=Window, Pref="dom.gamepad.enabled"] interface GamepadButtonList { getter GamepadButton? item(unsigned long index); readonly attribute unsigned long length; diff --git a/components/script/dom/webidls/GamepadEvent.webidl b/components/script/dom/webidls/GamepadEvent.webidl index ea40fd4261c..0da800bafe2 100644 --- a/components/script/dom/webidls/GamepadEvent.webidl +++ b/components/script/dom/webidls/GamepadEvent.webidl @@ -1,10 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/gamepad/#gamepadevent-interface -[Pref="dom.gamepad.enabled", Constructor(DOMString type, GamepadEventInit eventInitDict)] +[Exposed=Window, Pref="dom.gamepad.enabled"] interface GamepadEvent : Event { + [Throws] constructor(DOMString type, GamepadEventInit eventInitDict); readonly attribute Gamepad gamepad; }; diff --git a/components/script/dom/webidls/GamepadList.webidl b/components/script/dom/webidls/GamepadList.webidl index 2d99e4e8f3c..926ab7ac848 100644 --- a/components/script/dom/webidls/GamepadList.webidl +++ b/components/script/dom/webidls/GamepadList.webidl @@ -1,9 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/gamepad/#navigator-interface-extension -[Pref="dom.gamepad.enabled"] +[Exposed=Window, Pref="dom.gamepad.enabled"] interface GamepadList { getter Gamepad? item(unsigned long index); readonly attribute unsigned long length; diff --git a/components/script/dom/webidls/VRPose.webidl b/components/script/dom/webidls/GamepadPose.webidl index ffbd931cfbc..5afa9f3251e 100644 --- a/components/script/dom/webidls/VRPose.webidl +++ b/components/script/dom/webidls/GamepadPose.webidl @@ -1,10 +1,13 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +// https://w3c.github.io/gamepad/extensions.html#gamepadpose-interface +[Exposed=Window, Pref="dom.gamepad.enabled"] +interface GamepadPose { + readonly attribute boolean hasOrientation; + readonly attribute boolean hasPosition; -// https://w3c.github.io/webvr/#interface-vrpose -[Pref="dom.webvr.enabled"] -interface VRPose { readonly attribute Float32Array? position; readonly attribute Float32Array? linearVelocity; readonly attribute Float32Array? linearAcceleration; diff --git a/components/script/dom/webidls/GlobalScope.webidl b/components/script/dom/webidls/GlobalScope.webidl index 7dab4f3afa7..57206d13e6a 100644 --- a/components/script/dom/webidls/GlobalScope.webidl +++ b/components/script/dom/webidls/GlobalScope.webidl @@ -1,10 +1,10 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // This interface is entirely internal to Servo, and should not be accessible to // web pages. -[Exposed=(Window,Worker), +[Exposed=(Window,Worker,Worklet,DissimilarOriginWindow), Inline] interface GlobalScope : EventTarget {}; diff --git a/components/script/dom/webidls/HTMLAnchorElement.webidl b/components/script/dom/webidls/HTMLAnchorElement.webidl index 41026e25bce..f6e48281102 100644 --- a/components/script/dom/webidls/HTMLAnchorElement.webidl +++ b/components/script/dom/webidls/HTMLAnchorElement.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://html.spec.whatwg.org/multipage/#the-a-element @@ -11,27 +11,41 @@ */ // https://html.spec.whatwg.org/multipage/#htmlanchorelement +[Exposed=Window] interface HTMLAnchorElement : HTMLElement { + [HTMLConstructor] constructor(); + + [CEReactions] attribute DOMString target; + // [CEReactions] // attribute DOMString download; + // [CEReactions] // attribute USVString ping; + [CEReactions] attribute DOMString rel; - readonly attribute DOMTokenList relList; + [SameObject, PutForwards=value] readonly attribute DOMTokenList relList; + // [CEReactions] // attribute DOMString hreflang; + // [CEReactions] // attribute DOMString type; - [Pure] + [CEReactions, Pure] attribute DOMString text; // also has obsolete members }; -HTMLAnchorElement implements HTMLHyperlinkElementUtils; +HTMLAnchorElement includes HTMLHyperlinkElementUtils; // https://html.spec.whatwg.org/multipage/#HTMLAnchorElement-partial partial interface HTMLAnchorElement { + [CEReactions] attribute DOMString coords; - // attribute DOMString charset; + // [CEReactions] + // attribute DOMString charset; + [CEReactions] attribute DOMString name; + [CEReactions] attribute DOMString rev; + [CEReactions] attribute DOMString shape; }; diff --git a/components/script/dom/webidls/HTMLAppletElement.webidl b/components/script/dom/webidls/HTMLAppletElement.webidl deleted file mode 100644 index 9cfeb4183df..00000000000 --- a/components/script/dom/webidls/HTMLAppletElement.webidl +++ /dev/null @@ -1,18 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -// https://html.spec.whatwg.org/multipage/#htmlappletelement -interface HTMLAppletElement : HTMLElement { - // attribute DOMString align; - // attribute DOMString alt; - // attribute DOMString archive; - // attribute DOMString code; - // attribute DOMString codeBase; - // attribute DOMString height; - // attribute unsigned long hspace; - attribute DOMString name; - // attribute DOMString _object; // the underscore is not part of the identifier - // attribute unsigned long vspace; - // attribute DOMString width; -}; diff --git a/components/script/dom/webidls/HTMLAreaElement.webidl b/components/script/dom/webidls/HTMLAreaElement.webidl index 14883df3613..74c281e93c5 100644 --- a/components/script/dom/webidls/HTMLAreaElement.webidl +++ b/components/script/dom/webidls/HTMLAreaElement.webidl @@ -1,22 +1,33 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlareaelement +[Exposed=Window] interface HTMLAreaElement : HTMLElement { + [HTMLConstructor] constructor(); + + // [CEReactions] // attribute DOMString alt; + // [CEReactions] // attribute DOMString coords; + // [CEReactions] // attribute DOMString shape; - // attribute DOMString target; + [CEReactions] + attribute DOMString target; + // [CEReactions] // attribute DOMString download; + // [CEReactions] // attribute USVString ping; - // attribute DOMString rel; - readonly attribute DOMTokenList relList; + [CEReactions] + attribute DOMString rel; + [SameObject, PutForwards=value] readonly attribute DOMTokenList relList; // hreflang and type are not reflected }; -//HTMLAreaElement implements HTMLHyperlinkElementUtils; +//HTMLAreaElement includes HTMLHyperlinkElementUtils; // https://html.spec.whatwg.org/multipage/#HTMLAreaElement-partial partial interface HTMLAreaElement { - // attribute boolean noHref; + // [CEReactions] + // attribute boolean noHref; }; diff --git a/components/script/dom/webidls/HTMLAudioElement.webidl b/components/script/dom/webidls/HTMLAudioElement.webidl index 09ad8a7cdb3..bad06df5cfc 100644 --- a/components/script/dom/webidls/HTMLAudioElement.webidl +++ b/components/script/dom/webidls/HTMLAudioElement.webidl @@ -1,7 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlaudioelement -//[NamedConstructor=Audio(optional DOMString src)] -interface HTMLAudioElement : HTMLMediaElement {}; +[Exposed=Window, NamedConstructor=Audio(optional DOMString src)] +interface HTMLAudioElement : HTMLMediaElement { + [HTMLConstructor] constructor(); +}; diff --git a/components/script/dom/webidls/HTMLBRElement.webidl b/components/script/dom/webidls/HTMLBRElement.webidl index ab277396bdd..367f3bd36a9 100644 --- a/components/script/dom/webidls/HTMLBRElement.webidl +++ b/components/script/dom/webidls/HTMLBRElement.webidl @@ -1,9 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlbrelement +[Exposed=Window] interface HTMLBRElement : HTMLElement { + [HTMLConstructor] constructor(); + // also has obsolete members }; diff --git a/components/script/dom/webidls/HTMLBaseElement.webidl b/components/script/dom/webidls/HTMLBaseElement.webidl index a13be544cb9..813a4cffbd1 100644 --- a/components/script/dom/webidls/HTMLBaseElement.webidl +++ b/components/script/dom/webidls/HTMLBaseElement.webidl @@ -1,9 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlbaseelement +[Exposed=Window] interface HTMLBaseElement : HTMLElement { - attribute DOMString href; -// attribute DOMString target; + [HTMLConstructor] constructor(); + + [CEReactions] + attribute DOMString href; + // [CEReactions] + // attribute DOMString target; }; diff --git a/components/script/dom/webidls/HTMLBodyElement.webidl b/components/script/dom/webidls/HTMLBodyElement.webidl index 36c6f4d64e3..a84d800ff10 100644 --- a/components/script/dom/webidls/HTMLBodyElement.webidl +++ b/components/script/dom/webidls/HTMLBodyElement.webidl @@ -1,26 +1,29 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#the-body-element +[Exposed=Window] interface HTMLBodyElement : HTMLElement { + [HTMLConstructor] constructor(); + // also has obsolete members }; -HTMLBodyElement implements WindowEventHandlers; +HTMLBodyElement includes WindowEventHandlers; // https://html.spec.whatwg.org/multipage/#HTMLBodyElement-partial partial interface HTMLBodyElement { - [TreatNullAs=EmptyString] attribute DOMString text; + [CEReactions] attribute [TreatNullAs=EmptyString] DOMString text; // https://github.com/servo/servo/issues/8715 - //[TreatNullAs=EmptyString] attribute DOMString link; + //[CEReactions, TreatNullAs=EmptyString] attribute DOMString link; // https://github.com/servo/servo/issues/8716 - //[TreatNullAs=EmptyString] attribute DOMString vLink; + //[CEReactions, TreatNullAs=EmptyString] attribute DOMString vLink; // https://github.com/servo/servo/issues/8717 - //[TreatNullAs=EmptyString] attribute DOMString aLink; + //[CEReactions, TreatNullAs=EmptyString] attribute DOMString aLink; - [TreatNullAs=EmptyString] attribute DOMString bgColor; - attribute DOMString background; + [CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor; + [CEReactions] attribute DOMString background; }; diff --git a/components/script/dom/webidls/HTMLButtonElement.webidl b/components/script/dom/webidls/HTMLButtonElement.webidl index 7f663fd305f..a221f6669cf 100644 --- a/components/script/dom/webidls/HTMLButtonElement.webidl +++ b/components/script/dom/webidls/HTMLButtonElement.webidl @@ -1,28 +1,41 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlbuttonelement +[Exposed=Window] interface HTMLButtonElement : HTMLElement { + [HTMLConstructor] constructor(); + + // [CEReactions] // attribute boolean autofocus; - attribute boolean disabled; + [CEReactions] + attribute boolean disabled; readonly attribute HTMLFormElement? form; - attribute DOMString formAction; - attribute DOMString formEnctype; - attribute DOMString formMethod; - attribute boolean formNoValidate; - attribute DOMString formTarget; - attribute DOMString name; - attribute DOMString type; - attribute DOMString value; + [CEReactions] + attribute DOMString formAction; + [CEReactions] + attribute DOMString formEnctype; + [CEReactions] + attribute DOMString formMethod; + [CEReactions] + attribute boolean formNoValidate; + [CEReactions] + attribute DOMString formTarget; + [CEReactions] + attribute DOMString name; + [CEReactions] + attribute DOMString type; + [CEReactions] + attribute DOMString value; // attribute HTMLMenuElement? menu; - //readonly attribute boolean willValidate; + readonly attribute boolean willValidate; readonly attribute ValidityState validity; - //readonly attribute DOMString validationMessage; - //boolean checkValidity(); - //boolean reportValidity(); - //void setCustomValidity(DOMString error); + readonly attribute DOMString validationMessage; + boolean checkValidity(); + boolean reportValidity(); + void setCustomValidity(DOMString error); readonly attribute NodeList labels; }; diff --git a/components/script/dom/webidls/HTMLCanvasElement.webidl b/components/script/dom/webidls/HTMLCanvasElement.webidl index fbb53016605..5c33aa3532e 100644 --- a/components/script/dom/webidls/HTMLCanvasElement.webidl +++ b/components/script/dom/webidls/HTMLCanvasElement.webidl @@ -1,23 +1,31 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlcanvaselement -typedef (CanvasRenderingContext2D or WebGLRenderingContext) RenderingContext; +typedef (CanvasRenderingContext2D + or WebGLRenderingContext + or WebGL2RenderingContext + or GPUCanvasContext) RenderingContext; +[Exposed=Window] interface HTMLCanvasElement : HTMLElement { - [Pure] - attribute unsigned long width; - [Pure] - attribute unsigned long height; + [HTMLConstructor] constructor(); - RenderingContext? getContext(DOMString contextId, any... arguments); - //boolean probablySupportsContext(DOMString contextId, any... arguments); + [CEReactions, Pure] attribute unsigned long width; + [CEReactions, Pure] attribute unsigned long height; - //void setContext(RenderingContext context); - //CanvasProxy transferControlToProxy(); + RenderingContext? getContext(DOMString contextId, optional any options = null); [Throws] - DOMString toDataURL(optional DOMString type, any... arguments); - //void toBlob(FileCallback? _callback, optional DOMString type, any... arguments); + USVString toDataURL(optional DOMString type, optional any quality); + //void toBlob(BlobCallback _callback, optional DOMString type, optional any quality); + //OffscreenCanvas transferControlToOffscreen(); }; + +partial interface HTMLCanvasElement { + [Pref="dom.canvas_capture.enabled"] + MediaStream captureStream (optional double frameRequestRate); +}; + +//callback BlobCallback = void (Blob? blob); diff --git a/components/script/dom/webidls/HTMLCollection.webidl b/components/script/dom/webidls/HTMLCollection.webidl index 79f82046652..ac0962a5d10 100644 --- a/components/script/dom/webidls/HTMLCollection.webidl +++ b/components/script/dom/webidls/HTMLCollection.webidl @@ -1,10 +1,10 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://dom.spec.whatwg.org/#interface-htmlcollection -[LegacyUnenumerableNamedProperties] +[Exposed=Window, LegacyUnenumerableNamedProperties] interface HTMLCollection { [Pure] readonly attribute unsigned long length; diff --git a/components/script/dom/webidls/HTMLDListElement.webidl b/components/script/dom/webidls/HTMLDListElement.webidl index b6275107db5..76cf662620e 100644 --- a/components/script/dom/webidls/HTMLDListElement.webidl +++ b/components/script/dom/webidls/HTMLDListElement.webidl @@ -1,13 +1,17 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmldlistelement +[Exposed=Window] interface HTMLDListElement : HTMLElement { + [HTMLConstructor] constructor(); + // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLDListElement-partial partial interface HTMLDListElement { + // [CEReactions] // attribute boolean compact; }; diff --git a/components/script/dom/webidls/HTMLDataElement.webidl b/components/script/dom/webidls/HTMLDataElement.webidl index 658f5274491..b11368f3de2 100644 --- a/components/script/dom/webidls/HTMLDataElement.webidl +++ b/components/script/dom/webidls/HTMLDataElement.webidl @@ -1,8 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmldataelement +[Exposed=Window] interface HTMLDataElement : HTMLElement { + [HTMLConstructor] constructor(); + + [CEReactions] attribute DOMString value; }; diff --git a/components/script/dom/webidls/HTMLDataListElement.webidl b/components/script/dom/webidls/HTMLDataListElement.webidl index b8673b21c77..5bd9ac9d362 100644 --- a/components/script/dom/webidls/HTMLDataListElement.webidl +++ b/components/script/dom/webidls/HTMLDataListElement.webidl @@ -1,8 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmldatalistelement +[Exposed=Window] interface HTMLDataListElement : HTMLElement { + [HTMLConstructor] constructor(); + readonly attribute HTMLCollection options; }; diff --git a/components/script/dom/webidls/HTMLDetailsElement.webidl b/components/script/dom/webidls/HTMLDetailsElement.webidl index 811465c1c02..e860186a8ce 100644 --- a/components/script/dom/webidls/HTMLDetailsElement.webidl +++ b/components/script/dom/webidls/HTMLDetailsElement.webidl @@ -1,8 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmldetailselement +[Exposed=Window] interface HTMLDetailsElement : HTMLElement { + [HTMLConstructor] constructor(); + + [CEReactions] attribute boolean open; }; diff --git a/components/script/dom/webidls/HTMLDialogElement.webidl b/components/script/dom/webidls/HTMLDialogElement.webidl index 0ac76a0465e..f83f2547a72 100644 --- a/components/script/dom/webidls/HTMLDialogElement.webidl +++ b/components/script/dom/webidls/HTMLDialogElement.webidl @@ -1,12 +1,19 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmldialogelement +[Exposed=Window] interface HTMLDialogElement : HTMLElement { + [HTMLConstructor] constructor(); + + [CEReactions] attribute boolean open; attribute DOMString returnValue; - //void show(optional (MouseEvent or Element) anchor); - //void showModal(optional (MouseEvent or Element) anchor); + // [CEReactions] + // void show(); + // [CEReactions] + // void showModal(); + [CEReactions] void close(optional DOMString returnValue); }; diff --git a/components/script/dom/webidls/HTMLDirectoryElement.webidl b/components/script/dom/webidls/HTMLDirectoryElement.webidl index 5df65cd90c2..0fc1a65949c 100644 --- a/components/script/dom/webidls/HTMLDirectoryElement.webidl +++ b/components/script/dom/webidls/HTMLDirectoryElement.webidl @@ -1,8 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmldirectoryelement +[Exposed=Window] interface HTMLDirectoryElement : HTMLElement { + [HTMLConstructor] constructor(); + + // [CEReactions] // attribute boolean compact; }; diff --git a/components/script/dom/webidls/HTMLDivElement.webidl b/components/script/dom/webidls/HTMLDivElement.webidl index 46ee67ee0e5..c38127c87eb 100644 --- a/components/script/dom/webidls/HTMLDivElement.webidl +++ b/components/script/dom/webidls/HTMLDivElement.webidl @@ -1,13 +1,17 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmldivelement +[Exposed=Window] interface HTMLDivElement : HTMLElement { + [HTMLConstructor] constructor(); + // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLDivElement-partial partial interface HTMLDivElement { + [CEReactions] attribute DOMString align; }; diff --git a/components/script/dom/webidls/HTMLElement.webidl b/components/script/dom/webidls/HTMLElement.webidl index 188c0421154..c743c0a7129 100644 --- a/components/script/dom/webidls/HTMLElement.webidl +++ b/components/script/dom/webidls/HTMLElement.webidl @@ -1,43 +1,62 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlelement +[Exposed=Window] interface HTMLElement : Element { + [HTMLConstructor] constructor(); + // metadata attributes + [CEReactions] attribute DOMString title; + [CEReactions] attribute DOMString lang; - // attribute boolean translate; - // attribute DOMString dir; + [CEReactions] + attribute boolean translate; + [CEReactions] + attribute DOMString dir; readonly attribute DOMStringMap dataset; // microdata // attribute boolean itemScope; + // attribute DOMString itemId; //readonly attribute HTMLPropertiesCollection properties; // attribute any itemValue; // acts as DOMString on setting + [Pref="dom.microdata.testing.enabled"] + sequence<DOMString>? propertyNames(); + [Pref="dom.microdata.testing.enabled"] + sequence<DOMString>? itemtypes(); // user interaction + [CEReactions] attribute boolean hidden; void click(); + // [CEReactions] // attribute long tabIndex; void focus(); void blur(); + // [CEReactions] // attribute DOMString accessKey; //readonly attribute DOMString accessKeyLabel; + // [CEReactions] // attribute boolean draggable; - //[SameObject, PutForwards=value] readonly attribute DOMTokenList dropzone; + // [SameObject, PutForwards=value] readonly attribute DOMTokenList dropzone; // attribute HTMLMenuElement? contextMenu; + // [CEReactions] // attribute boolean spellcheck; - //void forceSpellCheck(); + // void forceSpellCheck(); + + attribute [TreatNullAs=EmptyString] DOMString innerText; // command API - //readonly attribute DOMString? commandType; - //readonly attribute DOMString? commandLabel; - //readonly attribute DOMString? commandIcon; - //readonly attribute boolean? commandHidden; - //readonly attribute boolean? commandDisabled; - //readonly attribute boolean? commandChecked; + // readonly attribute DOMString? commandType; + // readonly attribute DOMString? commandLabel; + // readonly attribute DOMString? commandIcon; + // readonly attribute boolean? commandHidden; + // readonly attribute boolean? commandDisabled; + // readonly attribute boolean? commandChecked; }; // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlelement-interface @@ -50,7 +69,7 @@ partial interface HTMLElement { readonly attribute long offsetHeight; }; -HTMLElement implements GlobalEventHandlers; -HTMLElement implements DocumentAndElementEventHandlers; -HTMLElement implements ElementContentEditable; -HTMLElement implements ElementCSSInlineStyle; +HTMLElement includes GlobalEventHandlers; +HTMLElement includes DocumentAndElementEventHandlers; +HTMLElement includes ElementContentEditable; +HTMLElement includes ElementCSSInlineStyle; diff --git a/components/script/dom/webidls/HTMLEmbedElement.webidl b/components/script/dom/webidls/HTMLEmbedElement.webidl index 26fa4c3ea5a..50d8ce1a16a 100644 --- a/components/script/dom/webidls/HTMLEmbedElement.webidl +++ b/components/script/dom/webidls/HTMLEmbedElement.webidl @@ -1,12 +1,19 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlembedelement +[Exposed=Window] interface HTMLEmbedElement : HTMLElement { + [HTMLConstructor] constructor(); + + // [CEReactions] // attribute DOMString src; + // [CEReactions] // attribute DOMString type; + // [CEReactions] // attribute DOMString width; + // [CEReactions] // attribute DOMString height; //legacycaller any (any... arguments); @@ -15,6 +22,8 @@ interface HTMLEmbedElement : HTMLElement { // https://html.spec.whatwg.org/multipage/#HTMLEmbedElement-partial partial interface HTMLEmbedElement { + // [CEReactions] // attribute DOMString align; + // [CEReactions] // attribute DOMString name; }; diff --git a/components/script/dom/webidls/HTMLFieldSetElement.webidl b/components/script/dom/webidls/HTMLFieldSetElement.webidl index d041cdd612f..1257540adb3 100644 --- a/components/script/dom/webidls/HTMLFieldSetElement.webidl +++ b/components/script/dom/webidls/HTMLFieldSetElement.webidl @@ -1,21 +1,26 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlfieldsetelement +[Exposed=Window] interface HTMLFieldSetElement : HTMLElement { + [HTMLConstructor] constructor(); + + [CEReactions] attribute boolean disabled; readonly attribute HTMLFormElement? form; - // attribute DOMString name; + [CEReactions] + attribute DOMString name; //readonly attribute DOMString type; [SameObject] readonly attribute HTMLCollection elements; - //readonly attribute boolean willValidate; + readonly attribute boolean willValidate; [SameObject] readonly attribute ValidityState validity; - //readonly attribute DOMString validationMessage; - //boolean checkValidity(); - //boolean reportValidity(); - //void setCustomValidity(DOMString error); + readonly attribute DOMString validationMessage; + boolean checkValidity(); + boolean reportValidity(); + void setCustomValidity(DOMString error); }; diff --git a/components/script/dom/webidls/HTMLFontElement.webidl b/components/script/dom/webidls/HTMLFontElement.webidl index 74db3f45057..c85a3cdd3f2 100644 --- a/components/script/dom/webidls/HTMLFontElement.webidl +++ b/components/script/dom/webidls/HTMLFontElement.webidl @@ -1,10 +1,16 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlfontelement +[Exposed=Window] interface HTMLFontElement : HTMLElement { - [TreatNullAs=EmptyString] attribute DOMString color; + [HTMLConstructor] constructor(); + + [CEReactions] + attribute [TreatNullAs=EmptyString] DOMString color; + [CEReactions] attribute DOMString face; + [CEReactions] attribute DOMString size; }; diff --git a/components/script/dom/webidls/HTMLFormControlsCollection.webidl b/components/script/dom/webidls/HTMLFormControlsCollection.webidl index 61af522772f..c1b222dee23 100644 --- a/components/script/dom/webidls/HTMLFormControlsCollection.webidl +++ b/components/script/dom/webidls/HTMLFormControlsCollection.webidl @@ -1,8 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlformcontrolscollection +[Exposed=Window] interface HTMLFormControlsCollection : HTMLCollection { // inherits length and item() getter (RadioNodeList or Element)? namedItem(DOMString name); // shadows inherited namedItem() diff --git a/components/script/dom/webidls/HTMLFormElement.webidl b/components/script/dom/webidls/HTMLFormElement.webidl index fba10d25509..8bd872eba95 100644 --- a/components/script/dom/webidls/HTMLFormElement.webidl +++ b/components/script/dom/webidls/HTMLFormElement.webidl @@ -1,29 +1,51 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlformelement -//[OverrideBuiltins] +[Exposed=Window, LegacyUnenumerableNamedProperties] interface HTMLFormElement : HTMLElement { + [HTMLConstructor] constructor(); + + [CEReactions] attribute DOMString acceptCharset; + [CEReactions] attribute DOMString action; + [CEReactions] attribute DOMString autocomplete; + [CEReactions] attribute DOMString enctype; + [CEReactions] attribute DOMString encoding; + [CEReactions] attribute DOMString method; + [CEReactions] attribute DOMString name; + [CEReactions] attribute boolean noValidate; + [CEReactions] attribute DOMString target; + [CEReactions] + attribute DOMString rel; + [SameObject, PutForwards=value] readonly attribute DOMTokenList relList; [SameObject] readonly attribute HTMLFormControlsCollection elements; readonly attribute unsigned long length; getter Element? (unsigned long index); - //getter (RadioNodeList or Element) (DOMString name); + getter (RadioNodeList or Element) (DOMString name); void submit(); + [Throws] void requestSubmit(optional HTMLElement? submitter = null); + [CEReactions] void reset(); - //boolean checkValidity(); - //boolean reportValidity(); + boolean checkValidity(); + boolean reportValidity(); +}; - //void requestAutocomplete(); +// https://html.spec.whatwg.org/multipage/#selectionmode +enum SelectionMode { + "preserve", // default + "select", + "start", + "end" }; diff --git a/components/script/dom/webidls/HTMLFrameElement.webidl b/components/script/dom/webidls/HTMLFrameElement.webidl index ecac61f6860..fe6cab1a5c2 100644 --- a/components/script/dom/webidls/HTMLFrameElement.webidl +++ b/components/script/dom/webidls/HTMLFrameElement.webidl @@ -1,18 +1,29 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlframeelement +[Exposed=Window] interface HTMLFrameElement : HTMLElement { - // attribute DOMString name; - // attribute DOMString scrolling; - // attribute DOMString src; - // attribute DOMString frameBorder; - // attribute DOMString longDesc; - // attribute boolean noResize; - //readonly attribute Document? contentDocument; - //readonly attribute WindowProxy? contentWindow; + [HTMLConstructor] constructor(); - //[TreatNullAs=EmptyString] attribute DOMString marginHeight; - //[TreatNullAs=EmptyString] attribute DOMString marginWidth; + // [CEReactions] + // attribute DOMString name; + // [CEReactions] + // attribute DOMString scrolling; + // [CEReactions] + // attribute DOMString src; + // [CEReactions] + // attribute DOMString frameBorder; + // [CEReactions] + // attribute DOMString longDesc; + // [CEReactions] + // attribute boolean noResize; + // readonly attribute Document? contentDocument; + // readonly attribute WindowProxy? contentWindow; + + // [CEReactions, TreatNullAs=EmptyString] + // attribute DOMString marginHeight; + // [CEReactions, TreatNullAs=EmptyString] + // attribute DOMString marginWidth; }; diff --git a/components/script/dom/webidls/HTMLFrameSetElement.webidl b/components/script/dom/webidls/HTMLFrameSetElement.webidl index 5addd41d253..24aa80dca28 100644 --- a/components/script/dom/webidls/HTMLFrameSetElement.webidl +++ b/components/script/dom/webidls/HTMLFrameSetElement.webidl @@ -1,11 +1,16 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlframesetelement +[Exposed=Window] interface HTMLFrameSetElement : HTMLElement { + [HTMLConstructor] constructor(); + + // [CEReactions] // attribute DOMString cols; + // [CEReactions] // attribute DOMString rows; }; -HTMLFrameSetElement implements WindowEventHandlers; +HTMLFrameSetElement includes WindowEventHandlers; diff --git a/components/script/dom/webidls/HTMLHRElement.webidl b/components/script/dom/webidls/HTMLHRElement.webidl index 56e2f6ae19b..8963d5e8901 100644 --- a/components/script/dom/webidls/HTMLHRElement.webidl +++ b/components/script/dom/webidls/HTMLHRElement.webidl @@ -1,17 +1,25 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlhrelement +[Exposed=Window] interface HTMLHRElement : HTMLElement { + [HTMLConstructor] constructor(); + // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLHRElement-partial partial interface HTMLHRElement { + [CEReactions] attribute DOMString align; + [CEReactions] attribute DOMString color; - // attribute boolean noShade; - // attribute DOMString size; + // [CEReactions] + // attribute boolean noShade; + // [CEReactions] + // attribute DOMString size; + [CEReactions] attribute DOMString width; }; diff --git a/components/script/dom/webidls/HTMLHeadElement.webidl b/components/script/dom/webidls/HTMLHeadElement.webidl index 18e2b351d64..72fd1f7eb6d 100644 --- a/components/script/dom/webidls/HTMLHeadElement.webidl +++ b/components/script/dom/webidls/HTMLHeadElement.webidl @@ -1,6 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlheadelement -interface HTMLHeadElement : HTMLElement {}; +[Exposed=Window] +interface HTMLHeadElement : HTMLElement { + [HTMLConstructor] constructor(); +}; diff --git a/components/script/dom/webidls/HTMLHeadingElement.webidl b/components/script/dom/webidls/HTMLHeadingElement.webidl index 2c47d6fa10f..b2e6be1ca8f 100644 --- a/components/script/dom/webidls/HTMLHeadingElement.webidl +++ b/components/script/dom/webidls/HTMLHeadingElement.webidl @@ -1,13 +1,17 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlheadingelement +[Exposed=Window] interface HTMLHeadingElement : HTMLElement { + [HTMLConstructor] constructor(); + // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLHeadingElement-partial partial interface HTMLHeadingElement { + // [CEReactions] // attribute DOMString align; }; diff --git a/components/script/dom/webidls/HTMLHtmlElement.webidl b/components/script/dom/webidls/HTMLHtmlElement.webidl index ed409b1b84c..6b25a41ca8d 100644 --- a/components/script/dom/webidls/HTMLHtmlElement.webidl +++ b/components/script/dom/webidls/HTMLHtmlElement.webidl @@ -1,13 +1,17 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlhtmlelement +[Exposed=Window] interface HTMLHtmlElement : HTMLElement { + [HTMLConstructor] constructor(); + // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLHtmlElement-partial partial interface HTMLHtmlElement { + // [CEReactions] // attribute DOMString version; }; diff --git a/components/script/dom/webidls/HTMLHyperlinkElementUtils.webidl b/components/script/dom/webidls/HTMLHyperlinkElementUtils.webidl index a75ecb970a0..2f0f0ae68c0 100644 --- a/components/script/dom/webidls/HTMLHyperlinkElementUtils.webidl +++ b/components/script/dom/webidls/HTMLHyperlinkElementUtils.webidl @@ -1,25 +1,28 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlhyperlinkelementutils -[NoInterfaceObject] -interface HTMLHyperlinkElementUtils { -// stringifier attribute USVString href; - attribute USVString href; - readonly attribute USVString origin; - attribute USVString protocol; - attribute USVString username; - attribute USVString password; - attribute USVString host; - attribute USVString hostname; - attribute USVString port; - attribute USVString pathname; - attribute USVString search; - attribute USVString hash; - - // Adding a separate stringifier method until - // https://github.com/servo/servo/issues/7590 adds attribute stringifier - // support. - stringifier; +interface mixin HTMLHyperlinkElementUtils { + [CEReactions] + stringifier attribute USVString href; + readonly attribute USVString origin; + [CEReactions] + attribute USVString protocol; + [CEReactions] + attribute USVString username; + [CEReactions] + attribute USVString password; + [CEReactions] + attribute USVString host; + [CEReactions] + attribute USVString hostname; + [CEReactions] + attribute USVString port; + [CEReactions] + attribute USVString pathname; + [CEReactions] + attribute USVString search; + [CEReactions] + attribute USVString hash; }; diff --git a/components/script/dom/webidls/HTMLIFrameElement.webidl b/components/script/dom/webidls/HTMLIFrameElement.webidl index f02c7c35a1b..b9dd97bdea6 100644 --- a/components/script/dom/webidls/HTMLIFrameElement.webidl +++ b/components/script/dom/webidls/HTMLIFrameElement.webidl @@ -1,20 +1,29 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmliframeelement +[Exposed=Window] interface HTMLIFrameElement : HTMLElement { - attribute DOMString src; - // attribute DOMString srcdoc; + [HTMLConstructor] constructor(); - // https://github.com/servo/servo/issues/14453 - // attribute DOMString name; + [CEReactions] + attribute USVString src; + [CEReactions] + attribute DOMString srcdoc; - [SameObject, PutForwards=value] + [CEReactions] + attribute DOMString name; + + [SameObject, PutForwards=value] readonly attribute DOMTokenList sandbox; + // [CEReactions] // attribute boolean seamless; + [CEReactions] attribute boolean allowFullscreen; + [CEReactions] attribute DOMString width; + [CEReactions] attribute DOMString height; readonly attribute Document? contentDocument; readonly attribute WindowProxy? contentWindow; @@ -24,21 +33,17 @@ interface HTMLIFrameElement : HTMLElement { // https://html.spec.whatwg.org/multipage/#HTMLIFrameElement-partial partial interface HTMLIFrameElement { + // [CEReactions] // attribute DOMString align; + // [CEReactions] // attribute DOMString scrolling; + [CEReactions] attribute DOMString frameBorder; + // [CEReactions] // attribute DOMString longDesc; - //[TreatNullAs=EmptyString] attribute DOMString marginHeight; - //[TreatNullAs=EmptyString] attribute DOMString marginWidth; -}; - -partial interface HTMLIFrameElement { - [Func="::dom::window::Window::global_is_mozbrowser"] - attribute boolean mozbrowser; - - [Func="::dom::window::Window::global_is_mozbrowser"] - attribute boolean mozprivatebrowsing; + // [CEReactions, TreatNullAs=EmptyString] + // attribute DOMString marginHeight; + // [CEReactions, TreatNullAs=EmptyString] + // attribute DOMString marginWidth; }; - -HTMLIFrameElement implements BrowserElement; diff --git a/components/script/dom/webidls/HTMLImageElement.webidl b/components/script/dom/webidls/HTMLImageElement.webidl index 7bd69124d87..81f6b4674f1 100644 --- a/components/script/dom/webidls/HTMLImageElement.webidl +++ b/components/script/dom/webidls/HTMLImageElement.webidl @@ -1,35 +1,54 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlimageelement -[NamedConstructor=Image(optional unsigned long width, optional unsigned long height)] +[Exposed=Window, NamedConstructor=Image(optional unsigned long width, optional unsigned long height)] interface HTMLImageElement : HTMLElement { + [HTMLConstructor] constructor(); + + [CEReactions] attribute DOMString alt; - attribute DOMString src; - // attribute DOMString srcset; + [CEReactions] + attribute USVString src; + [CEReactions] + attribute USVString srcset; + [CEReactions] attribute DOMString? crossOrigin; + [CEReactions] attribute DOMString useMap; + [CEReactions] attribute boolean isMap; + [CEReactions] attribute unsigned long width; + [CEReactions] attribute unsigned long height; readonly attribute unsigned long naturalWidth; readonly attribute unsigned long naturalHeight; readonly attribute boolean complete; - readonly attribute DOMString currentSrc; + readonly attribute USVString currentSrc; + [CEReactions] + attribute DOMString referrerPolicy; // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLImageElement-partial partial interface HTMLImageElement { + [CEReactions] attribute DOMString name; - // attribute DOMString lowsrc; + // [CEReactions] + // attribute DOMString lowsrc; + [CEReactions] attribute DOMString align; + [CEReactions] attribute unsigned long hspace; + [CEReactions] attribute unsigned long vspace; + [CEReactions] attribute DOMString longDesc; - [TreatNullAs=EmptyString] attribute DOMString border; + [CEReactions] + attribute [TreatNullAs=EmptyString] DOMString border; }; // https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlimageelement-interface diff --git a/components/script/dom/webidls/HTMLInputElement.webidl b/components/script/dom/webidls/HTMLInputElement.webidl index 5c644894bbf..6b8c557e83d 100644 --- a/components/script/dom/webidls/HTMLInputElement.webidl +++ b/components/script/dom/webidls/HTMLInputElement.webidl @@ -1,81 +1,116 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlinputelement +[Exposed=Window] interface HTMLInputElement : HTMLElement { + [HTMLConstructor] constructor(); + + [CEReactions] attribute DOMString accept; + [CEReactions] attribute DOMString alt; + // [CEReactions] // attribute DOMString autocomplete; + // [CEReactions] // attribute boolean autofocus; + [CEReactions] attribute boolean defaultChecked; attribute boolean checked; + [CEReactions] attribute DOMString dirName; + [CEReactions] attribute boolean disabled; readonly attribute HTMLFormElement? form; readonly attribute FileList? files; - attribute DOMString formAction; - attribute DOMString formEnctype; - attribute DOMString formMethod; - attribute boolean formNoValidate; - attribute DOMString formTarget; - // attribute unsigned long height; - attribute boolean indeterminate; - // attribute DOMString inputMode; - //readonly attribute HTMLElement? list; + [CEReactions] + attribute DOMString formAction; + [CEReactions] + attribute DOMString formEnctype; + [CEReactions] + attribute DOMString formMethod; + [CEReactions] + attribute boolean formNoValidate; + [CEReactions] + attribute DOMString formTarget; + // [CEReactions] + // attribute unsigned long height; + attribute boolean indeterminate; + // [CEReactions] + // attribute DOMString inputMode; + readonly attribute HTMLElement? list; + [CEReactions] attribute DOMString max; - [SetterThrows] - attribute long maxLength; + [CEReactions, SetterThrows] + attribute long maxLength; + [CEReactions] attribute DOMString min; - [SetterThrows] - attribute long minLength; + [CEReactions, SetterThrows] + attribute long minLength; + [CEReactions] attribute boolean multiple; + [CEReactions] attribute DOMString name; + [CEReactions] attribute DOMString pattern; + [CEReactions] attribute DOMString placeholder; + [CEReactions] attribute boolean readOnly; + [CEReactions] attribute boolean required; - [SetterThrows] - attribute unsigned long size; - attribute DOMString src; + [CEReactions, SetterThrows] + attribute unsigned long size; + [CEReactions] + attribute USVString src; + [CEReactions] attribute DOMString step; + [CEReactions] attribute DOMString type; + [CEReactions] attribute DOMString defaultValue; -[TreatNullAs=EmptyString, SetterThrows] - attribute DOMString value; - // attribute Date? valueAsDate; - // attribute unrestricted double valueAsNumber; - // attribute double valueLow; - // attribute double valueHigh; - // attribute unsigned long width; + [CEReactions, SetterThrows] + attribute [TreatNullAs=EmptyString] DOMString value; + [SetterThrows] + attribute object? valueAsDate; + [SetterThrows] + attribute unrestricted double valueAsNumber; + // [CEReactions] + // attribute unsigned long width; - //void stepUp(optional long n = 1); - //void stepDown(optional long n = 1); + [Throws] void stepUp(optional long n = 1); + [Throws] void stepDown(optional long n = 1); - //readonly attribute boolean willValidate; - //readonly attribute ValidityState validity; - //readonly attribute DOMString validationMessage; - //boolean checkValidity(); - //boolean reportValidity(); - //void setCustomValidity(DOMString error); + readonly attribute boolean willValidate; + readonly attribute ValidityState validity; + readonly attribute DOMString validationMessage; + boolean checkValidity(); + boolean reportValidity(); + void setCustomValidity(DOMString error); - readonly attribute NodeList labels; + readonly attribute NodeList? labels; - //void select(); - attribute unsigned long selectionStart; - attribute unsigned long selectionEnd; - attribute DOMString selectionDirection; - //void setRangeText(DOMString replacement); - //void setRangeText(DOMString replacement, unsigned long start, unsigned long end, - // optional SelectionMode selectionMode = "preserve"); - void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction); + void select(); + [SetterThrows] + attribute unsigned long? selectionStart; + [SetterThrows] + attribute unsigned long? selectionEnd; + [SetterThrows] + attribute DOMString? selectionDirection; + [Throws] + void setRangeText(DOMString replacement); + [Throws] + void setRangeText(DOMString replacement, unsigned long start, unsigned long end, + optional SelectionMode selectionMode = "preserve"); + [Throws] + void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction); // also has obsolete members // Select with file-system paths for testing purpose [Pref="dom.testing.htmlinputelement.select_files.enabled"] void selectFiles(sequence<DOMString> path); - }; // https://html.spec.whatwg.org/multipage/#HTMLInputElement-partial diff --git a/components/script/dom/webidls/HTMLLIElement.webidl b/components/script/dom/webidls/HTMLLIElement.webidl index ea7d574eba4..e5c7e68c874 100644 --- a/components/script/dom/webidls/HTMLLIElement.webidl +++ b/components/script/dom/webidls/HTMLLIElement.webidl @@ -1,9 +1,13 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmllielement +[Exposed=Window] interface HTMLLIElement : HTMLElement { + [HTMLConstructor] constructor(); + + [CEReactions] attribute long value; // also has obsolete members @@ -11,5 +15,6 @@ interface HTMLLIElement : HTMLElement { // https://html.spec.whatwg.org/multipage/#HTMLLIElement-partial partial interface HTMLLIElement { + // [CEReactions] // attribute DOMString type; }; diff --git a/components/script/dom/webidls/HTMLLabelElement.webidl b/components/script/dom/webidls/HTMLLabelElement.webidl index 8acb1f312c8..228e45fc7c4 100644 --- a/components/script/dom/webidls/HTMLLabelElement.webidl +++ b/components/script/dom/webidls/HTMLLabelElement.webidl @@ -1,10 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmllabelelement +[Exposed=Window] interface HTMLLabelElement : HTMLElement { + [HTMLConstructor] constructor(); + readonly attribute HTMLFormElement? form; + [CEReactions] attribute DOMString htmlFor; readonly attribute HTMLElement? control; }; diff --git a/components/script/dom/webidls/HTMLLegendElement.webidl b/components/script/dom/webidls/HTMLLegendElement.webidl index c137d6db66a..1ef2a8fd701 100644 --- a/components/script/dom/webidls/HTMLLegendElement.webidl +++ b/components/script/dom/webidls/HTMLLegendElement.webidl @@ -1,9 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmllegendelement +[Exposed=Window] interface HTMLLegendElement : HTMLElement { + [HTMLConstructor] constructor(); + readonly attribute HTMLFormElement? form; // also has obsolete members @@ -11,5 +14,6 @@ interface HTMLLegendElement : HTMLElement { // https://html.spec.whatwg.org/multipage/#HTMLLegendElement-partial partial interface HTMLLegendElement { + // [CEReactions] // attribute DOMString align; }; diff --git a/components/script/dom/webidls/HTMLLinkElement.webidl b/components/script/dom/webidls/HTMLLinkElement.webidl index bfab6270092..31590a8dc04 100644 --- a/components/script/dom/webidls/HTMLLinkElement.webidl +++ b/components/script/dom/webidls/HTMLLinkElement.webidl @@ -1,26 +1,40 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmllinkelement +[Exposed=Window] interface HTMLLinkElement : HTMLElement { - attribute DOMString href; + [HTMLConstructor] constructor(); + + [CEReactions] + attribute USVString href; + [CEReactions] attribute DOMString? crossOrigin; + [CEReactions] attribute DOMString rel; - readonly attribute DOMTokenList relList; + [SameObject, PutForwards=value] readonly attribute DOMTokenList relList; + [CEReactions] attribute DOMString media; + [CEReactions] attribute DOMString hreflang; + [CEReactions] attribute DOMString type; + [CEReactions] attribute DOMString integrity; - // [SameObject, PutForwards=value] readonly attribute DOMTokenList sizes; + [CEReactions] + attribute DOMString referrerPolicy; // also has obsolete members }; -HTMLLinkElement implements LinkStyle; +HTMLLinkElement includes LinkStyle; // https://html.spec.whatwg.org/multipage/#HTMLLinkElement-partial partial interface HTMLLinkElement { + [CEReactions] attribute DOMString charset; + [CEReactions] attribute DOMString rev; + [CEReactions] attribute DOMString target; }; diff --git a/components/script/dom/webidls/HTMLMapElement.webidl b/components/script/dom/webidls/HTMLMapElement.webidl index 5e21b52916e..44c397948fd 100644 --- a/components/script/dom/webidls/HTMLMapElement.webidl +++ b/components/script/dom/webidls/HTMLMapElement.webidl @@ -1,10 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlmapelement +[Exposed=Window] interface HTMLMapElement : HTMLElement { - // attribute DOMString name; - //readonly attribute HTMLCollection areas; - //readonly attribute HTMLCollection images; + [HTMLConstructor] constructor(); + + // [CEReactions] + // attribute DOMString name; + // readonly attribute HTMLCollection areas; + // readonly attribute HTMLCollection images; }; diff --git a/components/script/dom/webidls/HTMLMediaElement.webidl b/components/script/dom/webidls/HTMLMediaElement.webidl index ce952c9b539..fd658913ca5 100644 --- a/components/script/dom/webidls/HTMLMediaElement.webidl +++ b/components/script/dom/webidls/HTMLMediaElement.webidl @@ -1,67 +1,66 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlmediaelement + enum CanPlayTypeResult { "" /* empty string */, "maybe", "probably" }; -[Abstract] -interface HTMLMediaElement : HTMLElement { +typedef (MediaStream /*or MediaSource */ or Blob) MediaProvider; +[Exposed=Window, Abstract] +interface HTMLMediaElement : HTMLElement { // error state - readonly attribute MediaError? error; + readonly attribute MediaError? error; // network state - attribute DOMString src; - readonly attribute DOMString currentSrc; - // attribute DOMString crossOrigin; - const unsigned short NETWORK_EMPTY = 0; - const unsigned short NETWORK_IDLE = 1; - const unsigned short NETWORK_LOADING = 2; - const unsigned short NETWORK_NO_SOURCE = 3; - readonly attribute unsigned short networkState; - attribute DOMString preload; - //readonly attribute TimeRanges buffered; - void load(); - CanPlayTypeResult canPlayType(DOMString type); + [CEReactions] attribute USVString src; + attribute MediaProvider? srcObject; + readonly attribute USVString currentSrc; + [CEReactions] attribute DOMString? crossOrigin; + const unsigned short NETWORK_EMPTY = 0; + const unsigned short NETWORK_IDLE = 1; + const unsigned short NETWORK_LOADING = 2; + const unsigned short NETWORK_NO_SOURCE = 3; + readonly attribute unsigned short networkState; + [CEReactions] attribute DOMString preload; + readonly attribute TimeRanges buffered; + void load(); + CanPlayTypeResult canPlayType(DOMString type); // ready state - const unsigned short HAVE_NOTHING = 0; - const unsigned short HAVE_METADATA = 1; - const unsigned short HAVE_CURRENT_DATA = 2; - const unsigned short HAVE_FUTURE_DATA = 3; - const unsigned short HAVE_ENOUGH_DATA = 4; - readonly attribute unsigned short readyState; - //readonly attribute boolean seeking; + const unsigned short HAVE_NOTHING = 0; + const unsigned short HAVE_METADATA = 1; + const unsigned short HAVE_CURRENT_DATA = 2; + const unsigned short HAVE_FUTURE_DATA = 3; + const unsigned short HAVE_ENOUGH_DATA = 4; + readonly attribute unsigned short readyState; + readonly attribute boolean seeking; // playback state - // attribute double currentTime; - //void fastSeek(double time); - //readonly attribute unrestricted double duration; - //Date getStartDate(); - readonly attribute boolean paused; - // attribute double defaultPlaybackRate; - // attribute double playbackRate; - //readonly attribute TimeRanges played; - //readonly attribute TimeRanges seekable; - //readonly attribute boolean ended; - attribute boolean autoplay; - // attribute boolean loop; - void play(); - void pause(); - - // media controller - // attribute DOMString mediaGroup; - // attribute MediaController? controller; + attribute double currentTime; + void fastSeek(double time); + readonly attribute unrestricted double duration; + // Date getStartDate(); + readonly attribute boolean paused; + [Throws] attribute double defaultPlaybackRate; + [Throws] attribute double playbackRate; + readonly attribute TimeRanges played; + // readonly attribute TimeRanges seekable; + readonly attribute boolean ended; + [CEReactions] attribute boolean autoplay; + [CEReactions] attribute boolean loop; + Promise<void> play(); + void pause(); // controls - // attribute boolean controls; - // attribute double volume; - // attribute boolean muted; - // attribute boolean defaultMuted; + [CEReactions] attribute boolean controls; + [Throws] attribute double volume; + attribute boolean muted; + [CEReactions] attribute boolean defaultMuted; // tracks - //readonly attribute AudioTrackList audioTracks; - //readonly attribute VideoTrackList videoTracks; - //readonly attribute TextTrackList textTracks; - //TextTrack addTextTrack(TextTrackKind kind, optional DOMString label = "", optional DOMString language = ""); + readonly attribute AudioTrackList audioTracks; + readonly attribute VideoTrackList videoTracks; + readonly attribute TextTrackList textTracks; + TextTrack addTextTrack(TextTrackKind kind, optional DOMString label = "", optional DOMString language = ""); }; diff --git a/components/script/dom/webidls/HTMLMenuElement.webidl b/components/script/dom/webidls/HTMLMenuElement.webidl new file mode 100644 index 00000000000..be638bd4d88 --- /dev/null +++ b/components/script/dom/webidls/HTMLMenuElement.webidl @@ -0,0 +1,17 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#htmlmenuelement +[Exposed=Window] +interface HTMLMenuElement : HTMLElement { + [HTMLConstructor] constructor(); + + // also has obsolete members +}; + +// https://html.spec.whatwg.org/multipage/#HTMLMenuElement-partial +partial interface HTMLMenuElement { + [CEReactions] + attribute boolean compact; +}; diff --git a/components/script/dom/webidls/HTMLMetaElement.webidl b/components/script/dom/webidls/HTMLMetaElement.webidl index 20afc297a20..c8d4faeba5f 100644 --- a/components/script/dom/webidls/HTMLMetaElement.webidl +++ b/components/script/dom/webidls/HTMLMetaElement.webidl @@ -1,11 +1,17 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlmetaelement +[Exposed=Window] interface HTMLMetaElement : HTMLElement { + [HTMLConstructor] constructor(); + + [CEReactions] attribute DOMString name; + // [CEReactions] // attribute DOMString httpEquiv; + [CEReactions] attribute DOMString content; // also has obsolete members @@ -13,5 +19,6 @@ interface HTMLMetaElement : HTMLElement { // https://html.spec.whatwg.org/multipage/#HTMLMetaElement-partial partial interface HTMLMetaElement { + // [CEReactions] // attribute DOMString scheme; }; diff --git a/components/script/dom/webidls/HTMLMeterElement.webidl b/components/script/dom/webidls/HTMLMeterElement.webidl index c6abe4aef46..4021d2ec185 100644 --- a/components/script/dom/webidls/HTMLMeterElement.webidl +++ b/components/script/dom/webidls/HTMLMeterElement.webidl @@ -1,14 +1,23 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlmeterelement +[Exposed=Window] interface HTMLMeterElement : HTMLElement { + [HTMLConstructor] constructor(); + + // [CEReactions] // attribute double value; + // [CEReactions] // attribute double min; + // [CEReactions] // attribute double max; + // [CEReactions] // attribute double low; + // [CEReactions] // attribute double high; + // [CEReactions] // attribute double optimum; readonly attribute NodeList labels; }; diff --git a/components/script/dom/webidls/HTMLModElement.webidl b/components/script/dom/webidls/HTMLModElement.webidl index beda6f97dcc..6d26249c447 100644 --- a/components/script/dom/webidls/HTMLModElement.webidl +++ b/components/script/dom/webidls/HTMLModElement.webidl @@ -1,9 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlmodelement +[Exposed=Window] interface HTMLModElement : HTMLElement { + [HTMLConstructor] constructor(); + + // [CEReactions] // attribute DOMString cite; + // [CEReactions] // attribute DOMString dateTime; }; diff --git a/components/script/dom/webidls/HTMLOListElement.webidl b/components/script/dom/webidls/HTMLOListElement.webidl index 02dc3d1146f..3739d6d98af 100644 --- a/components/script/dom/webidls/HTMLOListElement.webidl +++ b/components/script/dom/webidls/HTMLOListElement.webidl @@ -1,11 +1,17 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlolistelement +[Exposed=Window] interface HTMLOListElement : HTMLElement { + [HTMLConstructor] constructor(); + + // [CEReactions] // attribute boolean reversed; + // [CEReactions] // attribute long start; + // [CEReactions] // attribute DOMString type; // also has obsolete members @@ -13,5 +19,6 @@ interface HTMLOListElement : HTMLElement { // https://html.spec.whatwg.org/multipage/#HTMLOListElement-partial partial interface HTMLOListElement { + // [CEReactions] // attribute boolean compact; }; diff --git a/components/script/dom/webidls/HTMLObjectElement.webidl b/components/script/dom/webidls/HTMLObjectElement.webidl index ce1d0ff1f8c..9d60c4a4f92 100644 --- a/components/script/dom/webidls/HTMLObjectElement.webidl +++ b/components/script/dom/webidls/HTMLObjectElement.webidl @@ -1,26 +1,36 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlobjectelement +[Exposed=Window] interface HTMLObjectElement : HTMLElement { + [HTMLConstructor] constructor(); + + // [CEReactions] // attribute DOMString data; + [CEReactions] attribute DOMString type; + // [CEReactions] // attribute boolean typeMustMatch; + // [CEReactions] // attribute DOMString name; + // [CEReactions] // attribute DOMString useMap; readonly attribute HTMLFormElement? form; + // [CEReactions] // attribute DOMString width; + // [CEReactions] // attribute DOMString height; //readonly attribute Document? contentDocument; //readonly attribute WindowProxy? contentWindow; - //readonly attribute boolean willValidate; + readonly attribute boolean willValidate; readonly attribute ValidityState validity; - //readonly attribute DOMString validationMessage; - //boolean checkValidity(); - //boolean reportValidity(); - //void setCustomValidity(DOMString error); + readonly attribute DOMString validationMessage; + boolean checkValidity(); + boolean reportValidity(); + void setCustomValidity(DOMString error); //legacycaller any (any... arguments); diff --git a/components/script/dom/webidls/HTMLOptGroupElement.webidl b/components/script/dom/webidls/HTMLOptGroupElement.webidl index a81df036a4d..afa11148cd5 100644 --- a/components/script/dom/webidls/HTMLOptGroupElement.webidl +++ b/components/script/dom/webidls/HTMLOptGroupElement.webidl @@ -1,9 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmloptgroupelement +[Exposed=Window] interface HTMLOptGroupElement : HTMLElement { + [HTMLConstructor] constructor(); + + [CEReactions] attribute boolean disabled; - // attribute DOMString label; + // [CEReactions] + // attribute DOMString label; }; diff --git a/components/script/dom/webidls/HTMLOptionElement.webidl b/components/script/dom/webidls/HTMLOptionElement.webidl index 713ff85a483..c995070d0e7 100644 --- a/components/script/dom/webidls/HTMLOptionElement.webidl +++ b/components/script/dom/webidls/HTMLOptionElement.webidl @@ -1,19 +1,26 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmloptionelement -//[NamedConstructor=Option(optional DOMString text = "", optional DOMString value, -// optional boolean defaultSelected = false, -// optional boolean selected = false)] +[Exposed=Window, NamedConstructor=Option(optional DOMString text = "", optional DOMString value, + optional boolean defaultSelected = false, + optional boolean selected = false)] interface HTMLOptionElement : HTMLElement { - attribute boolean disabled; - readonly attribute HTMLFormElement? form; - attribute DOMString label; - attribute boolean defaultSelected; - attribute boolean selected; - attribute DOMString value; + [HTMLConstructor] constructor(); - attribute DOMString text; - //readonly attribute long index; + [CEReactions] + attribute boolean disabled; + readonly attribute HTMLFormElement? form; + [CEReactions] + attribute DOMString label; + [CEReactions] + attribute boolean defaultSelected; + attribute boolean selected; + [CEReactions] + attribute DOMString value; + + [CEReactions] + attribute DOMString text; + readonly attribute long index; }; diff --git a/components/script/dom/webidls/HTMLOptionsCollection.webidl b/components/script/dom/webidls/HTMLOptionsCollection.webidl index 73b11779159..91906b785fb 100644 --- a/components/script/dom/webidls/HTMLOptionsCollection.webidl +++ b/components/script/dom/webidls/HTMLOptionsCollection.webidl @@ -1,18 +1,18 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmloptionscollection +[Exposed=Window] interface HTMLOptionsCollection : HTMLCollection { // inherits item(), namedItem() + [CEReactions] attribute unsigned long length; // shadows inherited length - //[CEReactions] - [Throws] + [CEReactions, Throws] setter void (unsigned long index, HTMLOptionElement? option); - //[CEReactions] - [Throws] + [CEReactions, Throws] void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null); - //[CEReactions] + [CEReactions] void remove(long index); attribute long selectedIndex; }; diff --git a/components/script/dom/webidls/HTMLOutputElement.webidl b/components/script/dom/webidls/HTMLOutputElement.webidl index f0baeb8fa03..c44f2a7f44c 100644 --- a/components/script/dom/webidls/HTMLOutputElement.webidl +++ b/components/script/dom/webidls/HTMLOutputElement.webidl @@ -1,23 +1,29 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmloutputelement +[Exposed=Window] interface HTMLOutputElement : HTMLElement { + [HTMLConstructor] constructor(); + // [SameObject, PutForwards=value] readonly attribute DOMTokenList htmlFor; readonly attribute HTMLFormElement? form; - // attribute DOMString name; + [CEReactions] + attribute DOMString name; - //readonly attribute DOMString type; - // attribute DOMString defaultValue; - // attribute DOMString value; + [Pure] readonly attribute DOMString type; + [CEReactions] + attribute DOMString defaultValue; + [CEReactions] + attribute DOMString value; - //readonly attribute boolean willValidate; + readonly attribute boolean willValidate; readonly attribute ValidityState validity; - //readonly attribute DOMString validationMessage; - //boolean checkValidity(); - //boolean reportValidity(); - //void setCustomValidity(DOMString error); + readonly attribute DOMString validationMessage; + boolean checkValidity(); + boolean reportValidity(); + void setCustomValidity(DOMString error); readonly attribute NodeList labels; }; diff --git a/components/script/dom/webidls/HTMLParagraphElement.webidl b/components/script/dom/webidls/HTMLParagraphElement.webidl index a96c6dc6f81..d42533b9ef9 100644 --- a/components/script/dom/webidls/HTMLParagraphElement.webidl +++ b/components/script/dom/webidls/HTMLParagraphElement.webidl @@ -1,13 +1,17 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlparagraphelement +[Exposed=Window] interface HTMLParagraphElement : HTMLElement { + [HTMLConstructor] constructor(); + // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLParagraphElement-partial partial interface HTMLParagraphElement { + // [CEReactions] // attribute DOMString align; }; diff --git a/components/script/dom/webidls/HTMLParamElement.webidl b/components/script/dom/webidls/HTMLParamElement.webidl index 9648c9f87ce..4539b3b8474 100644 --- a/components/script/dom/webidls/HTMLParamElement.webidl +++ b/components/script/dom/webidls/HTMLParamElement.webidl @@ -1,10 +1,15 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlparamelement +[Exposed=Window] interface HTMLParamElement : HTMLElement { + [HTMLConstructor] constructor(); + + // [CEReactions] // attribute DOMString name; + // [CEReactions] // attribute DOMString value; // also has obsolete members @@ -12,6 +17,8 @@ interface HTMLParamElement : HTMLElement { // https://html.spec.whatwg.org/multipage/#HTMLParamElement-partial partial interface HTMLParamElement { + // [CEReactions] // attribute DOMString type; + // [CEReactions] // attribute DOMString valueType; }; diff --git a/components/script/dom/webidls/HTMLPictureElement.webidl b/components/script/dom/webidls/HTMLPictureElement.webidl new file mode 100644 index 00000000000..d03377ee541 --- /dev/null +++ b/components/script/dom/webidls/HTMLPictureElement.webidl @@ -0,0 +1,9 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#htmlpictureelement +[Exposed=Window] +interface HTMLPictureElement : HTMLElement { + [HTMLConstructor] constructor(); +}; diff --git a/components/script/dom/webidls/HTMLPreElement.webidl b/components/script/dom/webidls/HTMLPreElement.webidl index ea0df151020..ecbebb71e38 100644 --- a/components/script/dom/webidls/HTMLPreElement.webidl +++ b/components/script/dom/webidls/HTMLPreElement.webidl @@ -1,13 +1,17 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlpreelement +[Exposed=Window] interface HTMLPreElement : HTMLElement { + [HTMLConstructor] constructor(); + // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLPreElement-partial partial interface HTMLPreElement { + // [CEReactions] // attribute long width; }; diff --git a/components/script/dom/webidls/HTMLProgressElement.webidl b/components/script/dom/webidls/HTMLProgressElement.webidl index cf69566ecdd..c901e379659 100644 --- a/components/script/dom/webidls/HTMLProgressElement.webidl +++ b/components/script/dom/webidls/HTMLProgressElement.webidl @@ -1,11 +1,16 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlprogresselement +[Exposed=Window] interface HTMLProgressElement : HTMLElement { - // attribute double value; - // attribute double max; - //readonly attribute double position; + [HTMLConstructor] constructor(); + + // [CEReactions] + // attribute double value; + // [CEReactions] + // attribute double max; + // readonly attribute double position; readonly attribute NodeList labels; }; diff --git a/components/script/dom/webidls/HTMLQuoteElement.webidl b/components/script/dom/webidls/HTMLQuoteElement.webidl index e546f151d49..d7623fb47b9 100644 --- a/components/script/dom/webidls/HTMLQuoteElement.webidl +++ b/components/script/dom/webidls/HTMLQuoteElement.webidl @@ -1,8 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlquoteelement +[Exposed=Window] interface HTMLQuoteElement : HTMLElement { - // attribute DOMString cite; + [HTMLConstructor] constructor(); + + // [CEReactions] + // attribute DOMString cite; }; diff --git a/components/script/dom/webidls/HTMLScriptElement.webidl b/components/script/dom/webidls/HTMLScriptElement.webidl index 8a1dbc3fc35..b79382dbbb8 100644 --- a/components/script/dom/webidls/HTMLScriptElement.webidl +++ b/components/script/dom/webidls/HTMLScriptElement.webidl @@ -1,24 +1,40 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlscriptelement +[Exposed=Window] interface HTMLScriptElement : HTMLElement { - attribute DOMString src; + [HTMLConstructor] constructor(); + + [CEReactions] + attribute USVString src; + [CEReactions] attribute DOMString type; + [CEReactions] + attribute boolean noModule; + [CEReactions] attribute DOMString charset; + [CEReactions] attribute boolean async; + [CEReactions] attribute boolean defer; + [CEReactions] attribute DOMString? crossOrigin; - [Pure] + [CEReactions, Pure] attribute DOMString text; + [CEReactions] attribute DOMString integrity; + [CEReactions] + attribute DOMString referrerPolicy; // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLScriptElement-partial partial interface HTMLScriptElement { + [CEReactions] attribute DOMString event; + [CEReactions] attribute DOMString htmlFor; }; diff --git a/components/script/dom/webidls/HTMLSelectElement.webidl b/components/script/dom/webidls/HTMLSelectElement.webidl index 543c3267c64..91258f88ee8 100644 --- a/components/script/dom/webidls/HTMLSelectElement.webidl +++ b/components/script/dom/webidls/HTMLSelectElement.webidl @@ -1,39 +1,52 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlselectelement +[Exposed=Window] interface HTMLSelectElement : HTMLElement { - // attribute boolean autofocus; + [HTMLConstructor] constructor(); + + // [CEReactions] + // attribute boolean autofocus; + [CEReactions] attribute boolean disabled; readonly attribute HTMLFormElement? form; + [CEReactions] attribute boolean multiple; + [CEReactions] attribute DOMString name; - // attribute boolean required; + [CEReactions] + attribute boolean required; + [CEReactions] attribute unsigned long size; readonly attribute DOMString type; readonly attribute HTMLOptionsCollection options; + [CEReactions] attribute unsigned long length; getter Element? item(unsigned long index); HTMLOptionElement? namedItem(DOMString name); - // Note: this function currently only exists for union.html. + + [CEReactions, Throws] void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null); + [CEReactions] void remove(); // ChildNode overload + [CEReactions] void remove(long index); - //setter void (unsigned long index, HTMLOptionElement? option); + [CEReactions, Throws] setter void (unsigned long index, HTMLOptionElement? option); - //readonly attribute HTMLCollection selectedOptions; + // readonly attribute HTMLCollection selectedOptions; attribute long selectedIndex; attribute DOMString value; - //readonly attribute boolean willValidate; + readonly attribute boolean willValidate; readonly attribute ValidityState validity; - //readonly attribute DOMString validationMessage; - //boolean checkValidity(); - //boolean reportValidity(); - //void setCustomValidity(DOMString error); + readonly attribute DOMString validationMessage; + boolean checkValidity(); + boolean reportValidity(); + void setCustomValidity(DOMString error); readonly attribute NodeList labels; }; diff --git a/components/script/dom/webidls/HTMLSourceElement.webidl b/components/script/dom/webidls/HTMLSourceElement.webidl index 738a545713a..92f75ff5995 100644 --- a/components/script/dom/webidls/HTMLSourceElement.webidl +++ b/components/script/dom/webidls/HTMLSourceElement.webidl @@ -1,9 +1,20 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlsourceelement +[Exposed=Window] interface HTMLSourceElement : HTMLElement { - // attribute DOMString src; - // attribute DOMString type; + [HTMLConstructor] constructor(); + + [CEReactions] + attribute DOMString src; + [CEReactions] + attribute DOMString type; + [CEReactions] + attribute DOMString srcset; + [CEReactions] + attribute DOMString sizes; + [CEReactions] + attribute DOMString media; }; diff --git a/components/script/dom/webidls/HTMLSpanElement.webidl b/components/script/dom/webidls/HTMLSpanElement.webidl index a74967536a1..2645cd7678b 100644 --- a/components/script/dom/webidls/HTMLSpanElement.webidl +++ b/components/script/dom/webidls/HTMLSpanElement.webidl @@ -1,6 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlspanelement -interface HTMLSpanElement : HTMLElement {}; +[Exposed=Window] +interface HTMLSpanElement : HTMLElement { + [HTMLConstructor] constructor(); +}; diff --git a/components/script/dom/webidls/HTMLStyleElement.webidl b/components/script/dom/webidls/HTMLStyleElement.webidl index 78926c2c1a8..dd68cb6270a 100644 --- a/components/script/dom/webidls/HTMLStyleElement.webidl +++ b/components/script/dom/webidls/HTMLStyleElement.webidl @@ -1,11 +1,17 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlstyleelement +[Exposed=Window] interface HTMLStyleElement : HTMLElement { - // attribute DOMString media; - // attribute DOMString type; - // attribute boolean scoped; + [HTMLConstructor] constructor(); + + // [CEReactions] + // attribute DOMString media; + // [CEReactions] + // attribute DOMString type; + // [CEReactions] + // attribute boolean scoped; }; -HTMLStyleElement implements LinkStyle; +HTMLStyleElement includes LinkStyle; diff --git a/components/script/dom/webidls/HTMLTableCaptionElement.webidl b/components/script/dom/webidls/HTMLTableCaptionElement.webidl index b405d23ed40..e834be183c8 100644 --- a/components/script/dom/webidls/HTMLTableCaptionElement.webidl +++ b/components/script/dom/webidls/HTMLTableCaptionElement.webidl @@ -1,13 +1,17 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmltablecaptionelement +[Exposed=Window] interface HTMLTableCaptionElement : HTMLElement { + [HTMLConstructor] constructor(); + // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLTableCaptionElement-partial partial interface HTMLTableCaptionElement { - // attribute DOMString align; + // [CEReactions] + // attribute DOMString align; }; diff --git a/components/script/dom/webidls/HTMLTableCellElement.webidl b/components/script/dom/webidls/HTMLTableCellElement.webidl index 8ac135170ec..3c955de66b9 100644 --- a/components/script/dom/webidls/HTMLTableCellElement.webidl +++ b/components/script/dom/webidls/HTMLTableCellElement.webidl @@ -1,29 +1,47 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmltablecellelement -[Abstract] +[Exposed=Window] interface HTMLTableCellElement : HTMLElement { - attribute unsigned long colSpan; - attribute unsigned long rowSpan; - // attribute DOMString headers; + [HTMLConstructor] constructor(); + + [CEReactions] + attribute unsigned long colSpan; + [CEReactions] + attribute unsigned long rowSpan; + // [CEReactions] + // attribute DOMString headers; readonly attribute long cellIndex; + // [CEReactions] + // attribute DOMString scope; // only conforming for th elements + // [CEReactions] + // attribute DOMString abbr; // only conforming for th elements + // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLTableCellElement-partial partial interface HTMLTableCellElement { - // attribute DOMString align; - // attribute DOMString axis; - // attribute DOMString height; + // [CEReactions] + // attribute DOMString align; + // [CEReactions] + // attribute DOMString axis; + // [CEReactions] + // attribute DOMString height; + [CEReactions] attribute DOMString width; - // attribute DOMString ch; - // attribute DOMString chOff; - // attribute boolean noWrap; - // attribute DOMString vAlign; + // attribute DOMString ch; + // [CEReactions] + // attribute DOMString chOff; + // [CEReactions] + // attribute boolean noWrap; + // [CEReactions] + // attribute DOMString vAlign; - [TreatNullAs=EmptyString] attribute DOMString bgColor; + [CEReactions] + attribute [TreatNullAs=EmptyString] DOMString bgColor; }; diff --git a/components/script/dom/webidls/HTMLTableColElement.webidl b/components/script/dom/webidls/HTMLTableColElement.webidl index 69188251443..1d853643827 100644 --- a/components/script/dom/webidls/HTMLTableColElement.webidl +++ b/components/script/dom/webidls/HTMLTableColElement.webidl @@ -1,19 +1,28 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmltablecolelement +[Exposed=Window] interface HTMLTableColElement : HTMLElement { - // attribute unsigned long span; + [HTMLConstructor] constructor(); + + // [CEReactions] + // attribute unsigned long span; // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLTableColElement-partial partial interface HTMLTableColElement { - // attribute DOMString align; - // attribute DOMString ch; - // attribute DOMString chOff; - // attribute DOMString vAlign; - // attribute DOMString width; + // [CEReactions] + // attribute DOMString align; + // [CEReactions] + // attribute DOMString ch; + // [CEReactions] + // attribute DOMString chOff; + // [CEReactions] + // attribute DOMString vAlign; + // [CEReactions] + // attribute DOMString width; }; diff --git a/components/script/dom/webidls/HTMLTableDataCellElement.webidl b/components/script/dom/webidls/HTMLTableDataCellElement.webidl deleted file mode 100644 index 208ed76d692..00000000000 --- a/components/script/dom/webidls/HTMLTableDataCellElement.webidl +++ /dev/null @@ -1,13 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -// https://html.spec.whatwg.org/multipage/#htmltabledatacellelement -interface HTMLTableDataCellElement : HTMLTableCellElement { - // also has obsolete members -}; - -// https://html.spec.whatwg.org/multipage/#HTMLTableDataCellElement-partial -partial interface HTMLTableDataCellElement { - // attribute DOMString abbr; -}; diff --git a/components/script/dom/webidls/HTMLTableElement.webidl b/components/script/dom/webidls/HTMLTableElement.webidl index f0d8e19d0eb..05acced2e57 100644 --- a/components/script/dom/webidls/HTMLTableElement.webidl +++ b/components/script/dom/webidls/HTMLTableElement.webidl @@ -1,39 +1,59 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmltableelement +[Exposed=Window] interface HTMLTableElement : HTMLElement { + [HTMLConstructor] constructor(); + + [CEReactions] attribute HTMLTableCaptionElement? caption; HTMLTableCaptionElement createCaption(); + [CEReactions] void deleteCaption(); - [SetterThrows] + + [CEReactions, SetterThrows] attribute HTMLTableSectionElement? tHead; HTMLTableSectionElement createTHead(); + [CEReactions] void deleteTHead(); - [SetterThrows] + + [CEReactions, SetterThrows] attribute HTMLTableSectionElement? tFoot; HTMLTableSectionElement createTFoot(); + [CEReactions] void deleteTFoot(); + readonly attribute HTMLCollection tBodies; HTMLTableSectionElement createTBody(); + readonly attribute HTMLCollection rows; [Throws] HTMLTableRowElement insertRow(optional long index = -1); - [Throws] void deleteRow(long index); + [CEReactions, Throws] void deleteRow(long index); // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLTableElement-partial partial interface HTMLTableElement { - // attribute DOMString align; - // attribute DOMString border; - // attribute DOMString frame; - // attribute DOMString rules; - // attribute DOMString summary; + // [CEReactions] + // attribute DOMString align; + // [CEReactions] + // attribute DOMString border; + // [CEReactions] + // attribute DOMString frame; + // [CEReactions] + // attribute DOMString rules; + // [CEReactions] + // attribute DOMString summary; + [CEReactions] attribute DOMString width; - [TreatNullAs=EmptyString] attribute DOMString bgColor; - //[TreatNullAs=EmptyString] attribute DOMString cellPadding; - //[TreatNullAs=EmptyString] attribute DOMString cellSpacing; + [CEReactions] + attribute [TreatNullAs=EmptyString] DOMString bgColor; + // [CEReactions, TreatNullAs=EmptyString] + // attribute DOMString cellPadding; + // [CEReactions, TreatNullAs=EmptyString] + // attribute DOMString cellSpacing; }; diff --git a/components/script/dom/webidls/HTMLTableHeaderCellElement.webidl b/components/script/dom/webidls/HTMLTableHeaderCellElement.webidl deleted file mode 100644 index 9bf8f1fc950..00000000000 --- a/components/script/dom/webidls/HTMLTableHeaderCellElement.webidl +++ /dev/null @@ -1,11 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -// https://html.spec.whatwg.org/multipage/#htmltableheadercellelement -interface HTMLTableHeaderCellElement : HTMLTableCellElement { - // attribute DOMString scope; - // attribute DOMString abbr; - // attribute DOMString sorted; - //void sort(); -}; diff --git a/components/script/dom/webidls/HTMLTableRowElement.webidl b/components/script/dom/webidls/HTMLTableRowElement.webidl index 9d4b0655cad..c51e06e6fdc 100644 --- a/components/script/dom/webidls/HTMLTableRowElement.webidl +++ b/components/script/dom/webidls/HTMLTableRowElement.webidl @@ -1,15 +1,18 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmltablerowelement +[Exposed=Window] interface HTMLTableRowElement : HTMLElement { + [HTMLConstructor] constructor(); + readonly attribute long rowIndex; readonly attribute long sectionRowIndex; readonly attribute HTMLCollection cells; [Throws] HTMLElement insertCell(optional long index = -1); - [Throws] + [CEReactions, Throws] void deleteCell(long index); // also has obsolete members @@ -17,10 +20,15 @@ interface HTMLTableRowElement : HTMLElement { // https://html.spec.whatwg.org/multipage/#HTMLTableRowElement-partial partial interface HTMLTableRowElement { - // attribute DOMString align; - // attribute DOMString ch; - // attribute DOMString chOff; - // attribute DOMString vAlign; + // [CEReactions] + // attribute DOMString align; + // [CEReactions] + // attribute DOMString ch; + // [CEReactions] + // attribute DOMString chOff; + // [CEReactions] + // attribute DOMString vAlign; - [TreatNullAs=EmptyString] attribute DOMString bgColor; + [CEReactions] + attribute [TreatNullAs=EmptyString] DOMString bgColor; }; diff --git a/components/script/dom/webidls/HTMLTableSectionElement.webidl b/components/script/dom/webidls/HTMLTableSectionElement.webidl index 979d8030ffd..e73d16020dc 100644 --- a/components/script/dom/webidls/HTMLTableSectionElement.webidl +++ b/components/script/dom/webidls/HTMLTableSectionElement.webidl @@ -1,13 +1,16 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmltablesectionelement +[Exposed=Window] interface HTMLTableSectionElement : HTMLElement { + [HTMLConstructor] constructor(); + readonly attribute HTMLCollection rows; [Throws] HTMLElement insertRow(optional long index = -1); - [Throws] + [CEReactions, Throws] void deleteRow(long index); // also has obsolete members @@ -15,8 +18,12 @@ interface HTMLTableSectionElement : HTMLElement { // https://html.spec.whatwg.org/multipage/#HTMLTableSectionElement-partial partial interface HTMLTableSectionElement { - // attribute DOMString align; - // attribute DOMString ch; - // attribute DOMString chOff; - // attribute DOMString vAlign; + // [CEReactions] + // attribute DOMString align; + // [CEReactions] + // attribute DOMString ch; + // [CEReactions] + // attribute DOMString chOff; + // [CEReactions] + // attribute DOMString vAlign; }; diff --git a/components/script/dom/webidls/HTMLTemplateElement.webidl b/components/script/dom/webidls/HTMLTemplateElement.webidl index b3383de69d2..b71d37f4914 100644 --- a/components/script/dom/webidls/HTMLTemplateElement.webidl +++ b/components/script/dom/webidls/HTMLTemplateElement.webidl @@ -1,8 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmltemplateelement +[Exposed=Window] interface HTMLTemplateElement : HTMLElement { + [HTMLConstructor] constructor(); + readonly attribute DocumentFragment content; }; diff --git a/components/script/dom/webidls/HTMLTextAreaElement.webidl b/components/script/dom/webidls/HTMLTextAreaElement.webidl index f92e662c354..b726946bc48 100644 --- a/components/script/dom/webidls/HTMLTextAreaElement.webidl +++ b/components/script/dom/webidls/HTMLTextAreaElement.webidl @@ -1,47 +1,69 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmltextareaelement +[Exposed=Window] interface HTMLTextAreaElement : HTMLElement { - // attribute DOMString autocomplete; - // attribute boolean autofocus; - [SetterThrows] - attribute unsigned long cols; - // attribute DOMString dirName; + [HTMLConstructor] constructor(); + + // [CEReactions] + // attribute DOMString autocomplete; + // [CEReactions] + // attribute boolean autofocus; + [CEReactions, SetterThrows] + attribute unsigned long cols; + [CEReactions] + attribute DOMString dirName; + [CEReactions] attribute boolean disabled; readonly attribute HTMLFormElement? form; - // attribute DOMString inputMode; - // attribute long maxLength; - // attribute long minLength; + // [CEReactions] + // attribute DOMString inputMode; + [CEReactions, SetterThrows] + attribute long maxLength; + [CEReactions, SetterThrows] + attribute long minLength; + [CEReactions] attribute DOMString name; + [CEReactions] attribute DOMString placeholder; + [CEReactions] attribute boolean readOnly; + [CEReactions] attribute boolean required; - [SetterThrows] + [CEReactions, SetterThrows] attribute unsigned long rows; + [CEReactions] attribute DOMString wrap; readonly attribute DOMString type; + [CEReactions] attribute DOMString defaultValue; - [TreatNullAs=EmptyString] attribute DOMString value; - //readonly attribute unsigned long textLength; + attribute [TreatNullAs=EmptyString] DOMString value; + readonly attribute unsigned long textLength; - //readonly attribute boolean willValidate; - //readonly attribute ValidityState validity; - //readonly attribute DOMString validationMessage; - //boolean checkValidity(); - //boolean reportValidity(); - //void setCustomValidity(DOMString error); + readonly attribute boolean willValidate; + readonly attribute ValidityState validity; + readonly attribute DOMString validationMessage; + boolean checkValidity(); + boolean reportValidity(); + void setCustomValidity(DOMString error); readonly attribute NodeList labels; - //void select(); - attribute unsigned long selectionStart; - attribute unsigned long selectionEnd; - attribute DOMString selectionDirection; - //void setRangeText(DOMString replacement); - //void setRangeText(DOMString replacement, unsigned long start, unsigned long end, - // optional SelectionMode selectionMode = "preserve"); - void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction); + void select(); + [SetterThrows] + attribute unsigned long? selectionStart; + [SetterThrows] + attribute unsigned long? selectionEnd; + [SetterThrows] + attribute DOMString? selectionDirection; + [Throws] + void setRangeText(DOMString replacement); + [Throws] + void setRangeText(DOMString replacement, unsigned long start, unsigned long end, + optional SelectionMode selectionMode = "preserve"); + [Throws] + void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction); }; diff --git a/components/script/dom/webidls/HTMLTimeElement.webidl b/components/script/dom/webidls/HTMLTimeElement.webidl index 5f2ac73d4cb..27dbf26cb88 100644 --- a/components/script/dom/webidls/HTMLTimeElement.webidl +++ b/components/script/dom/webidls/HTMLTimeElement.webidl @@ -1,8 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmltimeelement +[Exposed=Window] interface HTMLTimeElement : HTMLElement { + [HTMLConstructor] constructor(); + + [CEReactions] attribute DOMString dateTime; }; diff --git a/components/script/dom/webidls/HTMLTitleElement.webidl b/components/script/dom/webidls/HTMLTitleElement.webidl index 10373be7e4b..49fc9e0daf4 100644 --- a/components/script/dom/webidls/HTMLTitleElement.webidl +++ b/components/script/dom/webidls/HTMLTitleElement.webidl @@ -1,9 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmltitleelement +[Exposed=Window] interface HTMLTitleElement : HTMLElement { - [Pure] - attribute DOMString text; + [HTMLConstructor] constructor(); + + [CEReactions, Pure] + attribute DOMString text; }; diff --git a/components/script/dom/webidls/HTMLTrackElement.webidl b/components/script/dom/webidls/HTMLTrackElement.webidl index 55733235321..350901cf2e9 100644 --- a/components/script/dom/webidls/HTMLTrackElement.webidl +++ b/components/script/dom/webidls/HTMLTrackElement.webidl @@ -1,20 +1,28 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmltrackelement +[Exposed=Window] interface HTMLTrackElement : HTMLElement { - // attribute DOMString kind; - // attribute DOMString src; - // attribute DOMString srclang; - // attribute DOMString label; - // attribute boolean default; + [HTMLConstructor] constructor(); - //const unsigned short NONE = 0; - //const unsigned short LOADING = 1; - //const unsigned short LOADED = 2; - //const unsigned short ERROR = 3; - //readonly attribute unsigned short readyState; + [CEReactions] + attribute DOMString kind; + [CEReactions] + attribute USVString src; + [CEReactions] + attribute DOMString srclang; + [CEReactions] + attribute DOMString label; + [CEReactions] + attribute boolean default; - //readonly attribute TextTrack track; + const unsigned short NONE = 0; + const unsigned short LOADING = 1; + const unsigned short LOADED = 2; + const unsigned short ERROR = 3; + readonly attribute unsigned short readyState; + + readonly attribute TextTrack track; }; diff --git a/components/script/dom/webidls/HTMLUListElement.webidl b/components/script/dom/webidls/HTMLUListElement.webidl index 91a79c7f925..479e46961c9 100644 --- a/components/script/dom/webidls/HTMLUListElement.webidl +++ b/components/script/dom/webidls/HTMLUListElement.webidl @@ -1,14 +1,19 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlulistelement +[Exposed=Window] interface HTMLUListElement : HTMLElement { + [HTMLConstructor] constructor(); + // also has obsolete members }; // https://html.spec.whatwg.org/multipage/#HTMLUListElement-partial partial interface HTMLUListElement { - // attribute boolean compact; - // attribute DOMString type; + // [CEReactions] + // attribute boolean compact; + // [CEReactions] + // attribute DOMString type; }; diff --git a/components/script/dom/webidls/HTMLUnknownElement.webidl b/components/script/dom/webidls/HTMLUnknownElement.webidl index acf5a47a996..5e26b34468f 100644 --- a/components/script/dom/webidls/HTMLUnknownElement.webidl +++ b/components/script/dom/webidls/HTMLUnknownElement.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://html.spec.whatwg.org/multipage/#htmlunknownelement and @@ -11,5 +11,6 @@ * and create derivative works of this document. */ +[Exposed=Window] interface HTMLUnknownElement : HTMLElement { }; diff --git a/components/script/dom/webidls/HTMLVideoElement.webidl b/components/script/dom/webidls/HTMLVideoElement.webidl index 5e7c9cb9fce..d9e6b86e4bb 100644 --- a/components/script/dom/webidls/HTMLVideoElement.webidl +++ b/components/script/dom/webidls/HTMLVideoElement.webidl @@ -1,12 +1,22 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlvideoelement +[Exposed=Window] interface HTMLVideoElement : HTMLMediaElement { - // attribute unsigned long width; - // attribute unsigned long height; - //readonly attribute unsigned long videoWidth; - //readonly attribute unsigned long videoHeight; - // attribute DOMString poster; + [HTMLConstructor] constructor(); + + // [CEReactions] + // attribute unsigned long width; + // [CEReactions] + // attribute unsigned long height; + readonly attribute unsigned long videoWidth; + readonly attribute unsigned long videoHeight; + [CEReactions] attribute DOMString poster; +}; + +partial interface HTMLVideoElement { + [Pref="media.testing.enabled"] + attribute EventHandler onpostershown; }; diff --git a/components/script/dom/webidls/HashChangeEvent.webidl b/components/script/dom/webidls/HashChangeEvent.webidl index 3d81e8ad383..f225967a138 100644 --- a/components/script/dom/webidls/HashChangeEvent.webidl +++ b/components/script/dom/webidls/HashChangeEvent.webidl @@ -1,11 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#hashchangeevent -[Constructor(DOMString type, optional HashChangeEventInit eventInitDict), - Exposed=Window] +[Exposed=Window] interface HashChangeEvent : Event { + [Throws] constructor(DOMString type, optional HashChangeEventInit eventInitDict = {}); readonly attribute USVString oldURL; readonly attribute USVString newURL; }; diff --git a/components/script/dom/webidls/Headers.webidl b/components/script/dom/webidls/Headers.webidl index 5ae08ad2bd7..dac3d860154 100644 --- a/components/script/dom/webidls/Headers.webidl +++ b/components/script/dom/webidls/Headers.webidl @@ -1,14 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://fetch.spec.whatwg.org/#headers-class -typedef (Headers or sequence<sequence<ByteString>> or MozMap<ByteString>) HeadersInit; +typedef (sequence<sequence<ByteString>> or record<ByteString, ByteString>) HeadersInit; -[Constructor(optional HeadersInit init), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface Headers { + [Throws] constructor(optional HeadersInit init); [Throws] void append(ByteString name, ByteString value); [Throws] diff --git a/components/script/dom/webidls/History.webidl b/components/script/dom/webidls/History.webidl index 56171470877..95248cbcd9b 100644 --- a/components/script/dom/webidls/History.webidl +++ b/components/script/dom/webidls/History.webidl @@ -1,18 +1,26 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // enum ScrollRestoration { "auto", "manual" }; // https://html.spec.whatwg.org/multipage/#the-history-interface [Exposed=(Window,Worker)] interface History { + [Throws] readonly attribute unsigned long length; + // [Throws] // attribute ScrollRestoration scrollRestoration; - // readonly attribute any state; - [Throws] void go(optional long delta = 0); + [Throws] + readonly attribute any state; + [Throws] + void go(optional long delta = 0); + [Throws] void back(); + [Throws] void forward(); - // void pushState(any data, DOMString title, optional USVString? url = null); - // void replaceState(any data, DOMString title, optional USVString? url = null); + [Throws] + void pushState(any data, DOMString title, optional USVString? url = null); + [Throws] + void replaceState(any data, DOMString title, optional USVString? url = null); }; diff --git a/components/script/dom/webidls/ImageBitmap.webidl b/components/script/dom/webidls/ImageBitmap.webidl new file mode 100644 index 00000000000..51c923bfaf4 --- /dev/null +++ b/components/script/dom/webidls/ImageBitmap.webidl @@ -0,0 +1,36 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://html.spec.whatwg.org/multipage/#imagebitmap + * + * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera Software ASA. + * You are granted a license to use, reproduce and create derivative works of this document. + */ + +//[Exposed=(Window,Worker), Serializable, Transferable] +[Exposed=(Window,Worker), Pref="dom.imagebitmap.enabled"] +interface ImageBitmap { + readonly attribute unsigned long width; + readonly attribute unsigned long height; + //void close(); +}; + +typedef (CanvasImageSource or + Blob or + ImageData) ImageBitmapSource; + +enum ImageOrientation { "none", "flipY" }; +enum PremultiplyAlpha { "none", "premultiply", "default" }; +enum ColorSpaceConversion { "none", "default" }; +enum ResizeQuality { "pixelated", "low", "medium", "high" }; + +dictionary ImageBitmapOptions { + ImageOrientation imageOrientation = "none"; + PremultiplyAlpha premultiplyAlpha = "default"; + ColorSpaceConversion colorSpaceConversion = "default"; + [EnforceRange] unsigned long resizeWidth; + [EnforceRange] unsigned long resizeHeight; + ResizeQuality resizeQuality = "low"; +}; diff --git a/components/script/dom/webidls/ImageData.webidl b/components/script/dom/webidls/ImageData.webidl index d327facd5c9..b05e201f42a 100644 --- a/components/script/dom/webidls/ImageData.webidl +++ b/components/script/dom/webidls/ImageData.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://html.spec.whatwg.org/multipage/#imagedata @@ -9,10 +9,10 @@ * You are granted a license to use, reproduce and create derivative works of this document. */ -[Constructor(unsigned long sw, unsigned long sh), - Constructor(/* Uint8ClampedArray */ object data, unsigned long sw, optional unsigned long sh), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface ImageData { + [Throws] constructor(unsigned long sw, unsigned long sh); + [Throws] constructor(/* Uint8ClampedArray */ object data, unsigned long sw, optional unsigned long sh); //[Constant] readonly attribute unsigned long width; //[Constant] diff --git a/components/script/dom/webidls/InputEvent.webidl b/components/script/dom/webidls/InputEvent.webidl new file mode 100644 index 00000000000..58699b643fa --- /dev/null +++ b/components/script/dom/webidls/InputEvent.webidl @@ -0,0 +1,22 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://w3c.github.io/uievents/#idl-inputevent + * + */ + +// https://w3c.github.io/uievents/#idl-inputevent +[Exposed=Window] +interface InputEvent : UIEvent { + [Throws] constructor(DOMString type, optional InputEventInit eventInitDict = {}); + readonly attribute DOMString? data; + readonly attribute boolean isComposing; +}; + +// https://w3c.github.io/uievents/#idl-inputeventinit +dictionary InputEventInit : UIEventInit { + DOMString? data = null; + boolean isComposing = false; +}; diff --git a/components/script/dom/webidls/IterableIterator.webidl b/components/script/dom/webidls/IterableIterator.webidl index d975aa5645d..25b8aae881e 100644 --- a/components/script/dom/webidls/IterableIterator.webidl +++ b/components/script/dom/webidls/IterableIterator.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // This interface is entirely internal to Servo, and should not be accessible to // web pages. diff --git a/components/script/dom/webidls/KeyboardEvent.webidl b/components/script/dom/webidls/KeyboardEvent.webidl index 9426b0da30a..6933a0105ed 100644 --- a/components/script/dom/webidls/KeyboardEvent.webidl +++ b/components/script/dom/webidls/KeyboardEvent.webidl @@ -1,14 +1,15 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://w3c.github.io/uievents/#interface-keyboardevent * */ -[Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)] +[Exposed=Window] interface KeyboardEvent : UIEvent { + [Throws] constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict = {}); // KeyLocationCode const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00; const unsigned long DOM_KEY_LOCATION_LEFT = 0x01; diff --git a/components/script/dom/webidls/Location.webidl b/components/script/dom/webidls/Location.webidl index 6413bd3846a..4120fc2731d 100644 --- a/components/script/dom/webidls/Location.webidl +++ b/components/script/dom/webidls/Location.webidl @@ -1,10 +1,10 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#location [Exposed=Window, Unforgeable] interface Location { - /*stringifier*/ [Throws] attribute USVString href; + [Throws] stringifier attribute USVString href; [Throws] readonly attribute USVString origin; [Throws] attribute USVString protocol; [Throws] attribute USVString host; @@ -19,9 +19,4 @@ [Throws] void reload(); //[SameObject] readonly attribute USVString[] ancestorOrigins; - - // This is only doing as well as gecko right now. - // https://github.com/servo/servo/issues/7590 is on file for - // adding attribute stringifier support. - [Throws] stringifier; }; diff --git a/components/script/dom/webidls/MediaDeviceInfo.webidl b/components/script/dom/webidls/MediaDeviceInfo.webidl new file mode 100644 index 00000000000..ab24f8046f9 --- /dev/null +++ b/components/script/dom/webidls/MediaDeviceInfo.webidl @@ -0,0 +1,21 @@ +/* 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/. */ + + // https://w3c.github.io/mediacapture-main/#device-info + +[Exposed=Window, +SecureContext, Pref="dom.webrtc.enabled"] +interface MediaDeviceInfo { + readonly attribute DOMString deviceId; + readonly attribute MediaDeviceKind kind; + readonly attribute DOMString label; + readonly attribute DOMString groupId; + [Default] object toJSON(); +}; + +enum MediaDeviceKind { + "audioinput", + "audiooutput", + "videoinput" +}; diff --git a/components/script/dom/webidls/MediaDevices.webidl b/components/script/dom/webidls/MediaDevices.webidl new file mode 100644 index 00000000000..53e6c3599a4 --- /dev/null +++ b/components/script/dom/webidls/MediaDevices.webidl @@ -0,0 +1,86 @@ +/* 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/. */ + +// https://w3c.github.io/mediacapture-main/#dom-mediadevices + +[Exposed=Window, +SecureContext, Pref="dom.webrtc.enabled"] +interface MediaDevices : EventTarget { + // attribute EventHandler ondevicechange; + Promise<sequence<MediaDeviceInfo>> enumerateDevices(); +}; + +partial interface Navigator { + // [SameObject, SecureContext] + [Pref="dom.webrtc.enabled"] readonly attribute MediaDevices mediaDevices; +}; + +partial interface MediaDevices { + // MediaTrackSupportedConstraints getSupportedConstraints(); + Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints = {}); +}; + + +dictionary MediaStreamConstraints { + (boolean or MediaTrackConstraints) video = false; + (boolean or MediaTrackConstraints) audio = false; +}; + +dictionary DoubleRange { + double max; + double min; +}; + +dictionary ConstrainDoubleRange : DoubleRange { + double exact; + double ideal; +}; + +dictionary ULongRange { + [Clamp] unsigned long max; + [Clamp] unsigned long min; +}; + +dictionary ConstrainULongRange : ULongRange { + [Clamp] unsigned long exact; + [Clamp] unsigned long ideal; +}; + +// dictionary ConstrainBooleanParameters { +// boolean exact; +// boolean ideal; +// }; + +// dictionary ConstrainDOMStringParameters { +// (DOMString or sequence<DOMString>) exact; +// (DOMString or sequence<DOMString>) ideal; +// }; + +dictionary MediaTrackConstraints : MediaTrackConstraintSet { + sequence<MediaTrackConstraintSet> advanced; +}; + +typedef ([Clamp] unsigned long or ConstrainULongRange) ConstrainULong; +typedef (double or ConstrainDoubleRange) ConstrainDouble; +// typedef (boolean or ConstrainBooleanParameters) ConstrainBoolean; +// typedef (DOMString or sequence<DOMString> or ConstrainDOMStringParameters) ConstrainDOMString; + +dictionary MediaTrackConstraintSet { + ConstrainULong width; + ConstrainULong height; + ConstrainDouble aspectRatio; + ConstrainDouble frameRate; + // ConstrainDOMString facingMode; + // ConstrainDOMString resizeMode; + // ConstrainDouble volume; + ConstrainULong sampleRate; + // ConstrainULong sampleSize; + // ConstrainBoolean echoCancellation; + // ConstrainBoolean autoGainControl; + // ConstrainBoolean noiseSuppression; + // ConstrainDouble latency; + // ConstrainULong channelCount; + // ConstrainDOMString deviceId; + // ConstrainDOMString groupId; +}; diff --git a/components/script/dom/webidls/MediaElementAudioSourceNode.webidl b/components/script/dom/webidls/MediaElementAudioSourceNode.webidl new file mode 100644 index 00000000000..5afe7775caa --- /dev/null +++ b/components/script/dom/webidls/MediaElementAudioSourceNode.webidl @@ -0,0 +1,17 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#mediaelementaudiosourcenode + */ + +dictionary MediaElementAudioSourceOptions { + required HTMLMediaElement mediaElement; +}; + +[Exposed=Window] +interface MediaElementAudioSourceNode : AudioNode { + [Throws] constructor (AudioContext context, MediaElementAudioSourceOptions options); + [SameObject] readonly attribute HTMLMediaElement mediaElement; +}; diff --git a/components/script/dom/webidls/MediaError.webidl b/components/script/dom/webidls/MediaError.webidl index ab1966d1095..bff99c786f4 100644 --- a/components/script/dom/webidls/MediaError.webidl +++ b/components/script/dom/webidls/MediaError.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#mediaerror @@ -11,4 +11,5 @@ interface MediaError { const unsigned short MEDIA_ERR_DECODE = 3; const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4; readonly attribute unsigned short code; + readonly attribute DOMString message; }; diff --git a/components/script/dom/webidls/MediaList.webidl b/components/script/dom/webidls/MediaList.webidl index f397badfd52..b2ba10f0d7a 100644 --- a/components/script/dom/webidls/MediaList.webidl +++ b/components/script/dom/webidls/MediaList.webidl @@ -1,11 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom/#the-medialist-interface -// [LegacyArrayClass] +[Exposed=Window] interface MediaList { - [TreatNullAs=EmptyString] /* stringifier */ attribute DOMString mediaText; + stringifier attribute [TreatNullAs=EmptyString] DOMString mediaText; readonly attribute unsigned long length; getter DOMString? item(unsigned long index); void appendMedium(DOMString medium); diff --git a/components/script/dom/webidls/MediaMetadata.webidl b/components/script/dom/webidls/MediaMetadata.webidl new file mode 100644 index 00000000000..495aeef8e35 --- /dev/null +++ b/components/script/dom/webidls/MediaMetadata.webidl @@ -0,0 +1,30 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://w3c.github.io/mediasession/#mediametadata + */ + +dictionary MediaImage { + required USVString src; + DOMString sizes = ""; + DOMString type = ""; +}; + +[Exposed=Window] +interface MediaMetadata { + [Throws] constructor(optional MediaMetadataInit init = {}); + attribute DOMString title; + attribute DOMString artist; + attribute DOMString album; + // TODO: https://github.com/servo/servo/issues/10072 + // attribute FrozenArray<MediaImage> artwork; +}; + +dictionary MediaMetadataInit { + DOMString title = ""; + DOMString artist = ""; + DOMString album = ""; + sequence<MediaImage> artwork = []; +}; diff --git a/components/script/dom/webidls/MediaQueryList.webidl b/components/script/dom/webidls/MediaQueryList.webidl index 2991efa89a8..3818382645a 100644 --- a/components/script/dom/webidls/MediaQueryList.webidl +++ b/components/script/dom/webidls/MediaQueryList.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom-view/#mediaquerylist diff --git a/components/script/dom/webidls/MediaQueryListEvent.webidl b/components/script/dom/webidls/MediaQueryListEvent.webidl index 877ca17b60b..f1837ee2750 100644 --- a/components/script/dom/webidls/MediaQueryListEvent.webidl +++ b/components/script/dom/webidls/MediaQueryListEvent.webidl @@ -1,10 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom-view/#dom-mediaquerylistevent-mediaquerylistevent -[Constructor(DOMString type, optional MediaQueryListEventInit eventInitDict), Exposed=(Window)] +[Exposed=(Window)] interface MediaQueryListEvent : Event { + [Throws] constructor(DOMString type, optional MediaQueryListEventInit eventInitDict = {}); readonly attribute DOMString media; readonly attribute boolean matches; }; diff --git a/components/script/dom/webidls/MediaSession.webidl b/components/script/dom/webidls/MediaSession.webidl new file mode 100644 index 00000000000..2680ea0c40b --- /dev/null +++ b/components/script/dom/webidls/MediaSession.webidl @@ -0,0 +1,62 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://w3c.github.io/mediasession/#mediasession + */ + +[Exposed=Window] +partial interface Navigator { + [SameObject] readonly attribute MediaSession mediaSession; +}; + +enum MediaSessionPlaybackState { + "none", + "paused", + "playing" +}; + +enum MediaSessionAction { + "play", + "pause", + "seekbackward", + "seekforward", + "previoustrack", + "nexttrack", + "skipad", + "stop", + "seekto" +}; + +dictionary MediaSessionActionDetails { + required MediaSessionAction action; +}; + +dictionary MediaSessionSeekActionDetails : MediaSessionActionDetails { + double? seekOffset; +}; + +dictionary MediaSessionSeekToActionDetails : MediaSessionActionDetails { + required double seekTime; + boolean? fastSeek; +}; + +dictionary MediaPositionState { + double duration; + double playbackRate; + double position; +}; + +callback MediaSessionActionHandler = void(/*MediaSessionActionDetails details*/); + +[Exposed=Window] +interface MediaSession { + attribute MediaMetadata? metadata; + + attribute MediaSessionPlaybackState playbackState; + + void setActionHandler(MediaSessionAction action, MediaSessionActionHandler? handler); + + [Throws] void setPositionState(optional MediaPositionState state = {}); +}; diff --git a/components/script/dom/webidls/MediaStream.webidl b/components/script/dom/webidls/MediaStream.webidl new file mode 100644 index 00000000000..3df07a22454 --- /dev/null +++ b/components/script/dom/webidls/MediaStream.webidl @@ -0,0 +1,23 @@ +/* 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/. */ + +// https://w3c.github.io/mediacapture-main/#dom-mediastream + +[Exposed=Window] +interface MediaStream : EventTarget { + [Throws] constructor(); + [Throws] constructor(MediaStream stream); + [Throws] constructor(sequence<MediaStreamTrack> tracks); + // readonly attribute DOMString id; + sequence<MediaStreamTrack> getAudioTracks(); + sequence<MediaStreamTrack> getVideoTracks(); + sequence<MediaStreamTrack> getTracks(); + MediaStreamTrack? getTrackById(DOMString trackId); + void addTrack(MediaStreamTrack track); + void removeTrack(MediaStreamTrack track); + MediaStream clone(); + // readonly attribute boolean active; + // attribute EventHandler onaddtrack; + // attribute EventHandler onremovetrack; +}; diff --git a/components/script/dom/webidls/MediaStreamAudioDestinationNode.webidl b/components/script/dom/webidls/MediaStreamAudioDestinationNode.webidl new file mode 100644 index 00000000000..93d5f86ebc5 --- /dev/null +++ b/components/script/dom/webidls/MediaStreamAudioDestinationNode.webidl @@ -0,0 +1,13 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#mediastreamaudiodestinationnode + */ + +[Exposed=Window] +interface MediaStreamAudioDestinationNode : AudioNode { + [Throws] constructor (AudioContext context, optional AudioNodeOptions options = {}); + readonly attribute MediaStream stream; +}; diff --git a/components/script/dom/webidls/MediaStreamAudioSourceNode.webidl b/components/script/dom/webidls/MediaStreamAudioSourceNode.webidl new file mode 100644 index 00000000000..655e2443081 --- /dev/null +++ b/components/script/dom/webidls/MediaStreamAudioSourceNode.webidl @@ -0,0 +1,17 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#mediastreamaudiosourcenode + */ + +dictionary MediaStreamAudioSourceOptions { + required MediaStream mediaStream; +}; + +[Exposed=Window] +interface MediaStreamAudioSourceNode : AudioNode { + [Throws] constructor (AudioContext context, MediaStreamAudioSourceOptions options); + [SameObject] readonly attribute MediaStream mediaStream; +}; diff --git a/components/script/dom/webidls/MediaStreamTrack.webidl b/components/script/dom/webidls/MediaStreamTrack.webidl new file mode 100644 index 00000000000..b514360622a --- /dev/null +++ b/components/script/dom/webidls/MediaStreamTrack.webidl @@ -0,0 +1,24 @@ +/* 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/. */ + +// https://w3c.github.io/mediacapture-main/#dom-mediastreamtrack + +[Exposed=Window] +interface MediaStreamTrack : EventTarget { + readonly attribute DOMString kind; + readonly attribute DOMString id; + // readonly attribute DOMString label; + // attribute boolean enabled; + // readonly attribute boolean muted; + // attribute EventHandler onmute; + // attribute EventHandler onunmute; + // readonly attribute MediaStreamTrackState readyState; + // attribute EventHandler onended; + MediaStreamTrack clone(); + // void stop(); + // MediaTrackCapabilities getCapabilities(); + // MediaTrackConstraints getConstraints(); + // MediaTrackSettings getSettings(); + // Promise<void> applyConstraints(optional MediaTrackConstraints constraints); +}; diff --git a/components/script/dom/webidls/MediaStreamTrackAudioSourceNode.webidl b/components/script/dom/webidls/MediaStreamTrackAudioSourceNode.webidl new file mode 100644 index 00000000000..354b8fa8c85 --- /dev/null +++ b/components/script/dom/webidls/MediaStreamTrackAudioSourceNode.webidl @@ -0,0 +1,16 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#mediastreamtrackaudiosourcenode + */ + +dictionary MediaStreamTrackAudioSourceOptions { + required MediaStreamTrack mediaStreamTrack; +}; + +[Exposed=Window] +interface MediaStreamTrackAudioSourceNode : AudioNode { + [Throws] constructor (AudioContext context, MediaStreamTrackAudioSourceOptions options); +}; diff --git a/components/script/dom/webidls/MessageChannel.webidl b/components/script/dom/webidls/MessageChannel.webidl new file mode 100644 index 00000000000..f48fe643353 --- /dev/null +++ b/components/script/dom/webidls/MessageChannel.webidl @@ -0,0 +1,14 @@ +/* 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 http://mozilla.org/MPL/2.0/. */ +/* + * The origin of this IDL file is: + * https://html.spec.whatwg.org/multipage/#messagechannel + */ + +[Exposed=(Window,Worker)] +interface MessageChannel { + constructor(); + readonly attribute MessagePort port1; + readonly attribute MessagePort port2; +}; diff --git a/components/script/dom/webidls/MessageEvent.webidl b/components/script/dom/webidls/MessageEvent.webidl index 0870f979dac..b37d725b793 100644 --- a/components/script/dom/webidls/MessageEvent.webidl +++ b/components/script/dom/webidls/MessageEvent.webidl @@ -1,15 +1,27 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#messageevent -[Constructor(DOMString type, optional MessageEventInit eventInitDict), Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface MessageEvent : Event { + [Throws] constructor(DOMString type, optional MessageEventInit eventInitDict = {}); readonly attribute any data; readonly attribute DOMString origin; readonly attribute DOMString lastEventId; - //readonly attribute (WindowProxy or MessagePort)? source; - //readonly attribute MessagePort[]? ports; + readonly attribute MessageEventSource? source; + readonly attribute /*FrozenArray<MessagePort>*/any ports; + + void initMessageEvent( + DOMString type, + optional boolean bubbles = false, + optional boolean cancelable = false, + optional any data = null, + optional DOMString origin = "", + optional DOMString lastEventId = "", + optional MessageEventSource? source = null, + optional sequence<MessagePort> ports = [] + ); }; dictionary MessageEventInit : EventInit { @@ -17,6 +29,8 @@ dictionary MessageEventInit : EventInit { DOMString origin = ""; DOMString lastEventId = ""; //DOMString channel; - //(WindowProxy or MessagePort)? source; - //sequence<MessagePort> ports; + MessageEventSource? source = null; + sequence<MessagePort> ports = []; }; + +typedef (WindowProxy or MessagePort or ServiceWorker) MessageEventSource; diff --git a/components/script/dom/webidls/MessagePort.webidl b/components/script/dom/webidls/MessagePort.webidl new file mode 100644 index 00000000000..58a3f06a960 --- /dev/null +++ b/components/script/dom/webidls/MessagePort.webidl @@ -0,0 +1,23 @@ +/* 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 http://mozilla.org/MPL/2.0/. */ +/* + * The origin of this IDL file is: + * https://html.spec.whatwg.org/multipage/#messageport + */ + +[Exposed=(Window,Worker)] +interface MessagePort : EventTarget { + [Throws] void postMessage(any message, sequence<object> transfer); + [Throws] void postMessage(any message, optional PostMessageOptions options = {}); + void start(); + void close(); + + // event handlers + attribute EventHandler onmessage; + attribute EventHandler onmessageerror; +}; + +dictionary PostMessageOptions { + sequence<object> transfer = []; +}; diff --git a/components/script/dom/webidls/MimeType.webidl b/components/script/dom/webidls/MimeType.webidl index 2f9ef726994..0f971a858cc 100644 --- a/components/script/dom/webidls/MimeType.webidl +++ b/components/script/dom/webidls/MimeType.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#mimetype [Exposed=Window] diff --git a/components/script/dom/webidls/MimeTypeArray.webidl b/components/script/dom/webidls/MimeTypeArray.webidl index b66cef1b594..c7f724c5fbf 100644 --- a/components/script/dom/webidls/MimeTypeArray.webidl +++ b/components/script/dom/webidls/MimeTypeArray.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#mimetypearray [LegacyUnenumerableNamedProperties, Exposed=Window] diff --git a/components/script/dom/webidls/MouseEvent.webidl b/components/script/dom/webidls/MouseEvent.webidl index e9f7a31db48..0b7cb644368 100644 --- a/components/script/dom/webidls/MouseEvent.webidl +++ b/components/script/dom/webidls/MouseEvent.webidl @@ -1,15 +1,21 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/uievents/#interface-mouseevent -[Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict), - Exposed=Window] +[Exposed=Window] interface MouseEvent : UIEvent { + [Throws] constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict = {}); readonly attribute long screenX; readonly attribute long screenY; readonly attribute long clientX; readonly attribute long clientY; + readonly attribute long pageX; + readonly attribute long pageY; + readonly attribute long x; + readonly attribute long y; + readonly attribute long offsetX; + readonly attribute long offsetY; readonly attribute boolean ctrlKey; readonly attribute boolean shiftKey; readonly attribute boolean altKey; @@ -17,7 +23,7 @@ interface MouseEvent : UIEvent { readonly attribute short button; readonly attribute EventTarget? relatedTarget; // Introduced in DOM Level 3 - //readonly attribute unsigned short buttons; + readonly attribute unsigned short buttons; //boolean getModifierState (DOMString keyArg); [Pref="dom.mouseevent.which.enabled"] @@ -31,7 +37,7 @@ dictionary MouseEventInit : EventModifierInit { long clientX = 0; long clientY = 0; short button = 0; - //unsigned short buttons = 0; + unsigned short buttons = 0; EventTarget? relatedTarget = null; }; diff --git a/components/script/dom/webidls/MutationObserver.webidl b/components/script/dom/webidls/MutationObserver.webidl index dbcfa945d4a..7d75c5ed0c4 100644 --- a/components/script/dom/webidls/MutationObserver.webidl +++ b/components/script/dom/webidls/MutationObserver.webidl @@ -1,17 +1,19 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is: * https://dom.spec.whatwg.org/#mutationobserver */ // https://dom.spec.whatwg.org/#mutationobserver -[Pref="dom.mutation_observer.enabled", Constructor(MutationCallback callback)] +[Exposed=Window, Pref="dom.mutation_observer.enabled"] interface MutationObserver { - //void observe(Node target, optional MutationObserverInit options); - //void disconnect(); - //sequence<MutationRecord> takeRecords(); + [Throws] constructor(MutationCallback callback); + [Throws] + void observe(Node target, optional MutationObserverInit options = {}); + void disconnect(); + sequence<MutationRecord> takeRecords(); }; callback MutationCallback = void (sequence<MutationRecord> mutations, MutationObserver observer); diff --git a/components/script/dom/webidls/MutationRecord.webidl b/components/script/dom/webidls/MutationRecord.webidl index 286801bf2ab..2c08fcea71f 100644 --- a/components/script/dom/webidls/MutationRecord.webidl +++ b/components/script/dom/webidls/MutationRecord.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is: * https://dom.spec.whatwg.org/#mutationrecord @@ -12,13 +12,13 @@ interface MutationRecord { readonly attribute DOMString type; [SameObject] readonly attribute Node target; - //[SameObject] - //readonly attribute NodeList addedNodes; - //[SameObject] - //readonly attribute NodeList removedNodes; - //readonly attribute Node? previousSibling; - //readonly attribute Node? nextSibling; - //readonly attribute DOMString? attributeName; - //readonly attribute DOMString? attributeNamespace; - //readonly attribute DOMString? oldValue; + [SameObject] + readonly attribute NodeList addedNodes; + [SameObject] + readonly attribute NodeList removedNodes; + readonly attribute Node? previousSibling; + readonly attribute Node? nextSibling; + readonly attribute DOMString? attributeName; + readonly attribute DOMString? attributeNamespace; + readonly attribute DOMString? oldValue; }; diff --git a/components/script/dom/webidls/NamedNodeMap.webidl b/components/script/dom/webidls/NamedNodeMap.webidl index 66156943b08..15adeac6852 100644 --- a/components/script/dom/webidls/NamedNodeMap.webidl +++ b/components/script/dom/webidls/NamedNodeMap.webidl @@ -1,10 +1,10 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://dom.spec.whatwg.org/#interface-namednodemap -[LegacyUnenumerableNamedProperties] +[Exposed=Window, LegacyUnenumerableNamedProperties] interface NamedNodeMap { [Pure] readonly attribute unsigned long length; @@ -14,12 +14,12 @@ interface NamedNodeMap { getter Attr? getNamedItem(DOMString qualifiedName); [Pure] Attr? getNamedItemNS(DOMString? namespace, DOMString localName); - [Throws] + [CEReactions, Throws] Attr? setNamedItem(Attr attr); - [Throws] + [CEReactions, Throws] Attr? setNamedItemNS(Attr attr); - [Throws] + [CEReactions, Throws] Attr removeNamedItem(DOMString qualifiedName); - [Throws] + [CEReactions, Throws] Attr removeNamedItemNS(DOMString? namespace, DOMString localName); }; diff --git a/components/script/dom/webidls/NavigationPreloadManager.webidl b/components/script/dom/webidls/NavigationPreloadManager.webidl new file mode 100644 index 00000000000..ba8d329769e --- /dev/null +++ b/components/script/dom/webidls/NavigationPreloadManager.webidl @@ -0,0 +1,17 @@ +/* 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/. */ + +// https://w3c.github.io/ServiceWorker/#navigation-preload-manager +[Pref="dom.serviceworker.enabled", SecureContext, Exposed=(Window,Worker)] +interface NavigationPreloadManager { + Promise<void> enable(); + Promise<void> disable(); + Promise<void> setHeaderValue(ByteString value); + Promise<NavigationPreloadState> getState(); +}; + +dictionary NavigationPreloadState { + boolean enabled = false; + ByteString headerValue; +}; diff --git a/components/script/dom/webidls/Navigator.webidl b/components/script/dom/webidls/Navigator.webidl index 338753d6261..4ebb5ad20be 100644 --- a/components/script/dom/webidls/Navigator.webidl +++ b/components/script/dom/webidls/Navigator.webidl @@ -1,29 +1,33 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#navigator +[Exposed=Window] interface Navigator { // objects implementing this interface also implement the interfaces given below }; -Navigator implements NavigatorID; -Navigator implements NavigatorLanguage; -//Navigator implements NavigatorOnLine; -//Navigator implements NavigatorContentUtils; -//Navigator implements NavigatorStorageUtils; -Navigator implements NavigatorPlugins; -Navigator implements NavigatorCookies; +Navigator includes NavigatorID; +Navigator includes NavigatorLanguage; +//Navigator includes NavigatorOnLine; +//Navigator includes NavigatorContentUtils; +//Navigator includes NavigatorStorageUtils; +Navigator includes NavigatorPlugins; +Navigator includes NavigatorCookies; // https://html.spec.whatwg.org/multipage/#navigatorid -[NoInterfaceObject, Exposed=(Window,Worker)] -interface NavigatorID { +[Exposed=(Window,Worker)] +interface mixin NavigatorID { readonly attribute DOMString appCodeName; // constant "Mozilla" readonly attribute DOMString appName; readonly attribute DOMString appVersion; readonly attribute DOMString platform; readonly attribute DOMString product; // constant "Gecko" + [Exposed=Window] readonly attribute DOMString productSub; boolean taintEnabled(); // constant false readonly attribute DOMString userAgent; + [Exposed=Window] readonly attribute DOMString vendor; + [Exposed=Window] readonly attribute DOMString vendorSub; // constant "" }; // https://webbluetoothcg.github.io/web-bluetooth/#navigator-extensions @@ -37,32 +41,24 @@ partial interface Navigator { }; // https://html.spec.whatwg.org/multipage/#navigatorlanguage -[NoInterfaceObject, Exposed=(Window,Worker)] -interface NavigatorLanguage { +[Exposed=(Window,Worker)] +interface mixin NavigatorLanguage { readonly attribute DOMString language; - // https://github.com/servo/servo/issues/10073 - //readonly attribute DOMString[] languages; + readonly attribute any languages; }; // https://html.spec.whatwg.org/multipage/#navigatorplugins -[NoInterfaceObject] -interface NavigatorPlugins { +interface mixin NavigatorPlugins { [SameObject] readonly attribute PluginArray plugins; [SameObject] readonly attribute MimeTypeArray mimeTypes; boolean javaEnabled(); }; // https://html.spec.whatwg.org/multipage/#navigatorcookies -[NoInterfaceObject] -interface NavigatorCookies { +interface mixin NavigatorCookies { readonly attribute boolean cookieEnabled; }; -// https://w3c.github.io/webvr/#interface-navigator -partial interface Navigator { - [SameObject, Pref="dom.webvr.enabled"] readonly attribute VR vr; -}; - // https://w3c.github.io/permissions/#navigator-and-workernavigator-extension [Exposed=(Window)] partial interface Navigator { @@ -73,3 +69,8 @@ partial interface Navigator { partial interface Navigator { [Pref="dom.gamepad.enabled"] GamepadList getGamepads(); }; + +[Exposed=Window] +partial interface Navigator { + [SameObject, Pref="dom.webgpu.enabled"] readonly attribute GPU gpu; +}; diff --git a/components/script/dom/webidls/Node.webidl b/components/script/dom/webidls/Node.webidl index 6108de01d90..c8a71dbebb7 100644 --- a/components/script/dom/webidls/Node.webidl +++ b/components/script/dom/webidls/Node.webidl @@ -1,12 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is: * https://dom.spec.whatwg.org/#interface-node */ -[Abstract] +[Exposed=Window, Abstract] interface Node : EventTarget { const unsigned short ELEMENT_NODE = 1; const unsigned short ATTRIBUTE_NODE = 2; // historical @@ -29,10 +29,13 @@ interface Node : EventTarget { readonly attribute USVString baseURI; [Pure] + readonly attribute boolean isConnected; + + [Pure] readonly attribute Document? ownerDocument; [Pure] - Node getRootNode(); + Node getRootNode(optional GetRootNodeOptions options = {}); [Pure] readonly attribute Node? parentNode; @@ -51,12 +54,14 @@ interface Node : EventTarget { [Pure] readonly attribute Node? nextSibling; - [Pure] + [CEReactions, Pure] attribute DOMString? nodeValue; - [Pure] + [CEReactions, Pure] attribute DOMString? textContent; + [CEReactions] void normalize(); + [CEReactions, Throws] Node cloneNode(optional boolean deep = false); [Pure] boolean isEqualNode(Node? node); @@ -81,12 +86,16 @@ interface Node : EventTarget { [Pure] boolean isDefaultNamespace(DOMString? namespace); - [Throws] + [CEReactions, Throws] Node insertBefore(Node node, Node? child); - [Throws] + [CEReactions, Throws] Node appendChild(Node node); - [Throws] + [CEReactions, Throws] Node replaceChild(Node node, Node child); - [Throws] + [CEReactions, Throws] Node removeChild(Node child); }; + +dictionary GetRootNodeOptions { + boolean composed = false; +}; diff --git a/components/script/dom/webidls/NodeFilter.webidl b/components/script/dom/webidls/NodeFilter.webidl index 79d059e393e..95e718ff771 100644 --- a/components/script/dom/webidls/NodeFilter.webidl +++ b/components/script/dom/webidls/NodeFilter.webidl @@ -1,12 +1,13 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://dom.spec.whatwg.org/#interface-nodefilter */ // Import from http://hg.mozilla.org/mozilla-central/file/a5a720259d79/dom/webidl/NodeFilter.webidl +[Exposed=Window] callback interface NodeFilter { // Constants for acceptNode() const unsigned short FILTER_ACCEPT = 1; diff --git a/components/script/dom/webidls/NodeIterator.webidl b/components/script/dom/webidls/NodeIterator.webidl index 636e7ed2943..9c9e1f41e80 100644 --- a/components/script/dom/webidls/NodeIterator.webidl +++ b/components/script/dom/webidls/NodeIterator.webidl @@ -1,11 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * https://dom.spec.whatwg.org/#nodeiterator */ // Import from http://hg.mozilla.org/mozilla-central/raw-file/a5a720259d79/dom/webidl/NodeIterator.webidl +[Exposed=Window] interface NodeIterator { [SameObject] readonly attribute Node root; diff --git a/components/script/dom/webidls/NodeList.webidl b/components/script/dom/webidls/NodeList.webidl index 2f959aed6e3..8ce65efb802 100644 --- a/components/script/dom/webidls/NodeList.webidl +++ b/components/script/dom/webidls/NodeList.webidl @@ -1,11 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is: * https://dom.spec.whatwg.org/#interface-nodelist */ +[Exposed=Window] interface NodeList { [Pure] getter Node? item(unsigned long index); diff --git a/components/script/dom/webidls/NonElementParentNode.webidl b/components/script/dom/webidls/NonElementParentNode.webidl index 02cc35cbe18..2d2c18c368e 100644 --- a/components/script/dom/webidls/NonElementParentNode.webidl +++ b/components/script/dom/webidls/NonElementParentNode.webidl @@ -1,10 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://dom.spec.whatwg.org/#nonelementparentnode -[NoInterfaceObject] -interface NonElementParentNode { +interface mixin NonElementParentNode { [Pure] Element? getElementById(DOMString elementId); }; diff --git a/components/script/dom/webidls/OESElementIndexUint.webidl b/components/script/dom/webidls/OESElementIndexUint.webidl new file mode 100644 index 00000000000..01a441e9946 --- /dev/null +++ b/components/script/dom/webidls/OESElementIndexUint.webidl @@ -0,0 +1,11 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/OES_element_index_uint/ + */ + +[NoInterfaceObject, Exposed=Window] +interface OESElementIndexUint { +}; diff --git a/components/script/dom/webidls/OESStandardDerivatives.webidl b/components/script/dom/webidls/OESStandardDerivatives.webidl new file mode 100644 index 00000000000..0e4c51e4df3 --- /dev/null +++ b/components/script/dom/webidls/OESStandardDerivatives.webidl @@ -0,0 +1,12 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/ + */ + +[NoInterfaceObject, Exposed=Window] +interface OESStandardDerivatives { + const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B; +}; diff --git a/components/script/dom/webidls/OESTextureFloat.webidl b/components/script/dom/webidls/OESTextureFloat.webidl new file mode 100644 index 00000000000..f053a405977 --- /dev/null +++ b/components/script/dom/webidls/OESTextureFloat.webidl @@ -0,0 +1,11 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/OES_texture_float/ + */ + +[NoInterfaceObject, Exposed=Window] +interface OESTextureFloat { +}; diff --git a/components/script/dom/webidls/OESTextureFloatLinear.webidl b/components/script/dom/webidls/OESTextureFloatLinear.webidl new file mode 100644 index 00000000000..f0abf5a1aac --- /dev/null +++ b/components/script/dom/webidls/OESTextureFloatLinear.webidl @@ -0,0 +1,11 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/OES_texture_float_linear/ + */ + +[NoInterfaceObject, Exposed=Window] +interface OESTextureFloatLinear { +}; diff --git a/components/script/dom/webidls/OESTextureHalfFloat.webidl b/components/script/dom/webidls/OESTextureHalfFloat.webidl new file mode 100644 index 00000000000..cba71c8cb56 --- /dev/null +++ b/components/script/dom/webidls/OESTextureHalfFloat.webidl @@ -0,0 +1,12 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/ + */ + +[NoInterfaceObject, Exposed=Window] +interface OESTextureHalfFloat { + const GLenum HALF_FLOAT_OES = 0x8D61; +}; diff --git a/components/script/dom/webidls/OESTextureHalfFloatLinear.webidl b/components/script/dom/webidls/OESTextureHalfFloatLinear.webidl new file mode 100644 index 00000000000..61454dd9cdb --- /dev/null +++ b/components/script/dom/webidls/OESTextureHalfFloatLinear.webidl @@ -0,0 +1,11 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float_linear/ + */ + +[NoInterfaceObject, Exposed=Window] +interface OESTextureHalfFloatLinear { +}; diff --git a/components/script/dom/webidls/OESVertexArrayObject.webidl b/components/script/dom/webidls/OESVertexArrayObject.webidl new file mode 100644 index 00000000000..21c59fd7a88 --- /dev/null +++ b/components/script/dom/webidls/OESVertexArrayObject.webidl @@ -0,0 +1,17 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/ + */ + +[NoInterfaceObject, Exposed=Window] +interface OESVertexArrayObject { + const unsigned long VERTEX_ARRAY_BINDING_OES = 0x85B5; + + WebGLVertexArrayObjectOES? createVertexArrayOES(); + void deleteVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject); + boolean isVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject); + void bindVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject); +}; diff --git a/components/script/dom/webidls/OfflineAudioCompletionEvent.webidl b/components/script/dom/webidls/OfflineAudioCompletionEvent.webidl new file mode 100644 index 00000000000..aa63fe22156 --- /dev/null +++ b/components/script/dom/webidls/OfflineAudioCompletionEvent.webidl @@ -0,0 +1,17 @@ +/* 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/. */ +/* + * For more information on this interface please see + * https://webaudio.github.io/web-audio-api/#offlineaudiocompletionevent + */ + +dictionary OfflineAudioCompletionEventInit : EventInit { + required AudioBuffer renderedBuffer; +}; + +[Exposed=Window] +interface OfflineAudioCompletionEvent : Event { + [Throws] constructor(DOMString type, OfflineAudioCompletionEventInit eventInitDict); + readonly attribute AudioBuffer renderedBuffer; +}; diff --git a/components/script/dom/webidls/OfflineAudioContext.webidl b/components/script/dom/webidls/OfflineAudioContext.webidl new file mode 100644 index 00000000000..ff2d923a096 --- /dev/null +++ b/components/script/dom/webidls/OfflineAudioContext.webidl @@ -0,0 +1,24 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#OfflineAudioContext + */ + +dictionary OfflineAudioContextOptions { + unsigned long numberOfChannels = 1; + required unsigned long length; + required float sampleRate; +}; + +[Exposed=Window] +interface OfflineAudioContext : BaseAudioContext { + [Throws] constructor(OfflineAudioContextOptions contextOptions); + [Throws] constructor(unsigned long numberOfChannels, unsigned long length, float sampleRate); + readonly attribute unsigned long length; + attribute EventHandler oncomplete; + + Promise<AudioBuffer> startRendering(); +// Promise<void> suspend(double suspendTime); +}; diff --git a/components/script/dom/webidls/OffscreenCanvas.webidl b/components/script/dom/webidls/OffscreenCanvas.webidl new file mode 100644 index 00000000000..8bb87b178f9 --- /dev/null +++ b/components/script/dom/webidls/OffscreenCanvas.webidl @@ -0,0 +1,25 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#the-offscreencanvas-interface +typedef (OffscreenCanvasRenderingContext2D or WebGLRenderingContext or WebGL2RenderingContext) +OffscreenRenderingContext; + +dictionary ImageEncodeOptions { + DOMString type = "image/png"; + unrestricted double quality = 1.0; +}; + +//enum OffscreenRenderingContextId { "2d", "webgl", "webgl2" }; + +[Exposed=(Window,Worker)/*, Transferable*/, Pref="dom.offscreen_canvas.enabled"] +interface OffscreenCanvas : EventTarget { + [Throws] constructor([EnforceRange] unsigned long long width, [EnforceRange] unsigned long long height); + attribute /*[EnforceRange]*/ unsigned long long width; + attribute /*[EnforceRange]*/ unsigned long long height; + + OffscreenRenderingContext? getContext(DOMString contextId, optional any options = null); + //ImageBitmap transferToImageBitmap(); + //Promise<Blob> convertToBlob(optional ImageEncodeOptions options); +}; diff --git a/components/script/dom/webidls/OffscreenCanvasRenderingContext2D.webidl b/components/script/dom/webidls/OffscreenCanvasRenderingContext2D.webidl new file mode 100644 index 00000000000..c129bfa8e47 --- /dev/null +++ b/components/script/dom/webidls/OffscreenCanvasRenderingContext2D.webidl @@ -0,0 +1,30 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#the-offscreen-2d-rendering-context +[Exposed=(Window,Worker), Pref="dom.offscreen_canvas.enabled"] +interface OffscreenCanvasRenderingContext2D { + //void commit(); + readonly attribute OffscreenCanvas canvas; +}; +OffscreenCanvasRenderingContext2D includes CanvasState; +OffscreenCanvasRenderingContext2D includes CanvasCompositing; +OffscreenCanvasRenderingContext2D includes CanvasImageSmoothing; +OffscreenCanvasRenderingContext2D includes CanvasFillStrokeStyles; +OffscreenCanvasRenderingContext2D includes CanvasShadowStyles; +OffscreenCanvasRenderingContext2D includes CanvasFilters; +OffscreenCanvasRenderingContext2D includes CanvasRect; + +OffscreenCanvasRenderingContext2D includes CanvasTransform; +OffscreenCanvasRenderingContext2D includes CanvasDrawPath; +OffscreenCanvasRenderingContext2D includes CanvasText; +OffscreenCanvasRenderingContext2D includes CanvasDrawImage; +OffscreenCanvasRenderingContext2D includes CanvasImageData; +OffscreenCanvasRenderingContext2D includes CanvasPathDrawingStyles; +OffscreenCanvasRenderingContext2D includes CanvasTextDrawingStyles; +OffscreenCanvasRenderingContext2D includes CanvasPath; + + + + diff --git a/components/script/dom/webidls/OscillatorNode.webidl b/components/script/dom/webidls/OscillatorNode.webidl new file mode 100644 index 00000000000..f2b4c215561 --- /dev/null +++ b/components/script/dom/webidls/OscillatorNode.webidl @@ -0,0 +1,34 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#oscillatornode + */ + +enum OscillatorType { + "sine", + "square", + "sawtooth", + "triangle", + "custom" +}; + +dictionary OscillatorOptions : AudioNodeOptions { + OscillatorType type = "sine"; + float frequency = 440; + float detune = 0; + // PeriodicWave periodicWave; +}; + +[Exposed=Window] +interface OscillatorNode : AudioScheduledSourceNode { + [Throws] constructor(BaseAudioContext context, optional OscillatorOptions options = {}); + [SetterThrows] + attribute OscillatorType type; + + readonly attribute AudioParam frequency; + readonly attribute AudioParam detune; + +// void setPeriodicWave (PeriodicWave periodicWave); +}; diff --git a/components/script/dom/webidls/PageTransitionEvent.webidl b/components/script/dom/webidls/PageTransitionEvent.webidl index a23f3099bad..000818f1a30 100644 --- a/components/script/dom/webidls/PageTransitionEvent.webidl +++ b/components/script/dom/webidls/PageTransitionEvent.webidl @@ -1,11 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#the-pagetransitionevent-interface -[Constructor(DOMString type, optional PageTransitionEventInit eventInitDict), - Exposed=Window] +[Exposed=Window] interface PageTransitionEvent : Event { + [Throws] constructor(DOMString type, optional PageTransitionEventInit eventInitDict = {}); readonly attribute boolean persisted; }; diff --git a/components/script/dom/webidls/PaintRenderingContext2D.webidl b/components/script/dom/webidls/PaintRenderingContext2D.webidl new file mode 100644 index 00000000000..bc415450358 --- /dev/null +++ b/components/script/dom/webidls/PaintRenderingContext2D.webidl @@ -0,0 +1,19 @@ +/* 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/. */ + +// https://drafts.css-houdini.org/css-paint-api/#paintrenderingcontext2d +[Pref="dom.worklet.enabled", Exposed=PaintWorklet] +interface PaintRenderingContext2D { +}; +PaintRenderingContext2D includes CanvasState; +PaintRenderingContext2D includes CanvasTransform; +PaintRenderingContext2D includes CanvasCompositing; +PaintRenderingContext2D includes CanvasImageSmoothing; +PaintRenderingContext2D includes CanvasFillStrokeStyles; +PaintRenderingContext2D includes CanvasShadowStyles; +PaintRenderingContext2D includes CanvasRect; +PaintRenderingContext2D includes CanvasDrawPath; +PaintRenderingContext2D includes CanvasDrawImage; +PaintRenderingContext2D includes CanvasPathDrawingStyles; +PaintRenderingContext2D includes CanvasPath; diff --git a/components/script/dom/webidls/PaintSize.webidl b/components/script/dom/webidls/PaintSize.webidl new file mode 100644 index 00000000000..ed1b46d29f4 --- /dev/null +++ b/components/script/dom/webidls/PaintSize.webidl @@ -0,0 +1,10 @@ +/* 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/. */ + +// https://drafts.css-houdini.org/css-paint-api/#paintsize +[Pref="dom.worklet.enabled", Exposed=PaintWorklet] +interface PaintSize { + readonly attribute double width; + readonly attribute double height; +}; diff --git a/components/script/dom/webidls/PaintWorkletGlobalScope.webidl b/components/script/dom/webidls/PaintWorkletGlobalScope.webidl new file mode 100644 index 00000000000..b80bf92dce5 --- /dev/null +++ b/components/script/dom/webidls/PaintWorkletGlobalScope.webidl @@ -0,0 +1,13 @@ +/* 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/. */ + +// https://drafts.css-houdini.org/css-paint-api/#paintworkletglobalscope +[Global=(Worklet,PaintWorklet), Pref="dom.worklet.enabled", Exposed=PaintWorklet] +interface PaintWorkletGlobalScope : WorkletGlobalScope { + [Throws] void registerPaint(DOMString name, VoidFunction paintCtor); + // This function is to be used only for testing, and should not be + // accessible outside of that use. + [Pref="dom.worklet.blockingsleep.enabled"] + void sleep(unsigned long long ms); +}; diff --git a/components/script/dom/webidls/PannerNode.webidl b/components/script/dom/webidls/PannerNode.webidl new file mode 100644 index 00000000000..c692a97e278 --- /dev/null +++ b/components/script/dom/webidls/PannerNode.webidl @@ -0,0 +1,56 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#pannernode + */ + +dictionary PannerOptions : AudioNodeOptions { + PanningModelType panningModel = "equalpower"; + DistanceModelType distanceModel = "inverse"; + float positionX = 0; + float positionY = 0; + float positionZ = 0; + float orientationX = 1; + float orientationY = 0; + float orientationZ = 0; + double refDistance = 1; + double maxDistance = 10000; + double rolloffFactor = 1; + double coneInnerAngle = 360; + double coneOuterAngle = 360; + double coneOuterGain = 0; +}; + +enum DistanceModelType { + "linear", + "inverse", + "exponential" +}; + +enum PanningModelType { + "equalpower", + "HRTF" +}; + +[Exposed=Window] +interface PannerNode : AudioNode { + [Throws] constructor(BaseAudioContext context, optional PannerOptions options = {}); + attribute PanningModelType panningModel; + readonly attribute AudioParam positionX; + readonly attribute AudioParam positionY; + readonly attribute AudioParam positionZ; + readonly attribute AudioParam orientationX; + readonly attribute AudioParam orientationY; + readonly attribute AudioParam orientationZ; + attribute DistanceModelType distanceModel; + [SetterThrows] attribute double refDistance; + [SetterThrows] attribute double maxDistance; + [SetterThrows] attribute double rolloffFactor; + attribute double coneInnerAngle; + attribute double coneOuterAngle; + [SetterThrows] attribute double coneOuterGain; + void setPosition (float x, float y, float z); + void setOrientation (float x, float y, float z); +}; diff --git a/components/script/dom/webidls/ParentNode.webidl b/components/script/dom/webidls/ParentNode.webidl index 84da03e3643..a7bcc64cd23 100644 --- a/components/script/dom/webidls/ParentNode.webidl +++ b/components/script/dom/webidls/ParentNode.webidl @@ -1,13 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://dom.spec.whatwg.org/#interface-parentnode */ -[NoInterfaceObject] -interface ParentNode { +interface mixin ParentNode { [SameObject] readonly attribute HTMLCollection children; [Pure] @@ -17,10 +16,12 @@ interface ParentNode { [Pure] readonly attribute unsigned long childElementCount; - [Throws, Unscopable] + [CEReactions, Throws, Unscopable] void prepend((Node or DOMString)... nodes); - [Throws, Unscopable] + [CEReactions, Throws, Unscopable] void append((Node or DOMString)... nodes); + [CEReactions, Throws, Unscopable] + void replaceChildren((Node or DOMString)... nodes); [Pure, Throws] Element? querySelector(DOMString selectors); diff --git a/components/script/dom/webidls/Performance.webidl b/components/script/dom/webidls/Performance.webidl index 6aeaa6d11aa..5db6551ff96 100644 --- a/components/script/dom/webidls/Performance.webidl +++ b/components/script/dom/webidls/Performance.webidl @@ -1,19 +1,53 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is - * https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html#sec-window.performance-attribute + * https://w3c.github.io/hr-time/#sec-performance */ typedef double DOMHighResTimeStamp; +typedef sequence<PerformanceEntry> PerformanceEntryList; +[Exposed=(Window, Worker)] +interface Performance : EventTarget { + DOMHighResTimeStamp now(); + readonly attribute DOMHighResTimeStamp timeOrigin; + [Default] object toJSON(); +}; + +// https://w3c.github.io/performance-timeline/#extensions-to-the-performance-interface +[Exposed=(Window, Worker)] +partial interface Performance { + PerformanceEntryList getEntries(); + PerformanceEntryList getEntriesByType(DOMString type); + PerformanceEntryList getEntriesByName(DOMString name, + optional DOMString type); +}; + +// https://w3c.github.io/user-timing/#extensions-performance-interface [Exposed=(Window,Worker)] -interface Performance { - readonly attribute PerformanceTiming timing; - /* readonly attribute PerformanceNavigation navigation; */ +partial interface Performance { + [Throws] + void mark(DOMString markName); + void clearMarks(optional DOMString markName); + [Throws] + void measure(DOMString measureName, optional DOMString startMark, optional DOMString endMark); + void clearMeasures(optional DOMString measureName); }; +//https://w3c.github.io/resource-timing/#sec-extensions-performance-interface partial interface Performance { - DOMHighResTimeStamp now(); + void clearResourceTimings (); + void setResourceTimingBufferSize (unsigned long maxSize); + attribute EventHandler onresourcetimingbufferfull; +}; + +// https://w3c.github.io/navigation-timing/#extensions-to-the-performance-interface +[Exposed=Window] +partial interface Performance { + [SameObject] + readonly attribute PerformanceNavigationTiming timing; + [SameObject] + readonly attribute PerformanceNavigation navigation; }; diff --git a/components/script/dom/webidls/PerformanceEntry.webidl b/components/script/dom/webidls/PerformanceEntry.webidl new file mode 100644 index 00000000000..5f6fee1cabd --- /dev/null +++ b/components/script/dom/webidls/PerformanceEntry.webidl @@ -0,0 +1,16 @@ +/* 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/. + * + * The origin of this IDL file is + * https://w3c.github.io/performance-timeline/#the-performanceentry-interface + */ + +[Exposed=(Window,Worker)] +interface PerformanceEntry { + readonly attribute DOMString name; + readonly attribute DOMString entryType; + readonly attribute DOMHighResTimeStamp startTime; + readonly attribute DOMHighResTimeStamp duration; + [Default] object toJSON(); +}; diff --git a/components/script/dom/webidls/PerformanceMark.webidl b/components/script/dom/webidls/PerformanceMark.webidl new file mode 100644 index 00000000000..43783454865 --- /dev/null +++ b/components/script/dom/webidls/PerformanceMark.webidl @@ -0,0 +1,11 @@ +/* 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/. + * + * The origin of this IDL file is + * https://w3c.github.io/user-timing/#performancemark + */ + +[Exposed=(Window,Worker)] +interface PerformanceMark : PerformanceEntry { +}; diff --git a/components/script/dom/webidls/PerformanceMeasure.webidl b/components/script/dom/webidls/PerformanceMeasure.webidl new file mode 100644 index 00000000000..8a1469fa68d --- /dev/null +++ b/components/script/dom/webidls/PerformanceMeasure.webidl @@ -0,0 +1,11 @@ +/* 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/. + * + * The origin of this IDL file is + * https://w3c.github.io/user-timing/#performancemeasure + */ + +[Exposed=(Window,Worker)] +interface PerformanceMeasure : PerformanceEntry { +}; diff --git a/components/script/dom/webidls/PerformanceNavigation.webidl b/components/script/dom/webidls/PerformanceNavigation.webidl new file mode 100644 index 00000000000..3e5cba196f6 --- /dev/null +++ b/components/script/dom/webidls/PerformanceNavigation.webidl @@ -0,0 +1,18 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://w3c.github.io/navigation-timing/#the-performancenavigation-interface + */ + +[Exposed=Window] +interface PerformanceNavigation { + const unsigned short TYPE_NAVIGATE = 0; + const unsigned short TYPE_RELOAD = 1; + const unsigned short TYPE_BACK_FORWARD = 2; + const unsigned short TYPE_RESERVED = 255; + readonly attribute unsigned short type; + readonly attribute unsigned short redirectCount; + [Default] object toJSON(); +}; diff --git a/components/script/dom/webidls/PerformanceNavigationTiming.webidl b/components/script/dom/webidls/PerformanceNavigationTiming.webidl new file mode 100644 index 00000000000..5e369b4eb91 --- /dev/null +++ b/components/script/dom/webidls/PerformanceNavigationTiming.webidl @@ -0,0 +1,32 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://w3c.github.io/navigation-timing/#dom-performancenavigationtiming + */ + +enum NavigationType { + "navigate", + "reload", + "back_forward", + "prerender" +}; + +[Exposed=Window] +interface PerformanceNavigationTiming : PerformanceResourceTiming { + readonly attribute DOMHighResTimeStamp unloadEventStart; + readonly attribute DOMHighResTimeStamp unloadEventEnd; + readonly attribute DOMHighResTimeStamp domInteractive; + readonly attribute DOMHighResTimeStamp domContentLoadedEventStart; + readonly attribute DOMHighResTimeStamp domContentLoadedEventEnd; + readonly attribute DOMHighResTimeStamp domComplete; + readonly attribute DOMHighResTimeStamp loadEventStart; + readonly attribute DOMHighResTimeStamp loadEventEnd; + readonly attribute NavigationType type; + readonly attribute unsigned short redirectCount; + [Default] object toJSON(); + /* Servo-only attribute for measuring when the top-level document (not iframes) is complete. */ + [Pref="dom.testperf.enabled"] + readonly attribute DOMHighResTimeStamp topLevelDomComplete; +}; diff --git a/components/script/dom/webidls/PerformanceObserver.webidl b/components/script/dom/webidls/PerformanceObserver.webidl new file mode 100644 index 00000000000..db511a7b4b7 --- /dev/null +++ b/components/script/dom/webidls/PerformanceObserver.webidl @@ -0,0 +1,26 @@ +/* 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/. + * + * The origin of this IDL file is + * https://w3c.github.io/performance-timeline/#the-performanceobserver-interface + */ + +dictionary PerformanceObserverInit { + sequence<DOMString> entryTypes; + DOMString type; + boolean buffered; +}; + +callback PerformanceObserverCallback = void (PerformanceObserverEntryList entries, PerformanceObserver observer); + +[Exposed=(Window,Worker)] +interface PerformanceObserver { + [Throws] constructor(PerformanceObserverCallback callback); + [Throws] + void observe(optional PerformanceObserverInit options = {}); + void disconnect(); + PerformanceEntryList takeRecords(); + // codegen doesn't like SameObject+static and doesn't know FrozenArray + /*[SameObject]*/ static readonly attribute /*FrozenArray<DOMString>*/ any supportedEntryTypes; +}; diff --git a/components/script/dom/webidls/PerformanceObserverEntryList.webidl b/components/script/dom/webidls/PerformanceObserverEntryList.webidl new file mode 100644 index 00000000000..fc29226714c --- /dev/null +++ b/components/script/dom/webidls/PerformanceObserverEntryList.webidl @@ -0,0 +1,15 @@ +/* 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/. + * + * The origin of this IDL file is + * https://w3c.github.io/performance-timeline/#performanceobserverentrylist-interface + */ + +[Exposed=(Window,Worker)] +interface PerformanceObserverEntryList { + PerformanceEntryList getEntries(); + PerformanceEntryList getEntriesByType(DOMString entryType); + PerformanceEntryList getEntriesByName(DOMString name, + optional DOMString entryType); +}; diff --git a/components/script/dom/webidls/PerformancePaintTiming.webidl b/components/script/dom/webidls/PerformancePaintTiming.webidl new file mode 100644 index 00000000000..207e5c405ad --- /dev/null +++ b/components/script/dom/webidls/PerformancePaintTiming.webidl @@ -0,0 +1,11 @@ +/* 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/. + * + * The origin of this IDL file is + * https://wicg.github.io/paint-timing/#sec-PerformancePaintTiming + */ + +[Exposed=(Window,Worker)] +interface PerformancePaintTiming : PerformanceEntry { +}; diff --git a/components/script/dom/webidls/PerformanceResourceTiming.webidl b/components/script/dom/webidls/PerformanceResourceTiming.webidl new file mode 100644 index 00000000000..50a6dba1416 --- /dev/null +++ b/components/script/dom/webidls/PerformanceResourceTiming.webidl @@ -0,0 +1,30 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://w3c.github.io/resource-timing/ + */ + +// https://w3c.github.io/resource-timing/#sec-performanceresourcetiming +[Exposed=(Window,Worker)] +interface PerformanceResourceTiming : PerformanceEntry { + readonly attribute DOMString initiatorType; + readonly attribute DOMString nextHopProtocol; + // readonly attribute DOMHighResTimeStamp workerStart; + readonly attribute DOMHighResTimeStamp redirectStart; + readonly attribute DOMHighResTimeStamp redirectEnd; + readonly attribute DOMHighResTimeStamp fetchStart; + readonly attribute DOMHighResTimeStamp domainLookupStart; + readonly attribute DOMHighResTimeStamp domainLookupEnd; + readonly attribute DOMHighResTimeStamp connectStart; + readonly attribute DOMHighResTimeStamp connectEnd; + readonly attribute DOMHighResTimeStamp secureConnectionStart; + readonly attribute DOMHighResTimeStamp requestStart; + readonly attribute DOMHighResTimeStamp responseStart; + readonly attribute DOMHighResTimeStamp responseEnd; + readonly attribute unsigned long long transferSize; + readonly attribute unsigned long long encodedBodySize; + readonly attribute unsigned long long decodedBodySize; + [Default] object toJSON(); +}; diff --git a/components/script/dom/webidls/PerformanceTiming.webidl b/components/script/dom/webidls/PerformanceTiming.webidl deleted file mode 100644 index 2728bcd48d5..00000000000 --- a/components/script/dom/webidls/PerformanceTiming.webidl +++ /dev/null @@ -1,32 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ -/* - * The origin of this IDL file is - * https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html#sec-navigation-timing-interface - */ - -[Exposed=(Window,Worker)] -interface PerformanceTiming { - readonly attribute unsigned long long navigationStart; - /* readonly attribute unsigned long long unloadEventStart; - readonly attribute unsigned long long unloadEventEnd; - readonly attribute unsigned long long redirectStart; - readonly attribute unsigned long long redirectEnd; - readonly attribute unsigned long long fetchStart; - readonly attribute unsigned long long domainLookupStart; - readonly attribute unsigned long long domainLookupEnd; - readonly attribute unsigned long long connectStart; - readonly attribute unsigned long long connectEnd; - readonly attribute unsigned long long secureConnectionStart; - readonly attribute unsigned long long requestStart; - readonly attribute unsigned long long responseStart; - readonly attribute unsigned long long responseEnd; */ - readonly attribute unsigned long long domLoading; - readonly attribute unsigned long long domInteractive; - readonly attribute unsigned long long domContentLoadedEventStart; - readonly attribute unsigned long long domContentLoadedEventEnd; - readonly attribute unsigned long long domComplete; - readonly attribute unsigned long long loadEventStart; - readonly attribute unsigned long long loadEventEnd; -}; diff --git a/components/script/dom/webidls/PermissionStatus.webidl b/components/script/dom/webidls/PermissionStatus.webidl index 9fb1a5ce966..83c0371e0de 100644 --- a/components/script/dom/webidls/PermissionStatus.webidl +++ b/components/script/dom/webidls/PermissionStatus.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/permissions/#permissionstatus diff --git a/components/script/dom/webidls/Permissions.webidl b/components/script/dom/webidls/Permissions.webidl index 56841956e8d..5b4092cc645 100644 --- a/components/script/dom/webidls/Permissions.webidl +++ b/components/script/dom/webidls/Permissions.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/permissions/#permissions-interface diff --git a/components/script/dom/webidls/Plugin.webidl b/components/script/dom/webidls/Plugin.webidl index accf5de1ce3..4c03636fabe 100644 --- a/components/script/dom/webidls/Plugin.webidl +++ b/components/script/dom/webidls/Plugin.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#dom-plugin [LegacyUnenumerableNamedProperties, Exposed=Window] diff --git a/components/script/dom/webidls/PluginArray.webidl b/components/script/dom/webidls/PluginArray.webidl index bc2e963ee24..09883cbfad4 100644 --- a/components/script/dom/webidls/PluginArray.webidl +++ b/components/script/dom/webidls/PluginArray.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#pluginarray [LegacyUnenumerableNamedProperties, Exposed=Window] diff --git a/components/script/dom/webidls/PopStateEvent.webidl b/components/script/dom/webidls/PopStateEvent.webidl index 4508cac6288..deb398abb3d 100644 --- a/components/script/dom/webidls/PopStateEvent.webidl +++ b/components/script/dom/webidls/PopStateEvent.webidl @@ -1,11 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#the-popstateevent-interface -[Constructor(DOMString type, optional PopStateEventInit eventInitDict), - Exposed=Window] +[Exposed=Window] interface PopStateEvent : Event { + [Throws] constructor(DOMString type, optional PopStateEventInit eventInitDict = {}); readonly attribute any state; }; diff --git a/components/script/dom/webidls/ProcessingInstruction.webidl b/components/script/dom/webidls/ProcessingInstruction.webidl index 734d43ebe5a..b3641badf1f 100644 --- a/components/script/dom/webidls/ProcessingInstruction.webidl +++ b/components/script/dom/webidls/ProcessingInstruction.webidl @@ -1,11 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://dom.spec.whatwg.org/#interface-processinginstruction */ +[Exposed=Window] interface ProcessingInstruction : CharacterData { [Constant] readonly attribute DOMString target; diff --git a/components/script/dom/webidls/ProgressEvent.webidl b/components/script/dom/webidls/ProgressEvent.webidl index 0c518822ef4..17d066ef187 100644 --- a/components/script/dom/webidls/ProgressEvent.webidl +++ b/components/script/dom/webidls/ProgressEvent.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://xhr.spec.whatwg.org/#interface-progressevent @@ -12,9 +12,9 @@ * http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0. */ -[Constructor(DOMString type, optional ProgressEventInit eventInitDict), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface ProgressEvent : Event { + [Throws] constructor(DOMString type, optional ProgressEventInit eventInitDict = {}); readonly attribute boolean lengthComputable; readonly attribute unsigned long long loaded; readonly attribute unsigned long long total; diff --git a/components/script/dom/webidls/Promise.webidl b/components/script/dom/webidls/Promise.webidl index 5897ff422f9..6cfbfb68bb0 100644 --- a/components/script/dom/webidls/Promise.webidl +++ b/components/script/dom/webidls/Promise.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // This interface is entirely internal to Servo, and should not be accessible to // web pages. diff --git a/components/script/dom/webidls/PromiseNativeHandler.webidl b/components/script/dom/webidls/PromiseNativeHandler.webidl index caa1692dfd3..7d5f35e3223 100644 --- a/components/script/dom/webidls/PromiseNativeHandler.webidl +++ b/components/script/dom/webidls/PromiseNativeHandler.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // This interface is entirely internal to Servo, and should not be accessible to // web pages. diff --git a/components/script/dom/webidls/PromiseRejectionEvent.webidl b/components/script/dom/webidls/PromiseRejectionEvent.webidl new file mode 100644 index 00000000000..70d11b1ff33 --- /dev/null +++ b/components/script/dom/webidls/PromiseRejectionEvent.webidl @@ -0,0 +1,17 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#the-promiserejectionevent-interface + +[Exposed=(Window,Worker)] +interface PromiseRejectionEvent : Event { + [Throws] constructor(DOMString type, PromiseRejectionEventInit eventInitDict); + readonly attribute Promise<any> promise; + readonly attribute any reason; +}; + +dictionary PromiseRejectionEventInit : EventInit { + required Promise<any> promise; + any reason; +}; diff --git a/components/script/dom/webidls/RTCDataChannel.webidl b/components/script/dom/webidls/RTCDataChannel.webidl new file mode 100644 index 00000000000..cdc3b9fdd48 --- /dev/null +++ b/components/script/dom/webidls/RTCDataChannel.webidl @@ -0,0 +1,49 @@ +/* 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/. */ + +// https://w3c.github.io/webrtc-pc/#dom-rtcdatachannel + +[Exposed=Window, Pref="dom.webrtc.enabled"] +interface RTCDataChannel : EventTarget { + readonly attribute USVString label; + readonly attribute boolean ordered; + readonly attribute unsigned short? maxPacketLifeTime; + readonly attribute unsigned short? maxRetransmits; + readonly attribute USVString protocol; + readonly attribute boolean negotiated; + readonly attribute unsigned short? id; + readonly attribute RTCDataChannelState readyState; + //readonly attribute unsigned long bufferedAmount; + //attribute unsigned long bufferedAmountLowThreshold; + attribute EventHandler onopen; + attribute EventHandler onbufferedamountlow; + attribute EventHandler onerror; + attribute EventHandler onclosing; + attribute EventHandler onclose; + void close(); + attribute EventHandler onmessage; + [SetterThrows] attribute DOMString binaryType; + [Throws] void send(USVString data); + [Throws] void send(Blob data); + [Throws] void send(ArrayBuffer data); + [Throws] void send(ArrayBufferView data); +}; + +// https://www.w3.org/TR/webrtc/#dom-rtcdatachannelinit +dictionary RTCDataChannelInit { + boolean ordered = true; + unsigned short maxPacketLifeTime; + unsigned short maxRetransmits; + USVString protocol = ""; + boolean negotiated = false; + unsigned short id; +}; + +// https://www.w3.org/TR/webrtc/#dom-rtcdatachannelstate +enum RTCDataChannelState { + "connecting", + "open", + "closing", + "closed" +}; diff --git a/components/script/dom/webidls/RTCDataChannelEvent.webidl b/components/script/dom/webidls/RTCDataChannelEvent.webidl new file mode 100644 index 00000000000..bc564a12138 --- /dev/null +++ b/components/script/dom/webidls/RTCDataChannelEvent.webidl @@ -0,0 +1,15 @@ +/* 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/. */ + +// https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelevent + +[Exposed=Window, Pref="dom.webrtc.enabled"] +interface RTCDataChannelEvent : Event { + constructor(DOMString type, RTCDataChannelEventInit eventInitDict); + readonly attribute RTCDataChannel channel; +}; + +dictionary RTCDataChannelEventInit : EventInit { + required RTCDataChannel channel; +}; diff --git a/components/script/dom/webidls/RTCError.webidl b/components/script/dom/webidls/RTCError.webidl new file mode 100644 index 00000000000..f7ffa3d2d57 --- /dev/null +++ b/components/script/dom/webidls/RTCError.webidl @@ -0,0 +1,35 @@ +/* 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/. */ + +// https://w3c.github.io/webrtc-pc/#dom-rtcerror + +[Exposed=Window, Pref="dom.webrtc.enabled"] +interface RTCError : DOMException { + constructor(RTCErrorInit init, optional DOMString message = ""); + readonly attribute RTCErrorDetailType errorDetail; + readonly attribute long? sdpLineNumber; + readonly attribute long? httpRequestStatusCode; + readonly attribute long? sctpCauseCode; + readonly attribute unsigned long? receivedAlert; + readonly attribute unsigned long? sentAlert; +}; + +dictionary RTCErrorInit { + required RTCErrorDetailType errorDetail; + long sdpLineNumber; + long httpRequestStatusCode; + long sctpCauseCode; + unsigned long receivedAlert; + unsigned long sentAlert; +}; + +enum RTCErrorDetailType { + "data-channel-failure", + "dtls-failure", + "fingerprint-failure", + "sctp-failure", + "sdp-syntax-error", + "hardware-encoder-not-available", + "hardware-encoder-error" +}; diff --git a/components/script/dom/webidls/RTCErrorEvent.webidl b/components/script/dom/webidls/RTCErrorEvent.webidl new file mode 100644 index 00000000000..d3ac256744c --- /dev/null +++ b/components/script/dom/webidls/RTCErrorEvent.webidl @@ -0,0 +1,15 @@ +/* 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/. */ + +// https://w3c.github.io/webrtc-pc/#dom-rtcerrorevent + +[Exposed=Window, Pref="dom.webrtc.enabled"] +interface RTCErrorEvent : Event { + constructor(DOMString type, RTCErrorEventInit eventInitDict); + [SameObject] readonly attribute RTCError error; +}; + +dictionary RTCErrorEventInit : EventInit { + required RTCError error; +}; diff --git a/components/script/dom/webidls/RTCIceCandidate.webidl b/components/script/dom/webidls/RTCIceCandidate.webidl new file mode 100644 index 00000000000..fde0421c8c0 --- /dev/null +++ b/components/script/dom/webidls/RTCIceCandidate.webidl @@ -0,0 +1,33 @@ +/* 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/. */ + +// https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface + + +[Exposed=Window, Pref="dom.webrtc.enabled"] +interface RTCIceCandidate { + [Throws] constructor(optional RTCIceCandidateInit candidateInitDict = {}); + readonly attribute DOMString candidate; + readonly attribute DOMString? sdpMid; + readonly attribute unsigned short? sdpMLineIndex; + // readonly attribute DOMString? foundation; + // readonly attribute RTCIceComponent? component; + // readonly attribute unsigned long? priority; + // readonly attribute DOMString? address; + // readonly attribute RTCIceProtocol? protocol; + // readonly attribute unsigned short? port; + // readonly attribute RTCIceCandidateType? type; + // readonly attribute RTCIceTcpCandidateType? tcpType; + // readonly attribute DOMString? relatedAddress; + // readonly attribute unsigned short? relatedPort; + readonly attribute DOMString? usernameFragment; + RTCIceCandidateInit toJSON(); +}; + +dictionary RTCIceCandidateInit { + DOMString candidate = ""; + DOMString? sdpMid = null; + unsigned short? sdpMLineIndex = null; + DOMString usernameFragment; +}; diff --git a/components/script/dom/webidls/RTCPeerConnection.webidl b/components/script/dom/webidls/RTCPeerConnection.webidl new file mode 100644 index 00000000000..d75f2f9c14c --- /dev/null +++ b/components/script/dom/webidls/RTCPeerConnection.webidl @@ -0,0 +1,153 @@ +/* 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/. */ + +// https://w3c.github.io/webrtc-pc/#interface-definition + +[Exposed=Window, Pref="dom.webrtc.enabled"] +interface RTCPeerConnection : EventTarget { + [Throws] constructor(optional RTCConfiguration configuration = {}); + Promise<RTCSessionDescriptionInit> createOffer(optional RTCOfferOptions options = {}); + Promise<RTCSessionDescriptionInit> createAnswer(optional RTCAnswerOptions options = {}); + Promise<void> setLocalDescription(RTCSessionDescriptionInit description); + readonly attribute RTCSessionDescription? localDescription; + // readonly attribute RTCSessionDescription? currentLocalDescription; + // readonly attribute RTCSessionDescription? pendingLocalDescription; + Promise<void> setRemoteDescription(RTCSessionDescriptionInit description); + readonly attribute RTCSessionDescription? remoteDescription; + // readonly attribute RTCSessionDescription? currentRemoteDescription; + // readonly attribute RTCSessionDescription? pendingRemoteDescription; + Promise<void> addIceCandidate(optional RTCIceCandidateInit candidate = {}); + readonly attribute RTCSignalingState signalingState; + readonly attribute RTCIceGatheringState iceGatheringState; + readonly attribute RTCIceConnectionState iceConnectionState; + // readonly attribute RTCPeerConnectionState connectionState; + // readonly attribute boolean? canTrickleIceCandidates; + // static sequence<RTCIceServer> getDefaultIceServers(); + // RTCConfiguration getConfiguration(); + // void setConfiguration(RTCConfiguration configuration); + void close(); + attribute EventHandler onnegotiationneeded; + attribute EventHandler onicecandidate; + // attribute EventHandler onicecandidateerror; + attribute EventHandler onsignalingstatechange; + attribute EventHandler oniceconnectionstatechange; + attribute EventHandler onicegatheringstatechange; + // attribute EventHandler onconnectionstatechange; + + // removed from spec, but still shipped by browsers + void addStream (MediaStream stream); +}; + +dictionary RTCConfiguration { + sequence<RTCIceServer> iceServers; + RTCIceTransportPolicy iceTransportPolicy = "all"; + RTCBundlePolicy bundlePolicy = "balanced"; + RTCRtcpMuxPolicy rtcpMuxPolicy = "require"; + DOMString peerIdentity; + // sequence<RTCCertificate> certificates; + [EnforceRange] + octet iceCandidatePoolSize = 0; +}; + +enum RTCIceTransportPolicy { + "relay", + "all" +}; + +enum RTCBundlePolicy { + "balanced", + "max-compat", + "max-bundle" +}; + +enum RTCRtcpMuxPolicy { + // At risk due to lack of implementers' interest. + "negotiate", + "require" +}; + +dictionary RTCIceServer { + required (DOMString or sequence<DOMString>) urls; + DOMString username; + DOMString /*(DOMString or RTCOAuthCredential)*/ credential; + RTCIceCredentialType credentialType = "password"; +}; + +enum RTCIceCredentialType { + "password", + "oauth" +}; + +dictionary RTCOfferAnswerOptions { + boolean voiceActivityDetection = true; +}; + +dictionary RTCOfferOptions : RTCOfferAnswerOptions { + boolean iceRestart = false; +}; + +dictionary RTCAnswerOptions : RTCOfferAnswerOptions { +}; + +enum RTCIceGatheringState { + "new", + "gathering", + "complete" +}; + +enum RTCIceConnectionState { + "new", + "checking", + "connected", + "completed", + "disconnected", + "failed", + "closed" +}; + +enum RTCSignalingState { + "stable", + "have-local-offer", + "have-remote-offer", + "have-local-pranswer", + "have-remote-pranswer", + "closed" +}; + +dictionary RTCRtpCodingParameters { + DOMString rid; +}; + +dictionary RTCRtpEncodingParameters : RTCRtpCodingParameters { + boolean active = true; + unsigned long maxBitrate; + double scaleResolutionDownBy; +}; + +dictionary RTCRtpTransceiverInit { + RTCRtpTransceiverDirection direction = "sendrecv"; + sequence<MediaStream> streams = []; + sequence<RTCRtpEncodingParameters> sendEncodings = []; +}; + +partial interface RTCPeerConnection { + // sequence<RTCRtpSender> getSenders(); + // sequence<RTCRtpReceiver> getReceivers(); + // sequence<RTCRtpTransceiver> getTransceivers(); + // RTCRtpSender addTrack(MediaStreamTrack track, + // MediaStream... streams); + // void removeTrack(RTCRtpSender sender); + [Pref="dom.webrtc.transceiver.enabled"] + RTCRtpTransceiver addTransceiver((MediaStreamTrack or DOMString) trackOrKind, + optional RTCRtpTransceiverInit init = {}); + attribute EventHandler ontrack; +}; + +// https://www.w3.org/TR/webrtc/#rtcpeerconnection-interface-extensions-0 +partial interface RTCPeerConnection { + // readonly attribute RTCSctpTransport? sctp; + RTCDataChannel createDataChannel(USVString label, + optional RTCDataChannelInit dataChannelDict = {}); + attribute EventHandler ondatachannel; +}; diff --git a/components/script/dom/webidls/RTCPeerConnectionIceEvent.webidl b/components/script/dom/webidls/RTCPeerConnectionIceEvent.webidl new file mode 100644 index 00000000000..2ffd69cea50 --- /dev/null +++ b/components/script/dom/webidls/RTCPeerConnectionIceEvent.webidl @@ -0,0 +1,17 @@ +/* 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/. */ + +// https://w3c.github.io/webrtc-pc/#rtcpeerconnectioniceevent + +[Exposed=Window, Pref="dom.webrtc.enabled"] +interface RTCPeerConnectionIceEvent : Event { + [Throws] constructor(DOMString type, optional RTCPeerConnectionIceEventInit eventInitDict = {}); + readonly attribute RTCIceCandidate? candidate; + readonly attribute DOMString? url; +}; + +dictionary RTCPeerConnectionIceEventInit : EventInit { + RTCIceCandidate? candidate; + DOMString? url; +}; diff --git a/components/script/dom/webidls/RTCRtpSender.webidl b/components/script/dom/webidls/RTCRtpSender.webidl new file mode 100644 index 00000000000..d804b1bb3b7 --- /dev/null +++ b/components/script/dom/webidls/RTCRtpSender.webidl @@ -0,0 +1,47 @@ +/* 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/. */ + +// https://w3c.github.io/webrtc-pc/#dom-rtcrtpsender + +dictionary RTCRtpHeaderExtensionParameters { + required DOMString uri; + required unsigned short id; + boolean encrypted = false; +}; + +dictionary RTCRtcpParameters { + DOMString cname; + boolean reducedSize; +}; + +dictionary RTCRtpCodecParameters { + required octet payloadType; + required DOMString mimeType; + required unsigned long clockRate; + unsigned short channels; + DOMString sdpFmtpLine; +}; + +dictionary RTCRtpParameters { + required sequence<RTCRtpHeaderExtensionParameters> headerExtensions; + required RTCRtcpParameters rtcp; + required sequence<RTCRtpCodecParameters> codecs; +}; + +dictionary RTCRtpSendParameters : RTCRtpParameters { + required DOMString transactionId; + required sequence<RTCRtpEncodingParameters> encodings; +}; + +[Exposed=Window, Pref="dom.webrtc.transceiver.enabled"] +interface RTCRtpSender { + //readonly attribute MediaStreamTrack? track; + //readonly attribute RTCDtlsTransport? transport; + //static RTCRtpCapabilities? getCapabilities(DOMString kind); + Promise<void> setParameters(RTCRtpSendParameters parameters); + RTCRtpSendParameters getParameters(); + //Promise<void> replaceTrack(MediaStreamTrack? withTrack); + //void setStreams(MediaStream... streams); + //Promise<RTCStatsReport> getStats(); +}; diff --git a/components/script/dom/webidls/RTCRtpTransceiver.webidl b/components/script/dom/webidls/RTCRtpTransceiver.webidl new file mode 100644 index 00000000000..408c2708709 --- /dev/null +++ b/components/script/dom/webidls/RTCRtpTransceiver.webidl @@ -0,0 +1,24 @@ +/* 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/. */ + +// https://w3c.github.io/webrtc-pc/#rtcrtptransceiver-interface + +[Exposed=Window, Pref="dom.webrtc.transceiver.enabled"] +interface RTCRtpTransceiver { + //readonly attribute DOMString? mid; + [SameObject] readonly attribute RTCRtpSender sender; + //[SameObject] readonly attribute RTCRtpReceiver receiver; + attribute RTCRtpTransceiverDirection direction; + //readonly attribute RTCRtpTransceiverDirection? currentDirection; + //void stop(); + //void setCodecPreferences(sequence<RTCRtpCodecCapability> codecs); +}; + +enum RTCRtpTransceiverDirection { + "sendrecv", + "sendonly", + "recvonly", + "inactive", + "stopped" +}; diff --git a/components/script/dom/webidls/RTCSessionDescription.webidl b/components/script/dom/webidls/RTCSessionDescription.webidl new file mode 100644 index 00000000000..f13d0fd0d9f --- /dev/null +++ b/components/script/dom/webidls/RTCSessionDescription.webidl @@ -0,0 +1,25 @@ +/* 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/. */ + +// https://w3c.github.io/webrtc-pc/#rtcsessiondescription-class + +[Exposed=Window, Pref="dom.webrtc.enabled"] +interface RTCSessionDescription { + [Throws] constructor(RTCSessionDescriptionInit descriptionInitDict); + readonly attribute RTCSdpType type; + readonly attribute DOMString sdp; + [Default] object toJSON(); +}; + +dictionary RTCSessionDescriptionInit { + required RTCSdpType type; + DOMString sdp = ""; +}; + +enum RTCSdpType { + "offer", + "pranswer", + "answer", + "rollback" +}; diff --git a/components/script/dom/webidls/RTCTrackEvent.webidl b/components/script/dom/webidls/RTCTrackEvent.webidl new file mode 100644 index 00000000000..c2283e5a803 --- /dev/null +++ b/components/script/dom/webidls/RTCTrackEvent.webidl @@ -0,0 +1,23 @@ +/* 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/. */ + +// https://w3c.github.io/webrtc-pc/#dom-rtctrackevent + +[Exposed=Window, Pref="dom.webrtc.enabled"] +interface RTCTrackEvent : Event { + [Throws] constructor(DOMString type, RTCTrackEventInit eventInitDict); + // readonly attribute RTCRtpReceiver receiver; + readonly attribute MediaStreamTrack track; + // [SameObject] + // readonly attribute FrozenArray<MediaStream> streams; + // readonly attribute RTCRtpTransceiver transceiver; +}; + +// https://www.w3.org/TR/webrtc/#dom-rtctrackeventinit +dictionary RTCTrackEventInit : EventInit { + // required RTCRtpReceiver receiver; + required MediaStreamTrack track; + // sequence<MediaStream> streams = []; + // required RTCRtpTransceiver transceiver; +}; diff --git a/components/script/dom/webidls/RadioNodeList.webidl b/components/script/dom/webidls/RadioNodeList.webidl index 7168ea34551..6db8d2af353 100644 --- a/components/script/dom/webidls/RadioNodeList.webidl +++ b/components/script/dom/webidls/RadioNodeList.webidl @@ -1,8 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#radionodelist +[Exposed=Window] interface RadioNodeList : NodeList { attribute DOMString value; }; diff --git a/components/script/dom/webidls/Range.webidl b/components/script/dom/webidls/Range.webidl index 1daf2d8182f..84cd80da0ef 100644 --- a/components/script/dom/webidls/Range.webidl +++ b/components/script/dom/webidls/Range.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://dom.spec.whatwg.org/#range @@ -8,8 +8,9 @@ * http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom-view/Overview.html#extensions-to-the-range-interface */ -[Constructor] +[Exposed=Window] interface Range { + [Throws] constructor(); [Pure] readonly attribute Node startContainer; [Pure] @@ -47,15 +48,15 @@ interface Range { const unsigned short END_TO_START = 3; [Pure, Throws] short compareBoundaryPoints(unsigned short how, Range sourceRange); - [Throws] + [CEReactions, Throws] void deleteContents(); - [NewObject, Throws] + [CEReactions, NewObject, Throws] DocumentFragment extractContents(); - [NewObject, Throws] + [CEReactions, NewObject, Throws] DocumentFragment cloneContents(); - [Throws] + [CEReactions, Throws] void insertNode(Node node); - [Throws] + [CEReactions, Throws] void surroundContents(Node newParent); [NewObject] @@ -76,7 +77,7 @@ interface Range { // https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#extensions-to-the-range-interface partial interface Range { - [NewObject, Throws] + [CEReactions, NewObject, Throws] DocumentFragment createContextualFragment(DOMString fragment); }; diff --git a/components/script/dom/webidls/ReadableStream.webidl b/components/script/dom/webidls/ReadableStream.webidl new file mode 100644 index 00000000000..3662ca75ab8 --- /dev/null +++ b/components/script/dom/webidls/ReadableStream.webidl @@ -0,0 +1,11 @@ +/* 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/. */ + +// This interface is entirely internal to Servo, and should not be accessible to +// web pages. + +[NoInterfaceObject, Exposed=(Window,Worker)] +// Need to escape "ReadableStream" so it's treated as an identifier. +interface _ReadableStream { +}; diff --git a/components/script/dom/webidls/Request.webidl b/components/script/dom/webidls/Request.webidl index 95efc97937a..048636c1e8b 100644 --- a/components/script/dom/webidls/Request.webidl +++ b/components/script/dom/webidls/Request.webidl @@ -1,19 +1,18 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://fetch.spec.whatwg.org/#request-class typedef (Request or USVString) RequestInfo; -[Constructor(RequestInfo input, optional RequestInit init), - Exposed=(Window,Worker)] - +[Exposed=(Window,Worker)] interface Request { + [Throws] constructor(RequestInfo input, optional RequestInit init = {}); readonly attribute ByteString method; readonly attribute USVString url; [SameObject] readonly attribute Headers headers; - readonly attribute RequestType type; + readonly attribute RequestDestination destination; readonly attribute USVString referrer; readonly attribute ReferrerPolicy referrerPolicy; @@ -22,10 +21,11 @@ interface Request { readonly attribute RequestCache cache; readonly attribute RequestRedirect redirect; readonly attribute DOMString integrity; + [NewObject, Throws] Request clone(); }; -Request implements Body; +Request includes Body; dictionary RequestInit { ByteString method; @@ -41,31 +41,21 @@ dictionary RequestInit { any window; // can only be set to null }; -enum RequestType { - "", - "audio", - "font", - "image", - "script", - "style", - "track", - "video" -}; - enum RequestDestination { "", + "audio", "document", "embed", "font", "image", "manifest", - "media", "object", "report", "script", - "serviceworker", "sharedworker", "style", + "track", + "video", "worker", "xslt" }; @@ -105,6 +95,7 @@ enum ReferrerPolicy { "origin", "origin-when-cross-origin", "unsafe-url", + "same-origin", "strict-origin", "strict-origin-when-cross-origin" }; diff --git a/components/script/dom/webidls/Response.webidl b/components/script/dom/webidls/Response.webidl index a1b3cf7dd9a..0ced0c13794 100644 --- a/components/script/dom/webidls/Response.webidl +++ b/components/script/dom/webidls/Response.webidl @@ -1,12 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://fetch.spec.whatwg.org/#response-class - [Constructor(optional BodyInit? body = null, optional ResponseInit init), - Exposed=(Window,Worker)] + [Exposed=(Window,Worker)] interface Response { + [Throws] constructor(optional BodyInit? body = null, optional ResponseInit init = {}); [NewObject] static Response error(); [NewObject, Throws] static Response redirect(USVString url, optional unsigned short status = 302); @@ -23,11 +23,11 @@ interface Response { [NewObject, Throws] Response clone(); }; -Response implements Body; +Response includes Body; dictionary ResponseInit { unsigned short status = 200; - ByteString statusText = "OK"; + ByteString statusText = ""; HeadersInit headers; }; diff --git a/components/script/dom/webidls/SVGElement.webidl b/components/script/dom/webidls/SVGElement.webidl index 529e9e67f06..2da7f062b89 100644 --- a/components/script/dom/webidls/SVGElement.webidl +++ b/components/script/dom/webidls/SVGElement.webidl @@ -1,9 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://svgwg.org/svg2-draft/types.html#InterfaceSVGElement -[Abstract, Pref="dom.svg.enabled"] +[Exposed=Window, Pref="dom.svg.enabled"] interface SVGElement : Element { //[SameObject] readonly attribute SVGAnimatedString className; @@ -18,5 +18,6 @@ interface SVGElement : Element { //void blur(); }; -//SVGElement implements GlobalEventHandlers; -//SVGElement implements SVGElementInstance; +//SVGElement includes GlobalEventHandlers; +//SVGElement includes SVGElementInstance; +SVGElement includes ElementCSSInlineStyle; diff --git a/components/script/dom/webidls/SVGGraphicsElement.webidl b/components/script/dom/webidls/SVGGraphicsElement.webidl index cf6c315d917..052182e374d 100644 --- a/components/script/dom/webidls/SVGGraphicsElement.webidl +++ b/components/script/dom/webidls/SVGGraphicsElement.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://svgwg.org/svg2-draft/types.html#InterfaceSVGGraphicsElement //dictionary SVGBoundingBoxOptions { @@ -10,7 +10,7 @@ // boolean clipped = false; //}; -[Abstract, Pref="dom.svg.enabled"] +[Exposed=Window, Abstract, Pref="dom.svg.enabled"] interface SVGGraphicsElement : SVGElement { //[SameObject] readonly attribute SVGAnimatedTransformList transform; @@ -19,4 +19,4 @@ interface SVGGraphicsElement : SVGElement { //DOMMatrix? getScreenCTM(); }; -//SVGGraphicsElement implements SVGTests; +//SVGGraphicsElement includes SVGTests; diff --git a/components/script/dom/webidls/SVGSVGElement.webidl b/components/script/dom/webidls/SVGSVGElement.webidl index bed2c03a74b..0e61776a40e 100644 --- a/components/script/dom/webidls/SVGSVGElement.webidl +++ b/components/script/dom/webidls/SVGSVGElement.webidl @@ -1,9 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://svgwg.org/svg2-draft/struct.html#InterfaceSVGSVGElement -[Pref="dom.svg.enabled"] +[Exposed=Window, Pref="dom.svg.enabled"] interface SVGSVGElement : SVGGraphicsElement { //[SameObject] readonly attribute SVGAnimatedLength x; @@ -40,6 +40,6 @@ interface SVGSVGElement : SVGGraphicsElement { //void forceRedraw(); }; -//SVGSVGElement implements SVGFitToViewBox; -//SVGSVGElement implements SVGZoomAndPan; -//SVGSVGElement implements WindowEventHandlers; +//SVGSVGElement includes SVGFitToViewBox; +//SVGSVGElement includes SVGZoomAndPan; +//SVGSVGElement includes WindowEventHandlers; diff --git a/components/script/dom/webidls/Screen.webidl b/components/script/dom/webidls/Screen.webidl index dfc81221d76..9160560b8c1 100644 --- a/components/script/dom/webidls/Screen.webidl +++ b/components/script/dom/webidls/Screen.webidl @@ -1,14 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // http://dev.w3.org/csswg/cssom-view/#the-screen-interface [Exposed=Window] interface Screen { - //readonly attribute double availWidth; - //readonly attribute double availHeight; - //readonly attribute double width; - //readonly attribute double height; + readonly attribute double availWidth; + readonly attribute double availHeight; + readonly attribute double width; + readonly attribute double height; readonly attribute unsigned long colorDepth; readonly attribute unsigned long pixelDepth; }; diff --git a/components/script/dom/webidls/Selection.webidl b/components/script/dom/webidls/Selection.webidl new file mode 100644 index 00000000000..38c874e3bf7 --- /dev/null +++ b/components/script/dom/webidls/Selection.webidl @@ -0,0 +1,32 @@ +/* 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/. */ + +// https://w3c.github.io/selection-api/#selection-interface +[Exposed=Window] +interface Selection { +readonly attribute Node? anchorNode; + readonly attribute unsigned long anchorOffset; + readonly attribute Node? focusNode; + readonly attribute unsigned long focusOffset; + readonly attribute boolean isCollapsed; + readonly attribute unsigned long rangeCount; + readonly attribute DOMString type; + [Throws] Range getRangeAt(unsigned long index); + void addRange(Range range); + [Throws] void removeRange(Range range); + void removeAllRanges(); + void empty(); + [Throws] void collapse(Node? node, optional unsigned long offset = 0); + [Throws] void setPosition(Node? node, optional unsigned long offset = 0); + [Throws] void collapseToStart(); + [Throws] void collapseToEnd(); + [Throws] void extend(Node node, optional unsigned long offset = 0); + [Throws] + void setBaseAndExtent(Node anchorNode, unsigned long anchorOffset, Node focusNode, unsigned long focusOffset); + [Throws] void selectAllChildren(Node node); + [CEReactions, Throws] + void deleteFromDocument(); + boolean containsNode(Node node, optional boolean allowPartialContainment = false); + stringifier DOMString (); +}; diff --git a/components/script/dom/webidls/ServiceWorker.webidl b/components/script/dom/webidls/ServiceWorker.webidl index 219c25bcd52..60bb6dfc4b9 100644 --- a/components/script/dom/webidls/ServiceWorker.webidl +++ b/components/script/dom/webidls/ServiceWorker.webidl @@ -1,19 +1,21 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -// http://w3c.github.io/ServiceWorker/#service-worker-obj -[Pref="dom.serviceworker.enabled", Exposed=(Window,Worker)] +// https://w3c.github.io/ServiceWorker/#serviceworker-interface +[Pref="dom.serviceworker.enabled", SecureContext, Exposed=(Window,Worker)] interface ServiceWorker : EventTarget { readonly attribute USVString scriptURL; readonly attribute ServiceWorkerState state; - [Throws] void postMessage(any message/*, optional sequence<Transferable> transfer*/); + [Throws] void postMessage(any message, sequence<object> transfer); + [Throws] void postMessage(any message, optional PostMessageOptions options = {}); // event attribute EventHandler onstatechange; }; -ServiceWorker implements AbstractWorker; +// FIXME: use `includes` instead of `implements` after #22539 is fixed. +ServiceWorker includes AbstractWorker; enum ServiceWorkerState { "installing", diff --git a/components/script/dom/webidls/ServiceWorkerContainer.webidl b/components/script/dom/webidls/ServiceWorkerContainer.webidl index 6d183619af8..18deb5e58f4 100644 --- a/components/script/dom/webidls/ServiceWorkerContainer.webidl +++ b/components/script/dom/webidls/ServiceWorkerContainer.webidl @@ -1,26 +1,30 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -// https://w3c.github.io/ServiceWorker/#service-worker-container +// https://w3c.github.io/ServiceWorker/#serviceworkercontainer-interface [Pref="dom.serviceworker.enabled", Exposed=(Window,Worker)] interface ServiceWorkerContainer : EventTarget { - [Unforgeable] readonly attribute ServiceWorker? controller; - //[SameObject] readonly attribute Promise<ServiceWorkerRegistration> ready; + readonly attribute ServiceWorker? controller; + //readonly attribute Promise<ServiceWorkerRegistration> ready; - [NewObject] Promise<ServiceWorkerRegistration> register(USVString scriptURL, optional RegistrationOptions options); + [NewObject] Promise<ServiceWorkerRegistration> register(USVString scriptURL, + optional RegistrationOptions options = {}); - //[NewObject] /*Promise<any>*/ any getRegistration(optional USVString clientURL = ""); - //[NewObject] /* Promise */<sequence<ServiceWorkerRegistration>> getRegistrations(); + //[NewObject] Promise<any> getRegistration(optional USVString clientURL = ""); + //[NewObject] Promise<FrozenArray<ServiceWorkerRegistration>> getRegistrations(); + //void startMessages(); // events //attribute EventHandler oncontrollerchange; //attribute EventHandler onerror; //attribute EventHandler onmessage; // event.source of message events is ServiceWorker object + //attribute EventHandler onmessageerror; }; dictionary RegistrationOptions { USVString scope; - //WorkerType type = "classic"; + WorkerType type = "classic"; + ServiceWorkerUpdateViaCache updateViaCache = "imports"; }; diff --git a/components/script/dom/webidls/ServiceWorkerGlobalScope.webidl b/components/script/dom/webidls/ServiceWorkerGlobalScope.webidl index 9259c3d64c4..257f3ff3252 100644 --- a/components/script/dom/webidls/ServiceWorkerGlobalScope.webidl +++ b/components/script/dom/webidls/ServiceWorkerGlobalScope.webidl @@ -1,8 +1,8 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -// https://w3c.github.io/ServiceWorker/#service-worker-global-scope +// https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope [Global=(Worker,ServiceWorker), Exposed=ServiceWorker, Pref="dom.serviceworker.enabled"] @@ -17,8 +17,8 @@ interface ServiceWorkerGlobalScope : WorkerGlobalScope { //attribute EventHandler oninstall; //attribute EventHandler onactivate; //attribute EventHandler onfetch; - //attribute EventHandler onforeignfetch; // event attribute EventHandler onmessage; // event.source of the message events is Client object + attribute EventHandler onmessageerror; }; diff --git a/components/script/dom/webidls/ServiceWorkerRegistration.webidl b/components/script/dom/webidls/ServiceWorkerRegistration.webidl index 27c27d7cc41..f7a10659513 100644 --- a/components/script/dom/webidls/ServiceWorkerRegistration.webidl +++ b/components/script/dom/webidls/ServiceWorkerRegistration.webidl @@ -1,15 +1,17 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -// https://w3c.github.io/ServiceWorker/#service-worker-registration-obj -[Pref="dom.serviceworker.enabled", Exposed=(Window,Worker)] +// https://w3c.github.io/ServiceWorker/#serviceworkerregistration-interface +[Pref="dom.serviceworker.enabled", SecureContext, Exposed=(Window,Worker)] interface ServiceWorkerRegistration : EventTarget { - [Unforgeable] readonly attribute ServiceWorker? installing; - [Unforgeable] readonly attribute ServiceWorker? waiting; - [Unforgeable] readonly attribute ServiceWorker? active; + readonly attribute ServiceWorker? installing; + readonly attribute ServiceWorker? waiting; + readonly attribute ServiceWorker? active; + [SameObject] readonly attribute NavigationPreloadManager navigationPreload; readonly attribute USVString scope; + readonly attribute ServiceWorkerUpdateViaCache updateViaCache; // [NewObject] Promise<void> update(); // [NewObject] Promise<boolean> unregister(); @@ -17,3 +19,9 @@ interface ServiceWorkerRegistration : EventTarget { // event // attribute EventHandler onupdatefound; }; + +enum ServiceWorkerUpdateViaCache { + "imports", + "all", + "none" +}; diff --git a/components/script/dom/webidls/ServoParser.webidl b/components/script/dom/webidls/ServoParser.webidl index c3b0926d824..89350130919 100644 --- a/components/script/dom/webidls/ServoParser.webidl +++ b/components/script/dom/webidls/ServoParser.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // This interface is entirely internal to Servo, and should not be accessible to // web pages. diff --git a/components/script/dom/webidls/ShadowRoot.webidl b/components/script/dom/webidls/ShadowRoot.webidl new file mode 100644 index 00000000000..b39991df4b6 --- /dev/null +++ b/components/script/dom/webidls/ShadowRoot.webidl @@ -0,0 +1,17 @@ +/* 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/. */ +/* + * The origin of this IDL file is: + * https://dom.spec.whatwg.org/#interface-shadowroot + */ + +[Exposed=Window] +interface ShadowRoot : DocumentFragment { + readonly attribute ShadowRootMode mode; + readonly attribute Element host; +}; + +enum ShadowRootMode { "open", "closed"}; + +ShadowRoot includes DocumentOrShadowRoot; diff --git a/components/script/dom/webidls/StereoPannerNode.webidl b/components/script/dom/webidls/StereoPannerNode.webidl new file mode 100644 index 00000000000..e59f7cb9d19 --- /dev/null +++ b/components/script/dom/webidls/StereoPannerNode.webidl @@ -0,0 +1,17 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#StereoPannerNode + */ + +dictionary StereoPannerOptions: AudioNodeOptions { + float pan = 0; +}; + +[Exposed=Window] +interface StereoPannerNode : AudioScheduledSourceNode { + [Throws] constructor(BaseAudioContext context, optional StereoPannerOptions options = {}); + readonly attribute AudioParam pan; +}; diff --git a/components/script/dom/webidls/Storage.webidl b/components/script/dom/webidls/Storage.webidl index ba04dceee3e..380eb72d265 100644 --- a/components/script/dom/webidls/Storage.webidl +++ b/components/script/dom/webidls/Storage.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://html.spec.whatwg.org/multipage/#the-storage-interface diff --git a/components/script/dom/webidls/StorageEvent.webidl b/components/script/dom/webidls/StorageEvent.webidl index e838bc9480a..dbc60b23036 100644 --- a/components/script/dom/webidls/StorageEvent.webidl +++ b/components/script/dom/webidls/StorageEvent.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * Interface for a client side storage. See * https://html.spec.whatwg.org/multipage/#the-storageevent-interface @@ -9,13 +9,20 @@ * Event sent to a window when a storage area changes. */ -[Constructor(DOMString type, optional StorageEventInit eventInitDict), Exposed=Window] +[Exposed=Window] interface StorageEvent : Event { + [Throws] constructor(DOMString type, optional StorageEventInit eventInitDict = {}); readonly attribute DOMString? key; readonly attribute DOMString? oldValue; readonly attribute DOMString? newValue; readonly attribute DOMString url; readonly attribute Storage? storageArea; + + + void initStorageEvent(DOMString type, optional boolean bubbles = false, + optional boolean cancelable = false, optional DOMString? key = null, optional + DOMString? oldValue = null, optional DOMString? newValue = null, optional + USVString url = "", optional Storage? storageArea = null); }; dictionary StorageEventInit : EventInit { diff --git a/components/script/dom/webidls/StylePropertyMapReadOnly.webidl b/components/script/dom/webidls/StylePropertyMapReadOnly.webidl new file mode 100644 index 00000000000..7f3860ee701 --- /dev/null +++ b/components/script/dom/webidls/StylePropertyMapReadOnly.webidl @@ -0,0 +1,16 @@ +/* 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/. */ + +// https://drafts.css-houdini.org/css-typed-om-1/#stylepropertymapreadonly +// NOTE: should this be exposed to Window? +[Pref="dom.worklet.enabled", Exposed=(Worklet)] +interface StylePropertyMapReadOnly { + CSSStyleValue? get(DOMString property); + // sequence<CSSStyleValue> getAll(DOMString property); + boolean has(DOMString property); + // iterable<DOMString, (CSSStyleValue or sequence<CSSStyleValue>)>; + sequence<DOMString> getProperties(); + // https://github.com/w3c/css-houdini-drafts/issues/268 + // stringifier; +}; diff --git a/components/script/dom/webidls/StyleSheet.webidl b/components/script/dom/webidls/StyleSheet.webidl index 1ef0533abdc..cb8290cc30b 100644 --- a/components/script/dom/webidls/StyleSheet.webidl +++ b/components/script/dom/webidls/StyleSheet.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom/#the-stylesheet-interface [Exposed=Window] @@ -8,16 +8,15 @@ interface StyleSheet { readonly attribute DOMString type_; readonly attribute DOMString? href; - // readonly attribute (Element or ProcessingInstruction)? ownerNode; + readonly attribute Element? ownerNode; // readonly attribute StyleSheet? parentStyleSheet; readonly attribute DOMString? title; - // [SameObject, PutForwards=mediaText] readonly attribute MediaList media; + [SameObject, PutForwards=mediaText] readonly attribute MediaList media; attribute boolean disabled; }; // https://drafts.csswg.org/cssom/#the-linkstyle-interface -[NoInterfaceObject] -interface LinkStyle { +interface mixin LinkStyle { readonly attribute StyleSheet? sheet; }; diff --git a/components/script/dom/webidls/StyleSheetList.webidl b/components/script/dom/webidls/StyleSheetList.webidl index 20360eb4ba4..2179c284495 100644 --- a/components/script/dom/webidls/StyleSheetList.webidl +++ b/components/script/dom/webidls/StyleSheetList.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom/#the-stylesheetlist-interface // [ArrayClass] diff --git a/components/script/dom/webidls/SubmitEvent.webidl b/components/script/dom/webidls/SubmitEvent.webidl new file mode 100644 index 00000000000..f5b2c49257d --- /dev/null +++ b/components/script/dom/webidls/SubmitEvent.webidl @@ -0,0 +1,15 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#submitevent +[Exposed=Window] +interface SubmitEvent : Event { + constructor(DOMString typeArg, optional SubmitEventInit eventInitDict = {}); + + readonly attribute HTMLElement? submitter; +}; + +dictionary SubmitEventInit : EventInit { + HTMLElement? submitter = null; +}; diff --git a/components/script/dom/webidls/TestBinding.webidl b/components/script/dom/webidls/TestBinding.webidl index 74216947917..14ab146d8be 100644 --- a/components/script/dom/webidls/TestBinding.webidl +++ b/components/script/dom/webidls/TestBinding.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // This interface is entirely internal to Servo, and should not be accessible to // web pages. @@ -32,8 +32,10 @@ dictionary TestDictionary { Blob interfaceValue; any anyValue; object objectValue; - TestDictionaryDefaults dict; + TestDictionaryDefaults dict = {}; sequence<TestDictionaryDefaults> seqDict; + // Testing codegen to import Element correctly, ensure no other code references Element directly + sequence<Element> elementSequence; // Reserved rust keyword DOMString type; // These are used to test bidirectional conversion @@ -43,6 +45,14 @@ dictionary TestDictionary { DOMString? nonRequiredNullable2; }; +dictionary TestDictionaryParent { + DOMString parentStringMember; +}; + +dictionary TestDictionaryWithParent : TestDictionaryParent { + DOMString stringMember; +}; + dictionary TestDictionaryDefaults { boolean booleanValue = false; byte byteValue = 7; @@ -62,6 +72,7 @@ dictionary TestDictionaryDefaults { USVString usvstringValue = "foo"; TestEnum enumValue = "bar"; any anyValue = null; + sequence<object> arrayValue = []; boolean? nullableBooleanValue = false; byte? nullableByteValue = 7; @@ -83,13 +94,17 @@ dictionary TestDictionaryDefaults { object? nullableObjectValue = null; }; -[Constructor, - Constructor(sequence<unrestricted double> numberSequence), - Constructor(unrestricted double num), - Pref="dom.testbinding.enabled", +dictionary TestURLLike { + required DOMString href; +}; + +[Pref="dom.testbinding.enabled", Exposed=(Window,Worker) ] interface TestBinding { + [Throws] constructor(); + [Throws] constructor(sequence<unrestricted double> numberSequence); + [Throws] constructor(unrestricted double num); attribute boolean booleanAttribute; attribute byte byteAttribute; attribute octet octetAttribute; @@ -151,6 +166,13 @@ interface TestBinding { [BinaryName="BinaryRenamedAttribute2"] attribute DOMString attr-to-binary-rename; attribute DOMString attr-to-automatically-rename; + const long long constantInt64 = -1; + const unsigned long long constantUint64 = 1; + const float constantFloat32 = 1.0; + const double constantFloat64 = 1.0; + const unrestricted float constantUnrestrictedFloat32 = 1.0; + const unrestricted double constantUnrestrictedFloat64 = 1.0; + [PutForwards=booleanAttribute] readonly attribute TestBinding forwardedAttribute; @@ -219,6 +241,8 @@ interface TestBinding { TestDictionary receiveTestDictionaryWithSuccessOnKeyword(); boolean dictMatchesPassedValues(TestDictionary arg); + (DOMString or object) receiveUnionIdentity((DOMString or object) arg); + void passBoolean(boolean arg); void passByte(byte arg); void passOctet(octet arg); @@ -237,6 +261,9 @@ interface TestBinding { void passByteString(ByteString arg); void passEnum(TestEnum arg); void passInterface(Blob arg); + void passTypedArray(Int8Array arg); + void passTypedArray2(ArrayBuffer arg); + void passTypedArray3(ArrayBufferView arg); void passUnion((HTMLElement or long) arg); void passUnion2((Event or DOMString) data); void passUnion3((Blob or DOMString) data); @@ -247,6 +274,7 @@ interface TestBinding { void passUnion8((sequence<ByteString> or long) arg); void passUnion9((TestDictionary or long) arg); void passUnion10((DOMString or object) arg); + void passUnion11((ArrayBuffer or ArrayBufferView) arg); void passUnionWithTypedef((Document or TestTypedef) arg); void passUnionWithTypedef2((sequence<long> or TestTypedef) arg); void passAny(any arg); @@ -254,9 +282,19 @@ interface TestBinding { void passCallbackFunction(Function fun); void passCallbackInterface(EventListener listener); void passSequence(sequence<long> seq); + void passAnySequence(sequence<any> seq); + sequence<any> anySequencePassthrough(sequence<any> seq); + void passObjectSequence(sequence<object> seq); void passStringSequence(sequence<DOMString> seq); void passInterfaceSequence(sequence<Blob> seq); + void passOverloaded(ArrayBuffer arg); + void passOverloaded(DOMString arg); + + // https://github.com/servo/servo/pull/26154 + DOMString passOverloadedDict(Node arg); + DOMString passOverloadedDict(TestURLLike arg); + void passNullableBoolean(boolean? arg); void passNullableByte(byte? arg); void passNullableOctet(octet? arg); @@ -276,6 +314,7 @@ interface TestBinding { // void passNullableEnum(TestEnum? arg); void passNullableInterface(Blob? arg); void passNullableObject(object? arg); + void passNullableTypedArray(Int8Array? arg); void passNullableUnion((HTMLElement or long)? arg); void passNullableUnion2((Event or DOMString)? data); void passNullableUnion3((DOMString or sequence<long>)? data); @@ -358,6 +397,7 @@ interface TestBinding { void passOptionalStringWithDefault(optional DOMString arg = "x"); void passOptionalUsvstringWithDefault(optional USVString arg = "x"); void passOptionalEnumWithDefault(optional TestEnum arg = "foo"); + void passOptionalSequenceWithDefault(optional sequence<long> seq = []); // void passOptionalUnionWithDefault(optional (HTMLElement or long) arg = 9); // void passOptionalUnion2WithDefault(optional(Event or DOMString)? data = "foo"); @@ -400,6 +440,9 @@ interface TestBinding { // void passOptionalNullableEnumWithNonNullDefault(optional TestEnum? arg = "foo"); // void passOptionalNullableUnionWithNonNullDefault(optional (HTMLElement or long)? arg = 7); // void passOptionalNullableUnion2WithNonNullDefault(optional (Event or DOMString)? data = "foo"); + TestBinding passOptionalOverloaded(TestBinding arg0, optional unsigned long arg1 = 0, + optional unsigned long arg2 = 0); + void passOptionalOverloaded(Blob arg0, optional unsigned long arg1 = 0); void passVariadicBoolean(boolean... args); void passVariadicBooleanAndDefault(optional boolean arg = true, boolean... args); @@ -434,33 +477,37 @@ interface TestBinding { sequence<sequence<long>> returnSequenceSequence(); void passUnionSequenceSequence((long or sequence<sequence<long>>) seq); - void passMozMap(MozMap<long> arg); - void passNullableMozMap(MozMap<long>? arg); - void passMozMapOfNullableInts(MozMap<long?> arg); - void passOptionalMozMapOfNullableInts(optional MozMap<long?> arg); - void passOptionalNullableMozMapOfNullableInts(optional MozMap<long?>? arg); - void passCastableObjectMozMap(MozMap<TestBinding> arg); - void passNullableCastableObjectMozMap(MozMap<TestBinding?> arg); - void passCastableObjectNullableMozMap(MozMap<TestBinding>? arg); - void passNullableCastableObjectNullableMozMap(MozMap<TestBinding?>? arg); - void passOptionalMozMap(optional MozMap<long> arg); - void passOptionalNullableMozMap(optional MozMap<long>? arg); - void passOptionalNullableMozMapWithDefaultValue(optional MozMap<long>? arg = null); - void passOptionalObjectMozMap(optional MozMap<TestBinding> arg); - void passStringMozMap(MozMap<DOMString> arg); - void passByteStringMozMap(MozMap<ByteString> arg); - void passMozMapOfMozMaps(MozMap<MozMap<long>> arg); - - void passMozMapUnion((long or MozMap<ByteString>) init); - void passMozMapUnion2((TestBinding or MozMap<ByteString>) init); - void passMozMapUnion3((TestBinding or sequence<sequence<ByteString>> or MozMap<ByteString>) init); - - MozMap<long> receiveMozMap(); - MozMap<long>? receiveNullableMozMap(); - MozMap<long?> receiveMozMapOfNullableInts(); - MozMap<long?>? receiveNullableMozMapOfNullableInts(); - MozMap<MozMap<long>> receiveMozMapOfMozMaps(); - MozMap<any> receiveAnyMozMap(); + void passRecord(record<DOMString, long> arg); + void passRecordWithUSVStringKey(record<USVString, long> arg); + void passRecordWithByteStringKey(record<ByteString, long> arg); + void passNullableRecord(record<DOMString, long>? arg); + void passRecordOfNullableInts(record<DOMString, long?> arg); + void passOptionalRecordOfNullableInts(optional record<DOMString, long?> arg); + void passOptionalNullableRecordOfNullableInts(optional record<DOMString, long?>? arg); + void passCastableObjectRecord(record<DOMString, TestBinding> arg); + void passNullableCastableObjectRecord(record<DOMString, TestBinding?> arg); + void passCastableObjectNullableRecord(record<DOMString, TestBinding>? arg); + void passNullableCastableObjectNullableRecord(record<DOMString, TestBinding?>? arg); + void passOptionalRecord(optional record<DOMString, long> arg); + void passOptionalNullableRecord(optional record<DOMString, long>? arg); + void passOptionalNullableRecordWithDefaultValue(optional record<DOMString, long>? arg = null); + void passOptionalObjectRecord(optional record<DOMString, TestBinding> arg); + void passStringRecord(record<DOMString, DOMString> arg); + void passByteStringRecord(record<DOMString, ByteString> arg); + void passRecordOfRecords(record<DOMString, record<DOMString, long>> arg); + + void passRecordUnion((long or record<DOMString, ByteString>) init); + void passRecordUnion2((TestBinding or record<DOMString, ByteString>) init); + void passRecordUnion3((TestBinding or sequence<sequence<ByteString>> or record<DOMString, ByteString>) init); + + record<DOMString, long> receiveRecord(); + record<USVString, long> receiveRecordWithUSVStringKey(); + record<ByteString, long> receiveRecordWithByteStringKey(); + record<DOMString, long>? receiveNullableRecord(); + record<DOMString, long?> receiveRecordOfNullableInts(); + record<DOMString, long?>? receiveNullableRecordOfNullableInts(); + record<DOMString, record<DOMString, long>> receiveRecordOfRecords(); + record<DOMString, any> receiveAnyRecord(); static attribute boolean booleanAttributeStatic; static void receiveVoidStatic(); @@ -478,7 +525,7 @@ interface TestBinding { [Pref="dom.testbinding.prefcontrolled.enabled"] const unsigned short prefControlledConstDisabled = 0; [Pref="layout.animations.test.enabled"] - void advanceClock(long millis, optional boolean forceLayoutTick = true); + void advanceClock(long millis); [Pref="dom.testbinding.prefcontrolled2.enabled"] readonly attribute boolean prefControlledAttributeEnabled; @@ -519,7 +566,6 @@ interface TestBinding { Promise<any> returnRejectedPromise(any value); readonly attribute Promise<boolean> promiseAttribute; void acceptPromise(Promise<DOMString> string); - void acceptNullablePromise(Promise<DOMString>? string); Promise<any> promiseNativeHandler(SimpleCallback? resolve, SimpleCallback? reject); void promiseResolveNative(Promise<any> p, any value); void promiseRejectNative(Promise<any> p, any value); @@ -530,6 +576,21 @@ interface TestBinding { GlobalScope entryGlobal(); GlobalScope incumbentGlobal(); + + [Exposed=(Window)] + readonly attribute boolean semiExposedBoolFromInterface; + + TestDictionaryWithParent getDictionaryWithParent(DOMString parent, DOMString child); +}; + +[Exposed=(Window)] +partial interface TestBinding { + readonly attribute boolean boolFromSemiExposedPartialInterface; +}; + +partial interface TestBinding { + [Exposed=(Window)] + readonly attribute boolean semiExposedBoolFromPartialInterface; }; callback SimpleCallback = void(any value); diff --git a/components/script/dom/webidls/TestBindingIterable.webidl b/components/script/dom/webidls/TestBindingIterable.webidl index c9e61074eed..d74c43d8f5f 100644 --- a/components/script/dom/webidls/TestBindingIterable.webidl +++ b/components/script/dom/webidls/TestBindingIterable.webidl @@ -1,12 +1,13 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // This interface is entirely internal to Servo, and should not be accessible to // web pages. -[Pref="dom.testbinding.enabled", Exposed=(Window,Worker), Constructor] +[Pref="dom.testbinding.enabled", Exposed=(Window,Worker)] interface TestBindingIterable { + [Throws] constructor(); void add(DOMString arg); readonly attribute unsigned long length; getter DOMString getItem(unsigned long index); diff --git a/components/script/dom/webidls/TestBindingPairIterable.webidl b/components/script/dom/webidls/TestBindingPairIterable.webidl index a7bc66c1be3..5d19fbe9f32 100644 --- a/components/script/dom/webidls/TestBindingPairIterable.webidl +++ b/components/script/dom/webidls/TestBindingPairIterable.webidl @@ -1,12 +1,13 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // This interface is entirely internal to Servo, and should not be accessible to // web pages. -[Pref="dom.testbinding.enabled", Exposed=(Window,Worker), Constructor] +[Pref="dom.testbinding.enabled", Exposed=(Window,Worker)] interface TestBindingPairIterable { + [Throws] constructor(); void add(DOMString key, unsigned long value); iterable<DOMString, unsigned long>; }; diff --git a/components/script/dom/webidls/TestBindingProxy.webidl b/components/script/dom/webidls/TestBindingProxy.webidl index f0117721d73..211a4f3a9f7 100644 --- a/components/script/dom/webidls/TestBindingProxy.webidl +++ b/components/script/dom/webidls/TestBindingProxy.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * This IDL file was created to test the special operations (see * https://heycam.github.io/webidl/#idl-special-operations) without converting diff --git a/components/script/dom/webidls/TestRunner.webidl b/components/script/dom/webidls/TestRunner.webidl index 0326c14dbec..bea35374bd6 100644 --- a/components/script/dom/webidls/TestRunner.webidl +++ b/components/script/dom/webidls/TestRunner.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://webbluetoothcg.github.io/web-bluetooth/tests#test-runner diff --git a/components/script/dom/webidls/TestWorklet.webidl b/components/script/dom/webidls/TestWorklet.webidl new file mode 100644 index 00000000000..be254a3d079 --- /dev/null +++ b/components/script/dom/webidls/TestWorklet.webidl @@ -0,0 +1,13 @@ +/* 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/. */ + +// This interface is entirely internal to Servo, and should not be accessible to +// web pages. + +[Pref="dom.worklet.testing.enabled", Exposed=(Window)] +interface TestWorklet { + [Throws] constructor(); + [NewObject] Promise<void> addModule(USVString moduleURL, optional WorkletOptions options = {}); + DOMString? lookup(DOMString key); +}; diff --git a/components/script/dom/webidls/TestWorkletGlobalScope.webidl b/components/script/dom/webidls/TestWorkletGlobalScope.webidl new file mode 100644 index 00000000000..e3cbec7c052 --- /dev/null +++ b/components/script/dom/webidls/TestWorkletGlobalScope.webidl @@ -0,0 +1,11 @@ +/* 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/. */ + +// This interface is entirely internal to Servo, and should not be accessible to +// web pages. + +[Global=(Worklet,TestWorklet), Pref="dom.worklet.enabled", Exposed=TestWorklet] +interface TestWorkletGlobalScope : WorkletGlobalScope { + void registerKeyValue(DOMString key, DOMString value); +}; diff --git a/components/script/dom/webidls/Text.webidl b/components/script/dom/webidls/Text.webidl index 515d9939806..0b0a980d0a9 100644 --- a/components/script/dom/webidls/Text.webidl +++ b/components/script/dom/webidls/Text.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://dom.spec.whatwg.org/ @@ -10,8 +10,9 @@ */ // https://dom.spec.whatwg.org/#text -[Constructor(optional DOMString data = "")] +[Exposed=Window] interface Text : CharacterData { + [Throws] constructor(optional DOMString data = ""); [NewObject, Throws] Text splitText(unsigned long offset); [Pure] diff --git a/components/script/dom/webidls/TextDecoder.webidl b/components/script/dom/webidls/TextDecoder.webidl index e7292ed3061..cc9cf5506db 100644 --- a/components/script/dom/webidls/TextDecoder.webidl +++ b/components/script/dom/webidls/TextDecoder.webidl @@ -1,19 +1,23 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://encoding.spec.whatwg.org/#interface-textdecoder dictionary TextDecoderOptions { boolean fatal = false; - //boolean ignoreBOM = false; + boolean ignoreBOM = false; }; -[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options), Exposed=(Window,Worker)] +dictionary TextDecodeOptions { + boolean stream = false; +}; + +[Exposed=(Window,Worker)] interface TextDecoder { + [Throws] constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options = {}); readonly attribute DOMString encoding; readonly attribute boolean fatal; - //readonly attribute boolean ignoreBOM; - //USVString decode(optional BufferSource input, optional TextDecodeOptions options); + readonly attribute boolean ignoreBOM; [Throws] - USVString decode(optional object input); + USVString decode(optional BufferSource input, optional TextDecodeOptions options = {}); }; diff --git a/components/script/dom/webidls/TextEncoder.webidl b/components/script/dom/webidls/TextEncoder.webidl index eef46f68edf..77e5132ff05 100644 --- a/components/script/dom/webidls/TextEncoder.webidl +++ b/components/script/dom/webidls/TextEncoder.webidl @@ -1,10 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* https://encoding.spec.whatwg.org/#interface-textencoder */ -[Constructor, Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface TextEncoder { + [Throws] constructor(); readonly attribute DOMString encoding; [NewObject] Uint8Array encode(optional USVString input = ""); diff --git a/components/script/dom/webidls/TextMetrics.webidl b/components/script/dom/webidls/TextMetrics.webidl new file mode 100644 index 00000000000..efba27450fe --- /dev/null +++ b/components/script/dom/webidls/TextMetrics.webidl @@ -0,0 +1,23 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#textmetrics +[Exposed=(PaintWorklet, Window, Worker), Pref="dom.canvas_text.enabled"] +interface TextMetrics { + // x-direction + readonly attribute double width; // advance width + readonly attribute double actualBoundingBoxLeft; + readonly attribute double actualBoundingBoxRight; + + // y-direction + readonly attribute double fontBoundingBoxAscent; + readonly attribute double fontBoundingBoxDescent; + readonly attribute double actualBoundingBoxAscent; + readonly attribute double actualBoundingBoxDescent; + readonly attribute double emHeightAscent; + readonly attribute double emHeightDescent; + readonly attribute double hangingBaseline; + readonly attribute double alphabeticBaseline; + readonly attribute double ideographicBaseline; +}; diff --git a/components/script/dom/webidls/TextTrack.webidl b/components/script/dom/webidls/TextTrack.webidl new file mode 100644 index 00000000000..d51d9b0dc67 --- /dev/null +++ b/components/script/dom/webidls/TextTrack.webidl @@ -0,0 +1,30 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#texttrack + +enum TextTrackMode { "disabled", "hidden", "showing" }; +enum TextTrackKind { "subtitles", "captions", "descriptions", "chapters", "metadata" }; + +[Exposed=Window] +interface TextTrack : EventTarget { + readonly attribute TextTrackKind kind; + readonly attribute DOMString label; + readonly attribute DOMString language; + + readonly attribute DOMString id; + // readonly attribute DOMString inBandMetadataTrackDispatchType; + + attribute TextTrackMode mode; + + readonly attribute TextTrackCueList? cues; + readonly attribute TextTrackCueList? activeCues; + + [Throws] + void addCue(TextTrackCue cue); + [Throws] + void removeCue(TextTrackCue cue); + + attribute EventHandler oncuechange; +}; diff --git a/components/script/dom/webidls/TextTrackCue.webidl b/components/script/dom/webidls/TextTrackCue.webidl new file mode 100644 index 00000000000..20f1bf3f06d --- /dev/null +++ b/components/script/dom/webidls/TextTrackCue.webidl @@ -0,0 +1,18 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#texttrackcue + +[Exposed=Window] +interface TextTrackCue : EventTarget { + readonly attribute TextTrack? track; + + attribute DOMString id; + attribute double startTime; + attribute double endTime; + attribute boolean pauseOnExit; + + attribute EventHandler onenter; + attribute EventHandler onexit; +}; diff --git a/components/script/dom/webidls/TextTrackCueList.webidl b/components/script/dom/webidls/TextTrackCueList.webidl new file mode 100644 index 00000000000..357d8751bc2 --- /dev/null +++ b/components/script/dom/webidls/TextTrackCueList.webidl @@ -0,0 +1,12 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#texttrackcuelist + +[Exposed=Window] +interface TextTrackCueList { + readonly attribute unsigned long length; + getter TextTrackCue (unsigned long index); + TextTrackCue? getCueById(DOMString id); +}; diff --git a/components/script/dom/webidls/TextTrackList.webidl b/components/script/dom/webidls/TextTrackList.webidl new file mode 100644 index 00000000000..33e1bef0ff4 --- /dev/null +++ b/components/script/dom/webidls/TextTrackList.webidl @@ -0,0 +1,16 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#texttracklist + +[Exposed=Window] +interface TextTrackList : EventTarget { + readonly attribute unsigned long length; + getter TextTrack (unsigned long index); + TextTrack? getTrackById(DOMString id); + + attribute EventHandler onchange; + attribute EventHandler onaddtrack; + attribute EventHandler onremovetrack; +}; diff --git a/components/script/dom/webidls/TimeRanges.webidl b/components/script/dom/webidls/TimeRanges.webidl new file mode 100644 index 00000000000..0163a590a91 --- /dev/null +++ b/components/script/dom/webidls/TimeRanges.webidl @@ -0,0 +1,12 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage#time-ranges + +[Exposed=Window] +interface TimeRanges { + readonly attribute unsigned long length; + [Throws] double start(unsigned long index); + [Throws] double end(unsigned long index); +}; diff --git a/components/script/dom/webidls/Touch.webidl b/components/script/dom/webidls/Touch.webidl index d2a8e0373fa..c887a0fc2a3 100644 --- a/components/script/dom/webidls/Touch.webidl +++ b/components/script/dom/webidls/Touch.webidl @@ -1,8 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // http://w3c.github.io/touch-events/#idl-def-Touch +[Exposed=Window] interface Touch { readonly attribute long identifier; readonly attribute EventTarget target; diff --git a/components/script/dom/webidls/TouchEvent.webidl b/components/script/dom/webidls/TouchEvent.webidl index 971c7216443..3779349b781 100644 --- a/components/script/dom/webidls/TouchEvent.webidl +++ b/components/script/dom/webidls/TouchEvent.webidl @@ -1,8 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // http://w3c.github.io/touch-events/#idl-def-TouchEvent +[Exposed=Window] interface TouchEvent : UIEvent { readonly attribute TouchList touches; readonly attribute TouchList targetTouches; diff --git a/components/script/dom/webidls/TouchList.webidl b/components/script/dom/webidls/TouchList.webidl index c9229b69245..bc6f7cb1304 100644 --- a/components/script/dom/webidls/TouchList.webidl +++ b/components/script/dom/webidls/TouchList.webidl @@ -1,8 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // http://w3c.github.io/touch-events/#idl-def-TouchList +[Exposed=Window] interface TouchList { readonly attribute unsigned long length; getter Touch? item (unsigned long index); diff --git a/components/script/dom/webidls/TrackEvent.webidl b/components/script/dom/webidls/TrackEvent.webidl new file mode 100644 index 00000000000..124e5cf4345 --- /dev/null +++ b/components/script/dom/webidls/TrackEvent.webidl @@ -0,0 +1,15 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#the-trackevent-interface + +[Exposed=Window] +interface TrackEvent : Event { + [Throws] constructor(DOMString type, optional TrackEventInit eventInitDict = {}); + readonly attribute (VideoTrack or AudioTrack or TextTrack)? track; +}; + +dictionary TrackEventInit : EventInit { + (VideoTrack or AudioTrack or TextTrack)? track = null; +}; diff --git a/components/script/dom/webidls/TransitionEvent.webidl b/components/script/dom/webidls/TransitionEvent.webidl index 5e7a3ff6913..eaa9f3917db 100644 --- a/components/script/dom/webidls/TransitionEvent.webidl +++ b/components/script/dom/webidls/TransitionEvent.webidl @@ -1,14 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * For more information on this interface please see * https://dom.spec.whatwg.org/#event */ -[Constructor(DOMString type, optional TransitionEventInit transitionEventInitDict), - Exposed=Window] +[Exposed=Window] interface TransitionEvent : Event { + [Throws] constructor(DOMString type, optional TransitionEventInit transitionEventInitDict = {}); readonly attribute DOMString propertyName; readonly attribute float elapsedTime; readonly attribute DOMString pseudoElement; diff --git a/components/script/dom/webidls/TreeWalker.webidl b/components/script/dom/webidls/TreeWalker.webidl index 049f79bdd11..4162855dd09 100644 --- a/components/script/dom/webidls/TreeWalker.webidl +++ b/components/script/dom/webidls/TreeWalker.webidl @@ -1,11 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://dom.spec.whatwg.org/#interface-treewalker */ +[Exposed=Window] interface TreeWalker { [SameObject] readonly attribute Node root; diff --git a/components/script/dom/webidls/UIEvent.webidl b/components/script/dom/webidls/UIEvent.webidl index 58f04ff24dc..12850f70e45 100644 --- a/components/script/dom/webidls/UIEvent.webidl +++ b/components/script/dom/webidls/UIEvent.webidl @@ -1,10 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/uievents/#interface-uievent -[Constructor(DOMString type, optional UIEventInit eventInitDict)] +[Exposed=Window] interface UIEvent : Event { + [Throws] constructor(DOMString type, optional UIEventInit eventInitDict = {}); // readonly attribute WindowProxy? view; readonly attribute Window? view; readonly attribute long detail; diff --git a/components/script/dom/webidls/URL.webidl b/components/script/dom/webidls/URL.webidl index 7c47b6caa71..47a1ef53129 100644 --- a/components/script/dom/webidls/URL.webidl +++ b/components/script/dom/webidls/URL.webidl @@ -1,12 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://url.spec.whatwg.org/#url -[Constructor(USVString url, optional USVString base), Exposed=(Window,Worker)] +[Exposed=(Window,Worker), + LegacyWindowAlias=webkitURL] interface URL { + [Throws] constructor(USVString url, optional USVString base); [SetterThrows] - /*stringifier*/ attribute USVString href; + stringifier attribute USVString href; readonly attribute USVString origin; attribute USVString protocol; attribute USVString username; @@ -24,8 +26,5 @@ interface URL { // static DOMString createFor(Blob blob); static void revokeObjectURL(DOMString url); - // This is only doing as well as gecko right now. - // https://github.com/servo/servo/issues/7590 is on file for - // adding attribute stringifier support. - stringifier; + USVString toJSON(); }; diff --git a/components/script/dom/webidls/URLSearchParams.webidl b/components/script/dom/webidls/URLSearchParams.webidl index 1012f1bded5..33ba9253624 100644 --- a/components/script/dom/webidls/URLSearchParams.webidl +++ b/components/script/dom/webidls/URLSearchParams.webidl @@ -1,19 +1,23 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://url.spec.whatwg.org/#interface-urlsearchparams */ -[Constructor(optional (USVString or URLSearchParams) init/* = ""*/), Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface URLSearchParams { + [Throws] constructor(optional (sequence<sequence<USVString>> or record<USVString, USVString> or USVString) init = ""); void append(USVString name, USVString value); void delete(USVString name); USVString? get(USVString name); sequence<USVString> getAll(USVString name); boolean has(USVString name); void set(USVString name, USVString value); + + void sort(); + // Be careful with implementing iterable interface. // Search params might be mutated by URL::SetSearch while iterating (discussed in PR #10351). iterable<USVString, USVString>; diff --git a/components/script/dom/webidls/VR.webidl b/components/script/dom/webidls/VR.webidl deleted file mode 100644 index 0fded365be0..00000000000 --- a/components/script/dom/webidls/VR.webidl +++ /dev/null @@ -1,10 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -// https://w3c.github.io/webvr/#interface-navigator -[Pref="dom.webvr.enabled"] -interface VR: EventTarget { - Promise<sequence<VRDisplay>> getDisplays(); - //readonly attribute FrozenArray<VRDisplay> activeVRDisplays; -}; diff --git a/components/script/dom/webidls/VRDisplay.webidl b/components/script/dom/webidls/VRDisplay.webidl deleted file mode 100644 index 6822a994a9b..00000000000 --- a/components/script/dom/webidls/VRDisplay.webidl +++ /dev/null @@ -1,131 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -enum VREye { - "left", - "right" -}; - - -// https://w3c.github.io/webvr/#interface-vrdisplay -[Pref="dom.webvr.enabled"] -interface VRDisplay : EventTarget { - readonly attribute boolean isConnected; - readonly attribute boolean isPresenting; - - /** - * Dictionary of capabilities describing the VRDisplay. - */ - [SameObject] readonly attribute VRDisplayCapabilities capabilities; - - /** - * If this VRDisplay supports room-scale experiences, the optional - * stage attribute contains details on the room-scale parameters. - * The stageParameters attribute can not change between null - * and non-null once the VRDisplay is enumerated; however, - * the values within VRStageParameters may change after - * any call to VRDisplay.submitFrame as the user may re-configure - * their environment at any time. - */ - readonly attribute VRStageParameters? stageParameters; - - /** - * Return the current VREyeParameters for the given eye. - */ - VREyeParameters getEyeParameters(VREye whichEye); - - /** - * An identifier for this distinct VRDisplay. Used as an - * association point in the Gamepad API. - */ - readonly attribute unsigned long displayId; - - /** - * A display name, a user-readable name identifying it. - */ - readonly attribute DOMString displayName; - - /** - * Populates the passed VRFrameData with the information required to render - * the current frame. - */ - boolean getFrameData(VRFrameData frameData); - - /** - * Return a VRPose containing the future predicted pose of the VRDisplay - * when the current frame will be presented. The value returned will not - * change until JavaScript has returned control to the browser. - * - * The VRPose will contain the position, orientation, velocity, - * and acceleration of each of these properties. - */ - [NewObject] VRPose getPose(); - - /** - * Reset the pose for this display, treating its current position and - * orientation as the "origin/zero" values. VRPose.position, - * VRPose.orientation, and VRStageParameters.sittingToStandingTransform may be - * updated when calling resetPose(). This should be called in only - * sitting-space experiences. - */ - void resetPose(); - - /** - * z-depth defining the near plane of the eye view frustum - * enables mapping of values in the render target depth - * attachment to scene coordinates. Initially set to 0.01. - */ - attribute double depthNear; - - /** - * z-depth defining the far plane of the eye view frustum - * enables mapping of values in the render target depth - * attachment to scene coordinates. Initially set to 10000.0. - */ - attribute double depthFar; - - /** - * The callback passed to `requestAnimationFrame` will be called - * any time a new frame should be rendered. When the VRDisplay is - * presenting the callback will be called at the native refresh - * rate of the HMD. When not presenting this function acts - * identically to how window.requestAnimationFrame acts. Content should - * make no assumptions of frame rate or vsync behavior as the HMD runs - * asynchronously from other displays and at differing refresh rates. - */ - unsigned long requestAnimationFrame(FrameRequestCallback callback); - - /** - * Passing the value returned by `requestAnimationFrame` to - * `cancelAnimationFrame` will unregister the callback. - */ - void cancelAnimationFrame(unsigned long handle); - - /** - * Begin presenting to the VRDisplay. Must be called in response to a user gesture. - * Repeat calls while already presenting will update the VRLayers being displayed. - * If the number of values in the leftBounds/rightBounds arrays is not 0 or 4 for - * any of the passed layers the promise is rejected. - * If the source of any of the layers is not present (null), the promise is rejected. - */ - Promise<void> requestPresent(sequence<VRLayer> layers); - - /** - * Stops presenting to the VRDisplay. - */ - Promise<void> exitPresent(); - - /** - * Get the layers currently being presented. - */ - //sequence<VRLayer> getLayers(); - - /** - * The VRLayer provided to the VRDisplay will be captured and presented - * in the HMD. Calling this function has the same effect on the source - * canvas as any other operation that uses its source image, and canvases - * created without preserveDrawingBuffer set to true will be cleared. - */ - void submitFrame(); -}; diff --git a/components/script/dom/webidls/VRDisplayCapabilities.webidl b/components/script/dom/webidls/VRDisplayCapabilities.webidl deleted file mode 100644 index 2d9cccd6a97..00000000000 --- a/components/script/dom/webidls/VRDisplayCapabilities.webidl +++ /dev/null @@ -1,13 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -// https://w3c.github.io/webvr/#interface-vrdisplaycapabilities -[Pref="dom.webvr.enabled"] -interface VRDisplayCapabilities { - readonly attribute boolean hasPosition; - readonly attribute boolean hasOrientation; - readonly attribute boolean hasExternalDisplay; - readonly attribute boolean canPresent; - readonly attribute unsigned long maxLayers; -}; diff --git a/components/script/dom/webidls/VRDisplayEvent.webidl b/components/script/dom/webidls/VRDisplayEvent.webidl deleted file mode 100644 index df0990d32a8..00000000000 --- a/components/script/dom/webidls/VRDisplayEvent.webidl +++ /dev/null @@ -1,23 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -// https://w3c.github.io/webvr/#interface-vrdisplayevent - -enum VRDisplayEventReason { - "navigation", - "mounted", - "unmounted", - "requested" -}; - -[Pref="dom.webvr.enabled", Constructor(DOMString type, VRDisplayEventInit eventInitDict)] -interface VRDisplayEvent : Event { - readonly attribute VRDisplay display; - readonly attribute VRDisplayEventReason? reason; -}; - -dictionary VRDisplayEventInit : EventInit { - required VRDisplay display; - VRDisplayEventReason reason; -}; diff --git a/components/script/dom/webidls/VREyeParameters.webidl b/components/script/dom/webidls/VREyeParameters.webidl deleted file mode 100644 index 5d127f20784..00000000000 --- a/components/script/dom/webidls/VREyeParameters.webidl +++ /dev/null @@ -1,13 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -// https://w3c.github.io/webvr/#interface-vreyeparameters - -[Pref="dom.webvr.enabled"] -interface VREyeParameters { - readonly attribute Float32Array offset; - [SameObject] readonly attribute VRFieldOfView fieldOfView; - readonly attribute unsigned long renderWidth; - readonly attribute unsigned long renderHeight; -}; diff --git a/components/script/dom/webidls/VRFieldOfView.webidl b/components/script/dom/webidls/VRFieldOfView.webidl deleted file mode 100644 index b562c5b0e7f..00000000000 --- a/components/script/dom/webidls/VRFieldOfView.webidl +++ /dev/null @@ -1,13 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -// https://w3c.github.io/webvr/#interface-vrfieldofview - -[Pref="dom.webvr.enabled"] -interface VRFieldOfView { - readonly attribute double upDegrees; - readonly attribute double rightDegrees; - readonly attribute double downDegrees; - readonly attribute double leftDegrees; -}; diff --git a/components/script/dom/webidls/VRFrameData.webidl b/components/script/dom/webidls/VRFrameData.webidl deleted file mode 100644 index baa37ea6f68..00000000000 --- a/components/script/dom/webidls/VRFrameData.webidl +++ /dev/null @@ -1,15 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -// https://w3c.github.io/webvr/#interface-vrframedata - -[Pref="dom.webvr.enabled", Constructor] -interface VRFrameData { - readonly attribute DOMHighResTimeStamp timestamp; - readonly attribute Float32Array leftProjectionMatrix; - readonly attribute Float32Array leftViewMatrix; - readonly attribute Float32Array rightProjectionMatrix; - readonly attribute Float32Array rightViewMatrix; - readonly attribute VRPose pose; -}; diff --git a/components/script/dom/webidls/VRLayer.webidl b/components/script/dom/webidls/VRLayer.webidl deleted file mode 100644 index 47b30b324f7..00000000000 --- a/components/script/dom/webidls/VRLayer.webidl +++ /dev/null @@ -1,13 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -// https://w3c.github.io/webvr/#interface-vrlayer - -//typedef (HTMLCanvasElement or OffscreenCanvas) VRSource; - -dictionary VRLayer { - HTMLCanvasElement source; - sequence<float> leftBounds; - sequence<float> rightBounds; -}; diff --git a/components/script/dom/webidls/VRStageParameters.webidl b/components/script/dom/webidls/VRStageParameters.webidl deleted file mode 100644 index 255a8f07e76..00000000000 --- a/components/script/dom/webidls/VRStageParameters.webidl +++ /dev/null @@ -1,11 +0,0 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - -// https://w3c.github.io/webvr/#interface-vrstageparameters -[Pref="dom.webvr.enabled"] -interface VRStageParameters { - readonly attribute Float32Array sittingToStandingTransform; - readonly attribute float sizeX; - readonly attribute float sizeZ; -}; diff --git a/components/script/dom/webidls/VTTCue.webidl b/components/script/dom/webidls/VTTCue.webidl new file mode 100644 index 00000000000..073aa12f79b --- /dev/null +++ b/components/script/dom/webidls/VTTCue.webidl @@ -0,0 +1,30 @@ +/* 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/. */ + +// https://w3c.github.io/webvtt/#the-vttcue-interface + +enum AutoKeyword { "auto"}; +typedef (double or AutoKeyword) LineAndPositionSetting; +enum DirectionSetting { "" /* horizontal */, "rl", "lr" }; +enum LineAlignSetting { "start", "center", "end" }; +enum PositionAlignSetting { "line-left", "center", "line-right", "auto" }; +enum AlignSetting { "start", "center", "end", "left", "right" }; + +[Pref="dom.webvtt.enabled", Exposed=Window] +interface VTTCue : TextTrackCue { + constructor(double startTime, double endTime, DOMString text); + attribute VTTRegion? region; + attribute DirectionSetting vertical; + attribute boolean snapToLines; + attribute LineAndPositionSetting line; + attribute LineAlignSetting lineAlign; + [SetterThrows] + attribute LineAndPositionSetting position; + attribute PositionAlignSetting positionAlign; + [SetterThrows] + attribute double size; + attribute AlignSetting align; + attribute DOMString text; + DocumentFragment getCueAsHTML(); +}; diff --git a/components/script/dom/webidls/VTTRegion.webidl b/components/script/dom/webidls/VTTRegion.webidl new file mode 100644 index 00000000000..12fbe16170b --- /dev/null +++ b/components/script/dom/webidls/VTTRegion.webidl @@ -0,0 +1,26 @@ +/* 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/. */ + +// https://w3c.github.io/webvtt/#the-vttregion-interface + +enum ScrollSetting { "" /* none */, "up"}; + +[Pref="dom.webvtt.enabled", Exposed=Window] +interface VTTRegion { + [Throws] constructor(); + attribute DOMString id; + [SetterThrows] + attribute double width; + [SetterThrows] + attribute unsigned long lines; + [SetterThrows] + attribute double regionAnchorX; + [SetterThrows] + attribute double regionAnchorY; + [SetterThrows] + attribute double viewportAnchorX; + [SetterThrows] + attribute double viewportAnchorY; + attribute ScrollSetting scroll; +}; diff --git a/components/script/dom/webidls/ValidityState.webidl b/components/script/dom/webidls/ValidityState.webidl index e959e972a7f..a1a553e91ff 100644 --- a/components/script/dom/webidls/ValidityState.webidl +++ b/components/script/dom/webidls/ValidityState.webidl @@ -1,8 +1,9 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#validitystate +[Exposed=Window] interface ValidityState { readonly attribute boolean valueMissing; readonly attribute boolean typeMismatch; diff --git a/components/script/dom/webidls/VideoTrack.webidl b/components/script/dom/webidls/VideoTrack.webidl new file mode 100644 index 00000000000..90d6c487eaa --- /dev/null +++ b/components/script/dom/webidls/VideoTrack.webidl @@ -0,0 +1,14 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#videotrack + +[Exposed=Window] +interface VideoTrack { + readonly attribute DOMString id; + readonly attribute DOMString kind; + readonly attribute DOMString label; + readonly attribute DOMString language; + attribute boolean selected; +}; diff --git a/components/script/dom/webidls/VideoTrackList.webidl b/components/script/dom/webidls/VideoTrackList.webidl new file mode 100644 index 00000000000..9c880f0d2b7 --- /dev/null +++ b/components/script/dom/webidls/VideoTrackList.webidl @@ -0,0 +1,17 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#videotracklist + +[Exposed=Window] +interface VideoTrackList : EventTarget { + readonly attribute unsigned long length; + getter VideoTrack (unsigned long index); + VideoTrack? getTrackById(DOMString id); + readonly attribute long selectedIndex; + + attribute EventHandler onchange; + attribute EventHandler onaddtrack; + attribute EventHandler onremovetrack; +}; diff --git a/components/script/dom/webidls/VoidFunction.webidl b/components/script/dom/webidls/VoidFunction.webidl new file mode 100644 index 00000000000..6c219ff9380 --- /dev/null +++ b/components/script/dom/webidls/VoidFunction.webidl @@ -0,0 +1,13 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://heycam.github.io/webidl/#VoidFunction + * + * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and + * Opera Software ASA. You are granted a license to use, reproduce + * and create derivative works of this document. + */ + +callback VoidFunction = void (); diff --git a/components/script/dom/webidls/WEBGLColorBufferFloat.webidl b/components/script/dom/webidls/WEBGLColorBufferFloat.webidl new file mode 100644 index 00000000000..dd041927ec1 --- /dev/null +++ b/components/script/dom/webidls/WEBGLColorBufferFloat.webidl @@ -0,0 +1,14 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/WEBGL_color_buffer_float/ + */ + +[NoInterfaceObject, Exposed=Window] +interface WEBGLColorBufferFloat { + const GLenum RGBA32F_EXT = 0x8814; + const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211; + const GLenum UNSIGNED_NORMALIZED_EXT = 0x8C17; +}; // interface WEBGL_color_buffer_float diff --git a/components/script/dom/webidls/WEBGLCompressedTextureETC1.webidl b/components/script/dom/webidls/WEBGLCompressedTextureETC1.webidl new file mode 100644 index 00000000000..77f80197c97 --- /dev/null +++ b/components/script/dom/webidls/WEBGLCompressedTextureETC1.webidl @@ -0,0 +1,13 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc1/ + */ + +[NoInterfaceObject, Exposed=Window] +interface WEBGLCompressedTextureETC1 { + /* Compressed Texture Format */ + const GLenum COMPRESSED_RGB_ETC1_WEBGL = 0x8D64; +}; // interface WEBGLCompressedTextureETC1 diff --git a/components/script/dom/webidls/WEBGLCompressedTextureS3TC.webidl b/components/script/dom/webidls/WEBGLCompressedTextureS3TC.webidl new file mode 100644 index 00000000000..f940028bf5d --- /dev/null +++ b/components/script/dom/webidls/WEBGLCompressedTextureS3TC.webidl @@ -0,0 +1,16 @@ +/* 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/. */ +/* + * WebGL IDL definitions from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/ + */ + +[NoInterfaceObject, Exposed=Window] +interface WEBGLCompressedTextureS3TC { + /* Compressed Texture Formats */ + const GLenum COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0; + const GLenum COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1; + const GLenum COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2; + const GLenum COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3; +}; // interface WEBGLCompressedTextureS3TC diff --git a/components/script/dom/webidls/WebGL2RenderingContext.webidl b/components/script/dom/webidls/WebGL2RenderingContext.webidl new file mode 100644 index 00000000000..632f1ce5cc6 --- /dev/null +++ b/components/script/dom/webidls/WebGL2RenderingContext.webidl @@ -0,0 +1,588 @@ +/* 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/. */ +// +// WebGL IDL definitions scraped from the Khronos specification: +// https://www.khronos.org/registry/webgl/specs/latest/ +// +// This IDL depends on the typed array specification defined at: +// https://www.khronos.org/registry/typedarray/specs/latest/typedarrays.idl + +typedef long long GLint64; +typedef unsigned long long GLuint64; + +typedef (/*[AllowShared]*/ Uint32Array or sequence<GLuint>) Uint32List; + +interface mixin WebGL2RenderingContextBase +{ + const GLenum READ_BUFFER = 0x0C02; + const GLenum UNPACK_ROW_LENGTH = 0x0CF2; + const GLenum UNPACK_SKIP_ROWS = 0x0CF3; + const GLenum UNPACK_SKIP_PIXELS = 0x0CF4; + const GLenum PACK_ROW_LENGTH = 0x0D02; + const GLenum PACK_SKIP_ROWS = 0x0D03; + const GLenum PACK_SKIP_PIXELS = 0x0D04; + const GLenum COLOR = 0x1800; + const GLenum DEPTH = 0x1801; + const GLenum STENCIL = 0x1802; + const GLenum RED = 0x1903; + const GLenum RGB8 = 0x8051; + const GLenum RGBA8 = 0x8058; + const GLenum RGB10_A2 = 0x8059; + const GLenum TEXTURE_BINDING_3D = 0x806A; + const GLenum UNPACK_SKIP_IMAGES = 0x806D; + const GLenum UNPACK_IMAGE_HEIGHT = 0x806E; + const GLenum TEXTURE_3D = 0x806F; + const GLenum TEXTURE_WRAP_R = 0x8072; + const GLenum MAX_3D_TEXTURE_SIZE = 0x8073; + const GLenum UNSIGNED_INT_2_10_10_10_REV = 0x8368; + const GLenum MAX_ELEMENTS_VERTICES = 0x80E8; + const GLenum MAX_ELEMENTS_INDICES = 0x80E9; + const GLenum TEXTURE_MIN_LOD = 0x813A; + const GLenum TEXTURE_MAX_LOD = 0x813B; + const GLenum TEXTURE_BASE_LEVEL = 0x813C; + const GLenum TEXTURE_MAX_LEVEL = 0x813D; + const GLenum MIN = 0x8007; + const GLenum MAX = 0x8008; + const GLenum DEPTH_COMPONENT24 = 0x81A6; + const GLenum MAX_TEXTURE_LOD_BIAS = 0x84FD; + const GLenum TEXTURE_COMPARE_MODE = 0x884C; + const GLenum TEXTURE_COMPARE_FUNC = 0x884D; + const GLenum CURRENT_QUERY = 0x8865; + const GLenum QUERY_RESULT = 0x8866; + const GLenum QUERY_RESULT_AVAILABLE = 0x8867; + const GLenum STREAM_READ = 0x88E1; + const GLenum STREAM_COPY = 0x88E2; + const GLenum STATIC_READ = 0x88E5; + const GLenum STATIC_COPY = 0x88E6; + const GLenum DYNAMIC_READ = 0x88E9; + const GLenum DYNAMIC_COPY = 0x88EA; + const GLenum MAX_DRAW_BUFFERS = 0x8824; + const GLenum DRAW_BUFFER0 = 0x8825; + const GLenum DRAW_BUFFER1 = 0x8826; + const GLenum DRAW_BUFFER2 = 0x8827; + const GLenum DRAW_BUFFER3 = 0x8828; + const GLenum DRAW_BUFFER4 = 0x8829; + const GLenum DRAW_BUFFER5 = 0x882A; + const GLenum DRAW_BUFFER6 = 0x882B; + const GLenum DRAW_BUFFER7 = 0x882C; + const GLenum DRAW_BUFFER8 = 0x882D; + const GLenum DRAW_BUFFER9 = 0x882E; + const GLenum DRAW_BUFFER10 = 0x882F; + const GLenum DRAW_BUFFER11 = 0x8830; + const GLenum DRAW_BUFFER12 = 0x8831; + const GLenum DRAW_BUFFER13 = 0x8832; + const GLenum DRAW_BUFFER14 = 0x8833; + const GLenum DRAW_BUFFER15 = 0x8834; + const GLenum MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49; + const GLenum MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A; + const GLenum SAMPLER_3D = 0x8B5F; + const GLenum SAMPLER_2D_SHADOW = 0x8B62; + const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B; + const GLenum PIXEL_PACK_BUFFER = 0x88EB; + const GLenum PIXEL_UNPACK_BUFFER = 0x88EC; + const GLenum PIXEL_PACK_BUFFER_BINDING = 0x88ED; + const GLenum PIXEL_UNPACK_BUFFER_BINDING = 0x88EF; + const GLenum FLOAT_MAT2x3 = 0x8B65; + const GLenum FLOAT_MAT2x4 = 0x8B66; + const GLenum FLOAT_MAT3x2 = 0x8B67; + const GLenum FLOAT_MAT3x4 = 0x8B68; + const GLenum FLOAT_MAT4x2 = 0x8B69; + const GLenum FLOAT_MAT4x3 = 0x8B6A; + const GLenum SRGB = 0x8C40; + const GLenum SRGB8 = 0x8C41; + const GLenum SRGB8_ALPHA8 = 0x8C43; + const GLenum COMPARE_REF_TO_TEXTURE = 0x884E; + const GLenum RGBA32F = 0x8814; + const GLenum RGB32F = 0x8815; + const GLenum RGBA16F = 0x881A; + const GLenum RGB16F = 0x881B; + const GLenum VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD; + const GLenum MAX_ARRAY_TEXTURE_LAYERS = 0x88FF; + const GLenum MIN_PROGRAM_TEXEL_OFFSET = 0x8904; + const GLenum MAX_PROGRAM_TEXEL_OFFSET = 0x8905; + const GLenum MAX_VARYING_COMPONENTS = 0x8B4B; + const GLenum TEXTURE_2D_ARRAY = 0x8C1A; + const GLenum TEXTURE_BINDING_2D_ARRAY = 0x8C1D; + const GLenum R11F_G11F_B10F = 0x8C3A; + const GLenum UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B; + const GLenum RGB9_E5 = 0x8C3D; + const GLenum UNSIGNED_INT_5_9_9_9_REV = 0x8C3E; + const GLenum TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F; + const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80; + const GLenum TRANSFORM_FEEDBACK_VARYINGS = 0x8C83; + const GLenum TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84; + const GLenum TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85; + const GLenum TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88; + const GLenum RASTERIZER_DISCARD = 0x8C89; + const GLenum MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A; + const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B; + const GLenum INTERLEAVED_ATTRIBS = 0x8C8C; + const GLenum SEPARATE_ATTRIBS = 0x8C8D; + const GLenum TRANSFORM_FEEDBACK_BUFFER = 0x8C8E; + const GLenum TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F; + const GLenum RGBA32UI = 0x8D70; + const GLenum RGB32UI = 0x8D71; + const GLenum RGBA16UI = 0x8D76; + const GLenum RGB16UI = 0x8D77; + const GLenum RGBA8UI = 0x8D7C; + const GLenum RGB8UI = 0x8D7D; + const GLenum RGBA32I = 0x8D82; + const GLenum RGB32I = 0x8D83; + const GLenum RGBA16I = 0x8D88; + const GLenum RGB16I = 0x8D89; + const GLenum RGBA8I = 0x8D8E; + const GLenum RGB8I = 0x8D8F; + const GLenum RED_INTEGER = 0x8D94; + const GLenum RGB_INTEGER = 0x8D98; + const GLenum RGBA_INTEGER = 0x8D99; + const GLenum SAMPLER_2D_ARRAY = 0x8DC1; + const GLenum SAMPLER_2D_ARRAY_SHADOW = 0x8DC4; + const GLenum SAMPLER_CUBE_SHADOW = 0x8DC5; + const GLenum UNSIGNED_INT_VEC2 = 0x8DC6; + const GLenum UNSIGNED_INT_VEC3 = 0x8DC7; + const GLenum UNSIGNED_INT_VEC4 = 0x8DC8; + const GLenum INT_SAMPLER_2D = 0x8DCA; + const GLenum INT_SAMPLER_3D = 0x8DCB; + const GLenum INT_SAMPLER_CUBE = 0x8DCC; + const GLenum INT_SAMPLER_2D_ARRAY = 0x8DCF; + const GLenum UNSIGNED_INT_SAMPLER_2D = 0x8DD2; + const GLenum UNSIGNED_INT_SAMPLER_3D = 0x8DD3; + const GLenum UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4; + const GLenum UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7; + const GLenum DEPTH_COMPONENT32F = 0x8CAC; + const GLenum DEPTH32F_STENCIL8 = 0x8CAD; + const GLenum FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; + const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210; + const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211; + const GLenum FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212; + const GLenum FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213; + const GLenum FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214; + const GLenum FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215; + const GLenum FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216; + const GLenum FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217; + const GLenum FRAMEBUFFER_DEFAULT = 0x8218; + // BUG: https://github.com/KhronosGroup/WebGL/issues/2216 + // const GLenum DEPTH_STENCIL_ATTACHMENT = 0x821A; + // const GLenum DEPTH_STENCIL = 0x84F9; + const GLenum UNSIGNED_INT_24_8 = 0x84FA; + const GLenum DEPTH24_STENCIL8 = 0x88F0; + const GLenum UNSIGNED_NORMALIZED = 0x8C17; + const GLenum DRAW_FRAMEBUFFER_BINDING = 0x8CA6; /* Same as FRAMEBUFFER_BINDING */ + const GLenum READ_FRAMEBUFFER = 0x8CA8; + const GLenum DRAW_FRAMEBUFFER = 0x8CA9; + const GLenum READ_FRAMEBUFFER_BINDING = 0x8CAA; + const GLenum RENDERBUFFER_SAMPLES = 0x8CAB; + const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4; + const GLenum MAX_COLOR_ATTACHMENTS = 0x8CDF; + const GLenum COLOR_ATTACHMENT1 = 0x8CE1; + const GLenum COLOR_ATTACHMENT2 = 0x8CE2; + const GLenum COLOR_ATTACHMENT3 = 0x8CE3; + const GLenum COLOR_ATTACHMENT4 = 0x8CE4; + const GLenum COLOR_ATTACHMENT5 = 0x8CE5; + const GLenum COLOR_ATTACHMENT6 = 0x8CE6; + const GLenum COLOR_ATTACHMENT7 = 0x8CE7; + const GLenum COLOR_ATTACHMENT8 = 0x8CE8; + const GLenum COLOR_ATTACHMENT9 = 0x8CE9; + const GLenum COLOR_ATTACHMENT10 = 0x8CEA; + const GLenum COLOR_ATTACHMENT11 = 0x8CEB; + const GLenum COLOR_ATTACHMENT12 = 0x8CEC; + const GLenum COLOR_ATTACHMENT13 = 0x8CED; + const GLenum COLOR_ATTACHMENT14 = 0x8CEE; + const GLenum COLOR_ATTACHMENT15 = 0x8CEF; + const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56; + const GLenum MAX_SAMPLES = 0x8D57; + const GLenum HALF_FLOAT = 0x140B; + const GLenum RG = 0x8227; + const GLenum RG_INTEGER = 0x8228; + const GLenum R8 = 0x8229; + const GLenum RG8 = 0x822B; + const GLenum R16F = 0x822D; + const GLenum R32F = 0x822E; + const GLenum RG16F = 0x822F; + const GLenum RG32F = 0x8230; + const GLenum R8I = 0x8231; + const GLenum R8UI = 0x8232; + const GLenum R16I = 0x8233; + const GLenum R16UI = 0x8234; + const GLenum R32I = 0x8235; + const GLenum R32UI = 0x8236; + const GLenum RG8I = 0x8237; + const GLenum RG8UI = 0x8238; + const GLenum RG16I = 0x8239; + const GLenum RG16UI = 0x823A; + const GLenum RG32I = 0x823B; + const GLenum RG32UI = 0x823C; + const GLenum VERTEX_ARRAY_BINDING = 0x85B5; + const GLenum R8_SNORM = 0x8F94; + const GLenum RG8_SNORM = 0x8F95; + const GLenum RGB8_SNORM = 0x8F96; + const GLenum RGBA8_SNORM = 0x8F97; + const GLenum SIGNED_NORMALIZED = 0x8F9C; + const GLenum COPY_READ_BUFFER = 0x8F36; + const GLenum COPY_WRITE_BUFFER = 0x8F37; + const GLenum COPY_READ_BUFFER_BINDING = 0x8F36; /* Same as COPY_READ_BUFFER */ + const GLenum COPY_WRITE_BUFFER_BINDING = 0x8F37; /* Same as COPY_WRITE_BUFFER */ + const GLenum UNIFORM_BUFFER = 0x8A11; + const GLenum UNIFORM_BUFFER_BINDING = 0x8A28; + const GLenum UNIFORM_BUFFER_START = 0x8A29; + const GLenum UNIFORM_BUFFER_SIZE = 0x8A2A; + const GLenum MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B; + const GLenum MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D; + const GLenum MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E; + const GLenum MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F; + const GLenum MAX_UNIFORM_BLOCK_SIZE = 0x8A30; + const GLenum MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31; + const GLenum MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33; + const GLenum UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34; + const GLenum ACTIVE_UNIFORM_BLOCKS = 0x8A36; + const GLenum UNIFORM_TYPE = 0x8A37; + const GLenum UNIFORM_SIZE = 0x8A38; + const GLenum UNIFORM_BLOCK_INDEX = 0x8A3A; + const GLenum UNIFORM_OFFSET = 0x8A3B; + const GLenum UNIFORM_ARRAY_STRIDE = 0x8A3C; + const GLenum UNIFORM_MATRIX_STRIDE = 0x8A3D; + const GLenum UNIFORM_IS_ROW_MAJOR = 0x8A3E; + const GLenum UNIFORM_BLOCK_BINDING = 0x8A3F; + const GLenum UNIFORM_BLOCK_DATA_SIZE = 0x8A40; + const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42; + const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43; + const GLenum UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44; + const GLenum UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46; + const GLenum INVALID_INDEX = 0xFFFFFFFF; + const GLenum MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122; + const GLenum MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125; + const GLenum MAX_SERVER_WAIT_TIMEOUT = 0x9111; + const GLenum OBJECT_TYPE = 0x9112; + const GLenum SYNC_CONDITION = 0x9113; + const GLenum SYNC_STATUS = 0x9114; + const GLenum SYNC_FLAGS = 0x9115; + const GLenum SYNC_FENCE = 0x9116; + const GLenum SYNC_GPU_COMMANDS_COMPLETE = 0x9117; + const GLenum UNSIGNALED = 0x9118; + const GLenum SIGNALED = 0x9119; + const GLenum ALREADY_SIGNALED = 0x911A; + const GLenum TIMEOUT_EXPIRED = 0x911B; + const GLenum CONDITION_SATISFIED = 0x911C; + const GLenum WAIT_FAILED = 0x911D; + const GLenum SYNC_FLUSH_COMMANDS_BIT = 0x00000001; + const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE; + const GLenum ANY_SAMPLES_PASSED = 0x8C2F; + const GLenum ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A; + const GLenum SAMPLER_BINDING = 0x8919; + const GLenum RGB10_A2UI = 0x906F; + const GLenum INT_2_10_10_10_REV = 0x8D9F; + const GLenum TRANSFORM_FEEDBACK = 0x8E22; + const GLenum TRANSFORM_FEEDBACK_PAUSED = 0x8E23; + const GLenum TRANSFORM_FEEDBACK_ACTIVE = 0x8E24; + const GLenum TRANSFORM_FEEDBACK_BINDING = 0x8E25; + const GLenum TEXTURE_IMMUTABLE_FORMAT = 0x912F; + const GLenum MAX_ELEMENT_INDEX = 0x8D6B; + const GLenum TEXTURE_IMMUTABLE_LEVELS = 0x82DF; + + const GLint64 TIMEOUT_IGNORED = -1; + + /* WebGL-specific enums */ + const GLenum MAX_CLIENT_WAIT_TIMEOUT_WEBGL = 0x9247; + + /* Buffer objects */ + void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, + GLintptr writeOffset, GLsizeiptr size); + // MapBufferRange, in particular its read-only and write-only modes, + // can not be exposed safely to JavaScript. GetBufferSubData + // replaces it for the purpose of fetching data back from the GPU. + void getBufferSubData(GLenum target, GLintptr srcByteOffset, /*[AllowShared]*/ ArrayBufferView dstBuffer, + optional GLuint dstOffset = 0, optional GLuint length = 0); + + /* Framebuffer objects */ + // void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, + // GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + void framebufferTextureLayer(GLenum target, GLenum attachment, WebGLTexture? texture, GLint level, + GLint layer); + void invalidateFramebuffer(GLenum target, sequence<GLenum> attachments); + void invalidateSubFramebuffer(GLenum target, sequence<GLenum> attachments, + GLint x, GLint y, GLsizei width, GLsizei height); + void readBuffer(GLenum src); + + /* Renderbuffer objects */ + any getInternalformatParameter(GLenum target, GLenum internalformat, GLenum pname); + void renderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, + GLsizei width, GLsizei height); + + /* Texture objects */ + void texStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, + GLsizei height); + void texStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, + GLsizei height, GLsizei depth); + + //[Throws] + //void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, + // GLsizei depth, GLint border, GLenum format, GLenum type, GLintptr pboOffset); + //[Throws] + //void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, + // GLsizei depth, GLint border, GLenum format, GLenum type, + // TexImageSource source); // May throw DOMException + //[Throws] + //void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, + // GLsizei depth, GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView? srcData); + //[Throws] + //void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, + // GLsizei depth, GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView srcData, + // GLuint srcOffset); + + //[Throws] + //void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, + // GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, + // GLintptr pboOffset); + //[Throws] + //void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, + // GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, + // TexImageSource source); // May throw DOMException + //[Throws] + //void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, + // GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, + // [AllowShared] ArrayBufferView? srcData, optional GLuint srcOffset = 0); + + //void copyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, + // GLint x, GLint y, GLsizei width, GLsizei height); + + //void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, + // GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLintptr offset); + //void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, + // GLsizei height, GLsizei depth, GLint border, [AllowShared] ArrayBufferView srcData, + // optional GLuint srcOffset = 0, optional GLuint srcLengthOverride = 0); + + //void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, + // GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, + // GLenum format, GLsizei imageSize, GLintptr offset); + //void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, + // GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, + // GLenum format, [AllowShared] ArrayBufferView srcData, + // optional GLuint srcOffset = 0, + // optional GLuint srcLengthOverride = 0); + + /* Programs and shaders */ + [WebGLHandlesContextLoss] GLint getFragDataLocation(WebGLProgram program, DOMString name); + + /* Uniforms */ + void uniform1ui(WebGLUniformLocation? location, GLuint v0); + void uniform2ui(WebGLUniformLocation? location, GLuint v0, GLuint v1); + void uniform3ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2); + void uniform4ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); + + void uniform1uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0, + optional GLuint srcLength = 0); + void uniform2uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0, + optional GLuint srcLength = 0); + void uniform3uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0, + optional GLuint srcLength = 0); + void uniform4uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0, + optional GLuint srcLength = 0); + + void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, + optional GLuint srcOffset = 0, optional GLuint srcLength = 0); + void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, + optional GLuint srcOffset = 0, optional GLuint srcLength = 0); + + void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, + optional GLuint srcOffset = 0, optional GLuint srcLength = 0); + void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, + optional GLuint srcOffset = 0, optional GLuint srcLength = 0); + + void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, + optional GLuint srcOffset = 0, optional GLuint srcLength = 0); + void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, + optional GLuint srcOffset = 0, optional GLuint srcLength = 0); + + /* Vertex attribs */ + void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w); + void vertexAttribI4iv(GLuint index, Int32List values); + void vertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); + void vertexAttribI4uiv(GLuint index, Uint32List values); + void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); + + /* Writing to the drawing buffer */ + void vertexAttribDivisor(GLuint index, GLuint divisor); + void drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount); + void drawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei instanceCount); + void drawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLintptr offset); + + /* Multiple Render Targets */ + void drawBuffers(sequence<GLenum> buffers); + + void clearBufferfv(GLenum buffer, GLint drawbuffer, Float32List values, + optional GLuint srcOffset = 0); + void clearBufferiv(GLenum buffer, GLint drawbuffer, Int32List values, + optional GLuint srcOffset = 0); + void clearBufferuiv(GLenum buffer, GLint drawbuffer, Uint32List values, + optional GLuint srcOffset = 0); + + void clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); + + /* Query Objects */ + WebGLQuery? createQuery(); + void deleteQuery(WebGLQuery? query); + /*[WebGLHandlesContextLoss]*/ GLboolean isQuery(WebGLQuery? query); + void beginQuery(GLenum target, WebGLQuery query); + void endQuery(GLenum target); + WebGLQuery? getQuery(GLenum target, GLenum pname); + any getQueryParameter(WebGLQuery query, GLenum pname); + + /* Sampler Objects */ + WebGLSampler? createSampler(); + void deleteSampler(WebGLSampler? sampler); + [WebGLHandlesContextLoss] GLboolean isSampler(WebGLSampler? sampler); + void bindSampler(GLuint unit, WebGLSampler? sampler); + void samplerParameteri(WebGLSampler sampler, GLenum pname, GLint param); + void samplerParameterf(WebGLSampler sampler, GLenum pname, GLfloat param); + any getSamplerParameter(WebGLSampler sampler, GLenum pname); + + /* Sync objects */ + WebGLSync? fenceSync(GLenum condition, GLbitfield flags); + [WebGLHandlesContextLoss] GLboolean isSync(WebGLSync? sync); + void deleteSync(WebGLSync? sync); + GLenum clientWaitSync(WebGLSync sync, GLbitfield flags, GLuint64 timeout); + void waitSync(WebGLSync sync, GLbitfield flags, GLint64 timeout); + any getSyncParameter(WebGLSync sync, GLenum pname); + + /* Transform Feedback */ + WebGLTransformFeedback? createTransformFeedback(); + void deleteTransformFeedback(WebGLTransformFeedback? tf); + [WebGLHandlesContextLoss] GLboolean isTransformFeedback(WebGLTransformFeedback? tf); + void bindTransformFeedback (GLenum target, WebGLTransformFeedback? tf); + void beginTransformFeedback(GLenum primitiveMode); + void endTransformFeedback(); + void transformFeedbackVaryings(WebGLProgram program, sequence<DOMString> varyings, GLenum bufferMode); + WebGLActiveInfo? getTransformFeedbackVarying(WebGLProgram program, GLuint index); + void pauseTransformFeedback(); + void resumeTransformFeedback(); + + /* Uniform Buffer Objects and Transform Feedback Buffers */ + void bindBufferBase(GLenum target, GLuint index, WebGLBuffer? buffer); + void bindBufferRange(GLenum target, GLuint index, WebGLBuffer? buffer, GLintptr offset, GLsizeiptr size); + any getIndexedParameter(GLenum target, GLuint index); + sequence<GLuint>? getUniformIndices(WebGLProgram program, sequence<DOMString> uniformNames); + any getActiveUniforms(WebGLProgram program, sequence<GLuint> uniformIndices, GLenum pname); + GLuint getUniformBlockIndex(WebGLProgram program, DOMString uniformBlockName); + any getActiveUniformBlockParameter(WebGLProgram program, GLuint uniformBlockIndex, GLenum pname); + DOMString? getActiveUniformBlockName(WebGLProgram program, GLuint uniformBlockIndex); + void uniformBlockBinding(WebGLProgram program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); + + /* Vertex Array Objects */ + WebGLVertexArrayObject? createVertexArray(); + void deleteVertexArray(WebGLVertexArrayObject? vertexArray); + [WebGLHandlesContextLoss] GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray); + void bindVertexArray(WebGLVertexArrayObject? array); +}; + +interface mixin WebGL2RenderingContextOverloads +{ + // WebGL1: + void bufferData(GLenum target, GLsizeiptr size, GLenum usage); + void bufferData(GLenum target, /*[AllowShared]*/ BufferSource? srcData, GLenum usage); + void bufferSubData(GLenum target, GLintptr dstByteOffset, /*[AllowShared]*/ BufferSource srcData); + // WebGL2: + void bufferData(GLenum target, /*[AllowShared]*/ ArrayBufferView srcData, GLenum usage, GLuint srcOffset, + optional GLuint length = 0); + void bufferSubData(GLenum target, GLintptr dstByteOffset, /*[AllowShared]*/ ArrayBufferView srcData, + GLuint srcOffset, optional GLuint length = 0); + + // WebGL1 legacy entrypoints: + [Throws] + void texImage2D(GLenum target, GLint level, GLint internalformat, + GLsizei width, GLsizei height, GLint border, GLenum format, + GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels); + [Throws] + void texImage2D(GLenum target, GLint level, GLint internalformat, + GLenum format, GLenum type, TexImageSource source); // May throw DOMException + + [Throws] + void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels); + [Throws] + void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, + GLenum format, GLenum type, TexImageSource source); // May throw DOMException + + // WebGL2 entrypoints: + [Throws] + void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, + GLint border, GLenum format, GLenum type, GLintptr pboOffset); + [Throws] + void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, + GLint border, GLenum format, GLenum type, + TexImageSource source); // May throw DOMException + [Throws] + void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, + GLint border, GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView srcData, + GLuint srcOffset); + + //[Throws] + //void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, + // GLsizei height, GLenum format, GLenum type, GLintptr pboOffset); + //[Throws] + //void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, + // GLsizei height, GLenum format, GLenum type, + // TexImageSource source); // May throw DOMException + //[Throws] + //void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, + // GLsizei height, GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView srcData, + // GLuint srcOffset); + + //void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, + // GLsizei height, GLint border, GLsizei imageSize, GLintptr offset); + void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, + GLsizei height, GLint border, /*[AllowShared]*/ ArrayBufferView srcData, + optional GLuint srcOffset = 0, optional GLuint srcLengthOverride = 0); + + //void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, + // GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLintptr offset); + void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, GLenum format, + /*[AllowShared]*/ ArrayBufferView srcData, + optional GLuint srcOffset = 0, + optional GLuint srcLengthOverride = 0); + + void uniform1fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0, + optional GLuint srcLength = 0); + void uniform2fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0, + optional GLuint srcLength = 0); + void uniform3fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0, + optional GLuint srcLength = 0); + void uniform4fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0, + optional GLuint srcLength = 0); + + void uniform1iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0, + optional GLuint srcLength = 0); + void uniform2iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0, + optional GLuint srcLength = 0); + void uniform3iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0, + optional GLuint srcLength = 0); + void uniform4iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0, + optional GLuint srcLength = 0); + + void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, + optional GLuint srcOffset = 0, optional GLuint srcLength = 0); + void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, + optional GLuint srcOffset = 0, optional GLuint srcLength = 0); + void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, + optional GLuint srcOffset = 0, optional GLuint srcLength = 0); + + /* Reading back pixels */ + // WebGL1: + void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, + /*[AllowShared]*/ ArrayBufferView? dstData); + // WebGL2: + void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, + GLintptr offset); + void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, + /*[AllowShared]*/ ArrayBufferView dstData, GLuint dstOffset); +}; + +[Exposed=Window, Func="WebGL2RenderingContext::is_webgl2_enabled"] +interface WebGL2RenderingContext +{ +}; +WebGL2RenderingContext includes WebGLRenderingContextBase; +WebGL2RenderingContext includes WebGL2RenderingContextBase; +WebGL2RenderingContext includes WebGL2RenderingContextOverloads; diff --git a/components/script/dom/webidls/WebGLActiveInfo.webidl b/components/script/dom/webidls/WebGLActiveInfo.webidl index be9e6f4e2db..42e703db088 100644 --- a/components/script/dom/webidls/WebGLActiveInfo.webidl +++ b/components/script/dom/webidls/WebGLActiveInfo.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // // WebGL IDL definitions scraped from the Khronos specification: // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.7 diff --git a/components/script/dom/webidls/WebGLBuffer.webidl b/components/script/dom/webidls/WebGLBuffer.webidl index ca2697bb9be..c182be1415d 100644 --- a/components/script/dom/webidls/WebGLBuffer.webidl +++ b/components/script/dom/webidls/WebGLBuffer.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // // WebGL IDL definitions scraped from the Khronos specification: // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.4 diff --git a/components/script/dom/webidls/WebGLContextEvent.webidl b/components/script/dom/webidls/WebGLContextEvent.webidl index b5c70b8b17f..5c6a1c4f1d7 100644 --- a/components/script/dom/webidls/WebGLContextEvent.webidl +++ b/components/script/dom/webidls/WebGLContextEvent.webidl @@ -1,11 +1,11 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15 -[Constructor(DOMString type, optional WebGLContextEventInit eventInit), - Exposed=Window] +[Exposed=Window] interface WebGLContextEvent : Event { + [Throws] constructor(DOMString type, optional WebGLContextEventInit eventInit = {}); readonly attribute DOMString statusMessage; }; diff --git a/components/script/dom/webidls/WebGLFramebuffer.webidl b/components/script/dom/webidls/WebGLFramebuffer.webidl index 306e2c479ed..b036b752161 100644 --- a/components/script/dom/webidls/WebGLFramebuffer.webidl +++ b/components/script/dom/webidls/WebGLFramebuffer.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // // WebGL IDL definitions scraped from the Khronos specification: // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.7 diff --git a/components/script/dom/webidls/WebGLObject.webidl b/components/script/dom/webidls/WebGLObject.webidl index 3e8f1f54cca..90feba0ab6a 100644 --- a/components/script/dom/webidls/WebGLObject.webidl +++ b/components/script/dom/webidls/WebGLObject.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // // WebGL IDL definitions scraped from the Khronos specification: // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.3 diff --git a/components/script/dom/webidls/WebGLProgram.webidl b/components/script/dom/webidls/WebGLProgram.webidl index 2ee21b2a6a1..29125b57b84 100644 --- a/components/script/dom/webidls/WebGLProgram.webidl +++ b/components/script/dom/webidls/WebGLProgram.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // // WebGL IDL definitions scraped from the Khronos specification: // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.6 diff --git a/components/script/dom/webidls/WebGLQuery.webidl b/components/script/dom/webidls/WebGLQuery.webidl new file mode 100644 index 00000000000..04b3711dd86 --- /dev/null +++ b/components/script/dom/webidls/WebGLQuery.webidl @@ -0,0 +1,11 @@ +/* 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/. */ +// +// WebGL IDL definitions scraped from the Khronos specification: +// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.8 +// + +[Exposed=Window, Pref="dom.webgl2.enabled"] +interface WebGLQuery : WebGLObject { +}; diff --git a/components/script/dom/webidls/WebGLRenderbuffer.webidl b/components/script/dom/webidls/WebGLRenderbuffer.webidl index 3024dc7513e..465f193aaac 100644 --- a/components/script/dom/webidls/WebGLRenderbuffer.webidl +++ b/components/script/dom/webidls/WebGLRenderbuffer.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // // WebGL IDL definitions scraped from the Khronos specification: // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.5 diff --git a/components/script/dom/webidls/WebGLRenderingContext.webidl b/components/script/dom/webidls/WebGLRenderingContext.webidl index 0d4c14a05df..4003ab86ba5 100644 --- a/components/script/dom/webidls/WebGLRenderingContext.webidl +++ b/components/script/dom/webidls/WebGLRenderingContext.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // // WebGL IDL definitions scraped from the Khronos specification: // https://www.khronos.org/registry/webgl/specs/latest/ @@ -29,6 +29,8 @@ typedef (ImageData or HTMLCanvasElement or HTMLVideoElement) TexImageSource; +typedef (/*[AllowShared]*/ Float32Array or sequence<GLfloat>) Float32List; +typedef (/*[AllowShared]*/ Int32Array or sequence<GLint>) Int32List; dictionary WebGLContextAttributes { GLboolean alpha = true; @@ -41,8 +43,8 @@ dictionary WebGLContextAttributes { GLboolean failIfMajorPerformanceCaveat = false; }; -[Exposed=Window, NoInterfaceObject] -interface WebGLRenderingContextBase +[Exposed=Window] +interface mixin WebGLRenderingContextBase { /* ClearBufferMask */ @@ -419,7 +421,6 @@ interface WebGLRenderingContextBase const GLenum RGB5_A1 = 0x8057; const GLenum RGB565 = 0x8D62; const GLenum DEPTH_COMPONENT16 = 0x81A5; - const GLenum STENCIL_INDEX = 0x1901; const GLenum STENCIL_INDEX8 = 0x8D48; const GLenum DEPTH_STENCIL = 0x84F9; @@ -469,14 +470,14 @@ interface WebGLRenderingContextBase readonly attribute GLsizei drawingBufferHeight; [WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes(); - //[WebGLHandlesContextLoss] boolean isContextLost(); + [WebGLHandlesContextLoss] boolean isContextLost(); sequence<DOMString>? getSupportedExtensions(); object? getExtension(DOMString name); void activeTexture(GLenum texture); - void attachShader(WebGLProgram? program, WebGLShader? shader); - void bindAttribLocation(WebGLProgram? program, GLuint index, DOMString name); + void attachShader(WebGLProgram program, WebGLShader shader); + void bindAttribLocation(WebGLProgram program, GLuint index, DOMString name); void bindBuffer(GLenum target, WebGLBuffer? buffer); void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer); void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer); @@ -488,55 +489,17 @@ interface WebGLRenderingContextBase void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); - // typedef (ArrayBuffer or ArrayBufferView) BufferDataSource; - // FIXME(dmarcos) The function below is the original function in the webIdl: - // void bufferData(GLenum target, BufferDataSource? data, GLenum usage); - // The Code generator doesn't handle BufferDataSource so we're using 'object?' - // in the meantime, and marking the function as [Throws], so we can handle - // the type error from inside. - [Throws] - void bufferData(GLenum target, object? data, GLenum usage); - // FIXME: Codegen requires that this have [Throws] to match the other one. - [Throws] - void bufferData(GLenum target, GLsizeiptr size, GLenum usage); - - //void bufferSubData(GLenum target, GLintptr offset, BufferDataSource? data); - [Throws] - void bufferSubData(GLenum target, GLintptr offset, object? data); - [WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target); void clear(GLbitfield mask); void clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); void clearDepth(GLclampf depth); void clearStencil(GLint s); void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); - void compileShader(WebGLShader? shader); - - // FIXME(simartin) The Code generator doesn't handle ArrayBufferView so we're - // using 'object' in the meantime, and marking the function as Throws to - // handle the type error from inside. - // void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, - // GLsizei width, GLsizei height, GLint border, - // ArrayBufferView data); - [Throws] - void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, - GLsizei width, GLsizei height, GLint border, - object data); - // void compressedTexSubImage2D(GLenum target, GLint level, - // GLint xoffset, GLint yoffset, - // GLsizei width, GLsizei height, GLenum format, - // ArrayBufferView data); - [Throws] - void compressedTexSubImage2D(GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, GLenum format, - object data); + void compileShader(WebGLShader shader); - // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 void copyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); - // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); @@ -559,7 +522,7 @@ interface WebGLRenderingContextBase void depthFunc(GLenum func); void depthMask(GLboolean flag); void depthRange(GLclampf zNear, GLclampf zFar); - void detachShader(WebGLProgram? program, WebGLShader? shader); + void detachShader(WebGLProgram program, WebGLShader shader); void disable(GLenum cap); void disableVertexAttribArray(GLuint index); void drawArrays(GLenum mode, GLint first, GLsizei count); @@ -578,37 +541,37 @@ interface WebGLRenderingContextBase void generateMipmap(GLenum target); - WebGLActiveInfo? getActiveAttrib(WebGLProgram? program, GLuint index); - WebGLActiveInfo? getActiveUniform(WebGLProgram? program, GLuint index); - //sequence<WebGLShader>? getAttachedShaders(WebGLProgram? program); + WebGLActiveInfo? getActiveAttrib(WebGLProgram program, GLuint index); + WebGLActiveInfo? getActiveUniform(WebGLProgram program, GLuint index); + sequence<WebGLShader>? getAttachedShaders(WebGLProgram program); - [WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram? program, DOMString name); + [WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram program, DOMString name); any getBufferParameter(GLenum target, GLenum pname); any getParameter(GLenum pname); [WebGLHandlesContextLoss] GLenum getError(); - //any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, - // GLenum pname); - any getProgramParameter(WebGLProgram? program, GLenum pname); - DOMString? getProgramInfoLog(WebGLProgram? program); - //any getRenderbufferParameter(GLenum target, GLenum pname); - any getShaderParameter(WebGLShader? shader, GLenum pname); + any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, + GLenum pname); + any getProgramParameter(WebGLProgram program, GLenum pname); + DOMString? getProgramInfoLog(WebGLProgram program); + any getRenderbufferParameter(GLenum target, GLenum pname); + any getShaderParameter(WebGLShader shader, GLenum pname); WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype); - DOMString? getShaderInfoLog(WebGLShader? shader); + DOMString? getShaderInfoLog(WebGLShader shader); - DOMString? getShaderSource(WebGLShader? shader); + DOMString? getShaderSource(WebGLShader shader); - //any getTexParameter(GLenum target, GLenum pname); + any getTexParameter(GLenum target, GLenum pname); - //any getUniform(WebGLProgram? program, WebGLUniformLocation? location); + any getUniform(WebGLProgram program, WebGLUniformLocation location); - WebGLUniformLocation? getUniformLocation(WebGLProgram? program, DOMString name); + WebGLUniformLocation? getUniformLocation(WebGLProgram program, DOMString name); any getVertexAttrib(GLuint index, GLenum pname); - //[WebGLHandlesContextLoss] GLsizeiptr getVertexAttribOffset(GLuint index, GLenum pname); + [WebGLHandlesContextLoss] GLsizeiptr getVertexAttribOffset(GLuint index, GLenum pname); void hint(GLenum target, GLenum mode); [WebGLHandlesContextLoss] GLboolean isBuffer(WebGLBuffer? buffer); @@ -619,22 +582,16 @@ interface WebGLRenderingContextBase [WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader); [WebGLHandlesContextLoss] GLboolean isTexture(WebGLTexture? texture); void lineWidth(GLfloat width); - void linkProgram(WebGLProgram? program); + void linkProgram(WebGLProgram program); void pixelStorei(GLenum pname, GLint param); void polygonOffset(GLfloat factor, GLfloat units); - //void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, - // GLenum format, GLenum type, ArrayBufferView? pixels); - [Throws] - void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, object? pixels); - void renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); void sampleCoverage(GLclampf value, GLboolean invert); void scissor(GLint x, GLint y, GLsizei width, GLsizei height); - void shaderSource(WebGLShader? shader, DOMString source); + void shaderSource(WebGLShader shader, DOMString source); void stencilFunc(GLenum func, GLint ref, GLuint mask); void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); @@ -643,130 +600,96 @@ interface WebGLRenderingContextBase void stencilOp(GLenum fail, GLenum zfail, GLenum zpass); void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); - //void texImage2D(GLenum target, GLint level, GLenum internalformat, - // GLsizei width, GLsizei height, GLint border, GLenum format, - // GLenum type, ArrayBufferView? pixels); - // FIXME: SM interface arguments - [Throws] - void texImage2D(GLenum target, GLint level, GLenum internalformat, - GLsizei width, GLsizei height, GLint border, GLenum format, - GLenum type, object? data); - [Throws] - void texImage2D(GLenum target, GLint level, GLenum internalformat, - GLenum format, GLenum type, TexImageSource? source); // May throw DOMException - void texParameterf(GLenum target, GLenum pname, GLfloat param); void texParameteri(GLenum target, GLenum pname, GLint param); - [Throws] - void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, object? data); - [Throws] - void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLenum format, GLenum type, TexImageSource? source); // May throw DOMException - void uniform1f(WebGLUniformLocation? location, GLfloat x); - //void uniform1fv(WebGLUniformLocation? location, Float32Array v); - //void uniform1fv(WebGLUniformLocation? location, sequence<GLfloat> v); - [Throws] - void uniform1fv(WebGLUniformLocation? location, object v); - void uniform1i(WebGLUniformLocation? location, GLint x); - //void uniform1iv(WebGLUniformLocation? location, Int32Array v); - //void uniform1iv(WebGLUniformLocation? location, sequence<long> v); - [Throws] - void uniform1iv(WebGLUniformLocation? location, object v); void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y); - //void uniform2fv(WebGLUniformLocation? location, Float32Array v); - //void uniform2fv(WebGLUniformLocation? location, sequence<GLfloat> v); - [Throws] - void uniform2fv(WebGLUniformLocation? location, object v); - //void uniform2i(WebGLUniformLocation? location, GLint x, GLint y); - void uniform2i(WebGLUniformLocation? location, GLint x, GLint y); - //void uniform2iv(WebGLUniformLocation? location, Int32Array v); - //void uniform2iv(WebGLUniformLocation? location, sequence<long> v); - [Throws] - void uniform2iv(WebGLUniformLocation? location, object v); void uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z); - [Throws] - void uniform3fv(WebGLUniformLocation? location, object v); - //void uniform3fv(WebGLUniformLocation? location, Float32Array v); - //void uniform3fv(WebGLUniformLocation? location, sequence<GLfloat> v); - void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z); - //void uniform3iv(WebGLUniformLocation? location, Int32Array v); - //void uniform3iv(WebGLUniformLocation? location, sequence<long> v); - [Throws] - void uniform3iv(WebGLUniformLocation? location, object v); void uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - // FIXME(dmarcos) The function below is the original function in the webIdl: - //void uniform4fv(WebGLUniformLocation? location, Float32Array v); - // The Code genearator doesn't handle typed arrays, so we use object - // instead, and handle the type error ourselves. - [Throws] - void uniform4fv(WebGLUniformLocation? location, object v); - //void uniform4fv(WebGLUniformLocation? location, sequence<GLfloat> v); - void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w); - //void uniform4iv(WebGLUniformLocation? location, Int32Array v); - //void uniform4iv(WebGLUniformLocation? location, sequence<long> v); - // See FIXME above - [Throws] - void uniform4iv(WebGLUniformLocation? location, object v); - //void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, - // Float32Array value); - //void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, - // sequence<GLfloat> value); - [Throws] - void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, - object v); - //void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, - // Float32Array value); - //void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, - // sequence<GLfloat> value); - [Throws] - void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, - object v); - //void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, - // Float32Array value); - //void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, - // sequence<GLfloat> value); - [Throws] - void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, - object v); + void uniform1i(WebGLUniformLocation? location, GLint x); + void uniform2i(WebGLUniformLocation? location, GLint x, GLint y); + void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z); + void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w); void useProgram(WebGLProgram? program); - void validateProgram(WebGLProgram? program); + void validateProgram(WebGLProgram program); - // FIXME(dmarcos) - // The code generator doesn't handle Float32Array so we're using 'object' void vertexAttrib1f(GLuint indx, GLfloat x); - //void vertexAttrib1fv(GLuint indx, Float32Array values); - [Throws] - void vertexAttrib1fv(GLuint indx, object values); - //void vertexAttrib1fv(GLuint indx, sequence<GLfloat> values); void vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y); - //void vertexAttrib2fv(GLuint indx, Float32Array values); - [Throws] - void vertexAttrib2fv(GLuint indx, object values); - //void vertexAttrib2fv(GLuint indx, sequence<GLfloat> values); void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z); - //void vertexAttrib3fv(GLuint indx, Float32Array values); - [Throws] - void vertexAttrib3fv(GLuint indx, object values); - //void vertexAttrib3fv(GLuint indx, sequence<GLfloat> values); void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - //void vertexAttrib4fv(GLuint indx, Float32Array values); - [Throws] - void vertexAttrib4fv(GLuint indx, object values); - //void vertexAttrib4fv(GLuint indx, sequence<GLfloat> values); + + void vertexAttrib1fv(GLuint indx, Float32List values); + void vertexAttrib2fv(GLuint indx, Float32List values); + void vertexAttrib3fv(GLuint indx, Float32List values); + void vertexAttrib4fv(GLuint indx, Float32List values); + void vertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); void viewport(GLint x, GLint y, GLsizei width, GLsizei height); }; -[Exposed=Window] +interface mixin WebGLRenderingContextOverloads +{ + void bufferData(GLenum target, GLsizeiptr size, GLenum usage); + void bufferData(GLenum target, /*[AllowShared]*/ BufferSource? data, GLenum usage); + void bufferSubData(GLenum target, GLintptr offset, /*[AllowShared]*/ BufferSource data); + + void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, + GLsizei width, GLsizei height, GLint border, + /*[AllowShared]*/ ArrayBufferView data); + void compressedTexSubImage2D(GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, GLenum format, + /*[AllowShared]*/ ArrayBufferView data); + + void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels); + + [Throws] + void texImage2D(GLenum target, GLint level, GLint internalformat, + GLsizei width, GLsizei height, GLint border, GLenum format, + GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels); + [Throws] + void texImage2D(GLenum target, GLint level, GLint internalformat, + GLenum format, GLenum type, TexImageSource source); // May throw DOMException + + [Throws] + void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels); + [Throws] + void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, + GLenum format, GLenum type, TexImageSource source); // May throw DOMException + + void uniform1fv(WebGLUniformLocation? location, Float32List v); + void uniform2fv(WebGLUniformLocation? location, Float32List v); + void uniform3fv(WebGLUniformLocation? location, Float32List v); + void uniform4fv(WebGLUniformLocation? location, Float32List v); + + void uniform1iv(WebGLUniformLocation? location, Int32List v); + void uniform2iv(WebGLUniformLocation? location, Int32List v); + void uniform3iv(WebGLUniformLocation? location, Int32List v); + void uniform4iv(WebGLUniformLocation? location, Int32List v); + + void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value); + void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value); + void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value); +}; + +interface mixin WebGLRenderingContextExtensions { + [Throws, Pref="dom.webgl.dom_to_texture.enabled"] + void texImageDOM(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, + GLenum format, GLenum type, HTMLIFrameElement source); // May throw DOMException +}; + +[Exposed=(Window)] interface WebGLRenderingContext { }; -WebGLRenderingContext implements WebGLRenderingContextBase; +WebGLRenderingContext includes WebGLRenderingContextBase; +WebGLRenderingContext includes WebGLRenderingContextOverloads; +WebGLRenderingContext includes WebGLRenderingContextExtensions; diff --git a/components/script/dom/webidls/WebGLSampler.webidl b/components/script/dom/webidls/WebGLSampler.webidl new file mode 100644 index 00000000000..90c66b65a1d --- /dev/null +++ b/components/script/dom/webidls/WebGLSampler.webidl @@ -0,0 +1,11 @@ +/* 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/. */ +// +// WebGL IDL definitions scraped from the Khronos specification: +// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.8 +// + +[Exposed=Window, Pref="dom.webgl2.enabled"] +interface WebGLSampler : WebGLObject { +}; diff --git a/components/script/dom/webidls/WebGLShader.webidl b/components/script/dom/webidls/WebGLShader.webidl index 671da6405ff..af5f375dd99 100644 --- a/components/script/dom/webidls/WebGLShader.webidl +++ b/components/script/dom/webidls/WebGLShader.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // // WebGL IDL definitions scraped from the Khronos specification: // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.8 diff --git a/components/script/dom/webidls/WebGLShaderPrecisionFormat.webidl b/components/script/dom/webidls/WebGLShaderPrecisionFormat.webidl index eb7b1370b31..10fed47b558 100644 --- a/components/script/dom/webidls/WebGLShaderPrecisionFormat.webidl +++ b/components/script/dom/webidls/WebGLShaderPrecisionFormat.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // // WebGL IDL definitions scraped from the Khronos specification: // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.7 diff --git a/components/script/dom/webidls/WebGLSync.webidl b/components/script/dom/webidls/WebGLSync.webidl new file mode 100644 index 00000000000..f8cd33ef9ce --- /dev/null +++ b/components/script/dom/webidls/WebGLSync.webidl @@ -0,0 +1,11 @@ +/* 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/. */ +// +// WebGL IDL definitions scraped from the Khronos specification: +// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.14 +// + +[Exposed=Window, Pref="dom.webgl2.enabled"] +interface WebGLSync : WebGLObject { +}; diff --git a/components/script/dom/webidls/WebGLTexture.webidl b/components/script/dom/webidls/WebGLTexture.webidl index 42313c98683..384cea6644a 100644 --- a/components/script/dom/webidls/WebGLTexture.webidl +++ b/components/script/dom/webidls/WebGLTexture.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // // WebGL IDL definitions scraped from the Khronos specification: // https://www.khronos.org/registry/webgl/specs/latest/#5.9 diff --git a/components/script/dom/webidls/WebGLTransformFeedback.webidl b/components/script/dom/webidls/WebGLTransformFeedback.webidl new file mode 100644 index 00000000000..871c0f15c7b --- /dev/null +++ b/components/script/dom/webidls/WebGLTransformFeedback.webidl @@ -0,0 +1,11 @@ +/* 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/. */ +// +// WebGL IDL definitions scraped from the Khronos specification: +// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.15 +// + +[Exposed=(Window), Pref="dom.webgl2.enabled"] +interface WebGLTransformFeedback : WebGLObject { +}; diff --git a/components/script/dom/webidls/WebGLUniformLocation.webidl b/components/script/dom/webidls/WebGLUniformLocation.webidl index f068eead6e2..4cf09e42da4 100644 --- a/components/script/dom/webidls/WebGLUniformLocation.webidl +++ b/components/script/dom/webidls/WebGLUniformLocation.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // // WebGL IDL definitions scraped from the Khronos specification: // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.10 diff --git a/components/script/dom/webidls/WebGLVertexArrayObject.webidl b/components/script/dom/webidls/WebGLVertexArrayObject.webidl new file mode 100644 index 00000000000..a42d8cbe051 --- /dev/null +++ b/components/script/dom/webidls/WebGLVertexArrayObject.webidl @@ -0,0 +1,11 @@ +/* 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/. */ +// +// WebGL IDL definitions scraped from the Khronos specification: +// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.17 +// + +[Exposed=(Window), Pref="dom.webgl2.enabled"] +interface WebGLVertexArrayObject : WebGLObject { +}; diff --git a/components/script/dom/webidls/WebGLVertexArrayObjectOES.webidl b/components/script/dom/webidls/WebGLVertexArrayObjectOES.webidl new file mode 100644 index 00000000000..e576bd6089d --- /dev/null +++ b/components/script/dom/webidls/WebGLVertexArrayObjectOES.webidl @@ -0,0 +1,11 @@ +/* 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/. */ +/* + * WebGL IDL definitions scraped from the Khronos specification: + * https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/ + */ + +[NoInterfaceObject, Exposed=Window] +interface WebGLVertexArrayObjectOES: WebGLObject { +}; diff --git a/components/script/dom/webidls/WebSocket.webidl b/components/script/dom/webidls/WebSocket.webidl index b0f36a76657..089b2c5a378 100644 --- a/components/script/dom/webidls/WebSocket.webidl +++ b/components/script/dom/webidls/WebSocket.webidl @@ -1,13 +1,14 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#the-websocket-interface enum BinaryType { "blob", "arraybuffer" }; -[Constructor(DOMString url, optional (DOMString or sequence<DOMString>) protocols), Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface WebSocket : EventTarget { + [Throws] constructor(DOMString url, optional (DOMString or sequence<DOMString>) protocols); readonly attribute DOMString url; //ready state const unsigned short CONNECTING = 0; @@ -23,13 +24,13 @@ interface WebSocket : EventTarget { attribute EventHandler onclose; //readonly attribute DOMString extensions; readonly attribute DOMString protocol; - [Throws] void close([Clamp] optional unsigned short code, optional USVString reason); + [Throws] void close(optional [Clamp] unsigned short code, optional USVString reason); //messaging attribute EventHandler onmessage; attribute BinaryType binaryType; [Throws] void send(USVString data); [Throws] void send(Blob data); - //void send(ArrayBuffer data); - //void send(ArrayBufferView data); + [Throws] void send(ArrayBuffer data); + [Throws] void send(ArrayBufferView data); }; diff --git a/components/script/dom/webidls/WheelEvent.webidl b/components/script/dom/webidls/WheelEvent.webidl new file mode 100644 index 00000000000..15fc033a21b --- /dev/null +++ b/components/script/dom/webidls/WheelEvent.webidl @@ -0,0 +1,33 @@ +/* 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/. */ + +// https://w3c.github.io/uievents/#interface-wheelevent +[Exposed=Window] +interface WheelEvent : MouseEvent { + [Throws] constructor(DOMString typeArg, optional WheelEventInit wheelEventInitDict = {}); + const unsigned long DOM_DELTA_PIXEL = 0x00; + const unsigned long DOM_DELTA_LINE = 0x01; + const unsigned long DOM_DELTA_PAGE = 0x02; + readonly attribute double deltaX; + readonly attribute double deltaY; + readonly attribute double deltaZ; + readonly attribute unsigned long deltaMode; +}; + +// https://w3c.github.io/uievents/#idl-wheeleventinit +dictionary WheelEventInit : MouseEventInit { + double deltaX = 0.0; + double deltaY = 0.0; + double deltaZ = 0.0; + unsigned long deltaMode = 0; +}; + +// https://w3c.github.io/uievents/#idl-interface-WheelEvent-initializers +partial interface WheelEvent { + // Deprecated in DOM Level 3 + void initWheelEvent (DOMString typeArg, boolean bubblesArg, boolean cancelableArg, + Window? viewArg, long detailArg, + double deltaX, double deltaY, + double deltaZ, unsigned long deltaMode); +}; diff --git a/components/script/dom/webidls/Window.webidl b/components/script/dom/webidls/Window.webidl index 47c753f43b1..fa3460e9889 100644 --- a/components/script/dom/webidls/Window.webidl +++ b/components/script/dom/webidls/Window.webidl @@ -1,20 +1,21 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#window -[PrimaryGlobal] +[Global=Window, Exposed=Window /*, LegacyUnenumerableNamedProperties */] /*sealed*/ interface Window : GlobalScope { // the current browsing context [Unforgeable] readonly attribute WindowProxy window; [BinaryName="Self_", Replaceable] readonly attribute WindowProxy self; [Unforgeable] readonly attribute Document document; - // https://github.com/servo/servo/issues/14453 - // attribute DOMString name; + attribute DOMString name; - [/*PutForwards=href, */Unforgeable] readonly attribute Location location; + [PutForwards=href, Unforgeable] readonly attribute Location location; readonly attribute History history; + [Pref="dom.customelements.enabled"] + readonly attribute CustomElementRegistry customElements; //[Replaceable] readonly attribute BarProp locationbar; //[Replaceable] readonly attribute BarProp menubar; //[Replaceable] readonly attribute BarProp personalbar; @@ -23,24 +24,24 @@ //[Replaceable] readonly attribute BarProp toolbar; attribute DOMString status; void close(); - //readonly attribute boolean closed; - //void stop(); + readonly attribute boolean closed; + void stop(); //void focus(); //void blur(); // other browsing contexts [Replaceable] readonly attribute WindowProxy frames; - //[Replaceable] readonly attribute unsigned long length; + [Replaceable] readonly attribute unsigned long length; // Note that this can return null in the case that the browsing context has been discarded. // https://github.com/whatwg/html/issues/2115 [Unforgeable] readonly attribute WindowProxy? top; - // attribute any opener; + attribute any opener; // Note that this can return null in the case that the browsing context has been discarded. // https://github.com/whatwg/html/issues/2115 - readonly attribute WindowProxy? parent; + [Replaceable] readonly attribute WindowProxy? parent; readonly attribute Element? frameElement; - //WindowProxy open(optional DOMString url = "about:blank", optional DOMString target = "_blank", - // optional DOMString features = "", optional boolean replace = false); + [Throws] WindowProxy? open(optional USVString url = "", optional DOMString target = "_blank", + optional DOMString features = ""); //getter WindowProxy (unsigned long index); // https://github.com/servo/servo/issues/14453 @@ -54,52 +55,23 @@ // user prompts void alert(DOMString message); void alert(); - //boolean confirm(optional DOMString message = ""); - //DOMString? prompt(optional DOMString message = "", optional DOMString default = ""); + boolean confirm(optional DOMString message = ""); + DOMString? prompt(optional DOMString message = "", optional DOMString default = ""); //void print(); //any showModalDialog(DOMString url, optional any argument); unsigned long requestAnimationFrame(FrameRequestCallback callback); void cancelAnimationFrame(unsigned long handle); - //void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer); [Throws] - void postMessage(any message, DOMString targetOrigin); - - // also has obsolete members -}; -Window implements GlobalEventHandlers; -Window implements WindowEventHandlers; - -[NoInterfaceObject] -interface WindowProxy {}; - -// https://html.spec.whatwg.org/multipage/#timers -[NoInterfaceObject, Exposed=(Window,Worker)] -interface WindowTimers { - long setTimeout(Function handler, optional long timeout = 0, any... arguments); - long setTimeout(DOMString handler, optional long timeout = 0, any... arguments); - void clearTimeout(optional long handle = 0); - long setInterval(Function handler, optional long timeout = 0, any... arguments); - long setInterval(DOMString handler, optional long timeout = 0, any... arguments); - void clearInterval(optional long handle = 0); -}; -Window implements WindowTimers; - -// https://html.spec.whatwg.org/multipage/#atob -[NoInterfaceObject, Exposed=(Window,Worker)] -interface WindowBase64 { + void postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []); [Throws] - DOMString btoa(DOMString btoa); - [Throws] - DOMString atob(DOMString atob); -}; -Window implements WindowBase64; + void postMessage(any message, optional WindowPostMessageOptions options = {}); -// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html#sec-window.performance-attribute -partial interface Window { - [Replaceable] readonly attribute Performance performance; + // also has obsolete members }; +Window includes GlobalEventHandlers; +Window includes WindowEventHandlers; // https://html.spec.whatwg.org/multipage/#Window-partial partial interface Window { @@ -130,7 +102,7 @@ dictionary ScrollToOptions : ScrollOptions { // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface partial interface Window { [Exposed=(Window), NewObject] MediaQueryList matchMedia(DOMString query); - [SameObject] readonly attribute Screen screen; + [SameObject, Replaceable] readonly attribute Screen screen; // browsing context void moveTo(long x, long y); @@ -139,36 +111,39 @@ partial interface Window { void resizeBy(long x, long y); // viewport - readonly attribute long innerWidth; - readonly attribute long innerHeight; + [Replaceable] readonly attribute long innerWidth; + [Replaceable] readonly attribute long innerHeight; // viewport scrolling - readonly attribute long scrollX; - readonly attribute long pageXOffset; - readonly attribute long scrollY; - readonly attribute long pageYOffset; - void scroll(optional ScrollToOptions options); + [Replaceable] readonly attribute long scrollX; + [Replaceable] readonly attribute long pageXOffset; + [Replaceable] readonly attribute long scrollY; + [Replaceable] readonly attribute long pageYOffset; + void scroll(optional ScrollToOptions options = {}); void scroll(unrestricted double x, unrestricted double y); - void scrollTo(optional ScrollToOptions options); + void scrollTo(optional ScrollToOptions options = {}); void scrollTo(unrestricted double x, unrestricted double y); - void scrollBy(optional ScrollToOptions options); + void scrollBy(optional ScrollToOptions options = {}); void scrollBy(unrestricted double x, unrestricted double y); // client - readonly attribute long screenX; - readonly attribute long screenY; - readonly attribute long outerWidth; - readonly attribute long outerHeight; - readonly attribute double devicePixelRatio; + [Replaceable] readonly attribute long screenX; + [Replaceable] readonly attribute long screenY; + [Replaceable] readonly attribute long outerWidth; + [Replaceable] readonly attribute long outerHeight; + [Replaceable] readonly attribute double devicePixelRatio; }; // Proprietary extensions. partial interface Window { + [Pref="dom.servo_helpers.enabled"] void debug(DOMString arg); + [Pref="dom.servo_helpers.enabled"] void gc(); + [Pref="dom.servo_helpers.enabled"] void trap(); - [Func="Window::global_is_mozbrowser", Throws] - void openURLInDefaultBrowser(DOMString href); + [Pref="dom.servo_helpers.enabled"] + void js_backtrace(); }; // WebDriver extensions @@ -179,18 +154,16 @@ partial interface Window { }; // https://html.spec.whatwg.org/multipage/#dom-sessionstorage -[NoInterfaceObject] -interface WindowSessionStorage { +interface mixin WindowSessionStorage { readonly attribute Storage sessionStorage; }; -Window implements WindowSessionStorage; +Window includes WindowSessionStorage; // https://html.spec.whatwg.org/multipage/#dom-localstorage -[NoInterfaceObject] -interface WindowLocalStorage { +interface mixin WindowLocalStorage { readonly attribute Storage localStorage; }; -Window implements WindowLocalStorage; +Window includes WindowLocalStorage; // http://w3c.github.io/animation-timing/#framerequestcallback callback FrameRequestCallback = void (DOMHighResTimeStamp time); @@ -201,3 +174,22 @@ partial interface Window { readonly attribute TestRunner testRunner; //readonly attribute EventSender eventSender; }; + +partial interface Window { + [Pref="css.animations.testing.enabled"] + readonly attribute unsigned long runningAnimationCount; +}; + +// https://w3c.github.io/selection-api/#dom-document +partial interface Window { + Selection? getSelection(); +}; + +// https://dom.spec.whatwg.org/#interface-window-extensions +partial interface Window { + [Replaceable] readonly attribute any event; // historical +}; + +dictionary WindowPostMessageOptions : PostMessageOptions { + USVString targetOrigin = "/"; +}; diff --git a/components/script/dom/webidls/WindowOrWorkerGlobalScope.webidl b/components/script/dom/webidls/WindowOrWorkerGlobalScope.webidl index f0b8218fbe2..2ab8ba2c25d 100644 --- a/components/script/dom/webidls/WindowOrWorkerGlobalScope.webidl +++ b/components/script/dom/webidls/WindowOrWorkerGlobalScope.webidl @@ -1,30 +1,45 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#windoworworkerglobalscope -// typedef (DOMString or Function) TimerHandler; +typedef (DOMString or Function) TimerHandler; -[NoInterfaceObject, Exposed=(Window,Worker)] -interface WindowOrWorkerGlobalScope { - // [Replaceable] readonly attribute USVString origin; +[Exposed=(Window,Worker)] +interface mixin WindowOrWorkerGlobalScope { + [Replaceable] readonly attribute USVString origin; // base64 utility methods - // DOMString btoa(DOMString data); - // DOMString atob(DOMString data); + [Throws] DOMString btoa(DOMString data); + [Throws] DOMString atob(DOMString data); // timers - // long setTimeout(TimerHandler handler, optional long timeout = 0, any... arguments); - // void clearTimeout(optional long handle = 0); - // long setInterval(TimerHandler handler, optional long timeout = 0, any... arguments); - // void clearInterval(optional long handle = 0); + long setTimeout(TimerHandler handler, optional long timeout = 0, any... arguments); + void clearTimeout(optional long handle = 0); + long setInterval(TimerHandler handler, optional long timeout = 0, any... arguments); + void clearInterval(optional long handle = 0); + + // microtask queuing + void queueMicrotask(VoidFunction callback); // ImageBitmap - // Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options); + [Pref="dom.imagebitmap.enabled"] + Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options = {}); // Promise<ImageBitmap> createImageBitmap( // ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options); }; -Window implements WindowOrWorkerGlobalScope; -WorkerGlobalScope implements WindowOrWorkerGlobalScope; +// https://w3c.github.io/hr-time/#the-performance-attribute +partial interface mixin WindowOrWorkerGlobalScope { + [Replaceable] + readonly attribute Performance performance; +}; + +// https://w3c.github.io/webappsec-secure-contexts/#monkey-patching-global-object +partial interface mixin WindowOrWorkerGlobalScope { + readonly attribute boolean isSecureContext; +}; + +Window includes WindowOrWorkerGlobalScope; +WorkerGlobalScope includes WindowOrWorkerGlobalScope; diff --git a/components/script/dom/webidls/WindowProxy.webidl b/components/script/dom/webidls/WindowProxy.webidl new file mode 100644 index 00000000000..a4fd2a3f79c --- /dev/null +++ b/components/script/dom/webidls/WindowProxy.webidl @@ -0,0 +1,7 @@ +/* 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/. */ + +// https://html.spec.whatwg.org/multipage/#the-windowproxy-exotic-object +[Exposed=(Window,DissimilarOriginWindow), NoInterfaceObject] +interface WindowProxy {}; diff --git a/components/script/dom/webidls/Worker.webidl b/components/script/dom/webidls/Worker.webidl index deb519d78df..93df577ec32 100644 --- a/components/script/dom/webidls/Worker.webidl +++ b/components/script/dom/webidls/Worker.webidl @@ -1,20 +1,31 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#abstractworker -[NoInterfaceObject, Exposed=(Window,Worker)] -interface AbstractWorker { +[Exposed=(Window,Worker)] +interface mixin AbstractWorker { attribute EventHandler onerror; }; // https://html.spec.whatwg.org/multipage/#worker -[Constructor(DOMString scriptURL), Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface Worker : EventTarget { + [Throws] constructor(USVString scriptURL, optional WorkerOptions options = {}); void terminate(); -[Throws] -void postMessage(any message/*, optional sequence<Transferable> transfer*/); - attribute EventHandler onmessage; + [Throws] void postMessage(any message, sequence<object> transfer); + [Throws] void postMessage(any message, optional PostMessageOptions options = {}); + attribute EventHandler onmessage; + attribute EventHandler onmessageerror; }; -Worker implements AbstractWorker; + +dictionary WorkerOptions { + WorkerType type = "classic"; + RequestCredentials credentials = "same-origin"; // credentials is only used if type is "module" + DOMString name = ""; +}; + +enum WorkerType { "classic", "module" }; + +Worker includes AbstractWorker; diff --git a/components/script/dom/webidls/WorkerGlobalScope.webidl b/components/script/dom/webidls/WorkerGlobalScope.webidl index dcdd2957d43..191ab63967d 100644 --- a/components/script/dom/webidls/WorkerGlobalScope.webidl +++ b/components/script/dom/webidls/WorkerGlobalScope.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#workerglobalscope [Abstract, Exposed=Worker] @@ -22,5 +22,3 @@ partial interface WorkerGlobalScope { // not obsolete void importScripts(DOMString... urls); readonly attribute WorkerNavigator navigator; }; -WorkerGlobalScope implements WindowTimers; -WorkerGlobalScope implements WindowBase64; diff --git a/components/script/dom/webidls/WorkerLocation.webidl b/components/script/dom/webidls/WorkerLocation.webidl index e4c410f720a..8985da7e6e9 100644 --- a/components/script/dom/webidls/WorkerLocation.webidl +++ b/components/script/dom/webidls/WorkerLocation.webidl @@ -1,12 +1,12 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#worker-locations [Exposed=Worker] interface WorkerLocation { - /*stringifier*/ readonly attribute USVString href; - // readonly attribute USVString origin; + stringifier readonly attribute USVString href; + readonly attribute USVString origin; readonly attribute USVString protocol; readonly attribute USVString host; readonly attribute USVString hostname; @@ -14,9 +14,4 @@ interface WorkerLocation { readonly attribute USVString pathname; readonly attribute USVString search; readonly attribute USVString hash; - - // This is only doing as well as gecko right now. - // https://github.com/servo/servo/issues/7590 is on file for - // adding attribute stringifier support. - stringifier; }; diff --git a/components/script/dom/webidls/WorkerNavigator.webidl b/components/script/dom/webidls/WorkerNavigator.webidl index c60eda76896..5be43960802 100644 --- a/components/script/dom/webidls/WorkerNavigator.webidl +++ b/components/script/dom/webidls/WorkerNavigator.webidl @@ -1,13 +1,13 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#workernavigator [Exposed=Worker] interface WorkerNavigator {}; -WorkerNavigator implements NavigatorID; -WorkerNavigator implements NavigatorLanguage; -//WorkerNavigator implements NavigatorOnLine; +WorkerNavigator includes NavigatorID; +WorkerNavigator includes NavigatorLanguage; +//WorkerNavigator includes NavigatorOnLine; // https://w3c.github.io/permissions/#navigator-and-workernavigator-extension @@ -15,3 +15,8 @@ WorkerNavigator implements NavigatorLanguage; partial interface WorkerNavigator { [Pref="dom.permissions.enabled"] readonly attribute Permissions permissions; }; + +[Exposed=DedicatedWorker] +partial interface WorkerNavigator { + [SameObject, Pref="dom.webgpu.enabled"] readonly attribute GPU gpu; +}; diff --git a/components/script/dom/webidls/Worklet.webidl b/components/script/dom/webidls/Worklet.webidl new file mode 100644 index 00000000000..16ec8e8d7c9 --- /dev/null +++ b/components/script/dom/webidls/Worklet.webidl @@ -0,0 +1,13 @@ +/* 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/. */ + +// https://drafts.css-houdini.org/worklets/#worklet +[Pref="dom.worklet.enabled", Exposed=(Window)] +interface Worklet { + [NewObject] Promise<void> addModule(USVString moduleURL, optional WorkletOptions options = {}); +}; + +dictionary WorkletOptions { + RequestCredentials credentials = "omit"; +}; diff --git a/components/script/dom/webidls/WorkletGlobalScope.webidl b/components/script/dom/webidls/WorkletGlobalScope.webidl new file mode 100644 index 00000000000..21f7a7e0af0 --- /dev/null +++ b/components/script/dom/webidls/WorkletGlobalScope.webidl @@ -0,0 +1,10 @@ +/* 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/. */ + +// https://drafts.css-houdini.org/worklets/#workletglobalscope +// TODO: The spec IDL doesn't make this a subclass of EventTarget +// https://github.com/whatwg/html/issues/2611 +[Pref="dom.worklet.enabled", Exposed=Worklet] +interface WorkletGlobalScope: GlobalScope { +}; diff --git a/components/script/dom/webidls/XMLDocument.webidl b/components/script/dom/webidls/XMLDocument.webidl index 150267dd62a..64d11d29cd7 100644 --- a/components/script/dom/webidls/XMLDocument.webidl +++ b/components/script/dom/webidls/XMLDocument.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is: * https://dom.spec.whatwg.org/#interface-document @@ -8,4 +8,5 @@ */ // https://dom.spec.whatwg.org/#interface-document +[Exposed=Window] interface XMLDocument : Document {}; diff --git a/components/script/dom/webidls/XMLHttpRequest.webidl b/components/script/dom/webidls/XMLHttpRequest.webidl index 270e45ca7ed..2c043b9407a 100644 --- a/components/script/dom/webidls/XMLHttpRequest.webidl +++ b/components/script/dom/webidls/XMLHttpRequest.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://xhr.spec.whatwg.org/#interface-xmlhttprequest @@ -12,8 +12,11 @@ * http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0. */ +// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit +typedef (Blob or BufferSource or FormData or DOMString or URLSearchParams) XMLHttpRequestBodyInit; + // https://fetch.spec.whatwg.org/#bodyinit -typedef (Blob or /*BufferSource or */ FormData or DOMString or URLSearchParams) BodyInit; +typedef (ReadableStream or XMLHttpRequestBodyInit) BodyInit; enum XMLHttpRequestResponseType { "", @@ -21,11 +24,12 @@ enum XMLHttpRequestResponseType { "blob", "document", "json", - "text" + "text", }; -[Constructor, Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface XMLHttpRequest : XMLHttpRequestEventTarget { + [Throws] constructor(); // event handler attribute EventHandler onreadystatechange; @@ -53,7 +57,7 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget { attribute boolean withCredentials; readonly attribute XMLHttpRequestUpload upload; [Throws] - void send(optional (Document or BodyInit)? data = null); + void send(optional (Document or XMLHttpRequestBodyInit)? data = null); void abort(); // response diff --git a/components/script/dom/webidls/XMLHttpRequestEventTarget.webidl b/components/script/dom/webidls/XMLHttpRequestEventTarget.webidl index 2310e9b9153..bde137a2b48 100644 --- a/components/script/dom/webidls/XMLHttpRequestEventTarget.webidl +++ b/components/script/dom/webidls/XMLHttpRequestEventTarget.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://xhr.spec.whatwg.org/#interface-xmlhttprequest diff --git a/components/script/dom/webidls/XMLHttpRequestUpload.webidl b/components/script/dom/webidls/XMLHttpRequestUpload.webidl index 76d917a3c77..3dfee1210c5 100644 --- a/components/script/dom/webidls/XMLHttpRequestUpload.webidl +++ b/components/script/dom/webidls/XMLHttpRequestUpload.webidl @@ -1,6 +1,6 @@ /* 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 http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is * https://xhr.spec.whatwg.org/#interface-xmlhttprequest diff --git a/components/script/dom/webidls/XMLSerializer.webidl b/components/script/dom/webidls/XMLSerializer.webidl new file mode 100644 index 00000000000..c0111220e42 --- /dev/null +++ b/components/script/dom/webidls/XMLSerializer.webidl @@ -0,0 +1,14 @@ +/* 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/. */ +/* + * The origin of this IDL file is + * https://w3c.github.io/DOM-Parsing/#the-domparser-interface + */ + +[Exposed=Window] +interface XMLSerializer { + [Throws] constructor(); + [Throws] + DOMString serializeToString(Node root); +}; diff --git a/components/script/dom/webidls/XRCompositionLayer.webidl b/components/script/dom/webidls/XRCompositionLayer.webidl new file mode 100644 index 00000000000..bde8aed6cdf --- /dev/null +++ b/components/script/dom/webidls/XRCompositionLayer.webidl @@ -0,0 +1,20 @@ +/* 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/. */ + +// TODO: Implement the layer types +// https://github.com/servo/servo/issues/27493 + +// https://immersive-web.github.io/layers/#xrcompositionlayer +[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"] +interface XRCompositionLayer : XRLayer { +// readonly attribute XRLayerLayout layout; +// +// attribute boolean blendTextureSourceAlpha; +// attribute boolean? chromaticAberrationCorrection; +// attribute float? fixedFoveation; +// +// readonly attribute boolean needsRedraw; +// +// void destroy(); +}; diff --git a/components/script/dom/webidls/XRCubeLayer.webidl b/components/script/dom/webidls/XRCubeLayer.webidl new file mode 100644 index 00000000000..66e8eb18130 --- /dev/null +++ b/components/script/dom/webidls/XRCubeLayer.webidl @@ -0,0 +1,17 @@ +/* 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/. */ + +// TODO: Implement the layer types +// https://github.com/servo/servo/issues/27493 + +// https://immersive-web.github.io/layers/#xrcubelayer + +[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"] +interface XRCubeLayer : XRCompositionLayer { +// attribute XRSpace space; +// attribute DOMPointReadOnly orientation; +// +// // Events +// attribute EventHandler onredraw; +}; diff --git a/components/script/dom/webidls/XRCylinderLayer.webidl b/components/script/dom/webidls/XRCylinderLayer.webidl new file mode 100644 index 00000000000..9a3e2d051c6 --- /dev/null +++ b/components/script/dom/webidls/XRCylinderLayer.webidl @@ -0,0 +1,20 @@ +/* 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/. */ + +// TODO: Implement the layer types +// https://github.com/servo/servo/issues/27493 + +// https://immersive-web.github.io/layers/#xrcylinderlayer +[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"] +interface XRCylinderLayer : XRCompositionLayer { +// attribute XRSpace space; +// attribute XRRigidTransform transform; +// +// attribute float radius; +// attribute float centralAngle; +// attribute float aspectRatio; +// +// // Events +// attribute EventHandler onredraw; +}; diff --git a/components/script/dom/webidls/XREquirectLayer.webidl b/components/script/dom/webidls/XREquirectLayer.webidl new file mode 100644 index 00000000000..98a82bc80dd --- /dev/null +++ b/components/script/dom/webidls/XREquirectLayer.webidl @@ -0,0 +1,21 @@ +/* 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/. */ + +// TODO: Implement the layer types +// https://github.com/servo/servo/issues/27493 + +// https://immersive-web.github.io/layers/#xrequirectlayer +[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"] +interface XREquirectLayer : XRCompositionLayer { +// attribute XRSpace space; +// attribute XRRigidTransform transform; +// +// attribute float radius; +// attribute float centralHorizontalAngle; +// attribute float upperVerticalAngle; +// attribute float lowerVerticalAngle; +// +// // Events +// attribute EventHandler onredraw; +}; diff --git a/components/script/dom/webidls/XRFrame.webidl b/components/script/dom/webidls/XRFrame.webidl new file mode 100644 index 00000000000..e7a4eef1ddd --- /dev/null +++ b/components/script/dom/webidls/XRFrame.webidl @@ -0,0 +1,15 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrframe-interface + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRFrame { + readonly attribute XRSession session; + + [Throws] XRViewerPose? getViewerPose(XRReferenceSpace referenceSpace); + [Throws] XRPose? getPose(XRSpace space, XRSpace relativeTo); + [Pref="dom.webxr.hands.enabled", Throws] XRJointPose? getJointPose(XRJointSpace space, XRSpace relativeTo); + sequence<XRHitTestResult> getHitTestResults(XRHitTestSource hitTestSource); +}; diff --git a/components/script/dom/webidls/XRHand.webidl b/components/script/dom/webidls/XRHand.webidl new file mode 100644 index 00000000000..cff30268ba6 --- /dev/null +++ b/components/script/dom/webidls/XRHand.webidl @@ -0,0 +1,41 @@ +/* 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/. */ + +// https://github.com/immersive-web/webxr-hands-input/blob/master/explainer.md + +[SecureContext, Exposed=Window, Pref="dom.webxr.hands.enabled"] +interface XRHand { + readonly attribute long length; + getter XRJointSpace(unsigned long index); + + const unsigned long WRIST = 0; + const unsigned long THUMB_METACARPAL = 1; + const unsigned long THUMB_PHALANX_PROXIMAL = 2; + const unsigned long THUMB_PHALANX_DISTAL = 3; + const unsigned long THUMB_PHALANX_TIP = 4; + + const unsigned long INDEX_METACARPAL = 5; + const unsigned long INDEX_PHALANX_PROXIMAL = 6; + const unsigned long INDEX_PHALANX_INTERMEDIATE = 7; + const unsigned long INDEX_PHALANX_DISTAL = 8; + const unsigned long INDEX_PHALANX_TIP = 9; + + const unsigned long MIDDLE_METACARPAL = 10; + const unsigned long MIDDLE_PHALANX_PROXIMAL = 11; + const unsigned long MIDDLE_PHALANX_INTERMEDIATE = 12; + const unsigned long MIDDLE_PHALANX_DISTAL = 13; + const unsigned long MIDDLE_PHALANX_TIP = 14; + + const unsigned long RING_METACARPAL = 15; + const unsigned long RING_PHALANX_PROXIMAL = 16; + const unsigned long RING_PHALANX_INTERMEDIATE = 17; + const unsigned long RING_PHALANX_DISTAL = 18; + const unsigned long RING_PHALANX_TIP = 19; + + const unsigned long LITTLE_METACARPAL = 20; + const unsigned long LITTLE_PHALANX_PROXIMAL = 21; + const unsigned long LITTLE_PHALANX_INTERMEDIATE = 22; + const unsigned long LITTLE_PHALANX_DISTAL = 23; + const unsigned long LITTLE_PHALANX_TIP = 24; +}; diff --git a/components/script/dom/webidls/XRHitTestResult.webidl b/components/script/dom/webidls/XRHitTestResult.webidl new file mode 100644 index 00000000000..08bf4bf5389 --- /dev/null +++ b/components/script/dom/webidls/XRHitTestResult.webidl @@ -0,0 +1,10 @@ +/* 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/. */ + +// https://immersive-web.github.io/hit-test/#xrhittestresult-interface + +[SecureContext, Exposed=Window] +interface XRHitTestResult { + XRPose? getPose(XRSpace baseSpace); +}; diff --git a/components/script/dom/webidls/XRHitTestSource.webidl b/components/script/dom/webidls/XRHitTestSource.webidl new file mode 100644 index 00000000000..a3a56cebed4 --- /dev/null +++ b/components/script/dom/webidls/XRHitTestSource.webidl @@ -0,0 +1,22 @@ +/* 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/. */ + +// https://immersive-web.github.io/hit-test/#xrhittestsource-interface + +enum XRHitTestTrackableType { + "point", + "plane", + "mesh" +}; + +dictionary XRHitTestOptionsInit { + required XRSpace space; + sequence<XRHitTestTrackableType> entityTypes; + XRRay offsetRay; +}; + +[SecureContext, Exposed=Window] +interface XRHitTestSource { + void cancel(); +}; diff --git a/components/script/dom/webidls/XRInputSource.webidl b/components/script/dom/webidls/XRInputSource.webidl new file mode 100644 index 00000000000..b663666c872 --- /dev/null +++ b/components/script/dom/webidls/XRInputSource.webidl @@ -0,0 +1,30 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrinputsource-interface + +enum XRHandedness { + "none", + "left", + "right" +}; + +enum XRTargetRayMode { + "gaze", + "tracked-pointer", + "screen" +}; + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRInputSource { + readonly attribute XRHandedness handedness; + readonly attribute XRTargetRayMode targetRayMode; + [SameObject] readonly attribute XRSpace targetRaySpace; + [SameObject] readonly attribute XRSpace? gripSpace; + // [SameObject] readonly attribute Gamepad? gamepad; + /* [SameObject] */ readonly attribute /* FrozenArray<DOMString> */ any profiles; + + [Pref="dom.webxr.hands.enabled"] + readonly attribute XRHand? hand; +}; diff --git a/components/script/dom/webidls/XRInputSourceArray.webidl b/components/script/dom/webidls/XRInputSourceArray.webidl new file mode 100644 index 00000000000..f8a0eb4308d --- /dev/null +++ b/components/script/dom/webidls/XRInputSourceArray.webidl @@ -0,0 +1,12 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrinputsourcearray-interface + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRInputSourceArray { + iterable<XRInputSource>; + readonly attribute unsigned long length; + getter XRInputSource(unsigned long index); +}; diff --git a/components/script/dom/webidls/XRInputSourceEvent.webidl b/components/script/dom/webidls/XRInputSourceEvent.webidl new file mode 100644 index 00000000000..f1ffbf2a799 --- /dev/null +++ b/components/script/dom/webidls/XRInputSourceEvent.webidl @@ -0,0 +1,17 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrinputsourceevent-interface + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRInputSourceEvent : Event { + [Throws] constructor(DOMString type, XRInputSourceEventInit eventInitDict); + [SameObject] readonly attribute XRFrame frame; + [SameObject] readonly attribute XRInputSource inputSource; +}; + +dictionary XRInputSourceEventInit : EventInit { + required XRFrame frame; + required XRInputSource inputSource; +}; diff --git a/components/script/dom/webidls/XRInputSourcesChangeEvent.webidl b/components/script/dom/webidls/XRInputSourcesChangeEvent.webidl new file mode 100644 index 00000000000..aba56f8b0a6 --- /dev/null +++ b/components/script/dom/webidls/XRInputSourcesChangeEvent.webidl @@ -0,0 +1,19 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrinputsourceschangedevent-interface + +[SecureContext, Exposed=Window, Pref="dom.webxr.test"] +interface XRInputSourcesChangeEvent : Event { + constructor(DOMString type, XRInputSourcesChangeEventInit eventInitDict); + [SameObject] readonly attribute XRSession session; + /* [SameObject] */ readonly attribute /* FrozenArray<XRInputSource> */ any added; + /* [SameObject] */ readonly attribute /* FrozenArray<XRInputSource> */ any removed; +}; + +dictionary XRInputSourcesChangeEventInit : EventInit { + required XRSession session; + required sequence<XRInputSource> added; + required sequence<XRInputSource> removed; +}; diff --git a/components/script/dom/webidls/XRJointPose.webidl b/components/script/dom/webidls/XRJointPose.webidl new file mode 100644 index 00000000000..70750b66cc4 --- /dev/null +++ b/components/script/dom/webidls/XRJointPose.webidl @@ -0,0 +1,10 @@ +/* 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/. */ + +// https://github.com/immersive-web/webxr-hands-input/blob/master/explainer.md + +[SecureContext, Exposed=Window, Pref="dom.webxr.hands.enabled"] +interface XRJointPose: XRPose { + readonly attribute float? radius; +}; diff --git a/components/script/dom/webidls/XRJointSpace.webidl b/components/script/dom/webidls/XRJointSpace.webidl new file mode 100644 index 00000000000..0815a73ec58 --- /dev/null +++ b/components/script/dom/webidls/XRJointSpace.webidl @@ -0,0 +1,8 @@ +/* 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/. */ + +// https://github.com/immersive-web/webxr-hands-input/blob/master/explainer.md + +[SecureContext, Exposed=Window, Pref="dom.webxr.hands.enabled"] +interface XRJointSpace: XRSpace {}; diff --git a/components/script/dom/webidls/XRLayer.webidl b/components/script/dom/webidls/XRLayer.webidl new file mode 100644 index 00000000000..5f719db7bdb --- /dev/null +++ b/components/script/dom/webidls/XRLayer.webidl @@ -0,0 +1,7 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrlayer +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRLayer : EventTarget {}; diff --git a/components/script/dom/webidls/XRLayerEvent.webidl b/components/script/dom/webidls/XRLayerEvent.webidl new file mode 100644 index 00000000000..9a05272138e --- /dev/null +++ b/components/script/dom/webidls/XRLayerEvent.webidl @@ -0,0 +1,14 @@ +/* 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/. */ + +// https://immersive-web.github.io/layers/#xrlayerevent-interface +[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"] +interface XRLayerEvent : Event { + constructor(DOMString type, XRLayerEventInit eventInitDict); + [SameObject] readonly attribute XRLayer layer; +}; + +dictionary XRLayerEventInit : EventInit { + required XRLayer layer; +}; diff --git a/components/script/dom/webidls/XRMediaBinding.webidl b/components/script/dom/webidls/XRMediaBinding.webidl new file mode 100644 index 00000000000..87a858f098e --- /dev/null +++ b/components/script/dom/webidls/XRMediaBinding.webidl @@ -0,0 +1,19 @@ +/* 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/. */ + +// https://immersive-web.github.io/layers/#xrmediabindingtype +[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"] +interface XRMediaBinding { + [Throws] constructor(XRSession session); + + [Throws] XRQuadLayer createQuadLayer(HTMLVideoElement video, XRMediaLayerInit init); + [Throws] XRCylinderLayer createCylinderLayer(HTMLVideoElement video, XRMediaLayerInit init); + [Throws] XREquirectLayer createEquirectLayer(HTMLVideoElement video, XRMediaLayerInit init); +}; + +dictionary XRMediaLayerInit { + required XRSpace space; + XRLayerLayout layout = "mono"; + boolean invertStereo = false; +}; diff --git a/components/script/dom/webidls/XRPose.webidl b/components/script/dom/webidls/XRPose.webidl new file mode 100644 index 00000000000..a8ffd440010 --- /dev/null +++ b/components/script/dom/webidls/XRPose.webidl @@ -0,0 +1,11 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrpose-interface + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRPose { + readonly attribute XRRigidTransform transform; + // readonly attribute boolean emulatedPosition; +}; diff --git a/components/script/dom/webidls/XRProjectionLayer.webidl b/components/script/dom/webidls/XRProjectionLayer.webidl new file mode 100644 index 00000000000..c96afe4c28d --- /dev/null +++ b/components/script/dom/webidls/XRProjectionLayer.webidl @@ -0,0 +1,12 @@ +/* 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/. */ + +// TODO: Implement the layer types +// https://github.com/servo/servo/issues/27493 + +// https://immersive-web.github.io/layers/#xrprojectionlayer +[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"] +interface XRProjectionLayer : XRCompositionLayer { +// readonly attribute boolean ignoreDepthValues; +}; diff --git a/components/script/dom/webidls/XRQuadLayer.webidl b/components/script/dom/webidls/XRQuadLayer.webidl new file mode 100644 index 00000000000..78c513ecdb9 --- /dev/null +++ b/components/script/dom/webidls/XRQuadLayer.webidl @@ -0,0 +1,19 @@ +/* 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/. */ + +// TODO: Implement the layer types +// https://github.com/servo/servo/issues/27493 + +// https://immersive-web.github.io/layers/#xrquadlayer +[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"] +interface XRQuadLayer : XRCompositionLayer { +// attribute XRSpace space; +// attribute XRRigidTransform transform; +// +// attribute float width; +// attribute float height; +// +// // Events +// attribute EventHandler onredraw; +}; diff --git a/components/script/dom/webidls/XRRay.webidl b/components/script/dom/webidls/XRRay.webidl new file mode 100644 index 00000000000..f578436685d --- /dev/null +++ b/components/script/dom/webidls/XRRay.webidl @@ -0,0 +1,21 @@ +/* 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/. */ + +// https://immersive-web.github.io/hit-test/#xrray-interface + +dictionary XRRayDirectionInit { + double x = 0; + double y = 0; + double z = -1; + double w = 0; +}; + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRRay { + [Throws] constructor(optional DOMPointInit origin = {}, optional XRRayDirectionInit direction = {}); + [Throws] constructor(XRRigidTransform transform); + [SameObject] readonly attribute DOMPointReadOnly origin; + [SameObject] readonly attribute DOMPointReadOnly direction; + [SameObject] readonly attribute Float32Array matrix; +}; diff --git a/components/script/dom/webidls/XRReferenceSpace.webidl b/components/script/dom/webidls/XRReferenceSpace.webidl new file mode 100644 index 00000000000..0479bd12beb --- /dev/null +++ b/components/script/dom/webidls/XRReferenceSpace.webidl @@ -0,0 +1,19 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrreferencespace-interface + +enum XRReferenceSpaceType { + "viewer", + "local", + "local-floor", + "bounded-floor", + "unbounded" +}; + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRReferenceSpace : XRSpace { + XRReferenceSpace getOffsetReferenceSpace(XRRigidTransform originOffset); + // attribute EventHandler onreset; +}; diff --git a/components/script/dom/webidls/XRRenderState.webidl b/components/script/dom/webidls/XRRenderState.webidl new file mode 100644 index 00000000000..52c72511923 --- /dev/null +++ b/components/script/dom/webidls/XRRenderState.webidl @@ -0,0 +1,24 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrrenderstate-interface + +dictionary XRRenderStateInit { + double depthNear; + double depthFar; + double inlineVerticalFieldOfView; + XRWebGLLayer? baseLayer; + sequence<XRLayer>? layers; +}; + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] interface XRRenderState { + readonly attribute double depthNear; + readonly attribute double depthFar; + readonly attribute double? inlineVerticalFieldOfView; + readonly attribute XRWebGLLayer? baseLayer; + + // https://immersive-web.github.io/layers/#xrrenderstatechanges + // workaround until we have FrozenArray + readonly attribute /* FrozenArray<XRLayer> */ any layers; +}; diff --git a/components/script/dom/webidls/XRRigidTransform.webidl b/components/script/dom/webidls/XRRigidTransform.webidl new file mode 100644 index 00000000000..91505a96285 --- /dev/null +++ b/components/script/dom/webidls/XRRigidTransform.webidl @@ -0,0 +1,14 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrrigidtransform-interface + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRRigidTransform { + [Throws] constructor(optional DOMPointInit position = {}, optional DOMPointInit orientation = {}); + readonly attribute DOMPointReadOnly position; + readonly attribute DOMPointReadOnly orientation; + readonly attribute Float32Array matrix; + readonly attribute XRRigidTransform inverse; +}; diff --git a/components/script/dom/webidls/XRSession.webidl b/components/script/dom/webidls/XRSession.webidl new file mode 100644 index 00000000000..45cdbe2339e --- /dev/null +++ b/components/script/dom/webidls/XRSession.webidl @@ -0,0 +1,52 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrsession-interface + +enum XREnvironmentBlendMode { + "opaque", + "additive", + "alpha-blend", +}; + +enum XRVisibilityState { + "visible", + "visible-blurred", + "hidden", +}; + +callback XRFrameRequestCallback = void (DOMHighResTimeStamp time, XRFrame frame); + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRSession : EventTarget { + // // Attributes + readonly attribute XREnvironmentBlendMode environmentBlendMode; + + readonly attribute XRVisibilityState visibilityState; + [SameObject] readonly attribute XRRenderState renderState; + [SameObject] readonly attribute XRInputSourceArray inputSources; + + // // Methods + [Throws] void updateRenderState(optional XRRenderStateInit state = {}); + Promise<XRReferenceSpace> requestReferenceSpace(XRReferenceSpaceType type); + + long requestAnimationFrame(XRFrameRequestCallback callback); + void cancelAnimationFrame(long handle); + + Promise<void> end(); + + // hit test module + Promise<XRHitTestSource> requestHitTestSource(XRHitTestOptionsInit options); + + // // Events + attribute EventHandler onend; + attribute EventHandler onselect; + attribute EventHandler onsqueeze; + attribute EventHandler oninputsourceschange; + attribute EventHandler onselectstart; + attribute EventHandler onselectend; + attribute EventHandler onsqueezestart; + attribute EventHandler onsqueezeend; + attribute EventHandler onvisibilitychange; +}; diff --git a/components/script/dom/webidls/XRSessionEvent.webidl b/components/script/dom/webidls/XRSessionEvent.webidl new file mode 100644 index 00000000000..19506af613d --- /dev/null +++ b/components/script/dom/webidls/XRSessionEvent.webidl @@ -0,0 +1,15 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrsessionevent-interface + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRSessionEvent : Event { + [Throws] constructor(DOMString type, XRSessionEventInit eventInitDict); + [SameObject] readonly attribute XRSession session; +}; + +dictionary XRSessionEventInit : EventInit { + required XRSession session; +}; diff --git a/components/script/dom/webidls/XRSpace.webidl b/components/script/dom/webidls/XRSpace.webidl new file mode 100644 index 00000000000..54401b051c8 --- /dev/null +++ b/components/script/dom/webidls/XRSpace.webidl @@ -0,0 +1,10 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrspace-interface + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRSpace : EventTarget { + // XRRigidTransform? getTransformTo(XRSpace other); +}; diff --git a/components/script/dom/webidls/XRSubImage.webidl b/components/script/dom/webidls/XRSubImage.webidl new file mode 100644 index 00000000000..c96067fab17 --- /dev/null +++ b/components/script/dom/webidls/XRSubImage.webidl @@ -0,0 +1,9 @@ +/* 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/. */ + +// https://immersive-web.github.io/layers/#xrsubimagetype +[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"] +interface XRSubImage { + [SameObject] readonly attribute XRViewport viewport; +}; diff --git a/components/script/dom/webidls/XRSystem.webidl b/components/script/dom/webidls/XRSystem.webidl new file mode 100644 index 00000000000..b7eeed756bb --- /dev/null +++ b/components/script/dom/webidls/XRSystem.webidl @@ -0,0 +1,35 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrsystem-interface +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRSystem: EventTarget { + // Methods + Promise<boolean> isSessionSupported(XRSessionMode mode); + Promise<XRSession> requestSession(XRSessionMode mode, optional XRSessionInit parameters = {}); + + // Events + // attribute EventHandler ondevicechange; +}; + +[SecureContext] +partial interface Navigator { + [SameObject, Pref="dom.webxr.enabled"] readonly attribute XRSystem xr; +}; + +enum XRSessionMode { + "inline", + "immersive-vr", + "immersive-ar" +}; + +dictionary XRSessionInit { + sequence<any> requiredFeatures; + sequence<any> optionalFeatures; +}; + +partial interface XRSystem { + // https://github.com/immersive-web/webxr-test-api/ + [SameObject, Pref="dom.webxr.test"] readonly attribute XRTest test; +}; diff --git a/components/script/dom/webidls/XRTest.webidl b/components/script/dom/webidls/XRTest.webidl new file mode 100644 index 00000000000..1ae98f703bf --- /dev/null +++ b/components/script/dom/webidls/XRTest.webidl @@ -0,0 +1,42 @@ +/* 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/. */ + +// https://github.com/immersive-web/webxr-test-api/ + +[Exposed=Window, Pref="dom.webxr.test"] +interface XRTest { + // Simulates connecting a device to the system. + // Used to instantiate a fake device for use in tests. + Promise<FakeXRDevice> simulateDeviceConnection(FakeXRDeviceInit init); + + // // Simulates a user activation (aka user gesture) for the current scope. + // // The activation is only guaranteed to be valid in the provided function and only applies to WebXR + // // Device API methods. + void simulateUserActivation(Function f); + + // // Disconnect all fake devices + Promise<void> disconnectAllDevices(); +}; + +dictionary FakeXRDeviceInit { + boolean supportsImmersive = false; + sequence<XRSessionMode> supportedModes; + + required sequence<FakeXRViewInit> views; + + // this is actually sequence<any>, but we don't support + // non-string features anyway + sequence<DOMString> supportedFeatures; + // Whether the space supports tracking in inline sessions + boolean supportsTrackingInInline = true; + // The bounds coordinates. If null, bounded reference spaces are not supported. + sequence<FakeXRBoundsPoint> boundsCoodinates; + // Eye level used for calculating floor-level spaces + FakeXRRigidTransformInit floorOrigin; + FakeXRRigidTransformInit viewerOrigin; + + // Hit test extensions: + FakeXRWorldInit world; +}; + diff --git a/components/script/dom/webidls/XRView.webidl b/components/script/dom/webidls/XRView.webidl new file mode 100644 index 00000000000..7f433425a8b --- /dev/null +++ b/components/script/dom/webidls/XRView.webidl @@ -0,0 +1,18 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrview-interface + +enum XREye { + "left", + "right", + "none", +}; + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRView { + readonly attribute XREye eye; + readonly attribute Float32Array projectionMatrix; + readonly attribute XRRigidTransform transform; +}; diff --git a/components/script/dom/webidls/XRViewerPose.webidl b/components/script/dom/webidls/XRViewerPose.webidl new file mode 100644 index 00000000000..6a2663067ca --- /dev/null +++ b/components/script/dom/webidls/XRViewerPose.webidl @@ -0,0 +1,13 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrviewerpose-interface + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRViewerPose : XRPose { + // readonly attribute FrozenArray<XRView> views; + // workaround until we have FrozenArray + // see https://github.com/servo/servo/issues/10427#issuecomment-449593626 + readonly attribute any views; +}; diff --git a/components/script/dom/webidls/XRViewport.webidl b/components/script/dom/webidls/XRViewport.webidl new file mode 100644 index 00000000000..325b52c9f8f --- /dev/null +++ b/components/script/dom/webidls/XRViewport.webidl @@ -0,0 +1,13 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrviewport-interface + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRViewport { + readonly attribute long x; + readonly attribute long y; + readonly attribute long width; + readonly attribute long height; +}; diff --git a/components/script/dom/webidls/XRWebGLBinding.webidl b/components/script/dom/webidls/XRWebGLBinding.webidl new file mode 100644 index 00000000000..5823423ef86 --- /dev/null +++ b/components/script/dom/webidls/XRWebGLBinding.webidl @@ -0,0 +1,83 @@ +/* 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/. */ + +// https://immersive-web.github.io/layers/#XRWebGLBindingtype +[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"] +interface XRWebGLBinding { + constructor(XRSession session, XRWebGLRenderingContext context); + +// readonly attribute double nativeProjectionScaleFactor; + + [Throws] XRProjectionLayer createProjectionLayer(XRTextureType textureType, + optional XRProjectionLayerInit init = {}); + [Throws] XRQuadLayer createQuadLayer(XRTextureType textureType, + optional XRQuadLayerInit init); + [Throws] XRCylinderLayer createCylinderLayer(XRTextureType textureType, + optional XRCylinderLayerInit init); + [Throws] XREquirectLayer createEquirectLayer(XRTextureType textureType, + optional XREquirectLayerInit init); + [Throws] XRCubeLayer createCubeLayer(optional XRCubeLayerInit init); + + [Throws] XRWebGLSubImage getSubImage(XRCompositionLayer layer, XRFrame frame, optional XREye eye = "none"); + [Throws] XRWebGLSubImage getViewSubImage(XRProjectionLayer layer, XRView view); +}; + +dictionary XRProjectionLayerInit { + boolean depth = true; + boolean stencil = false; + boolean alpha = true; + double scaleFactor = 1.0; +}; + +dictionary XRQuadLayerInit : XRLayerInit { + XRRigidTransform? transform; + float width = 1.0; + float height = 1.0; + boolean isStatic = false; +}; + +dictionary XRCylinderLayerInit : XRLayerInit { + XRRigidTransform? transform; + float radius = 2.0; + float centralAngle = 0.78539; + float aspectRatio = 2.0; + boolean isStatic = false; +}; + +dictionary XREquirectLayerInit : XRLayerInit { + XRRigidTransform? transform; + float radius = 0; + float centralHorizontalAngle = 6.28318; + float upperVerticalAngle = 1.570795; + float lowerVerticalAngle = -1.570795; + boolean isStatic = false; +}; + +dictionary XRCubeLayerInit : XRLayerInit { + DOMPointReadOnly? orientation; + boolean isStatic = false; +}; + +dictionary XRLayerInit { + required XRSpace space; + required unsigned long viewPixelWidth; + required unsigned long viewPixelHeight; + XRLayerLayout layout = "mono"; + boolean depth = false; + boolean stencil = false; + boolean alpha = true; +}; + +enum XRTextureType { + "texture", + "texture-array" +}; + +enum XRLayerLayout { + "default", + "mono", + "stereo", + "stereo-left-right", + "stereo-top-bottom" +}; diff --git a/components/script/dom/webidls/XRWebGLLayer.webidl b/components/script/dom/webidls/XRWebGLLayer.webidl new file mode 100644 index 00000000000..87d2dc4dccb --- /dev/null +++ b/components/script/dom/webidls/XRWebGLLayer.webidl @@ -0,0 +1,41 @@ +/* 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/. */ + +// https://immersive-web.github.io/webxr/#xrwebgllayer-interface + +typedef (WebGLRenderingContext or + WebGL2RenderingContext) XRWebGLRenderingContext; + +dictionary XRWebGLLayerInit { + boolean antialias = true; + boolean depth = true; + boolean stencil = false; + boolean alpha = true; + boolean ignoreDepthValues = false; + double framebufferScaleFactor = 1.0; +}; + +[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] +interface XRWebGLLayer: XRLayer { + [Throws] constructor(XRSession session, + XRWebGLRenderingContext context, + optional XRWebGLLayerInit layerInit = {}); + // Attributes + readonly attribute boolean antialias; + readonly attribute boolean ignoreDepthValues; + + [SameObject] readonly attribute WebGLFramebuffer? framebuffer; + readonly attribute unsigned long framebufferWidth; + readonly attribute unsigned long framebufferHeight; + + // Methods + XRViewport? getViewport(XRView view); + + // // Static Methods + // static double getNativeFramebufferScaleFactor(XRSession session); +}; + +partial interface WebGLRenderingContext { + [Pref="dom.webxr.enabled"] Promise<void> makeXRCompatible(); +}; diff --git a/components/script/dom/webidls/XRWebGLSubImage.webidl b/components/script/dom/webidls/XRWebGLSubImage.webidl new file mode 100644 index 00000000000..2682206cc0a --- /dev/null +++ b/components/script/dom/webidls/XRWebGLSubImage.webidl @@ -0,0 +1,13 @@ +/* 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/. */ + +// https://immersive-web.github.io/layers/#xrwebglsubimagetype +[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"] +interface XRWebGLSubImage : XRSubImage { + [SameObject] readonly attribute WebGLTexture colorTexture; + [SameObject] readonly attribute WebGLTexture? depthStencilTexture; + readonly attribute unsigned long? imageIndex; + readonly attribute unsigned long textureWidth; + readonly attribute unsigned long textureHeight; +}; |