diff options
Diffstat (limited to 'components/script/dom/webidls')
12 files changed, 187 insertions, 10 deletions
diff --git a/components/script/dom/webidls/Blob.webidl b/components/script/dom/webidls/Blob.webidl index 15d28cadb99..8a3f5f5185e 100644 --- a/components/script/dom/webidls/Blob.webidl +++ b/components/script/dom/webidls/Blob.webidl @@ -16,6 +16,9 @@ interface Blob { Blob slice(optional [Clamp] long long start, optional [Clamp] long long end, optional DOMString contentType); + + [NewObject] Promise<DOMString> text(); + [NewObject] Promise<ArrayBuffer> arrayBuffer(); }; dictionary BlobPropertyBag { diff --git a/components/script/dom/webidls/CanvasRenderingContext2D.webidl b/components/script/dom/webidls/CanvasRenderingContext2D.webidl index 52e532e3a8b..bcc1b56396c 100644 --- a/components/script/dom/webidls/CanvasRenderingContext2D.webidl +++ b/components/script/dom/webidls/CanvasRenderingContext2D.webidl @@ -93,7 +93,7 @@ interface mixin 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); }; [Exposed=(PaintWorklet, Window, Worker)] diff --git a/components/script/dom/webidls/GPUBindGroup.webidl b/components/script/dom/webidls/GPUBindGroup.webidl new file mode 100644 index 00000000000..537fda29a63 --- /dev/null +++ b/components/script/dom/webidls/GPUBindGroup.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/#gpubindgrouplayout +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUBindGroup { +}; +GPUBindGroup includes GPUObjectBase; + +dictionary GPUBindGroupDescriptor : GPUObjectDescriptorBase { + required GPUBindGroupLayout layout; + required sequence<GPUBindGroupBindings> bindings; +}; + +typedef /*(GPUSampler or GPUTextureView or*/ GPUBufferBindings/*)*/ GPUBindingResource; + +// Note: Servo codegen doesn't like the name `GPUBindGroupBinding` because it's already occupied +// dictionary GPUBindGroupBinding { +dictionary GPUBindGroupBindings { + required unsigned long 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; + GPUBufferSize offset = 0; + GPUBufferSize size; +}; diff --git a/components/script/dom/webidls/GPUCommandBuffer.webidl b/components/script/dom/webidls/GPUCommandBuffer.webidl new file mode 100644 index 00000000000..fc61ccf4d64 --- /dev/null +++ b/components/script/dom/webidls/GPUCommandBuffer.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/#gpucommandbuffer +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUCommandBuffer { +}; +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..481c720260f --- /dev/null +++ b/components/script/dom/webidls/GPUCommandEncoder.webidl @@ -0,0 +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 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, + GPUBufferSize sourceOffset, + GPUBuffer destination, + GPUBufferSize destinationOffset, + GPUBufferSize 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(DOMString groupLabel); + // void popDebugGroup(); + // void insertDebugMarker(DOMString markerLabel); + + GPUCommandBuffer finish(optional GPUCommandBufferDescriptor descriptor = {}); +}; +GPUCommandEncoder includes GPUObjectBase; + +dictionary GPUComputePassDescriptor : GPUObjectDescriptorBase { +}; + +dictionary GPUCommandBufferDescriptor : GPUObjectDescriptorBase { +}; diff --git a/components/script/dom/webidls/GPUComputePassEncoder.webidl b/components/script/dom/webidls/GPUComputePassEncoder.webidl new file mode 100644 index 00000000000..0c03436a7e4 --- /dev/null +++ b/components/script/dom/webidls/GPUComputePassEncoder.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/#gpucomputepassencoder +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUComputePassEncoder { + // void setPipeline(GPUComputePipeline pipeline); + // void dispatch(unsigned long x, optional unsigned long y = 1, optional unsigned long z = 1); + // void dispatchIndirect(GPUBuffer indirectBuffer, GPUBufferSize indirectOffset); + + // void endPass(); +}; +GPUComputePassEncoder includes GPUObjectBase; +GPUComputePassEncoder includes GPUProgrammablePassEncoder; diff --git a/components/script/dom/webidls/GPUComputePipeline.webidl b/components/script/dom/webidls/GPUComputePipeline.webidl new file mode 100644 index 00000000000..671c36ad351 --- /dev/null +++ b/components/script/dom/webidls/GPUComputePipeline.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/#gpucomputepipeline +[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"] +interface GPUComputePipeline { +}; +GPUComputePipeline includes GPUObjectBase; + +dictionary GPUPipelineDescriptorBase : GPUObjectDescriptorBase { + required GPUPipelineLayout layout; +}; + +dictionary GPUProgrammableStageDescriptor { + required GPUShaderModule module; + required DOMString entryPoint; +}; + +dictionary GPUComputePipelineDescriptor : GPUPipelineDescriptorBase { + required GPUProgrammableStageDescriptor computeStage; +}; diff --git a/components/script/dom/webidls/GPUDevice.webidl b/components/script/dom/webidls/GPUDevice.webidl index 85e8a3ea633..05fb449df8c 100644 --- a/components/script/dom/webidls/GPUDevice.webidl +++ b/components/script/dom/webidls/GPUDevice.webidl @@ -11,21 +11,24 @@ interface GPUDevice : EventTarget { GPUBuffer createBuffer(GPUBufferDescriptor descriptor); GPUMappedBuffer createBufferMapped(GPUBufferDescriptor descriptor); - //Promise<GPUMappedBuffer> createBufferMappedAsync(GPUBufferDescriptor descriptor); - //GPUTexture createTexture(GPUTextureDescriptor descriptor); - //GPUSampler createSampler(optional GPUSamplerDescriptor descriptor = {}); + // Promise<GPUMappedBuffer> createBufferMappedAsync(GPUBufferDescriptor descriptor); + // GPUTexture createTexture(GPUTextureDescriptor descriptor); + // GPUSampler createSampler(optional GPUSamplerDescriptor descriptor = {}); GPUBindGroupLayout createBindGroupLayout(GPUBindGroupLayoutDescriptor descriptor); GPUPipelineLayout createPipelineLayout(GPUPipelineLayoutDescriptor descriptor); - /*GPUBindGroup createBindGroup(GPUBindGroupDescriptor descriptor); + GPUBindGroup createBindGroup(GPUBindGroupDescriptor descriptor); GPUShaderModule createShaderModule(GPUShaderModuleDescriptor descriptor); GPUComputePipeline createComputePipeline(GPUComputePipelineDescriptor descriptor); - GPURenderPipeline createRenderPipeline(GPURenderPipelineDescriptor descriptor); + // GPURenderPipeline createRenderPipeline(GPURenderPipelineDescriptor descriptor); GPUCommandEncoder createCommandEncoder(optional GPUCommandEncoderDescriptor descriptor = {}); - GPURenderBundleEncoder createRenderBundleEncoder(GPURenderBundleEncoderDescriptor descriptor); + // GPURenderBundleEncoder createRenderBundleEncoder(GPURenderBundleEncoderDescriptor descriptor); - GPUQueue getQueue();*/ + // GPUQueue getQueue(); }; GPUDevice includes GPUObjectBase; + +dictionary GPUCommandEncoderDescriptor : GPUObjectDescriptorBase { +}; diff --git a/components/script/dom/webidls/GPUProgrammablePassEncoder.webidl b/components/script/dom/webidls/GPUProgrammablePassEncoder.webidl new file mode 100644 index 00000000000..2a44e806065 --- /dev/null +++ b/components/script/dom/webidls/GPUProgrammablePassEncoder.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://gpuweb.github.io/gpuweb/#gpuprogrammablepassencoder +[Exposed=(Window, DedicatedWorker)] +interface mixin GPUProgrammablePassEncoder { + // void setBindGroup(unsigned long index, GPUBindGroup bindGroup, + // optional sequence<unsigned long> dynamicOffsets = []); + + // void setBindGroup(unsigned long index, GPUBindGroup bindGroup, + // Uint32Array dynamicOffsetsData, + // unsigned long long dynamicOffsetsDataStart, + // unsigned long long dynamicOffsetsDataLength); + + // void pushDebugGroup(DOMString groupLabel); + // void popDebugGroup(); + // void insertDebugMarker(DOMString markerLabel); +}; 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/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/Window.webidl b/components/script/dom/webidls/Window.webidl index afd5183de33..eb8e4232886 100644 --- a/components/script/dom/webidls/Window.webidl +++ b/components/script/dom/webidls/Window.webidl @@ -55,8 +55,8 @@ // 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); |