webgl: Update IDL exposed members (#33509)

* Update IDLs to expose on Workers

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update usage of Canvas/OffscreenCanvas union, add label

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update WPT expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix match arm

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing spec links

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update interfaces.worker.js

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
Daniel Adams 2024-09-22 11:55:31 +00:00 committed by GitHub
parent 8276673bae
commit 3a0d27b231
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 117 additions and 4772 deletions

View file

@ -34,6 +34,7 @@ use crate::dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{
};
use crate::dom::bindings::codegen::UnionTypes::{
ArrayBufferViewOrArrayBuffer, Float32ArrayOrUnrestrictedFloatSequence,
HTMLCanvasElementOrOffscreenCanvas,
ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement, Int32ArrayOrLongSequence,
Uint32ArrayOrUnsignedLongSequence,
};
@ -42,7 +43,7 @@ use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot, LayoutDom, MutNullableDom};
use crate::dom::bindings::str::DOMString;
use crate::dom::globalscope::GlobalScope;
use crate::dom::htmlcanvaselement::{HTMLCanvasElement, LayoutCanvasRenderingContextHelpers};
use crate::dom::htmlcanvaselement::LayoutCanvasRenderingContextHelpers;
use crate::dom::promise::Promise;
use crate::dom::webgl_validations::tex_image_2d::{
TexImage2DValidator, TexImage2DValidatorResult, TexStorageValidator, TexStorageValidatorResult,
@ -139,7 +140,7 @@ struct ReadPixelsSizes {
impl WebGL2RenderingContext {
fn new_inherited(
window: &Window,
canvas: &HTMLCanvasElement,
canvas: &HTMLCanvasElementOrOffscreenCanvas,
size: Size2D<u32>,
attrs: GLContextAttributes,
) -> Option<WebGL2RenderingContext> {
@ -186,7 +187,7 @@ impl WebGL2RenderingContext {
#[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
canvas: &HTMLCanvasElement,
canvas: &HTMLCanvasElementOrOffscreenCanvas,
size: Size2D<u32>,
attrs: GLContextAttributes,
) -> Option<DomRoot<WebGL2RenderingContext>> {
@ -902,7 +903,7 @@ impl WebGL2RenderingContext {
impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
/// <https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.1>
fn Canvas(&self) -> DomRoot<HTMLCanvasElement> {
fn Canvas(&self) -> HTMLCanvasElementOrOffscreenCanvas {
self.base.Canvas()
}