From 177ef22673bca632005a534b590336eee7db444c Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Mon, 14 Jan 2019 17:45:43 -0500 Subject: [PATCH 01/13] Add maybe adjust function --- crates/webidl/src/util.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/crates/webidl/src/util.rs b/crates/webidl/src/util.rs index 412e45d7c66..629b94e8cdf 100644 --- a/crates/webidl/src/util.rs +++ b/crates/webidl/src/util.rs @@ -433,7 +433,10 @@ impl<'src> FirstPassRecord<'src> { ); signatures.push((signature, idl_args.clone())); } - idl_args.push(arg.ty.to_idl_type(self)); + + let idl_type = arg.ty.to_idl_type(self); + let idl_type = maybe_adjust(idl_type, id); + idl_args.push(idl_type); } signatures.push((signature, idl_args)); } @@ -707,3 +710,21 @@ pub fn public() -> syn::Visibility { pub_token: Default::default(), }) } + +/// When generating our web_sys APIs we default to setting slice references that +/// get passed to JS as mutable in case they get mutated in JS. +/// +/// In certain cases we know for sure that the slice will not get mutated - for +/// example when working with the WebGlRenderingContext APIs. +/// +/// Here we implement a whitelist for those cases. This whitelist is currently +/// maintained by hand. +fn maybe_adjust<'a> (idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<'a> { + match id { + OperationId::Operation(Some(op)) => { + // TODO: `match op` and return an adjusted idl_type if necessary + idl_type + } + _ => idl_type + } +} From 1d0c2fee9ef14ea484e83c524c365e90809dacdb Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Thu, 17 Jan 2019 13:20:53 -0500 Subject: [PATCH 02/13] Add failing immutable slice test --- crates/web-sys/tests/wasm/element.js | 5 ++++ crates/web-sys/tests/wasm/immutable_slices.rs | 26 +++++++++++++++++++ crates/web-sys/tests/wasm/main.rs | 1 + crates/webidl-tests/lib.rs | 2 ++ 4 files changed, 34 insertions(+) create mode 100644 crates/web-sys/tests/wasm/immutable_slices.rs diff --git a/crates/web-sys/tests/wasm/element.js b/crates/web-sys/tests/wasm/element.js index ed51fbdbe71..3f34bc5f64e 100644 --- a/crates/web-sys/tests/wasm/element.js +++ b/crates/web-sys/tests/wasm/element.js @@ -151,6 +151,11 @@ export function new_title() { return document.createElement("title"); } +export function new_webgl_rendering_context() { + const canvas = document.createElement('canvas'); + return canvas.getContext('webgl'); +} + export function new_xpath_result() { let xmlDoc = new DOMParser().parseFromString("tomato", "application/xml"); let xpathResult = xmlDoc.evaluate("/root//value", xmlDoc, null, XPathResult.ANY_TYPE, null); diff --git a/crates/web-sys/tests/wasm/immutable_slices.rs b/crates/web-sys/tests/wasm/immutable_slices.rs new file mode 100644 index 00000000000..92b4cbd3def --- /dev/null +++ b/crates/web-sys/tests/wasm/immutable_slices.rs @@ -0,0 +1,26 @@ +//! When generating our web_sys APIs we default to setting slice references that +//! get passed to JS as mutable in case they get mutated in JS. +//! +//! In certain cases we know for sure that the slice will not get mutated - for +//! example when working with the WebGlRenderingContext APIs. +//! +//! These tests ensure that whitelisted methods do indeed accept mutable slices. +//! +//! @see https://github.com/rustwasm/wasm-bindgen/issues/1005 + +use wasm_bindgen::prelude::*; +use wasm_bindgen_test::*; +use web_sys::WebGlRenderingContext; + +#[wasm_bindgen(module = "./tests/wasm/element.js")] +extern "C" { + fn new_webgl_rendering_context() -> WebGlRenderingContext; +} + +// Ensure that our whitelisted WebGlRenderingContext methods work +#[wasm_bindgen_test] +fn test_webgl_rendering_context_immutable_slices() { + let gl = new_webgl_rendering_context(); + + gl.vertex_attrib1fv_with_f32_array(0, &[5000.]); +} diff --git a/crates/web-sys/tests/wasm/main.rs b/crates/web-sys/tests/wasm/main.rs index 8f2fd5ffd49..3b57604ac1c 100644 --- a/crates/web-sys/tests/wasm/main.rs +++ b/crates/web-sys/tests/wasm/main.rs @@ -56,6 +56,7 @@ pub mod style_element; pub mod table_element; pub mod title_element; pub mod xpath_result; +pub mod immutable_slices; #[wasm_bindgen_test] fn deref_works() { diff --git a/crates/webidl-tests/lib.rs b/crates/webidl-tests/lib.rs index 44425d9c15f..7d245db242a 100644 --- a/crates/webidl-tests/lib.rs +++ b/crates/webidl-tests/lib.rs @@ -1 +1,3 @@ // intentionally left blank + +// QUESTION FOR REVIEWER: WHY? (I'll include this context in the comment) From 459639137c7ed2be75c14e65d008a3aed190bfc9 Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Mon, 14 Jan 2019 17:45:43 -0500 Subject: [PATCH 03/13] Add maybe adjust function --- crates/webidl/src/util.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/crates/webidl/src/util.rs b/crates/webidl/src/util.rs index 412e45d7c66..629b94e8cdf 100644 --- a/crates/webidl/src/util.rs +++ b/crates/webidl/src/util.rs @@ -433,7 +433,10 @@ impl<'src> FirstPassRecord<'src> { ); signatures.push((signature, idl_args.clone())); } - idl_args.push(arg.ty.to_idl_type(self)); + + let idl_type = arg.ty.to_idl_type(self); + let idl_type = maybe_adjust(idl_type, id); + idl_args.push(idl_type); } signatures.push((signature, idl_args)); } @@ -707,3 +710,21 @@ pub fn public() -> syn::Visibility { pub_token: Default::default(), }) } + +/// When generating our web_sys APIs we default to setting slice references that +/// get passed to JS as mutable in case they get mutated in JS. +/// +/// In certain cases we know for sure that the slice will not get mutated - for +/// example when working with the WebGlRenderingContext APIs. +/// +/// Here we implement a whitelist for those cases. This whitelist is currently +/// maintained by hand. +fn maybe_adjust<'a> (idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<'a> { + match id { + OperationId::Operation(Some(op)) => { + // TODO: `match op` and return an adjusted idl_type if necessary + idl_type + } + _ => idl_type + } +} From e6971cee3407a72df9cbaa5efa38adcd2b27486d Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Thu, 17 Jan 2019 13:20:53 -0500 Subject: [PATCH 04/13] Add failing immutable slice test --- crates/web-sys/tests/wasm/element.js | 5 ++++ crates/web-sys/tests/wasm/immutable_slices.rs | 26 +++++++++++++++++++ crates/web-sys/tests/wasm/main.rs | 1 + crates/webidl-tests/lib.rs | 2 ++ 4 files changed, 34 insertions(+) create mode 100644 crates/web-sys/tests/wasm/immutable_slices.rs diff --git a/crates/web-sys/tests/wasm/element.js b/crates/web-sys/tests/wasm/element.js index ed51fbdbe71..3f34bc5f64e 100644 --- a/crates/web-sys/tests/wasm/element.js +++ b/crates/web-sys/tests/wasm/element.js @@ -151,6 +151,11 @@ export function new_title() { return document.createElement("title"); } +export function new_webgl_rendering_context() { + const canvas = document.createElement('canvas'); + return canvas.getContext('webgl'); +} + export function new_xpath_result() { let xmlDoc = new DOMParser().parseFromString("tomato", "application/xml"); let xpathResult = xmlDoc.evaluate("/root//value", xmlDoc, null, XPathResult.ANY_TYPE, null); diff --git a/crates/web-sys/tests/wasm/immutable_slices.rs b/crates/web-sys/tests/wasm/immutable_slices.rs new file mode 100644 index 00000000000..92b4cbd3def --- /dev/null +++ b/crates/web-sys/tests/wasm/immutable_slices.rs @@ -0,0 +1,26 @@ +//! When generating our web_sys APIs we default to setting slice references that +//! get passed to JS as mutable in case they get mutated in JS. +//! +//! In certain cases we know for sure that the slice will not get mutated - for +//! example when working with the WebGlRenderingContext APIs. +//! +//! These tests ensure that whitelisted methods do indeed accept mutable slices. +//! +//! @see https://github.com/rustwasm/wasm-bindgen/issues/1005 + +use wasm_bindgen::prelude::*; +use wasm_bindgen_test::*; +use web_sys::WebGlRenderingContext; + +#[wasm_bindgen(module = "./tests/wasm/element.js")] +extern "C" { + fn new_webgl_rendering_context() -> WebGlRenderingContext; +} + +// Ensure that our whitelisted WebGlRenderingContext methods work +#[wasm_bindgen_test] +fn test_webgl_rendering_context_immutable_slices() { + let gl = new_webgl_rendering_context(); + + gl.vertex_attrib1fv_with_f32_array(0, &[5000.]); +} diff --git a/crates/web-sys/tests/wasm/main.rs b/crates/web-sys/tests/wasm/main.rs index 8f2fd5ffd49..3b57604ac1c 100644 --- a/crates/web-sys/tests/wasm/main.rs +++ b/crates/web-sys/tests/wasm/main.rs @@ -56,6 +56,7 @@ pub mod style_element; pub mod table_element; pub mod title_element; pub mod xpath_result; +pub mod immutable_slices; #[wasm_bindgen_test] fn deref_works() { diff --git a/crates/webidl-tests/lib.rs b/crates/webidl-tests/lib.rs index 44425d9c15f..7d245db242a 100644 --- a/crates/webidl-tests/lib.rs +++ b/crates/webidl-tests/lib.rs @@ -1 +1,3 @@ // intentionally left blank + +// QUESTION FOR REVIEWER: WHY? (I'll include this context in the comment) From 216b4e36fff47442425f5b98257d37a47cf5862a Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Mon, 21 Jan 2019 16:58:58 -0500 Subject: [PATCH 05/13] Rename immutable slices test --- .../wasm/whitelisted_immutable_slices.rs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs diff --git a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs new file mode 100644 index 00000000000..92b4cbd3def --- /dev/null +++ b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs @@ -0,0 +1,26 @@ +//! When generating our web_sys APIs we default to setting slice references that +//! get passed to JS as mutable in case they get mutated in JS. +//! +//! In certain cases we know for sure that the slice will not get mutated - for +//! example when working with the WebGlRenderingContext APIs. +//! +//! These tests ensure that whitelisted methods do indeed accept mutable slices. +//! +//! @see https://github.com/rustwasm/wasm-bindgen/issues/1005 + +use wasm_bindgen::prelude::*; +use wasm_bindgen_test::*; +use web_sys::WebGlRenderingContext; + +#[wasm_bindgen(module = "./tests/wasm/element.js")] +extern "C" { + fn new_webgl_rendering_context() -> WebGlRenderingContext; +} + +// Ensure that our whitelisted WebGlRenderingContext methods work +#[wasm_bindgen_test] +fn test_webgl_rendering_context_immutable_slices() { + let gl = new_webgl_rendering_context(); + + gl.vertex_attrib1fv_with_f32_array(0, &[5000.]); +} From 1738f0772c4c2f9486879112b95fa13da03cc330 Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Mon, 21 Jan 2019 19:18:35 -0500 Subject: [PATCH 06/13] Add immutable field to IdlType::Float32Array --- crates/web-sys/foo | 3535 +++++++++++++++++ crates/web-sys/tests/wasm/immutable_slices.rs | 26 - crates/web-sys/tests/wasm/main.rs | 2 +- .../wasm/whitelisted_immutable_slices.rs | 2 +- crates/webidl/src/first_pass.rs | 3 + crates/webidl/src/idl_type.rs | 44 +- crates/webidl/src/util.rs | 15 +- 7 files changed, 3579 insertions(+), 48 deletions(-) create mode 100644 crates/web-sys/foo delete mode 100644 crates/web-sys/tests/wasm/immutable_slices.rs diff --git a/crates/web-sys/foo b/crates/web-sys/foo new file mode 100644 index 00000000000..789d77f9cf8 --- /dev/null +++ b/crates/web-sys/foo @@ -0,0 +1,3535 @@ +bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + uniform1fv + uniform1fv + uniform1iv + uniform1iv + uniform2fv + uniform2fv + uniform2iv + uniform2iv + uniform3fv + uniform3fv + uniform3iv + uniform3iv + uniform4fv + uniform4fv + uniform4iv + uniform4iv + uniformMatrix2fv + uniformMatrix2fv + uniformMatrix2fv + uniformMatrix3fv + uniformMatrix3fv + uniformMatrix3fv + uniformMatrix4fv + uniformMatrix4fv + uniformMatrix4fv + activeTexture + attachShader + attachShader + bindAttribLocation + bindAttribLocation + bindAttribLocation + bindBuffer + bindBuffer + bindFramebuffer + bindFramebuffer + bindRenderbuffer + bindRenderbuffer + bindTexture + bindTexture + blendColor + blendColor + blendColor + blendColor + blendEquation + blendEquationSeparate + blendEquationSeparate + blendFunc + blendFunc + blendFuncSeparate + blendFuncSeparate + blendFuncSeparate + blendFuncSeparate + checkFramebufferStatus + clear + clearColor + clearColor + clearColor + clearColor + clearDepth + clearStencil + colorMask + colorMask + colorMask + colorMask + compileShader + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + createShader + cullFace + deleteBuffer + deleteFramebuffer + deleteProgram + deleteRenderbuffer + deleteShader + deleteTexture + depthFunc + depthMask + depthRange + depthRange + detachShader + detachShader + disable + disableVertexAttribArray + drawArrays + drawArrays + drawArrays + drawElements + drawElements + drawElements + drawElements + enable + enableVertexAttribArray + framebufferRenderbuffer + framebufferRenderbuffer + framebufferRenderbuffer + framebufferRenderbuffer + framebufferTexture2D + framebufferTexture2D + framebufferTexture2D + framebufferTexture2D + framebufferTexture2D + frontFace + generateMipmap + getActiveAttrib + getActiveAttrib + getActiveUniform + getActiveUniform + getAttachedShaders + getAttribLocation + getAttribLocation + getBufferParameter + getBufferParameter + getExtension + getFramebufferAttachmentParameter + getFramebufferAttachmentParameter + getFramebufferAttachmentParameter + getParameter + getProgramInfoLog + getProgramParameter + getProgramParameter + getRenderbufferParameter + getRenderbufferParameter + getShaderInfoLog + getShaderParameter + getShaderParameter + getShaderPrecisionFormat + getShaderPrecisionFormat + getShaderSource + getTexParameter + getTexParameter + getUniform + getUniform + getUniformLocation + getUniformLocation + getVertexAttrib + getVertexAttrib + getVertexAttribOffset + getVertexAttribOffset + hint + hint + isBuffer + isEnabled + isFramebuffer + isProgram + isRenderbuffer + isShader + isTexture + lineWidth + linkProgram + pixelStorei + pixelStorei + polygonOffset + polygonOffset + renderbufferStorage + renderbufferStorage + renderbufferStorage + renderbufferStorage + sampleCoverage + sampleCoverage + scissor + scissor + scissor + scissor + shaderSource + shaderSource + stencilFunc + stencilFunc + stencilFunc + stencilFuncSeparate + stencilFuncSeparate + stencilFuncSeparate + stencilFuncSeparate + stencilMask + stencilMaskSeparate + stencilMaskSeparate + stencilOp + stencilOp + stencilOp + stencilOpSeparate + stencilOpSeparate + stencilOpSeparate + stencilOpSeparate + texParameterf + texParameterf + texParameterf + texParameteri + texParameteri + texParameteri + uniform1f + uniform1f + uniform1i + uniform1i + uniform2f + uniform2f + uniform2f + uniform2i + uniform2i + uniform2i + uniform3f + uniform3f + uniform3f + uniform3f + uniform3i + uniform3i + uniform3i + uniform3i + uniform4f + uniform4f + uniform4f + uniform4f + uniform4f + uniform4i + uniform4i + uniform4i + uniform4i + uniform4i + useProgram + validateProgram + vertexAttrib1f + vertexAttrib1f + vertexAttrib1fv + vertexAttrib1fv + vertexAttrib2f + vertexAttrib2f + vertexAttrib2f + vertexAttrib2fv + vertexAttrib2fv + vertexAttrib3f + vertexAttrib3f + vertexAttrib3f + vertexAttrib3f + vertexAttrib3fv + vertexAttrib3fv + vertexAttrib4f + vertexAttrib4f + vertexAttrib4f + vertexAttrib4f + vertexAttrib4f + vertexAttrib4fv + vertexAttrib4fv + vertexAttribPointer + vertexAttribPointer + vertexAttribPointer + vertexAttribPointer + vertexAttribPointer + vertexAttribPointer + viewport + viewport + viewport + viewport + escape + supports + supports + supports + assert + assert + count + countReset + debug + dir + dirxml + error + exception + group + groupCollapsed + info + log + profile + profileEnd + table + time + timeEnd + timeLog + timeLog + timeStamp + trace + warn + getByteFrequencyData + getByteTimeDomainData + getFloatFrequencyData + getFloatTimeDomainData + updatePlaybackRate + updateTiming + copyFromChannel + copyFromChannel + copyFromChannel + copyToChannel + copyToChannel + copyToChannel + getChannelData + start + start + start + stop + createMediaElementSource + createMediaStreamSource + createBuffer + createBuffer + createBuffer + createChannelMerger + createChannelSplitter + createDelay + createIIRFilter + createIIRFilter + createPeriodicWave + createPeriodicWave + createPeriodicWave + createScriptProcessor + createScriptProcessor + createScriptProcessor + decodeAudioData + decodeAudioData + decodeAudioData + setOrientation + setOrientation + setOrientation + setOrientation + setOrientation + setOrientation + setPosition + setPosition + setPosition + setVelocity + setVelocity + setVelocity + connect + connect + connect + connect + connect + disconnect + disconnect + disconnect + disconnect + disconnect + disconnect + disconnect + disconnect + disconnect + disconnect + cancelScheduledValues + exponentialRampToValueAtTime + exponentialRampToValueAtTime + linearRampToValueAtTime + linearRampToValueAtTime + setTargetAtTime + setTargetAtTime + setTargetAtTime + setValueAtTime + setValueAtTime + setValueCurveAtTime + setValueCurveAtTime + setValueCurveAtTime + start + stop + getTrackById + registerProcessor + registerProcessor + createBuffer + createBuffer + createBuffer + createChannelMerger + createChannelSplitter + createDelay + createIIRFilter + createIIRFilter + createPeriodicWave + createPeriodicWave + createPeriodicWave + createScriptProcessor + createScriptProcessor + createScriptProcessor + decodeAudioData + decodeAudioData + decodeAudioData + getFrequencyResponse + getFrequencyResponse + getFrequencyResponse + slice + slice + slice + postMessage + deleteRule + insertRule + insertRule + appendRule + deleteRule + findRule + item + getPropertyPriority + getPropertyValue + item + removeProperty + setProperty + setProperty + setProperty + deleteRule + insertRule + insertRule + add + addAll + delete + delete + keys + keys + match + match + matchAll + matchAll + put + put + delete + has + match + match + open + addColorStop + addColorStop + setTransform + drawWindow + drawWindow + drawWindow + drawWindow + drawWindow + drawWindow + drawWindow + drawImage + drawImage + drawImage + drawImage + drawImage + drawImage + drawImage + drawImage + drawImage + drawImage + drawImage + drawImage + drawImage + drawImage + drawImage + drawImage + drawImage + clip + clip + clip + fill + fill + fill + isPointInPath + isPointInPath + isPointInPath + isPointInPath + isPointInPath + isPointInPath + isPointInPath + isPointInStroke + isPointInStroke + isPointInStroke + isPointInStroke + isPointInStroke + stroke + createLinearGradient + createLinearGradient + createLinearGradient + createLinearGradient + createPattern + createPattern + createRadialGradient + createRadialGradient + createRadialGradient + createRadialGradient + createRadialGradient + createRadialGradient + addHitRegion + removeHitRegion + createImageData + createImageData + createImageData + getImageData + getImageData + getImageData + getImageData + putImageData + putImageData + putImageData + putImageData + putImageData + putImageData + putImageData + putImageData + putImageData + putImageData + setLineDash + arc + arc + arc + arc + arc + arc + arcTo + arcTo + arcTo + arcTo + arcTo + bezierCurveTo + bezierCurveTo + bezierCurveTo + bezierCurveTo + bezierCurveTo + bezierCurveTo + ellipse + ellipse + ellipse + ellipse + ellipse + ellipse + ellipse + ellipse + lineTo + lineTo + moveTo + moveTo + quadraticCurveTo + quadraticCurveTo + quadraticCurveTo + quadraticCurveTo + rect + rect + rect + rect + clearRect + clearRect + clearRect + clearRect + fillRect + fillRect + fillRect + fillRect + strokeRect + strokeRect + strokeRect + strokeRect + fillText + fillText + fillText + fillText + measureText + strokeText + strokeText + strokeText + strokeText + rotate + scale + scale + setTransform + setTransform + setTransform + setTransform + setTransform + setTransform + transform + transform + transform + transform + transform + transform + translate + translate + drawCustomFocusRing + drawFocusIfNeeded + appendData + deleteData + deleteData + insertData + insertData + replaceData + replaceData + replaceData + substringData + substringData + after + before + replaceWith + setRecordingEnabled + postMessage + postMessage + get + matchAll + openWindow + initCompositionEvent + initCompositionEvent + initCompositionEvent + initCompositionEvent + initCompositionEvent + initCompositionEvent + start + stop + create + get + store + getRandomValues + define + define + define + get + upgrade + whenDefined + initCustomEvent + initCustomEvent + initCustomEvent + initCustomEvent + createDocument + createDocument + createDocument + createDocumentType + createDocumentType + createDocumentType + createHTMLDocument + multiplySelf + preMultiplySelf + rotateAxisAngleSelf + rotateAxisAngleSelf + rotateAxisAngleSelf + rotateAxisAngleSelf + rotateFromVectorSelf + rotateFromVectorSelf + rotateSelf + rotateSelf + rotateSelf + scale3dSelf + scale3dSelf + scale3dSelf + scale3dSelf + scaleNonUniformSelf + scaleNonUniformSelf + scaleNonUniformSelf + scaleNonUniformSelf + scaleNonUniformSelf + scaleNonUniformSelf + scaleSelf + scaleSelf + scaleSelf + setMatrixValue + skewXSelf + skewYSelf + translateSelf + translateSelf + translateSelf + multiply + rotate + rotate + rotate + rotateAxisAngle + rotateAxisAngle + rotateAxisAngle + rotateAxisAngle + rotateFromVector + rotateFromVector + scale + scale + scale + scale3d + scale3d + scale3d + scale3d + scaleNonUniform + scaleNonUniform + scaleNonUniform + scaleNonUniform + scaleNonUniform + scaleNonUniform + skewX + skewY + transformPoint + translate + translate + translate + parseFromString + parseFromString + fromPoint + fromPoint + item + then + then + contains + item + add + contains + item + remove + replace + replace + supports + toggle + toggle + clearData + getData + getFiles + setData + setData + setDragImage + setDragImage + setDragImage + getAsString + add + add + add + remove + postMessage + postMessage + initDeviceOrientationEvent + initDeviceOrientationEvent + initDeviceOrientationEvent + initDeviceOrientationEvent + initDeviceOrientationEvent + initDeviceOrientationEvent + initDeviceOrientationEvent + getFiles + adoptNode + caretPositionFromPoint + caretPositionFromPoint + createAttribute + createAttributeNS + createAttributeNS + createCDATASection + createComment + createElement + createElement + createElementNS + createElementNS + createElementNS + createEvent + createNodeIterator + createNodeIterator + createNodeIterator + createProcessingInstruction + createProcessingInstruction + createTextNode + createTreeWalker + createTreeWalker + createTreeWalker + enableStyleSheetsForSet + getElementById + getElementsByClassName + getElementsByName + getElementsByTagName + getElementsByTagNameNS + getElementsByTagNameNS + importNode + importNode + querySelector + querySelectorAll + elementFromPoint + elementFromPoint + elementsFromPoint + elementsFromPoint + convertPointFromNode + convertPointFromNode + convertPointFromNode + convertQuadFromNode + convertQuadFromNode + convertQuadFromNode + convertRectFromNode + convertRectFromNode + convertRectFromNode + getBoxQuads + append + prepend + createExpression + createExpression + createNSResolver + evaluate + evaluate + evaluate + evaluate + evaluate + getElementById + querySelector + querySelectorAll + append + prepend + after + before + replaceWith + initDragEvent + initDragEvent + initDragEvent + initDragEvent + initDragEvent + initDragEvent + initDragEvent + initDragEvent + initDragEvent + initDragEvent + initDragEvent + initDragEvent + initDragEvent + initDragEvent + initDragEvent + initDragEvent + attachShadow + closest + getAttribute + getAttributeNS + getAttributeNS + getAttributeNode + getAttributeNodeNS + getAttributeNodeNS + hasAttribute + hasAttributeNS + hasAttributeNS + hasPointerCapture + insertAdjacentElement + insertAdjacentElement + insertAdjacentHTML + insertAdjacentHTML + insertAdjacentText + insertAdjacentText + matches + querySelector + querySelectorAll + releasePointerCapture + removeAttribute + removeAttributeNS + removeAttributeNS + removeAttributeNode + scroll + scroll + scroll + scrollBy + scrollBy + scrollBy + scrollIntoView + scrollTo + scrollTo + scrollTo + setAttribute + setAttribute + setAttributeNS + setAttributeNS + setAttributeNS + setAttributeNode + setAttributeNodeNS + setCapture + setPointerCapture + toggleAttribute + toggleAttribute + webkitMatchesSelector + after + before + replaceWith + convertPointFromNode + convertPointFromNode + convertPointFromNode + convertQuadFromNode + convertQuadFromNode + convertQuadFromNode + convertRectFromNode + convertRectFromNode + convertRectFromNode + getBoxQuads + append + prepend + initEvent + initEvent + initEvent + addEventListener + addEventListener + addEventListener + addEventListener + dispatchEvent + removeEventListener + removeEventListener + removeEventListener + waitUntil + respondWith + item + readAsArrayBuffer + readAsBinaryString + readAsDataURL + readAsText + readAsText + readAsArrayBuffer + readAsBinaryString + readAsDataURL + readAsText + readAsText + getDirectory + getDirectory + getDirectory + getDirectory + getFile + getFile + getFile + getFile + readEntries + readEntries + getParent + getParent + file + file + add + check + check + delete + forEach + forEach + has + load + load + append + append + append + append + append + delete + get + getAll + has + set + set + set + set + set + pulse + pulse + addGamepad + addGamepad + addGamepad + addGamepad + addGamepad + addGamepad + newAxisMoveEvent + newAxisMoveEvent + newAxisMoveEvent + newButtonEvent + newButtonEvent + newButtonEvent + newButtonEvent + newButtonValueEvent + newButtonValueEvent + newButtonValueEvent + newButtonValueEvent + newButtonValueEvent + newPoseMove + newPoseMove + newPoseMove + newPoseMove + newPoseMove + newPoseMove + newPoseMove + removeGamepad + item + item + namedItem + setCustomValidity + getContext + getContext + toBlob + toBlob + toBlob + toDataURL + toDataURL + item + namedItem + close + execCommand + execCommand + execCommand + open + open + open + open + open + open + queryCommandEnabled + queryCommandIndeterm + queryCommandState + queryCommandSupported + queryCommandValue + write + writeln + setCustomValidity + namedItem + setCustomValidity + setRangeText + setRangeText + setRangeText + setRangeText + setRangeText + setSelectionRange + setSelectionRange + setSelectionRange + addTextTrack + addTextTrack + addTextTrack + canPlayType + fastSeek + setMediaKeys + setVisible + setCustomValidity + add + add + remove + setCustomValidity + add + add + item + namedItem + remove + setCustomValidity + assignedNodes + deleteRow + insertRow + deleteCell + insertCell + deleteRow + insertRow + setCustomValidity + setRangeText + setRangeText + setRangeText + setRangeText + setRangeText + setSelectionRange + setSelectionRange + setSelectionRange + initHashChangeEvent + initHashChangeEvent + initHashChangeEvent + initHashChangeEvent + initHashChangeEvent + append + append + delete + get + has + set + set + go + pushState + pushState + pushState + replaceState + replaceState + replaceState + advance + continue + continuePrimaryKey + continuePrimaryKey + update + createMutableFile + createMutableFile + createObjectStore + createObjectStore + deleteObjectStore + transaction + transaction + cmp + cmp + deleteDatabase + deleteDatabase + open + open + open + open + append + getMetadata + readAsArrayBuffer + readAsText + readAsText + truncate + write + count + get + getAll + getAll + getAllKeys + getAllKeys + getKey + openCursor + openCursor + openKeyCursor + openKeyCursor + bound + bound + bound + bound + includes + lowerBound + lowerBound + only + upperBound + upperBound + bound + bound + bound + bound + open + add + add + count + createIndex + createIndex + createIndex + delete + deleteIndex + get + getAll + getAll + getAllKeys + getAllKeys + getKey + index + openCursor + openCursor + openKeyCursor + openKeyCursor + put + put + objectStore + getFrequencyResponse + getFrequencyResponse + getFrequencyResponse + findOptimalFormat + mapDataInto + mapDataInto + mapDataInto + mappedDataLength + transferFromImageBitmap + transferImageBitmap + observe + unobserve + initKeyEvent + initKeyEvent + initKeyEvent + initKeyEvent + initKeyEvent + initKeyEvent + initKeyEvent + initKeyEvent + initKeyEvent + initKeyEvent + getModifierState + initKeyboardEvent + initKeyboardEvent + initKeyboardEvent + initKeyboardEvent + initKeyboardEvent + initKeyboardEvent + initKeyboardEvent + initKeyboardEvent + initKeyboardEvent + initKeyboardEvent + setKeyframes + assign + reload + replace + send + send + decodingInfo + encodingInfo + getUserMedia + generateRequest + generateRequest + load + update + get + has + createSession + getStatusForPolicy + setServerCertificate + appendMedium + deleteMedium + item + addListener + removeListener + isTypeSupported + start + addSourceBuffer + endOfStream + isTypeSupported + removeSourceBuffer + setLiveSeekableRange + setLiveSeekableRange + addTrack + getTrackById + removeTrack + applyConstraints + initMessageEvent + initMessageEvent + initMessageEvent + initMessageEvent + initMessageEvent + initMessageEvent + initMessageEvent + initMessageEvent + postMessage + postMessage + item + namedItem + getModifierState + initMouseEvent + initMouseEvent + initMouseEvent + initMouseEvent + initMouseEvent + initMouseEvent + initMouseEvent + initMouseEvent + initMouseEvent + initMouseEvent + initMouseEvent + initMouseEvent + initMouseEvent + initMouseEvent + initMouseEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMouseScrollEvent + initMutationEvent + initMutationEvent + initMutationEvent + initMutationEvent + initMutationEvent + initMutationEvent + initMutationEvent + initMutationEvent + observe + observe + getNamedItem + getNamedItemNS + getNamedItemNS + item + removeNamedItem + removeNamedItemNS + removeNamedItemNS + setNamedItem + setNamedItemNS + requestMIDIAccess + requestMediaKeySystemAccess + requestMediaKeySystemAccess + sendBeacon + sendBeacon + vibrate + vibrate + registerContentHandler + registerContentHandler + registerContentHandler + registerProtocolHandler + registerProtocolHandler + registerProtocolHandler + appendChild + cloneNode + compareDocumentPosition + contains + getRootNode + insertBefore + insertBefore + isDefaultNamespace + isEqualNode + isSameNode + lookupNamespaceURI + lookupPrefix + removeChild + replaceChild + replaceChild + item + get + requestPermission + createBuffer + createBuffer + createBuffer + createChannelMerger + createChannelSplitter + createDelay + createIIRFilter + createIIRFilter + createPeriodicWave + createPeriodicWave + createPeriodicWave + createScriptProcessor + createScriptProcessor + createScriptProcessor + decodeAudioData + decodeAudioData + decodeAudioData + getContext + getContext + toBlob + toBlob + setPeriodicWave + start + stop + item + registerPaint + registerPaint + setOrientation + setOrientation + setOrientation + setPosition + setPosition + setPosition + setVelocity + setVelocity + setVelocity + addPath + addPath + arc + arc + arc + arc + arc + arc + arcTo + arcTo + arcTo + arcTo + arcTo + bezierCurveTo + bezierCurveTo + bezierCurveTo + bezierCurveTo + bezierCurveTo + bezierCurveTo + ellipse + ellipse + ellipse + ellipse + ellipse + ellipse + ellipse + ellipse + lineTo + lineTo + moveTo + moveTo + quadraticCurveTo + quadraticCurveTo + quadraticCurveTo + quadraticCurveTo + rect + rect + rect + rect + updateWith + complete + clearMarks + clearMeasures + getEntriesByName + getEntriesByName + getEntriesByType + mark + measure + measure + measure + setResourceTimingBufferSize + observe + getEntries + getEntriesByName + getEntriesByName + getEntriesByType + query + revoke + item + namedItem + item + namedItem + refresh + send + send + send + send + reconnect + permissionState + subscribe + getKey + insertDTMF + insertDTMF + insertDTMF + send + send + send + send + addIceCandidate + addIceCandidate + addIceCandidate + addIceCandidate + addStream + addTrack + addTrack + addTrack + addTransceiver + addTransceiver + createAnswer + createAnswer + createAnswer + createDataChannel + createDataChannel + createOffer + createOffer + createOffer + createOffer + generateCertificate + getStats + getStats + getStats + getStats + removeTrack + setIdentityProvider + setIdentityProvider + setLocalDescription + setLocalDescription + setLocalDescription + setLocalDescription + setRemoteDescription + setRemoteDescription + setRemoteDescription + setRemoteDescription + replaceTrack + setParameters + collapse + compareBoundaryPoints + compareBoundaryPoints + comparePoint + comparePoint + createContextualFragment + insertNode + intersectsNode + isPointInRange + isPointInRange + selectNode + selectNodeContents + setEnd + setEnd + setEndAfter + setEndBefore + setStart + setStart + setStartAfter + setStartBefore + surroundContents + redirect + redirect + convertToSpecifiedUnits + newValueSpecifiedUnits + newValueSpecifiedUnits + beginElementAt + endElementAt + hasExtension + setStdDeviation + setStdDeviation + setStdDeviation + setStdDeviation + getPointAtLength + getBBox + getTransformToElement + hasExtension + convertToSpecifiedUnits + newValueSpecifiedUnits + newValueSpecifiedUnits + appendItem + getItem + initialize + insertItemBefore + insertItemBefore + removeItem + replaceItem + replaceItem + setOrientToAngle + multiply + rotate + rotateFromVector + rotateFromVector + scale + scaleNonUniform + scaleNonUniform + skewX + skewY + translate + translate + appendItem + getItem + initialize + insertItemBefore + insertItemBefore + removeItem + replaceItem + replaceItem + getPathSegAtLength + getItem + matrixTransform + appendItem + getItem + initialize + insertItemBefore + insertItemBefore + removeItem + replaceItem + replaceItem + createSVGTransformFromMatrix + getElementById + setCurrentTime + suspendRedraw + unsuspendRedraw + appendItem + getItem + initialize + insertItemBefore + insertItemBefore + removeItem + replaceItem + replaceItem + hasExtension + getCharNumAtPosition + getEndPositionOfChar + getExtentOfChar + getRotationOfChar + getStartPositionOfChar + getSubStringLength + getSubStringLength + selectSubString + selectSubString + setMatrix + setRotate + setRotate + setRotate + setScale + setScale + setSkewX + setSkewY + setTranslate + setTranslate + appendItem + createSVGTransformFromMatrix + getItem + initialize + insertItemBefore + insertItemBefore + removeItem + replaceItem + replaceItem + lock + initScrollAreaEvent + initScrollAreaEvent + initScrollAreaEvent + initScrollAreaEvent + initScrollAreaEvent + initScrollAreaEvent + initScrollAreaEvent + initScrollAreaEvent + initScrollAreaEvent + addRange + collapse + collapse + containsNode + containsNode + extend + extend + getRangeAt + modify + modify + modify + removeRange + selectAllChildren + setBaseAndExtent + setBaseAndExtent + setBaseAndExtent + setBaseAndExtent + setPosition + setPosition + postMessage + postMessage + getRegistration + getScopeForUrl + register + register + getNotifications + showNotification + showNotification + getElementById + getElementsByClassName + getElementsByTagName + getElementsByTagNameNS + getElementsByTagNameNS + elementFromPoint + elementFromPoint + elementsFromPoint + elementsFromPoint + appendBuffer + appendBuffer + appendBufferAsync + appendBufferAsync + changeType + remove + remove + removeAsync + removeAsync + addFromString + addFromString + addFromURI + addFromURI + item + start + item + item + speak + getItem + key + removeItem + setItem + setItem + initStorageEvent + initStorageEvent + initStorageEvent + initStorageEvent + initStorageEvent + initStorageEvent + initStorageEvent + initStorageEvent + item + decrypt + decrypt + decrypt + deriveBits + deriveBits + deriveBits + deriveKey + deriveKey + deriveKey + deriveKey + deriveKey + digest + digest + encrypt + encrypt + encrypt + exportKey + exportKey + generateKey + generateKey + generateKey + importKey + importKey + importKey + importKey + importKey + sign + sign + sign + unwrapKey + unwrapKey + unwrapKey + unwrapKey + unwrapKey + unwrapKey + unwrapKey + verify + verify + verify + verify + wrapKey + wrapKey + wrapKey + wrapKey + send + send + send + send + splitText + convertPointFromNode + convertPointFromNode + convertPointFromNode + convertQuadFromNode + convertQuadFromNode + convertQuadFromNode + convertRectFromNode + convertRectFromNode + convertRectFromNode + getBoxQuads + decode + decode + encode + addCue + removeCue + getCueById + getTrackById + initTimeEvent + initTimeEvent + initTimeEvent + end + start + initTouchEvent + initTouchEvent + initTouchEvent + initTouchEvent + initTouchEvent + initTouchEvent + initTouchEvent + initTouchEvent + initTouchEvent + initTouchEvent + initTouchEvent + initTouchEvent + item + register + register + register + register + register + sign + sign + sign + sign + sign + initUIEvent + initUIEvent + initUIEvent + initUIEvent + initUIEvent + createObjectURL + createObjectURL + revokeObjectURL + append + append + delete + get + getAll + has + set + set + cancelAnimationFrame + getEyeParameters + getFrameData + getSubmitFrameResult + requestAnimationFrame + requestPresent + newAxisMoveEvent + newAxisMoveEvent + newButtonEvent + newButtonEvent + newPoseMove + newPoseMove + newPoseMove + newPoseMove + newPoseMove + newPoseMove + setEyeParameter + setEyeParameter + setEyeParameter + setEyeParameter + setEyeParameter + setEyeParameter + setEyeParameter + setEyeParameter + setEyeResolution + setEyeResolution + setMountState + setPose + setPose + setPose + setPose + setPose + setPose + attachVRController + attachVRDisplay + getTrackById + beginQuery + beginQuery + beginTransformFeedback + bindBufferBase + bindBufferBase + bindBufferBase + bindBufferRange + bindBufferRange + bindBufferRange + bindBufferRange + bindBufferRange + bindSampler + bindSampler + bindTransformFeedback + bindTransformFeedback + bindVertexArray + blitFramebuffer + blitFramebuffer + blitFramebuffer + blitFramebuffer + blitFramebuffer + blitFramebuffer + blitFramebuffer + blitFramebuffer + blitFramebuffer + blitFramebuffer + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + clearBufferfi + clearBufferfi + clearBufferfi + clearBufferfi + clearBufferfv + clearBufferfv + clearBufferfv + clearBufferfv + clearBufferiv + clearBufferiv + clearBufferiv + clearBufferiv + clearBufferuiv + clearBufferuiv + clearBufferuiv + clearBufferuiv + clientWaitSync + clientWaitSync + clientWaitSync + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexImage3D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + compressedTexSubImage3D + copyBufferSubData + copyBufferSubData + copyBufferSubData + copyBufferSubData + copyBufferSubData + copyTexSubImage3D + copyTexSubImage3D + copyTexSubImage3D + copyTexSubImage3D + copyTexSubImage3D + copyTexSubImage3D + copyTexSubImage3D + copyTexSubImage3D + copyTexSubImage3D + deleteQuery + deleteSampler + deleteSync + deleteTransformFeedback + deleteVertexArray + drawArraysInstanced + drawArraysInstanced + drawArraysInstanced + drawArraysInstanced + drawBuffers + drawElementsInstanced + drawElementsInstanced + drawElementsInstanced + drawElementsInstanced + drawElementsInstanced + drawRangeElements + drawRangeElements + drawRangeElements + drawRangeElements + drawRangeElements + drawRangeElements + endQuery + fenceSync + fenceSync + framebufferTextureLayer + framebufferTextureLayer + framebufferTextureLayer + framebufferTextureLayer + framebufferTextureLayer + getActiveUniformBlockName + getActiveUniformBlockName + getActiveUniformBlockParameter + getActiveUniformBlockParameter + getActiveUniformBlockParameter + getActiveUniforms + getActiveUniforms + getActiveUniforms + getBufferSubData + getBufferSubData + getBufferSubData + getBufferSubData + getBufferSubData + getFragDataLocation + getFragDataLocation + getIndexedParameter + getIndexedParameter + getInternalformatParameter + getInternalformatParameter + getInternalformatParameter + getQuery + getQuery + getQueryParameter + getQueryParameter + getSamplerParameter + getSamplerParameter + getSyncParameter + getSyncParameter + getTransformFeedbackVarying + getTransformFeedbackVarying + getUniformBlockIndex + getUniformBlockIndex + getUniformIndices + getUniformIndices + invalidateFramebuffer + invalidateFramebuffer + invalidateSubFramebuffer + invalidateSubFramebuffer + invalidateSubFramebuffer + invalidateSubFramebuffer + invalidateSubFramebuffer + invalidateSubFramebuffer + isQuery + isSampler + isSync + isTransformFeedback + isVertexArray + readBuffer + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + renderbufferStorageMultisample + renderbufferStorageMultisample + renderbufferStorageMultisample + renderbufferStorageMultisample + renderbufferStorageMultisample + samplerParameterf + samplerParameterf + samplerParameterf + samplerParameteri + samplerParameteri + samplerParameteri + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texImage3D + texStorage2D + texStorage2D + texStorage2D + texStorage2D + texStorage2D + texStorage3D + texStorage3D + texStorage3D + texStorage3D + texStorage3D + texStorage3D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + texSubImage3D + transformFeedbackVaryings + transformFeedbackVaryings + transformFeedbackVaryings + uniform1fv + uniform1fv + uniform1fv + uniform1fv + uniform1iv + uniform1iv + uniform1iv + uniform1iv + uniform1ui + uniform1ui + uniform1uiv + uniform1uiv + uniform1uiv + uniform1uiv + uniform2fv + uniform2fv + uniform2fv + uniform2fv + uniform2iv + uniform2iv + uniform2iv + uniform2iv + uniform2ui + uniform2ui + uniform2ui + uniform2uiv + uniform2uiv + uniform2uiv + uniform2uiv + uniform3fv + uniform3fv + uniform3fv + uniform3fv + uniform3iv + uniform3iv + uniform3iv + uniform3iv + uniform3ui + uniform3ui + uniform3ui + uniform3ui + uniform3uiv + uniform3uiv + uniform3uiv + uniform3uiv + uniform4fv + uniform4fv + uniform4fv + uniform4fv + uniform4iv + uniform4iv + uniform4iv + uniform4iv + uniform4ui + uniform4ui + uniform4ui + uniform4ui + uniform4ui + uniform4uiv + uniform4uiv + uniform4uiv + uniform4uiv + uniformBlockBinding + uniformBlockBinding + uniformBlockBinding + uniformMatrix2fv + uniformMatrix2fv + uniformMatrix2fv + uniformMatrix2fv + uniformMatrix2fv + uniformMatrix2x3fv + uniformMatrix2x3fv + uniformMatrix2x3fv + uniformMatrix2x3fv + uniformMatrix2x3fv + uniformMatrix2x4fv + uniformMatrix2x4fv + uniformMatrix2x4fv + uniformMatrix2x4fv + uniformMatrix2x4fv + uniformMatrix3fv + uniformMatrix3fv + uniformMatrix3fv + uniformMatrix3fv + uniformMatrix3fv + uniformMatrix3x2fv + uniformMatrix3x2fv + uniformMatrix3x2fv + uniformMatrix3x2fv + uniformMatrix3x2fv + uniformMatrix3x4fv + uniformMatrix3x4fv + uniformMatrix3x4fv + uniformMatrix3x4fv + uniformMatrix3x4fv + uniformMatrix4fv + uniformMatrix4fv + uniformMatrix4fv + uniformMatrix4fv + uniformMatrix4fv + uniformMatrix4x2fv + uniformMatrix4x2fv + uniformMatrix4x2fv + uniformMatrix4x2fv + uniformMatrix4x2fv + uniformMatrix4x3fv + uniformMatrix4x3fv + uniformMatrix4x3fv + uniformMatrix4x3fv + uniformMatrix4x3fv + vertexAttribDivisor + vertexAttribDivisor + vertexAttribI4i + vertexAttribI4i + vertexAttribI4i + vertexAttribI4i + vertexAttribI4i + vertexAttribI4iv + vertexAttribI4iv + vertexAttribI4ui + vertexAttribI4ui + vertexAttribI4ui + vertexAttribI4ui + vertexAttribI4ui + vertexAttribI4uiv + vertexAttribI4uiv + vertexAttribIPointer + vertexAttribIPointer + vertexAttribIPointer + vertexAttribIPointer + vertexAttribIPointer + waitSync + waitSync + waitSync + activeTexture + attachShader + attachShader + bindAttribLocation + bindAttribLocation + bindAttribLocation + bindBuffer + bindBuffer + bindFramebuffer + bindFramebuffer + bindRenderbuffer + bindRenderbuffer + bindTexture + bindTexture + blendColor + blendColor + blendColor + blendColor + blendEquation + blendEquationSeparate + blendEquationSeparate + blendFunc + blendFunc + blendFuncSeparate + blendFuncSeparate + blendFuncSeparate + blendFuncSeparate + checkFramebufferStatus + clear + clearColor + clearColor + clearColor + clearColor + clearDepth + clearStencil + colorMask + colorMask + colorMask + colorMask + compileShader + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + createShader + cullFace + deleteBuffer + deleteFramebuffer + deleteProgram + deleteRenderbuffer + deleteShader + deleteTexture + depthFunc + depthMask + depthRange + depthRange + detachShader + detachShader + disable + disableVertexAttribArray + drawArrays + drawArrays + drawArrays + drawElements + drawElements + drawElements + drawElements + enable + enableVertexAttribArray + framebufferRenderbuffer + framebufferRenderbuffer + framebufferRenderbuffer + framebufferRenderbuffer + framebufferTexture2D + framebufferTexture2D + framebufferTexture2D + framebufferTexture2D + framebufferTexture2D + frontFace + generateMipmap + getActiveAttrib + getActiveAttrib + getActiveUniform + getActiveUniform + getAttachedShaders + getAttribLocation + getAttribLocation + getBufferParameter + getBufferParameter + getExtension + getFramebufferAttachmentParameter + getFramebufferAttachmentParameter + getFramebufferAttachmentParameter + getParameter + getProgramInfoLog + getProgramParameter + getProgramParameter + getRenderbufferParameter + getRenderbufferParameter + getShaderInfoLog + getShaderParameter + getShaderParameter + getShaderPrecisionFormat + getShaderPrecisionFormat + getShaderSource + getTexParameter + getTexParameter + getUniform + getUniform + getUniformLocation + getUniformLocation + getVertexAttrib + getVertexAttrib + getVertexAttribOffset + getVertexAttribOffset + hint + hint + isBuffer + isEnabled + isFramebuffer + isProgram + isRenderbuffer + isShader + isTexture + lineWidth + linkProgram + pixelStorei + pixelStorei + polygonOffset + polygonOffset + renderbufferStorage + renderbufferStorage + renderbufferStorage + renderbufferStorage + sampleCoverage + sampleCoverage + scissor + scissor + scissor + scissor + shaderSource + shaderSource + stencilFunc + stencilFunc + stencilFunc + stencilFuncSeparate + stencilFuncSeparate + stencilFuncSeparate + stencilFuncSeparate + stencilMask + stencilMaskSeparate + stencilMaskSeparate + stencilOp + stencilOp + stencilOp + stencilOpSeparate + stencilOpSeparate + stencilOpSeparate + stencilOpSeparate + texParameterf + texParameterf + texParameterf + texParameteri + texParameteri + texParameteri + uniform1f + uniform1f + uniform1i + uniform1i + uniform2f + uniform2f + uniform2f + uniform2i + uniform2i + uniform2i + uniform3f + uniform3f + uniform3f + uniform3f + uniform3i + uniform3i + uniform3i + uniform3i + uniform4f + uniform4f + uniform4f + uniform4f + uniform4f + uniform4i + uniform4i + uniform4i + uniform4i + uniform4i + useProgram + validateProgram + vertexAttrib1f + vertexAttrib1f + vertexAttrib1fv + vertexAttrib1fv + vertexAttrib2f + vertexAttrib2f + vertexAttrib2f + vertexAttrib2fv + vertexAttrib2fv + vertexAttrib3f + vertexAttrib3f + vertexAttrib3f + vertexAttrib3f + vertexAttrib3fv + vertexAttrib3fv + vertexAttrib4f + vertexAttrib4f + vertexAttrib4f + vertexAttrib4f + vertexAttrib4f + vertexAttrib4fv + vertexAttrib4fv + vertexAttribPointer + vertexAttribPointer + vertexAttribPointer + vertexAttribPointer + vertexAttribPointer + vertexAttribPointer + viewport + viewport + viewport + viewport + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + bufferSubData + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + compressedTexSubImage2D + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + readPixels + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + texSubImage2D + uniform1fv + uniform1fv + uniform1iv + uniform1iv + uniform2fv + uniform2fv + uniform2iv + uniform2iv + uniform3fv + uniform3fv + uniform3iv + uniform3iv + uniform4fv + uniform4fv + uniform4iv + uniform4iv + uniformMatrix2fv + uniformMatrix2fv + uniformMatrix2fv + uniformMatrix3fv + uniformMatrix3fv + uniformMatrix3fv + uniformMatrix4fv + uniformMatrix4fv + uniformMatrix4fv + activeTexture + attachShader + attachShader + bindAttribLocation + bindAttribLocation + bindAttribLocation + bindBuffer + bindBuffer + bindFramebuffer + bindFramebuffer + bindRenderbuffer + bindRenderbuffer + bindTexture + bindTexture + blendColor + blendColor + blendColor + blendColor + blendEquation + blendEquationSeparate + blendEquationSeparate + blendFunc + blendFunc + blendFuncSeparate + blendFuncSeparate + blendFuncSeparate + blendFuncSeparate + checkFramebufferStatus + clear + clearColor + clearColor + clearColor + clearColor + clearDepth + clearStencil + colorMask + colorMask + colorMask + colorMask + compileShader + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + copyTexSubImage2D + createShader + cullFace + deleteBuffer + deleteFramebuffer + deleteProgram + deleteRenderbuffer + deleteShader + deleteTexture + depthFunc + depthMask + depthRange + depthRange + detachShader + detachShader + disable + disableVertexAttribArray + drawArrays + drawArrays + drawArrays + drawElements + drawElements + drawElements + drawElements + enable + enableVertexAttribArray + framebufferRenderbuffer + framebufferRenderbuffer + framebufferRenderbuffer + framebufferRenderbuffer + framebufferTexture2D + framebufferTexture2D + framebufferTexture2D + framebufferTexture2D + framebufferTexture2D + frontFace + generateMipmap + getActiveAttrib + getActiveAttrib + getActiveUniform + getActiveUniform + getAttachedShaders + getAttribLocation + getAttribLocation + getBufferParameter + getBufferParameter + getExtension + getFramebufferAttachmentParameter + getFramebufferAttachmentParameter + getFramebufferAttachmentParameter + getParameter + getProgramInfoLog + getProgramParameter + getProgramParameter + getRenderbufferParameter + getRenderbufferParameter + getShaderInfoLog + getShaderParameter + getShaderParameter + getShaderPrecisionFormat + getShaderPrecisionFormat + getShaderSource + getTexParameter + getTexParameter + getUniform + getUniform + getUniformLocation + getUniformLocation + getVertexAttrib + getVertexAttrib + getVertexAttribOffset + getVertexAttribOffset + hint + hint + isBuffer + isEnabled + isFramebuffer + isProgram + isRenderbuffer + isShader + isTexture + lineWidth + linkProgram + pixelStorei + pixelStorei + polygonOffset + polygonOffset + renderbufferStorage + renderbufferStorage + renderbufferStorage + renderbufferStorage + sampleCoverage + sampleCoverage + scissor + scissor + scissor + scissor + shaderSource + shaderSource + stencilFunc + stencilFunc + stencilFunc + stencilFuncSeparate + stencilFuncSeparate + stencilFuncSeparate + stencilFuncSeparate + stencilMask + stencilMaskSeparate + stencilMaskSeparate + stencilOp + stencilOp + stencilOp + stencilOpSeparate + stencilOpSeparate + stencilOpSeparate + stencilOpSeparate + texParameterf + texParameterf + texParameterf + texParameteri + texParameteri + texParameteri + uniform1f + uniform1f + uniform1i + uniform1i + uniform2f + uniform2f + uniform2f + uniform2i + uniform2i + uniform2i + uniform3f + uniform3f + uniform3f + uniform3f + uniform3i + uniform3i + uniform3i + uniform3i + uniform4f + uniform4f + uniform4f + uniform4f + uniform4f + uniform4i + uniform4i + uniform4i + uniform4i + uniform4i + useProgram + validateProgram + vertexAttrib1f + vertexAttrib1f + vertexAttrib1fv + vertexAttrib1fv + vertexAttrib2f + vertexAttrib2f + vertexAttrib2f + vertexAttrib2fv + vertexAttrib2fv + vertexAttrib3f + vertexAttrib3f + vertexAttrib3f + vertexAttrib3f + vertexAttrib3fv + vertexAttrib3fv + vertexAttrib4f + vertexAttrib4f + vertexAttrib4f + vertexAttrib4f + vertexAttrib4f + vertexAttrib4fv + vertexAttrib4fv + vertexAttribPointer + vertexAttribPointer + vertexAttribPointer + vertexAttribPointer + vertexAttribPointer + vertexAttribPointer + viewport + viewport + viewport + viewport + getAdapter + createDevice + beginRenderPass + copyBufferToBuffer + copyBufferToBuffer + copyBufferToBuffer + copyBufferToBuffer + copyBufferToBuffer + dispatch + dispatch + dispatch + draw + draw + draw + draw + drawIndexed + drawIndexed + drawIndexed + drawIndexed + drawIndexed + setBindGroup + setBindGroup + setBlendColor + setBlendColor + setBlendColor + setBlendColor + setIndexBuffer + setIndexBuffer + setPipeline + setPushConstants + setPushConstants + setPushConstants + setPushConstants + setVertexBuffers + setVertexBuffers + setVertexBuffers + transitionBuffer + transitionBuffer + createAttachmentState + createBindGroup + createBindGroupLayout + createBlendState + createBuffer + createCommandEncoder + createComputePipeline + createDepthStencilState + createInputState + createPipelineLayout + createRenderPipeline + createSampler + createShaderModule + createTexture + getObjectStatus + wait + submit + configure + createTextureView + multiply + rotate + rotate + rotate + rotateAxisAngle + rotateAxisAngle + rotateAxisAngle + rotateAxisAngle + scale + scale + scale + setMatrixValue + skewX + skewY + translate + translate + translate + close + close + send + send + send + send + alert + cancelAnimationFrame + cancelIdleCallback + confirm + getComputedStyle + getComputedStyle + matchMedia + moveBy + moveBy + moveTo + moveTo + open + open + open + postMessage + postMessage + postMessage + prompt + prompt + requestAnimationFrame + requestIdleCallback + requestIdleCallback + resizeBy + resizeBy + resizeTo + resizeTo + scroll + scroll + scroll + scrollBy + scrollBy + scrollBy + scrollTo + scrollTo + scrollTo + atob + btoa + clearInterval + clearTimeout + createImageBitmap + createImageBitmap + createImageBitmap + createImageBitmap + createImageBitmap + createImageBitmap + fetch + fetch + setInterval + setInterval + setInterval + setInterval + setInterval + setInterval + setTimeout + setTimeout + setTimeout + setTimeout + setTimeout + setTimeout + navigate + postMessage + postMessage + createSandbox + createSandbox + dump + loadSubScript + loadSubScript + postMessage + reportError + setConsoleEventHandler + setImmediate + importScripts + atob + btoa + clearInterval + clearTimeout + createImageBitmap + createImageBitmap + createImageBitmap + createImageBitmap + createImageBitmap + createImageBitmap + fetch + fetch + setInterval + setInterval + setInterval + setInterval + setInterval + setInterval + setTimeout + setTimeout + setTimeout + setTimeout + setTimeout + setTimeout + import + load + getResponseHeader + open + open + open + open + open + open + open + overrideMimeType + send + setRequestHeader + setRequestHeader + serializeToString + evaluate + evaluate + evaluate + snapshotItem + getParameter + getParameter + importStylesheet + removeParameter + removeParameter + setParameter + setParameter + setParameter + transformToDocument + transformToFragment + transformToFragment + \ No newline at end of file diff --git a/crates/web-sys/tests/wasm/immutable_slices.rs b/crates/web-sys/tests/wasm/immutable_slices.rs deleted file mode 100644 index 92b4cbd3def..00000000000 --- a/crates/web-sys/tests/wasm/immutable_slices.rs +++ /dev/null @@ -1,26 +0,0 @@ -//! When generating our web_sys APIs we default to setting slice references that -//! get passed to JS as mutable in case they get mutated in JS. -//! -//! In certain cases we know for sure that the slice will not get mutated - for -//! example when working with the WebGlRenderingContext APIs. -//! -//! These tests ensure that whitelisted methods do indeed accept mutable slices. -//! -//! @see https://github.com/rustwasm/wasm-bindgen/issues/1005 - -use wasm_bindgen::prelude::*; -use wasm_bindgen_test::*; -use web_sys::WebGlRenderingContext; - -#[wasm_bindgen(module = "./tests/wasm/element.js")] -extern "C" { - fn new_webgl_rendering_context() -> WebGlRenderingContext; -} - -// Ensure that our whitelisted WebGlRenderingContext methods work -#[wasm_bindgen_test] -fn test_webgl_rendering_context_immutable_slices() { - let gl = new_webgl_rendering_context(); - - gl.vertex_attrib1fv_with_f32_array(0, &[5000.]); -} diff --git a/crates/web-sys/tests/wasm/main.rs b/crates/web-sys/tests/wasm/main.rs index 3b57604ac1c..e3d3b48af0e 100644 --- a/crates/web-sys/tests/wasm/main.rs +++ b/crates/web-sys/tests/wasm/main.rs @@ -56,7 +56,7 @@ pub mod style_element; pub mod table_element; pub mod title_element; pub mod xpath_result; -pub mod immutable_slices; +pub mod whitelisted_immutable_slices; #[wasm_bindgen_test] fn deref_works() { diff --git a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs index 92b4cbd3def..59c60eb7b7f 100644 --- a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs +++ b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs @@ -22,5 +22,5 @@ extern "C" { fn test_webgl_rendering_context_immutable_slices() { let gl = new_webgl_rendering_context(); - gl.vertex_attrib1fv_with_f32_array(0, &[5000.]); + gl.vertex_attrib1fv_with_f32_array(0, &[5000.]); } diff --git a/crates/webidl/src/first_pass.rs b/crates/webidl/src/first_pass.rs index 79b5a2da75c..c3454c1e690 100644 --- a/crates/webidl/src/first_pass.rs +++ b/crates/webidl/src/first_pass.rs @@ -83,6 +83,9 @@ pub(crate) struct CallbackInterfaceData<'src> { #[derive(PartialEq, Eq, PartialOrd, Ord, Debug, Clone, Copy)] pub(crate) enum OperationId<'src> { Constructor(IgnoreTraits<&'src str>), + /// The name of a function in crates/web-sys/webidls/enabled/*.webidl + /// + /// ex: Operation(Some("vertexAttrib1fv")) Operation(Option<&'src str>), IndexingGetter, IndexingSetter, diff --git a/crates/webidl/src/idl_type.rs b/crates/webidl/src/idl_type.rs index d2dd3e8b234..3d24a18d7ed 100644 --- a/crates/webidl/src/idl_type.rs +++ b/crates/webidl/src/idl_type.rs @@ -41,7 +41,10 @@ pub(crate) enum IdlType<'a> { Uint16Array, Int32Array, Uint32Array, - Float32Array, + Float32Array { + /// Whether or not the generated web-sys function should use an immutable slice + immutable: bool + }, Float64Array, ArrayBufferView, BufferSource, @@ -324,14 +327,26 @@ impl<'a> ToIdlType<'a> for Identifier<'a> { } } +// We default to Float32Array's being mutable, but in certain cases where we're certain that +// slices won't get mutated on the JS side (such as the WebGL APIs) we might, later in the flow, +// instead use the immutable version. +impl<'a> ToIdlType<'a> for term::Float32Array { + fn to_idl_type(&self, _record: &FirstPassRecord<'a>) -> IdlType<'a> { + IdlType::Float32Array {immutable: false} + } +} + macro_rules! terms_to_idl_type { ($($t:tt => $r:tt)*) => ($( impl<'a> ToIdlType<'a> for term::$t { fn to_idl_type(&self, _record: &FirstPassRecord<'a>) -> IdlType<'a> { - IdlType::$r + match IdlType::$r { + IdlType::Callback => IdlType::Float32Array { immutable: false }, + _ => IdlType::$r + } } } - )*) + )*); } terms_to_idl_type! { @@ -358,7 +373,6 @@ terms_to_idl_type! { Uint16Array => Uint16Array Uint32Array => Uint32Array Uint8ClampedArray => Uint8ClampedArray - Float32Array => Float32Array Float64Array => Float64Array ArrayBufferView => ArrayBufferView BufferSource => BufferSource @@ -396,7 +410,7 @@ impl<'a> IdlType<'a> { IdlType::Uint16Array => dst.push_str("u16_array"), IdlType::Int32Array => dst.push_str("i32_array"), IdlType::Uint32Array => dst.push_str("u32_array"), - IdlType::Float32Array => dst.push_str("f32_array"), + IdlType::Float32Array { .. } => dst.push_str("f32_array"), IdlType::Float64Array => dst.push_str("f64_array"), IdlType::ArrayBufferView => dst.push_str("array_buffer_view"), IdlType::BufferSource => dst.push_str("buffer_source"), @@ -501,16 +515,16 @@ impl<'a> IdlType<'a> { IdlType::ArrayBuffer => js_sys("ArrayBuffer"), IdlType::DataView => None, - IdlType::Int8Array => Some(array("i8", pos)), - IdlType::Uint8Array => Some(array("u8", pos)), - IdlType::Uint8ArrayMut => Some(array("u8", pos)), - IdlType::Uint8ClampedArray => Some(clamped(array("u8", pos))), - IdlType::Int16Array => Some(array("i16", pos)), - IdlType::Uint16Array => Some(array("u16", pos)), - IdlType::Int32Array => Some(array("i32", pos)), - IdlType::Uint32Array => Some(array("u32", pos)), - IdlType::Float32Array => Some(array("f32", pos)), - IdlType::Float64Array => Some(array("f64", pos)), + IdlType::Int8Array => Some(array("i8", pos, false)), + IdlType::Uint8Array => Some(array("u8", pos, false)), + IdlType::Uint8ArrayMut => Some(array("u8", pos, false)), + IdlType::Uint8ClampedArray => Some(clamped(array("u8", pos, false))), + IdlType::Int16Array => Some(array("i16", pos, false)), + IdlType::Uint16Array => Some(array("u16", pos, false)), + IdlType::Int32Array => Some(array("i32", pos, false)), + IdlType::Uint32Array => Some(array("u32", pos, false)), + IdlType::Float32Array {immutable} => Some(array("f32", pos, *immutable)), + IdlType::Float64Array => Some(array("f64", pos, false)), IdlType::ArrayBufferView | IdlType::BufferSource => js_sys("Object"), IdlType::Interface(name) diff --git a/crates/webidl/src/util.rs b/crates/webidl/src/util.rs index 629b94e8cdf..56f8cf26b37 100644 --- a/crates/webidl/src/util.rs +++ b/crates/webidl/src/util.rs @@ -67,13 +67,13 @@ pub fn mdn_doc(class: &str, method: Option<&str>) -> String { format!("[MDN Documentation]({})", link).into() } -// Array type is borrowed for arguments (`&[T]`) and owned for return value (`Vec`). -pub(crate) fn array(base_ty: &str, pos: TypePosition) -> syn::Type { +// Array type is borrowed for arguments (`&mut [T]` or `&[T]`) and owned for return value (`Vec`). +pub(crate) fn array(base_ty: &str, pos: TypePosition, immutable: bool) -> syn::Type { match pos { TypePosition::Argument => { shared_ref( slice_ty(ident_ty(raw_ident(base_ty))), - /*mutable =*/ true, + /*mutable =*/ !immutable, ) } TypePosition::Return => vec_ty(ident_ty(raw_ident(base_ty))), @@ -721,9 +721,14 @@ pub fn public() -> syn::Visibility { /// maintained by hand. fn maybe_adjust<'a> (idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<'a> { match id { + // TODO: `match op` and return an adjusted idl_type if necessary OperationId::Operation(Some(op)) => { - // TODO: `match op` and return an adjusted idl_type if necessary - idl_type + match *op { +// "vertexAttrib1fv" => { +// IdlType::Float32Array { immutable: true} +// } + _ => idl_type + } } _ => idl_type } From 48b64f4cfe0d7325d7d8b0b0d1cd27e7d7da1082 Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Mon, 21 Jan 2019 19:24:37 -0500 Subject: [PATCH 07/13] Remove test file --- crates/web-sys/foo | 3535 -------------------------------------------- 1 file changed, 3535 deletions(-) delete mode 100644 crates/web-sys/foo diff --git a/crates/web-sys/foo b/crates/web-sys/foo deleted file mode 100644 index 789d77f9cf8..00000000000 --- a/crates/web-sys/foo +++ /dev/null @@ -1,3535 +0,0 @@ -bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - uniform1fv - uniform1fv - uniform1iv - uniform1iv - uniform2fv - uniform2fv - uniform2iv - uniform2iv - uniform3fv - uniform3fv - uniform3iv - uniform3iv - uniform4fv - uniform4fv - uniform4iv - uniform4iv - uniformMatrix2fv - uniformMatrix2fv - uniformMatrix2fv - uniformMatrix3fv - uniformMatrix3fv - uniformMatrix3fv - uniformMatrix4fv - uniformMatrix4fv - uniformMatrix4fv - activeTexture - attachShader - attachShader - bindAttribLocation - bindAttribLocation - bindAttribLocation - bindBuffer - bindBuffer - bindFramebuffer - bindFramebuffer - bindRenderbuffer - bindRenderbuffer - bindTexture - bindTexture - blendColor - blendColor - blendColor - blendColor - blendEquation - blendEquationSeparate - blendEquationSeparate - blendFunc - blendFunc - blendFuncSeparate - blendFuncSeparate - blendFuncSeparate - blendFuncSeparate - checkFramebufferStatus - clear - clearColor - clearColor - clearColor - clearColor - clearDepth - clearStencil - colorMask - colorMask - colorMask - colorMask - compileShader - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - createShader - cullFace - deleteBuffer - deleteFramebuffer - deleteProgram - deleteRenderbuffer - deleteShader - deleteTexture - depthFunc - depthMask - depthRange - depthRange - detachShader - detachShader - disable - disableVertexAttribArray - drawArrays - drawArrays - drawArrays - drawElements - drawElements - drawElements - drawElements - enable - enableVertexAttribArray - framebufferRenderbuffer - framebufferRenderbuffer - framebufferRenderbuffer - framebufferRenderbuffer - framebufferTexture2D - framebufferTexture2D - framebufferTexture2D - framebufferTexture2D - framebufferTexture2D - frontFace - generateMipmap - getActiveAttrib - getActiveAttrib - getActiveUniform - getActiveUniform - getAttachedShaders - getAttribLocation - getAttribLocation - getBufferParameter - getBufferParameter - getExtension - getFramebufferAttachmentParameter - getFramebufferAttachmentParameter - getFramebufferAttachmentParameter - getParameter - getProgramInfoLog - getProgramParameter - getProgramParameter - getRenderbufferParameter - getRenderbufferParameter - getShaderInfoLog - getShaderParameter - getShaderParameter - getShaderPrecisionFormat - getShaderPrecisionFormat - getShaderSource - getTexParameter - getTexParameter - getUniform - getUniform - getUniformLocation - getUniformLocation - getVertexAttrib - getVertexAttrib - getVertexAttribOffset - getVertexAttribOffset - hint - hint - isBuffer - isEnabled - isFramebuffer - isProgram - isRenderbuffer - isShader - isTexture - lineWidth - linkProgram - pixelStorei - pixelStorei - polygonOffset - polygonOffset - renderbufferStorage - renderbufferStorage - renderbufferStorage - renderbufferStorage - sampleCoverage - sampleCoverage - scissor - scissor - scissor - scissor - shaderSource - shaderSource - stencilFunc - stencilFunc - stencilFunc - stencilFuncSeparate - stencilFuncSeparate - stencilFuncSeparate - stencilFuncSeparate - stencilMask - stencilMaskSeparate - stencilMaskSeparate - stencilOp - stencilOp - stencilOp - stencilOpSeparate - stencilOpSeparate - stencilOpSeparate - stencilOpSeparate - texParameterf - texParameterf - texParameterf - texParameteri - texParameteri - texParameteri - uniform1f - uniform1f - uniform1i - uniform1i - uniform2f - uniform2f - uniform2f - uniform2i - uniform2i - uniform2i - uniform3f - uniform3f - uniform3f - uniform3f - uniform3i - uniform3i - uniform3i - uniform3i - uniform4f - uniform4f - uniform4f - uniform4f - uniform4f - uniform4i - uniform4i - uniform4i - uniform4i - uniform4i - useProgram - validateProgram - vertexAttrib1f - vertexAttrib1f - vertexAttrib1fv - vertexAttrib1fv - vertexAttrib2f - vertexAttrib2f - vertexAttrib2f - vertexAttrib2fv - vertexAttrib2fv - vertexAttrib3f - vertexAttrib3f - vertexAttrib3f - vertexAttrib3f - vertexAttrib3fv - vertexAttrib3fv - vertexAttrib4f - vertexAttrib4f - vertexAttrib4f - vertexAttrib4f - vertexAttrib4f - vertexAttrib4fv - vertexAttrib4fv - vertexAttribPointer - vertexAttribPointer - vertexAttribPointer - vertexAttribPointer - vertexAttribPointer - vertexAttribPointer - viewport - viewport - viewport - viewport - escape - supports - supports - supports - assert - assert - count - countReset - debug - dir - dirxml - error - exception - group - groupCollapsed - info - log - profile - profileEnd - table - time - timeEnd - timeLog - timeLog - timeStamp - trace - warn - getByteFrequencyData - getByteTimeDomainData - getFloatFrequencyData - getFloatTimeDomainData - updatePlaybackRate - updateTiming - copyFromChannel - copyFromChannel - copyFromChannel - copyToChannel - copyToChannel - copyToChannel - getChannelData - start - start - start - stop - createMediaElementSource - createMediaStreamSource - createBuffer - createBuffer - createBuffer - createChannelMerger - createChannelSplitter - createDelay - createIIRFilter - createIIRFilter - createPeriodicWave - createPeriodicWave - createPeriodicWave - createScriptProcessor - createScriptProcessor - createScriptProcessor - decodeAudioData - decodeAudioData - decodeAudioData - setOrientation - setOrientation - setOrientation - setOrientation - setOrientation - setOrientation - setPosition - setPosition - setPosition - setVelocity - setVelocity - setVelocity - connect - connect - connect - connect - connect - disconnect - disconnect - disconnect - disconnect - disconnect - disconnect - disconnect - disconnect - disconnect - disconnect - cancelScheduledValues - exponentialRampToValueAtTime - exponentialRampToValueAtTime - linearRampToValueAtTime - linearRampToValueAtTime - setTargetAtTime - setTargetAtTime - setTargetAtTime - setValueAtTime - setValueAtTime - setValueCurveAtTime - setValueCurveAtTime - setValueCurveAtTime - start - stop - getTrackById - registerProcessor - registerProcessor - createBuffer - createBuffer - createBuffer - createChannelMerger - createChannelSplitter - createDelay - createIIRFilter - createIIRFilter - createPeriodicWave - createPeriodicWave - createPeriodicWave - createScriptProcessor - createScriptProcessor - createScriptProcessor - decodeAudioData - decodeAudioData - decodeAudioData - getFrequencyResponse - getFrequencyResponse - getFrequencyResponse - slice - slice - slice - postMessage - deleteRule - insertRule - insertRule - appendRule - deleteRule - findRule - item - getPropertyPriority - getPropertyValue - item - removeProperty - setProperty - setProperty - setProperty - deleteRule - insertRule - insertRule - add - addAll - delete - delete - keys - keys - match - match - matchAll - matchAll - put - put - delete - has - match - match - open - addColorStop - addColorStop - setTransform - drawWindow - drawWindow - drawWindow - drawWindow - drawWindow - drawWindow - drawWindow - drawImage - drawImage - drawImage - drawImage - drawImage - drawImage - drawImage - drawImage - drawImage - drawImage - drawImage - drawImage - drawImage - drawImage - drawImage - drawImage - drawImage - clip - clip - clip - fill - fill - fill - isPointInPath - isPointInPath - isPointInPath - isPointInPath - isPointInPath - isPointInPath - isPointInPath - isPointInStroke - isPointInStroke - isPointInStroke - isPointInStroke - isPointInStroke - stroke - createLinearGradient - createLinearGradient - createLinearGradient - createLinearGradient - createPattern - createPattern - createRadialGradient - createRadialGradient - createRadialGradient - createRadialGradient - createRadialGradient - createRadialGradient - addHitRegion - removeHitRegion - createImageData - createImageData - createImageData - getImageData - getImageData - getImageData - getImageData - putImageData - putImageData - putImageData - putImageData - putImageData - putImageData - putImageData - putImageData - putImageData - putImageData - setLineDash - arc - arc - arc - arc - arc - arc - arcTo - arcTo - arcTo - arcTo - arcTo - bezierCurveTo - bezierCurveTo - bezierCurveTo - bezierCurveTo - bezierCurveTo - bezierCurveTo - ellipse - ellipse - ellipse - ellipse - ellipse - ellipse - ellipse - ellipse - lineTo - lineTo - moveTo - moveTo - quadraticCurveTo - quadraticCurveTo - quadraticCurveTo - quadraticCurveTo - rect - rect - rect - rect - clearRect - clearRect - clearRect - clearRect - fillRect - fillRect - fillRect - fillRect - strokeRect - strokeRect - strokeRect - strokeRect - fillText - fillText - fillText - fillText - measureText - strokeText - strokeText - strokeText - strokeText - rotate - scale - scale - setTransform - setTransform - setTransform - setTransform - setTransform - setTransform - transform - transform - transform - transform - transform - transform - translate - translate - drawCustomFocusRing - drawFocusIfNeeded - appendData - deleteData - deleteData - insertData - insertData - replaceData - replaceData - replaceData - substringData - substringData - after - before - replaceWith - setRecordingEnabled - postMessage - postMessage - get - matchAll - openWindow - initCompositionEvent - initCompositionEvent - initCompositionEvent - initCompositionEvent - initCompositionEvent - initCompositionEvent - start - stop - create - get - store - getRandomValues - define - define - define - get - upgrade - whenDefined - initCustomEvent - initCustomEvent - initCustomEvent - initCustomEvent - createDocument - createDocument - createDocument - createDocumentType - createDocumentType - createDocumentType - createHTMLDocument - multiplySelf - preMultiplySelf - rotateAxisAngleSelf - rotateAxisAngleSelf - rotateAxisAngleSelf - rotateAxisAngleSelf - rotateFromVectorSelf - rotateFromVectorSelf - rotateSelf - rotateSelf - rotateSelf - scale3dSelf - scale3dSelf - scale3dSelf - scale3dSelf - scaleNonUniformSelf - scaleNonUniformSelf - scaleNonUniformSelf - scaleNonUniformSelf - scaleNonUniformSelf - scaleNonUniformSelf - scaleSelf - scaleSelf - scaleSelf - setMatrixValue - skewXSelf - skewYSelf - translateSelf - translateSelf - translateSelf - multiply - rotate - rotate - rotate - rotateAxisAngle - rotateAxisAngle - rotateAxisAngle - rotateAxisAngle - rotateFromVector - rotateFromVector - scale - scale - scale - scale3d - scale3d - scale3d - scale3d - scaleNonUniform - scaleNonUniform - scaleNonUniform - scaleNonUniform - scaleNonUniform - scaleNonUniform - skewX - skewY - transformPoint - translate - translate - translate - parseFromString - parseFromString - fromPoint - fromPoint - item - then - then - contains - item - add - contains - item - remove - replace - replace - supports - toggle - toggle - clearData - getData - getFiles - setData - setData - setDragImage - setDragImage - setDragImage - getAsString - add - add - add - remove - postMessage - postMessage - initDeviceOrientationEvent - initDeviceOrientationEvent - initDeviceOrientationEvent - initDeviceOrientationEvent - initDeviceOrientationEvent - initDeviceOrientationEvent - initDeviceOrientationEvent - getFiles - adoptNode - caretPositionFromPoint - caretPositionFromPoint - createAttribute - createAttributeNS - createAttributeNS - createCDATASection - createComment - createElement - createElement - createElementNS - createElementNS - createElementNS - createEvent - createNodeIterator - createNodeIterator - createNodeIterator - createProcessingInstruction - createProcessingInstruction - createTextNode - createTreeWalker - createTreeWalker - createTreeWalker - enableStyleSheetsForSet - getElementById - getElementsByClassName - getElementsByName - getElementsByTagName - getElementsByTagNameNS - getElementsByTagNameNS - importNode - importNode - querySelector - querySelectorAll - elementFromPoint - elementFromPoint - elementsFromPoint - elementsFromPoint - convertPointFromNode - convertPointFromNode - convertPointFromNode - convertQuadFromNode - convertQuadFromNode - convertQuadFromNode - convertRectFromNode - convertRectFromNode - convertRectFromNode - getBoxQuads - append - prepend - createExpression - createExpression - createNSResolver - evaluate - evaluate - evaluate - evaluate - evaluate - getElementById - querySelector - querySelectorAll - append - prepend - after - before - replaceWith - initDragEvent - initDragEvent - initDragEvent - initDragEvent - initDragEvent - initDragEvent - initDragEvent - initDragEvent - initDragEvent - initDragEvent - initDragEvent - initDragEvent - initDragEvent - initDragEvent - initDragEvent - initDragEvent - attachShadow - closest - getAttribute - getAttributeNS - getAttributeNS - getAttributeNode - getAttributeNodeNS - getAttributeNodeNS - hasAttribute - hasAttributeNS - hasAttributeNS - hasPointerCapture - insertAdjacentElement - insertAdjacentElement - insertAdjacentHTML - insertAdjacentHTML - insertAdjacentText - insertAdjacentText - matches - querySelector - querySelectorAll - releasePointerCapture - removeAttribute - removeAttributeNS - removeAttributeNS - removeAttributeNode - scroll - scroll - scroll - scrollBy - scrollBy - scrollBy - scrollIntoView - scrollTo - scrollTo - scrollTo - setAttribute - setAttribute - setAttributeNS - setAttributeNS - setAttributeNS - setAttributeNode - setAttributeNodeNS - setCapture - setPointerCapture - toggleAttribute - toggleAttribute - webkitMatchesSelector - after - before - replaceWith - convertPointFromNode - convertPointFromNode - convertPointFromNode - convertQuadFromNode - convertQuadFromNode - convertQuadFromNode - convertRectFromNode - convertRectFromNode - convertRectFromNode - getBoxQuads - append - prepend - initEvent - initEvent - initEvent - addEventListener - addEventListener - addEventListener - addEventListener - dispatchEvent - removeEventListener - removeEventListener - removeEventListener - waitUntil - respondWith - item - readAsArrayBuffer - readAsBinaryString - readAsDataURL - readAsText - readAsText - readAsArrayBuffer - readAsBinaryString - readAsDataURL - readAsText - readAsText - getDirectory - getDirectory - getDirectory - getDirectory - getFile - getFile - getFile - getFile - readEntries - readEntries - getParent - getParent - file - file - add - check - check - delete - forEach - forEach - has - load - load - append - append - append - append - append - delete - get - getAll - has - set - set - set - set - set - pulse - pulse - addGamepad - addGamepad - addGamepad - addGamepad - addGamepad - addGamepad - newAxisMoveEvent - newAxisMoveEvent - newAxisMoveEvent - newButtonEvent - newButtonEvent - newButtonEvent - newButtonEvent - newButtonValueEvent - newButtonValueEvent - newButtonValueEvent - newButtonValueEvent - newButtonValueEvent - newPoseMove - newPoseMove - newPoseMove - newPoseMove - newPoseMove - newPoseMove - newPoseMove - removeGamepad - item - item - namedItem - setCustomValidity - getContext - getContext - toBlob - toBlob - toBlob - toDataURL - toDataURL - item - namedItem - close - execCommand - execCommand - execCommand - open - open - open - open - open - open - queryCommandEnabled - queryCommandIndeterm - queryCommandState - queryCommandSupported - queryCommandValue - write - writeln - setCustomValidity - namedItem - setCustomValidity - setRangeText - setRangeText - setRangeText - setRangeText - setRangeText - setSelectionRange - setSelectionRange - setSelectionRange - addTextTrack - addTextTrack - addTextTrack - canPlayType - fastSeek - setMediaKeys - setVisible - setCustomValidity - add - add - remove - setCustomValidity - add - add - item - namedItem - remove - setCustomValidity - assignedNodes - deleteRow - insertRow - deleteCell - insertCell - deleteRow - insertRow - setCustomValidity - setRangeText - setRangeText - setRangeText - setRangeText - setRangeText - setSelectionRange - setSelectionRange - setSelectionRange - initHashChangeEvent - initHashChangeEvent - initHashChangeEvent - initHashChangeEvent - initHashChangeEvent - append - append - delete - get - has - set - set - go - pushState - pushState - pushState - replaceState - replaceState - replaceState - advance - continue - continuePrimaryKey - continuePrimaryKey - update - createMutableFile - createMutableFile - createObjectStore - createObjectStore - deleteObjectStore - transaction - transaction - cmp - cmp - deleteDatabase - deleteDatabase - open - open - open - open - append - getMetadata - readAsArrayBuffer - readAsText - readAsText - truncate - write - count - get - getAll - getAll - getAllKeys - getAllKeys - getKey - openCursor - openCursor - openKeyCursor - openKeyCursor - bound - bound - bound - bound - includes - lowerBound - lowerBound - only - upperBound - upperBound - bound - bound - bound - bound - open - add - add - count - createIndex - createIndex - createIndex - delete - deleteIndex - get - getAll - getAll - getAllKeys - getAllKeys - getKey - index - openCursor - openCursor - openKeyCursor - openKeyCursor - put - put - objectStore - getFrequencyResponse - getFrequencyResponse - getFrequencyResponse - findOptimalFormat - mapDataInto - mapDataInto - mapDataInto - mappedDataLength - transferFromImageBitmap - transferImageBitmap - observe - unobserve - initKeyEvent - initKeyEvent - initKeyEvent - initKeyEvent - initKeyEvent - initKeyEvent - initKeyEvent - initKeyEvent - initKeyEvent - initKeyEvent - getModifierState - initKeyboardEvent - initKeyboardEvent - initKeyboardEvent - initKeyboardEvent - initKeyboardEvent - initKeyboardEvent - initKeyboardEvent - initKeyboardEvent - initKeyboardEvent - initKeyboardEvent - setKeyframes - assign - reload - replace - send - send - decodingInfo - encodingInfo - getUserMedia - generateRequest - generateRequest - load - update - get - has - createSession - getStatusForPolicy - setServerCertificate - appendMedium - deleteMedium - item - addListener - removeListener - isTypeSupported - start - addSourceBuffer - endOfStream - isTypeSupported - removeSourceBuffer - setLiveSeekableRange - setLiveSeekableRange - addTrack - getTrackById - removeTrack - applyConstraints - initMessageEvent - initMessageEvent - initMessageEvent - initMessageEvent - initMessageEvent - initMessageEvent - initMessageEvent - initMessageEvent - postMessage - postMessage - item - namedItem - getModifierState - initMouseEvent - initMouseEvent - initMouseEvent - initMouseEvent - initMouseEvent - initMouseEvent - initMouseEvent - initMouseEvent - initMouseEvent - initMouseEvent - initMouseEvent - initMouseEvent - initMouseEvent - initMouseEvent - initMouseEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMouseScrollEvent - initMutationEvent - initMutationEvent - initMutationEvent - initMutationEvent - initMutationEvent - initMutationEvent - initMutationEvent - initMutationEvent - observe - observe - getNamedItem - getNamedItemNS - getNamedItemNS - item - removeNamedItem - removeNamedItemNS - removeNamedItemNS - setNamedItem - setNamedItemNS - requestMIDIAccess - requestMediaKeySystemAccess - requestMediaKeySystemAccess - sendBeacon - sendBeacon - vibrate - vibrate - registerContentHandler - registerContentHandler - registerContentHandler - registerProtocolHandler - registerProtocolHandler - registerProtocolHandler - appendChild - cloneNode - compareDocumentPosition - contains - getRootNode - insertBefore - insertBefore - isDefaultNamespace - isEqualNode - isSameNode - lookupNamespaceURI - lookupPrefix - removeChild - replaceChild - replaceChild - item - get - requestPermission - createBuffer - createBuffer - createBuffer - createChannelMerger - createChannelSplitter - createDelay - createIIRFilter - createIIRFilter - createPeriodicWave - createPeriodicWave - createPeriodicWave - createScriptProcessor - createScriptProcessor - createScriptProcessor - decodeAudioData - decodeAudioData - decodeAudioData - getContext - getContext - toBlob - toBlob - setPeriodicWave - start - stop - item - registerPaint - registerPaint - setOrientation - setOrientation - setOrientation - setPosition - setPosition - setPosition - setVelocity - setVelocity - setVelocity - addPath - addPath - arc - arc - arc - arc - arc - arc - arcTo - arcTo - arcTo - arcTo - arcTo - bezierCurveTo - bezierCurveTo - bezierCurveTo - bezierCurveTo - bezierCurveTo - bezierCurveTo - ellipse - ellipse - ellipse - ellipse - ellipse - ellipse - ellipse - ellipse - lineTo - lineTo - moveTo - moveTo - quadraticCurveTo - quadraticCurveTo - quadraticCurveTo - quadraticCurveTo - rect - rect - rect - rect - updateWith - complete - clearMarks - clearMeasures - getEntriesByName - getEntriesByName - getEntriesByType - mark - measure - measure - measure - setResourceTimingBufferSize - observe - getEntries - getEntriesByName - getEntriesByName - getEntriesByType - query - revoke - item - namedItem - item - namedItem - refresh - send - send - send - send - reconnect - permissionState - subscribe - getKey - insertDTMF - insertDTMF - insertDTMF - send - send - send - send - addIceCandidate - addIceCandidate - addIceCandidate - addIceCandidate - addStream - addTrack - addTrack - addTrack - addTransceiver - addTransceiver - createAnswer - createAnswer - createAnswer - createDataChannel - createDataChannel - createOffer - createOffer - createOffer - createOffer - generateCertificate - getStats - getStats - getStats - getStats - removeTrack - setIdentityProvider - setIdentityProvider - setLocalDescription - setLocalDescription - setLocalDescription - setLocalDescription - setRemoteDescription - setRemoteDescription - setRemoteDescription - setRemoteDescription - replaceTrack - setParameters - collapse - compareBoundaryPoints - compareBoundaryPoints - comparePoint - comparePoint - createContextualFragment - insertNode - intersectsNode - isPointInRange - isPointInRange - selectNode - selectNodeContents - setEnd - setEnd - setEndAfter - setEndBefore - setStart - setStart - setStartAfter - setStartBefore - surroundContents - redirect - redirect - convertToSpecifiedUnits - newValueSpecifiedUnits - newValueSpecifiedUnits - beginElementAt - endElementAt - hasExtension - setStdDeviation - setStdDeviation - setStdDeviation - setStdDeviation - getPointAtLength - getBBox - getTransformToElement - hasExtension - convertToSpecifiedUnits - newValueSpecifiedUnits - newValueSpecifiedUnits - appendItem - getItem - initialize - insertItemBefore - insertItemBefore - removeItem - replaceItem - replaceItem - setOrientToAngle - multiply - rotate - rotateFromVector - rotateFromVector - scale - scaleNonUniform - scaleNonUniform - skewX - skewY - translate - translate - appendItem - getItem - initialize - insertItemBefore - insertItemBefore - removeItem - replaceItem - replaceItem - getPathSegAtLength - getItem - matrixTransform - appendItem - getItem - initialize - insertItemBefore - insertItemBefore - removeItem - replaceItem - replaceItem - createSVGTransformFromMatrix - getElementById - setCurrentTime - suspendRedraw - unsuspendRedraw - appendItem - getItem - initialize - insertItemBefore - insertItemBefore - removeItem - replaceItem - replaceItem - hasExtension - getCharNumAtPosition - getEndPositionOfChar - getExtentOfChar - getRotationOfChar - getStartPositionOfChar - getSubStringLength - getSubStringLength - selectSubString - selectSubString - setMatrix - setRotate - setRotate - setRotate - setScale - setScale - setSkewX - setSkewY - setTranslate - setTranslate - appendItem - createSVGTransformFromMatrix - getItem - initialize - insertItemBefore - insertItemBefore - removeItem - replaceItem - replaceItem - lock - initScrollAreaEvent - initScrollAreaEvent - initScrollAreaEvent - initScrollAreaEvent - initScrollAreaEvent - initScrollAreaEvent - initScrollAreaEvent - initScrollAreaEvent - initScrollAreaEvent - addRange - collapse - collapse - containsNode - containsNode - extend - extend - getRangeAt - modify - modify - modify - removeRange - selectAllChildren - setBaseAndExtent - setBaseAndExtent - setBaseAndExtent - setBaseAndExtent - setPosition - setPosition - postMessage - postMessage - getRegistration - getScopeForUrl - register - register - getNotifications - showNotification - showNotification - getElementById - getElementsByClassName - getElementsByTagName - getElementsByTagNameNS - getElementsByTagNameNS - elementFromPoint - elementFromPoint - elementsFromPoint - elementsFromPoint - appendBuffer - appendBuffer - appendBufferAsync - appendBufferAsync - changeType - remove - remove - removeAsync - removeAsync - addFromString - addFromString - addFromURI - addFromURI - item - start - item - item - speak - getItem - key - removeItem - setItem - setItem - initStorageEvent - initStorageEvent - initStorageEvent - initStorageEvent - initStorageEvent - initStorageEvent - initStorageEvent - initStorageEvent - item - decrypt - decrypt - decrypt - deriveBits - deriveBits - deriveBits - deriveKey - deriveKey - deriveKey - deriveKey - deriveKey - digest - digest - encrypt - encrypt - encrypt - exportKey - exportKey - generateKey - generateKey - generateKey - importKey - importKey - importKey - importKey - importKey - sign - sign - sign - unwrapKey - unwrapKey - unwrapKey - unwrapKey - unwrapKey - unwrapKey - unwrapKey - verify - verify - verify - verify - wrapKey - wrapKey - wrapKey - wrapKey - send - send - send - send - splitText - convertPointFromNode - convertPointFromNode - convertPointFromNode - convertQuadFromNode - convertQuadFromNode - convertQuadFromNode - convertRectFromNode - convertRectFromNode - convertRectFromNode - getBoxQuads - decode - decode - encode - addCue - removeCue - getCueById - getTrackById - initTimeEvent - initTimeEvent - initTimeEvent - end - start - initTouchEvent - initTouchEvent - initTouchEvent - initTouchEvent - initTouchEvent - initTouchEvent - initTouchEvent - initTouchEvent - initTouchEvent - initTouchEvent - initTouchEvent - initTouchEvent - item - register - register - register - register - register - sign - sign - sign - sign - sign - initUIEvent - initUIEvent - initUIEvent - initUIEvent - initUIEvent - createObjectURL - createObjectURL - revokeObjectURL - append - append - delete - get - getAll - has - set - set - cancelAnimationFrame - getEyeParameters - getFrameData - getSubmitFrameResult - requestAnimationFrame - requestPresent - newAxisMoveEvent - newAxisMoveEvent - newButtonEvent - newButtonEvent - newPoseMove - newPoseMove - newPoseMove - newPoseMove - newPoseMove - newPoseMove - setEyeParameter - setEyeParameter - setEyeParameter - setEyeParameter - setEyeParameter - setEyeParameter - setEyeParameter - setEyeParameter - setEyeResolution - setEyeResolution - setMountState - setPose - setPose - setPose - setPose - setPose - setPose - attachVRController - attachVRDisplay - getTrackById - beginQuery - beginQuery - beginTransformFeedback - bindBufferBase - bindBufferBase - bindBufferBase - bindBufferRange - bindBufferRange - bindBufferRange - bindBufferRange - bindBufferRange - bindSampler - bindSampler - bindTransformFeedback - bindTransformFeedback - bindVertexArray - blitFramebuffer - blitFramebuffer - blitFramebuffer - blitFramebuffer - blitFramebuffer - blitFramebuffer - blitFramebuffer - blitFramebuffer - blitFramebuffer - blitFramebuffer - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - clearBufferfi - clearBufferfi - clearBufferfi - clearBufferfi - clearBufferfv - clearBufferfv - clearBufferfv - clearBufferfv - clearBufferiv - clearBufferiv - clearBufferiv - clearBufferiv - clearBufferuiv - clearBufferuiv - clearBufferuiv - clearBufferuiv - clientWaitSync - clientWaitSync - clientWaitSync - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexImage3D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - compressedTexSubImage3D - copyBufferSubData - copyBufferSubData - copyBufferSubData - copyBufferSubData - copyBufferSubData - copyTexSubImage3D - copyTexSubImage3D - copyTexSubImage3D - copyTexSubImage3D - copyTexSubImage3D - copyTexSubImage3D - copyTexSubImage3D - copyTexSubImage3D - copyTexSubImage3D - deleteQuery - deleteSampler - deleteSync - deleteTransformFeedback - deleteVertexArray - drawArraysInstanced - drawArraysInstanced - drawArraysInstanced - drawArraysInstanced - drawBuffers - drawElementsInstanced - drawElementsInstanced - drawElementsInstanced - drawElementsInstanced - drawElementsInstanced - drawRangeElements - drawRangeElements - drawRangeElements - drawRangeElements - drawRangeElements - drawRangeElements - endQuery - fenceSync - fenceSync - framebufferTextureLayer - framebufferTextureLayer - framebufferTextureLayer - framebufferTextureLayer - framebufferTextureLayer - getActiveUniformBlockName - getActiveUniformBlockName - getActiveUniformBlockParameter - getActiveUniformBlockParameter - getActiveUniformBlockParameter - getActiveUniforms - getActiveUniforms - getActiveUniforms - getBufferSubData - getBufferSubData - getBufferSubData - getBufferSubData - getBufferSubData - getFragDataLocation - getFragDataLocation - getIndexedParameter - getIndexedParameter - getInternalformatParameter - getInternalformatParameter - getInternalformatParameter - getQuery - getQuery - getQueryParameter - getQueryParameter - getSamplerParameter - getSamplerParameter - getSyncParameter - getSyncParameter - getTransformFeedbackVarying - getTransformFeedbackVarying - getUniformBlockIndex - getUniformBlockIndex - getUniformIndices - getUniformIndices - invalidateFramebuffer - invalidateFramebuffer - invalidateSubFramebuffer - invalidateSubFramebuffer - invalidateSubFramebuffer - invalidateSubFramebuffer - invalidateSubFramebuffer - invalidateSubFramebuffer - isQuery - isSampler - isSync - isTransformFeedback - isVertexArray - readBuffer - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - renderbufferStorageMultisample - renderbufferStorageMultisample - renderbufferStorageMultisample - renderbufferStorageMultisample - renderbufferStorageMultisample - samplerParameterf - samplerParameterf - samplerParameterf - samplerParameteri - samplerParameteri - samplerParameteri - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texImage3D - texStorage2D - texStorage2D - texStorage2D - texStorage2D - texStorage2D - texStorage3D - texStorage3D - texStorage3D - texStorage3D - texStorage3D - texStorage3D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - texSubImage3D - transformFeedbackVaryings - transformFeedbackVaryings - transformFeedbackVaryings - uniform1fv - uniform1fv - uniform1fv - uniform1fv - uniform1iv - uniform1iv - uniform1iv - uniform1iv - uniform1ui - uniform1ui - uniform1uiv - uniform1uiv - uniform1uiv - uniform1uiv - uniform2fv - uniform2fv - uniform2fv - uniform2fv - uniform2iv - uniform2iv - uniform2iv - uniform2iv - uniform2ui - uniform2ui - uniform2ui - uniform2uiv - uniform2uiv - uniform2uiv - uniform2uiv - uniform3fv - uniform3fv - uniform3fv - uniform3fv - uniform3iv - uniform3iv - uniform3iv - uniform3iv - uniform3ui - uniform3ui - uniform3ui - uniform3ui - uniform3uiv - uniform3uiv - uniform3uiv - uniform3uiv - uniform4fv - uniform4fv - uniform4fv - uniform4fv - uniform4iv - uniform4iv - uniform4iv - uniform4iv - uniform4ui - uniform4ui - uniform4ui - uniform4ui - uniform4ui - uniform4uiv - uniform4uiv - uniform4uiv - uniform4uiv - uniformBlockBinding - uniformBlockBinding - uniformBlockBinding - uniformMatrix2fv - uniformMatrix2fv - uniformMatrix2fv - uniformMatrix2fv - uniformMatrix2fv - uniformMatrix2x3fv - uniformMatrix2x3fv - uniformMatrix2x3fv - uniformMatrix2x3fv - uniformMatrix2x3fv - uniformMatrix2x4fv - uniformMatrix2x4fv - uniformMatrix2x4fv - uniformMatrix2x4fv - uniformMatrix2x4fv - uniformMatrix3fv - uniformMatrix3fv - uniformMatrix3fv - uniformMatrix3fv - uniformMatrix3fv - uniformMatrix3x2fv - uniformMatrix3x2fv - uniformMatrix3x2fv - uniformMatrix3x2fv - uniformMatrix3x2fv - uniformMatrix3x4fv - uniformMatrix3x4fv - uniformMatrix3x4fv - uniformMatrix3x4fv - uniformMatrix3x4fv - uniformMatrix4fv - uniformMatrix4fv - uniformMatrix4fv - uniformMatrix4fv - uniformMatrix4fv - uniformMatrix4x2fv - uniformMatrix4x2fv - uniformMatrix4x2fv - uniformMatrix4x2fv - uniformMatrix4x2fv - uniformMatrix4x3fv - uniformMatrix4x3fv - uniformMatrix4x3fv - uniformMatrix4x3fv - uniformMatrix4x3fv - vertexAttribDivisor - vertexAttribDivisor - vertexAttribI4i - vertexAttribI4i - vertexAttribI4i - vertexAttribI4i - vertexAttribI4i - vertexAttribI4iv - vertexAttribI4iv - vertexAttribI4ui - vertexAttribI4ui - vertexAttribI4ui - vertexAttribI4ui - vertexAttribI4ui - vertexAttribI4uiv - vertexAttribI4uiv - vertexAttribIPointer - vertexAttribIPointer - vertexAttribIPointer - vertexAttribIPointer - vertexAttribIPointer - waitSync - waitSync - waitSync - activeTexture - attachShader - attachShader - bindAttribLocation - bindAttribLocation - bindAttribLocation - bindBuffer - bindBuffer - bindFramebuffer - bindFramebuffer - bindRenderbuffer - bindRenderbuffer - bindTexture - bindTexture - blendColor - blendColor - blendColor - blendColor - blendEquation - blendEquationSeparate - blendEquationSeparate - blendFunc - blendFunc - blendFuncSeparate - blendFuncSeparate - blendFuncSeparate - blendFuncSeparate - checkFramebufferStatus - clear - clearColor - clearColor - clearColor - clearColor - clearDepth - clearStencil - colorMask - colorMask - colorMask - colorMask - compileShader - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - createShader - cullFace - deleteBuffer - deleteFramebuffer - deleteProgram - deleteRenderbuffer - deleteShader - deleteTexture - depthFunc - depthMask - depthRange - depthRange - detachShader - detachShader - disable - disableVertexAttribArray - drawArrays - drawArrays - drawArrays - drawElements - drawElements - drawElements - drawElements - enable - enableVertexAttribArray - framebufferRenderbuffer - framebufferRenderbuffer - framebufferRenderbuffer - framebufferRenderbuffer - framebufferTexture2D - framebufferTexture2D - framebufferTexture2D - framebufferTexture2D - framebufferTexture2D - frontFace - generateMipmap - getActiveAttrib - getActiveAttrib - getActiveUniform - getActiveUniform - getAttachedShaders - getAttribLocation - getAttribLocation - getBufferParameter - getBufferParameter - getExtension - getFramebufferAttachmentParameter - getFramebufferAttachmentParameter - getFramebufferAttachmentParameter - getParameter - getProgramInfoLog - getProgramParameter - getProgramParameter - getRenderbufferParameter - getRenderbufferParameter - getShaderInfoLog - getShaderParameter - getShaderParameter - getShaderPrecisionFormat - getShaderPrecisionFormat - getShaderSource - getTexParameter - getTexParameter - getUniform - getUniform - getUniformLocation - getUniformLocation - getVertexAttrib - getVertexAttrib - getVertexAttribOffset - getVertexAttribOffset - hint - hint - isBuffer - isEnabled - isFramebuffer - isProgram - isRenderbuffer - isShader - isTexture - lineWidth - linkProgram - pixelStorei - pixelStorei - polygonOffset - polygonOffset - renderbufferStorage - renderbufferStorage - renderbufferStorage - renderbufferStorage - sampleCoverage - sampleCoverage - scissor - scissor - scissor - scissor - shaderSource - shaderSource - stencilFunc - stencilFunc - stencilFunc - stencilFuncSeparate - stencilFuncSeparate - stencilFuncSeparate - stencilFuncSeparate - stencilMask - stencilMaskSeparate - stencilMaskSeparate - stencilOp - stencilOp - stencilOp - stencilOpSeparate - stencilOpSeparate - stencilOpSeparate - stencilOpSeparate - texParameterf - texParameterf - texParameterf - texParameteri - texParameteri - texParameteri - uniform1f - uniform1f - uniform1i - uniform1i - uniform2f - uniform2f - uniform2f - uniform2i - uniform2i - uniform2i - uniform3f - uniform3f - uniform3f - uniform3f - uniform3i - uniform3i - uniform3i - uniform3i - uniform4f - uniform4f - uniform4f - uniform4f - uniform4f - uniform4i - uniform4i - uniform4i - uniform4i - uniform4i - useProgram - validateProgram - vertexAttrib1f - vertexAttrib1f - vertexAttrib1fv - vertexAttrib1fv - vertexAttrib2f - vertexAttrib2f - vertexAttrib2f - vertexAttrib2fv - vertexAttrib2fv - vertexAttrib3f - vertexAttrib3f - vertexAttrib3f - vertexAttrib3f - vertexAttrib3fv - vertexAttrib3fv - vertexAttrib4f - vertexAttrib4f - vertexAttrib4f - vertexAttrib4f - vertexAttrib4f - vertexAttrib4fv - vertexAttrib4fv - vertexAttribPointer - vertexAttribPointer - vertexAttribPointer - vertexAttribPointer - vertexAttribPointer - vertexAttribPointer - viewport - viewport - viewport - viewport - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - bufferSubData - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - compressedTexSubImage2D - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - readPixels - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - texSubImage2D - uniform1fv - uniform1fv - uniform1iv - uniform1iv - uniform2fv - uniform2fv - uniform2iv - uniform2iv - uniform3fv - uniform3fv - uniform3iv - uniform3iv - uniform4fv - uniform4fv - uniform4iv - uniform4iv - uniformMatrix2fv - uniformMatrix2fv - uniformMatrix2fv - uniformMatrix3fv - uniformMatrix3fv - uniformMatrix3fv - uniformMatrix4fv - uniformMatrix4fv - uniformMatrix4fv - activeTexture - attachShader - attachShader - bindAttribLocation - bindAttribLocation - bindAttribLocation - bindBuffer - bindBuffer - bindFramebuffer - bindFramebuffer - bindRenderbuffer - bindRenderbuffer - bindTexture - bindTexture - blendColor - blendColor - blendColor - blendColor - blendEquation - blendEquationSeparate - blendEquationSeparate - blendFunc - blendFunc - blendFuncSeparate - blendFuncSeparate - blendFuncSeparate - blendFuncSeparate - checkFramebufferStatus - clear - clearColor - clearColor - clearColor - clearColor - clearDepth - clearStencil - colorMask - colorMask - colorMask - colorMask - compileShader - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - copyTexSubImage2D - createShader - cullFace - deleteBuffer - deleteFramebuffer - deleteProgram - deleteRenderbuffer - deleteShader - deleteTexture - depthFunc - depthMask - depthRange - depthRange - detachShader - detachShader - disable - disableVertexAttribArray - drawArrays - drawArrays - drawArrays - drawElements - drawElements - drawElements - drawElements - enable - enableVertexAttribArray - framebufferRenderbuffer - framebufferRenderbuffer - framebufferRenderbuffer - framebufferRenderbuffer - framebufferTexture2D - framebufferTexture2D - framebufferTexture2D - framebufferTexture2D - framebufferTexture2D - frontFace - generateMipmap - getActiveAttrib - getActiveAttrib - getActiveUniform - getActiveUniform - getAttachedShaders - getAttribLocation - getAttribLocation - getBufferParameter - getBufferParameter - getExtension - getFramebufferAttachmentParameter - getFramebufferAttachmentParameter - getFramebufferAttachmentParameter - getParameter - getProgramInfoLog - getProgramParameter - getProgramParameter - getRenderbufferParameter - getRenderbufferParameter - getShaderInfoLog - getShaderParameter - getShaderParameter - getShaderPrecisionFormat - getShaderPrecisionFormat - getShaderSource - getTexParameter - getTexParameter - getUniform - getUniform - getUniformLocation - getUniformLocation - getVertexAttrib - getVertexAttrib - getVertexAttribOffset - getVertexAttribOffset - hint - hint - isBuffer - isEnabled - isFramebuffer - isProgram - isRenderbuffer - isShader - isTexture - lineWidth - linkProgram - pixelStorei - pixelStorei - polygonOffset - polygonOffset - renderbufferStorage - renderbufferStorage - renderbufferStorage - renderbufferStorage - sampleCoverage - sampleCoverage - scissor - scissor - scissor - scissor - shaderSource - shaderSource - stencilFunc - stencilFunc - stencilFunc - stencilFuncSeparate - stencilFuncSeparate - stencilFuncSeparate - stencilFuncSeparate - stencilMask - stencilMaskSeparate - stencilMaskSeparate - stencilOp - stencilOp - stencilOp - stencilOpSeparate - stencilOpSeparate - stencilOpSeparate - stencilOpSeparate - texParameterf - texParameterf - texParameterf - texParameteri - texParameteri - texParameteri - uniform1f - uniform1f - uniform1i - uniform1i - uniform2f - uniform2f - uniform2f - uniform2i - uniform2i - uniform2i - uniform3f - uniform3f - uniform3f - uniform3f - uniform3i - uniform3i - uniform3i - uniform3i - uniform4f - uniform4f - uniform4f - uniform4f - uniform4f - uniform4i - uniform4i - uniform4i - uniform4i - uniform4i - useProgram - validateProgram - vertexAttrib1f - vertexAttrib1f - vertexAttrib1fv - vertexAttrib1fv - vertexAttrib2f - vertexAttrib2f - vertexAttrib2f - vertexAttrib2fv - vertexAttrib2fv - vertexAttrib3f - vertexAttrib3f - vertexAttrib3f - vertexAttrib3f - vertexAttrib3fv - vertexAttrib3fv - vertexAttrib4f - vertexAttrib4f - vertexAttrib4f - vertexAttrib4f - vertexAttrib4f - vertexAttrib4fv - vertexAttrib4fv - vertexAttribPointer - vertexAttribPointer - vertexAttribPointer - vertexAttribPointer - vertexAttribPointer - vertexAttribPointer - viewport - viewport - viewport - viewport - getAdapter - createDevice - beginRenderPass - copyBufferToBuffer - copyBufferToBuffer - copyBufferToBuffer - copyBufferToBuffer - copyBufferToBuffer - dispatch - dispatch - dispatch - draw - draw - draw - draw - drawIndexed - drawIndexed - drawIndexed - drawIndexed - drawIndexed - setBindGroup - setBindGroup - setBlendColor - setBlendColor - setBlendColor - setBlendColor - setIndexBuffer - setIndexBuffer - setPipeline - setPushConstants - setPushConstants - setPushConstants - setPushConstants - setVertexBuffers - setVertexBuffers - setVertexBuffers - transitionBuffer - transitionBuffer - createAttachmentState - createBindGroup - createBindGroupLayout - createBlendState - createBuffer - createCommandEncoder - createComputePipeline - createDepthStencilState - createInputState - createPipelineLayout - createRenderPipeline - createSampler - createShaderModule - createTexture - getObjectStatus - wait - submit - configure - createTextureView - multiply - rotate - rotate - rotate - rotateAxisAngle - rotateAxisAngle - rotateAxisAngle - rotateAxisAngle - scale - scale - scale - setMatrixValue - skewX - skewY - translate - translate - translate - close - close - send - send - send - send - alert - cancelAnimationFrame - cancelIdleCallback - confirm - getComputedStyle - getComputedStyle - matchMedia - moveBy - moveBy - moveTo - moveTo - open - open - open - postMessage - postMessage - postMessage - prompt - prompt - requestAnimationFrame - requestIdleCallback - requestIdleCallback - resizeBy - resizeBy - resizeTo - resizeTo - scroll - scroll - scroll - scrollBy - scrollBy - scrollBy - scrollTo - scrollTo - scrollTo - atob - btoa - clearInterval - clearTimeout - createImageBitmap - createImageBitmap - createImageBitmap - createImageBitmap - createImageBitmap - createImageBitmap - fetch - fetch - setInterval - setInterval - setInterval - setInterval - setInterval - setInterval - setTimeout - setTimeout - setTimeout - setTimeout - setTimeout - setTimeout - navigate - postMessage - postMessage - createSandbox - createSandbox - dump - loadSubScript - loadSubScript - postMessage - reportError - setConsoleEventHandler - setImmediate - importScripts - atob - btoa - clearInterval - clearTimeout - createImageBitmap - createImageBitmap - createImageBitmap - createImageBitmap - createImageBitmap - createImageBitmap - fetch - fetch - setInterval - setInterval - setInterval - setInterval - setInterval - setInterval - setTimeout - setTimeout - setTimeout - setTimeout - setTimeout - setTimeout - import - load - getResponseHeader - open - open - open - open - open - open - open - overrideMimeType - send - setRequestHeader - setRequestHeader - serializeToString - evaluate - evaluate - evaluate - snapshotItem - getParameter - getParameter - importStylesheet - removeParameter - removeParameter - setParameter - setParameter - setParameter - transformToDocument - transformToFragment - transformToFragment - \ No newline at end of file From 048a22bc77e5d5ab68a0dee3b52199e2f527d593 Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Tue, 22 Jan 2019 21:35:22 -0500 Subject: [PATCH 08/13] Fix idl_type swap --- crates/web-sys/tests/wasm/element.js | 3 +++ crates/webidl-tests/lib.rs | 4 +--- crates/webidl/src/util.rs | 32 +++++++++++++++++++++------- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/crates/web-sys/tests/wasm/element.js b/crates/web-sys/tests/wasm/element.js index 3f34bc5f64e..38d1f517865 100644 --- a/crates/web-sys/tests/wasm/element.js +++ b/crates/web-sys/tests/wasm/element.js @@ -152,6 +152,9 @@ export function new_title() { } export function new_webgl_rendering_context() { + const foo = document.createElement('canvas'); + console.log('Does get context work? ' + foo.getContext('webgl')); + const canvas = document.createElement('canvas'); return canvas.getContext('webgl'); } diff --git a/crates/webidl-tests/lib.rs b/crates/webidl-tests/lib.rs index 7d245db242a..ef346239a83 100644 --- a/crates/webidl-tests/lib.rs +++ b/crates/webidl-tests/lib.rs @@ -1,3 +1 @@ -// intentionally left blank - -// QUESTION FOR REVIEWER: WHY? (I'll include this context in the comment) +// Intentionally left blank in order for Cargo to work diff --git a/crates/webidl/src/util.rs b/crates/webidl/src/util.rs index 56f8cf26b37..2f82288ed44 100644 --- a/crates/webidl/src/util.rs +++ b/crates/webidl/src/util.rs @@ -12,6 +12,8 @@ use weedle::literal::{ConstValue, FloatLit, IntegerLit}; use first_pass::{FirstPassRecord, OperationData, OperationId, Signature}; use idl_type::{IdlType, ToIdlType}; +// TODO: Remove.. just using this to see what idl types I need to change.. +use std::io::Write; /// For variadic operations an overload with a `js_sys::Array` argument is generated alongside with /// `operation_name_0`, `operation_name_1`, `operation_name_2`, ..., `operation_name_n` overloads @@ -434,7 +436,7 @@ impl<'src> FirstPassRecord<'src> { signatures.push((signature, idl_args.clone())); } - let idl_type = arg.ty.to_idl_type(self); + let mut idl_type = arg.ty.to_idl_type(self); let idl_type = maybe_adjust(idl_type, id); idl_args.push(idl_type); } @@ -719,16 +721,30 @@ pub fn public() -> syn::Visibility { /// /// Here we implement a whitelist for those cases. This whitelist is currently /// maintained by hand. -fn maybe_adjust<'a> (idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<'a> { +fn maybe_adjust<'a> (mut idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<'a> { +// let mut file = ::std::fs::OpenOptions::new().append(true).create(true).open("foo").unwrap(); + match id { - // TODO: `match op` and return an adjusted idl_type if necessary OperationId::Operation(Some(op)) => { match *op { -// "vertexAttrib1fv" => { -// IdlType::Float32Array { immutable: true} -// } - _ => idl_type - } + "vertexAttrib1fv" => { +// TODO: Remove.. just using this to see what idl types I need to change.. +// file.write( +// format!("{:#?}", idl_type).as_bytes() +// ); +// file.write(r#" +// "#.as_bytes()); + + if let IdlType::Union(ref mut union) = idl_type { + if let IdlType::Float32Array { ref mut immutable } = union[0] { + *immutable = true; + } + } + } + _ => {} + }; + + return idl_type } _ => idl_type } From 2e6880c43c0eb5089d7fcbcde63bc82e4bf17c5b Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Sat, 26 Jan 2019 12:10:08 -0500 Subject: [PATCH 09/13] Whitelist WebGlRenderingContext float slices --- crates/web-sys/tests/wasm/element.js | 3 - .../wasm/whitelisted_immutable_slices.rs | 22 ++++++- crates/webidl/src/idl_type.rs | 5 +- crates/webidl/src/util.rs | 61 +++++++++++-------- 4 files changed, 57 insertions(+), 34 deletions(-) diff --git a/crates/web-sys/tests/wasm/element.js b/crates/web-sys/tests/wasm/element.js index 38d1f517865..3f34bc5f64e 100644 --- a/crates/web-sys/tests/wasm/element.js +++ b/crates/web-sys/tests/wasm/element.js @@ -152,9 +152,6 @@ export function new_title() { } export function new_webgl_rendering_context() { - const foo = document.createElement('canvas'); - console.log('Does get context work? ' + foo.getContext('webgl')); - const canvas = document.createElement('canvas'); return canvas.getContext('webgl'); } diff --git a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs index 59c60eb7b7f..3b0cac98c66 100644 --- a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs +++ b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs @@ -5,6 +5,8 @@ //! example when working with the WebGlRenderingContext APIs. //! //! These tests ensure that whitelisted methods do indeed accept mutable slices. +//! Especially important since this whitelist is stringly typed and currently +//! maintained by hand. //! //! @see https://github.com/rustwasm/wasm-bindgen/issues/1005 @@ -20,7 +22,25 @@ extern "C" { // Ensure that our whitelisted WebGlRenderingContext methods work #[wasm_bindgen_test] fn test_webgl_rendering_context_immutable_slices() { + // WebGl wasn't working in headless firefox at the time of writing.. let gl = new_webgl_rendering_context(); - gl.vertex_attrib1fv_with_f32_array(0, &[5000.]); + gl.vertex_attrib1fv_with_f32_array(0, &[1.]); + gl.vertex_attrib2fv_with_f32_array(0, &[1.]); + gl.vertex_attrib3fv_with_f32_array(0, &[1.]); + gl.vertex_attrib4fv_with_f32_array(0, &[1.]); + + gl.uniform1fv_with_f32_array(None, &[1.]); + gl.uniform2fv_with_f32_array(None, &[1.]); + gl.uniform3fv_with_f32_array(None, &[1.]); + gl.uniform4fv_with_f32_array(None, &[1.]); + + gl.uniform_matrix2fv_with_f32_array(None, false, &[1.]); + gl.uniform_matrix3fv_with_f32_array(None, false, &[1.]); + gl.uniform_matrix4fv_with_f32_array(None, false, &[1.]); } + +// TODO: +//#[wasm_bindgen_test] +//fn test_another_types_immutable_slices_here() { +//} diff --git a/crates/webidl/src/idl_type.rs b/crates/webidl/src/idl_type.rs index 3d24a18d7ed..ca9fcb58223 100644 --- a/crates/webidl/src/idl_type.rs +++ b/crates/webidl/src/idl_type.rs @@ -340,10 +340,7 @@ macro_rules! terms_to_idl_type { ($($t:tt => $r:tt)*) => ($( impl<'a> ToIdlType<'a> for term::$t { fn to_idl_type(&self, _record: &FirstPassRecord<'a>) -> IdlType<'a> { - match IdlType::$r { - IdlType::Callback => IdlType::Float32Array { immutable: false }, - _ => IdlType::$r - } + IdlType::$r } } )*); diff --git a/crates/webidl/src/util.rs b/crates/webidl/src/util.rs index 2f82288ed44..e12146b886e 100644 --- a/crates/webidl/src/util.rs +++ b/crates/webidl/src/util.rs @@ -12,8 +12,8 @@ use weedle::literal::{ConstValue, FloatLit, IntegerLit}; use first_pass::{FirstPassRecord, OperationData, OperationId, Signature}; use idl_type::{IdlType, ToIdlType}; -// TODO: Remove.. just using this to see what idl types I need to change.. -use std::io::Write; + +use std::collections::HashSet; /// For variadic operations an overload with a `js_sys::Array` argument is generated alongside with /// `operation_name_0`, `operation_name_1`, `operation_name_2`, ..., `operation_name_n` overloads @@ -721,31 +721,40 @@ pub fn public() -> syn::Visibility { /// /// Here we implement a whitelist for those cases. This whitelist is currently /// maintained by hand. -fn maybe_adjust<'a> (mut idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<'a> { -// let mut file = ::std::fs::OpenOptions::new().append(true).create(true).open("foo").unwrap(); - - match id { - OperationId::Operation(Some(op)) => { - match *op { - "vertexAttrib1fv" => { -// TODO: Remove.. just using this to see what idl types I need to change.. -// file.write( -// format!("{:#?}", idl_type).as_bytes() -// ); -// file.write(r#" -// "#.as_bytes()); - - if let IdlType::Union(ref mut union) = idl_type { - if let IdlType::Float32Array { ref mut immutable } = union[0] { - *immutable = true; - } - } - } - _ => {} - }; +fn maybe_adjust<'a>(mut idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<'a> { + let immutable_f32_fns: Vec<&'static str> = vec![ + // WebGlRenderingContext + "vertexAttrib1fv", + "vertexAttrib2fv", + "vertexAttrib3fv", + "vertexAttrib4fv", + "uniform1fv", + "uniform2fv", + "uniform3fv", + "uniform4fv", + "uniformMatrix2fv", + "uniformMatrix3fv", + "uniformMatrix4fv", + // TODO: Add another type's functions here + ]; + + let mut immutable_f32_slice_whitelist: HashSet<&'static str> = HashSet::new(); + for function_name in immutable_f32_fns.into_iter() { + immutable_f32_slice_whitelist.insert(function_name); + } - return idl_type + // example `op`... -> "vertexAttrib1fv" + if let OperationId::Operation(Some(op)) = id { + // Look up this funtion in our whitelist and see if we should make its + // slice argument immutable. + if immutable_f32_slice_whitelist.get(op).is_some() { + if let IdlType::Union(ref mut union) = idl_type { + if let IdlType::Float32Array { ref mut immutable } = union[0] { + *immutable = true; + } + } } - _ => idl_type } + + idl_type } From fa1d51fe44174f251918ee9d7af05510fc48adf1 Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Sat, 26 Jan 2019 12:19:28 -0500 Subject: [PATCH 10/13] Comment out WebGl tests --- .../wasm/whitelisted_immutable_slices.rs | 46 +++++++++++-------- crates/webidl/src/util.rs | 10 ++-- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs index 3b0cac98c66..453e98224a0 100644 --- a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs +++ b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs @@ -17,28 +17,36 @@ use web_sys::WebGlRenderingContext; #[wasm_bindgen(module = "./tests/wasm/element.js")] extern "C" { fn new_webgl_rendering_context() -> WebGlRenderingContext; + // TODO: Add a function to create another type to test here. + // These functions come from element.js } -// Ensure that our whitelisted WebGlRenderingContext methods work -#[wasm_bindgen_test] -fn test_webgl_rendering_context_immutable_slices() { - // WebGl wasn't working in headless firefox at the time of writing.. - let gl = new_webgl_rendering_context(); - - gl.vertex_attrib1fv_with_f32_array(0, &[1.]); - gl.vertex_attrib2fv_with_f32_array(0, &[1.]); - gl.vertex_attrib3fv_with_f32_array(0, &[1.]); - gl.vertex_attrib4fv_with_f32_array(0, &[1.]); +// TODO: Uncomment WebGlRenderingContext test... +// Currently commented out because WebGl isn't working in geckodriver. +// It currently works in chromedriver so if you need to run this in the meantime you can +// uncomment this block and run it in using chromedriver. +// +// CHROMEDRIVER=chromedriver cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features --test test_webgl_rendering_context_immutable_slices - gl.uniform1fv_with_f32_array(None, &[1.]); - gl.uniform2fv_with_f32_array(None, &[1.]); - gl.uniform3fv_with_f32_array(None, &[1.]); - gl.uniform4fv_with_f32_array(None, &[1.]); - - gl.uniform_matrix2fv_with_f32_array(None, false, &[1.]); - gl.uniform_matrix3fv_with_f32_array(None, false, &[1.]); - gl.uniform_matrix4fv_with_f32_array(None, false, &[1.]); -} +// Ensure that our whitelisted WebGlRenderingContext methods work +//#[wasm_bindgen_test] +//fn test_webgl_rendering_context_immutable_slices() { +// let gl = new_webgl_rendering_context(); +// +// gl.vertex_attrib1fv_with_f32_array(0, &[1.]); +// gl.vertex_attrib2fv_with_f32_array(0, &[1.]); +// gl.vertex_attrib3fv_with_f32_array(0, &[1.]); +// gl.vertex_attrib4fv_with_f32_array(0, &[1.]); +// +// gl.uniform1fv_with_f32_array(None, &[1.]); +// gl.uniform2fv_with_f32_array(None, &[1.]); +// gl.uniform3fv_with_f32_array(None, &[1.]); +// gl.uniform4fv_with_f32_array(None, &[1.]); +// +// gl.uniform_matrix2fv_with_f32_array(None, false, &[1.]); +// gl.uniform_matrix3fv_with_f32_array(None, false, &[1.]); +// gl.uniform_matrix4fv_with_f32_array(None, false, &[1.]); +//} // TODO: //#[wasm_bindgen_test] diff --git a/crates/webidl/src/util.rs b/crates/webidl/src/util.rs index e12146b886e..2b3b86df4c6 100644 --- a/crates/webidl/src/util.rs +++ b/crates/webidl/src/util.rs @@ -724,10 +724,6 @@ pub fn public() -> syn::Visibility { fn maybe_adjust<'a>(mut idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<'a> { let immutable_f32_fns: Vec<&'static str> = vec![ // WebGlRenderingContext - "vertexAttrib1fv", - "vertexAttrib2fv", - "vertexAttrib3fv", - "vertexAttrib4fv", "uniform1fv", "uniform2fv", "uniform3fv", @@ -735,7 +731,11 @@ fn maybe_adjust<'a>(mut idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<' "uniformMatrix2fv", "uniformMatrix3fv", "uniformMatrix4fv", - // TODO: Add another type's functions here + "vertexAttrib1fv", + "vertexAttrib2fv", + "vertexAttrib3fv", + "vertexAttrib4fv", + // TODO: Add another type's functions here. Leave a comment header with the type name ]; let mut immutable_f32_slice_whitelist: HashSet<&'static str> = HashSet::new(); From 965bd8c9fa5b36afa0154e2efb1bbf28705d5542 Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Thu, 31 Jan 2019 07:32:12 -0500 Subject: [PATCH 11/13] Clean up --- .../wasm/whitelisted_immutable_slices.rs | 2 +- crates/webidl/Cargo.toml | 1 + crates/webidl/src/lib.rs | 2 + crates/webidl/src/util.rs | 84 ++++++++++++------- 4 files changed, 58 insertions(+), 31 deletions(-) diff --git a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs index 453e98224a0..ea8286f5fea 100644 --- a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs +++ b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs @@ -26,7 +26,7 @@ extern "C" { // It currently works in chromedriver so if you need to run this in the meantime you can // uncomment this block and run it in using chromedriver. // -// CHROMEDRIVER=chromedriver cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features --test test_webgl_rendering_context_immutable_slices +// CHROMEDRIVER=chromedriver cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features test_webgl_rendering_context_immutable_slices // Ensure that our whitelisted WebGlRenderingContext methods work //#[wasm_bindgen_test] diff --git a/crates/webidl/Cargo.toml b/crates/webidl/Cargo.toml index b3e3de3219d..c5c747ac0c6 100644 --- a/crates/webidl/Cargo.toml +++ b/crates/webidl/Cargo.toml @@ -14,6 +14,7 @@ Support for parsing WebIDL specific to wasm-bindgen [dependencies] failure = "0.1.2" heck = "0.3" +lazy_static = "1.2.0" log = "0.4.1" proc-macro2 = "0.4.8" quote = '0.6' diff --git a/crates/webidl/src/lib.rs b/crates/webidl/src/lib.rs index 2e11b1282ef..186f6fa7f4f 100644 --- a/crates/webidl/src/lib.rs +++ b/crates/webidl/src/lib.rs @@ -21,6 +21,8 @@ extern crate quote; extern crate syn; extern crate wasm_bindgen_backend as backend; extern crate weedle; +#[macro_use] +extern crate lazy_static; mod error; mod first_pass; diff --git a/crates/webidl/src/util.rs b/crates/webidl/src/util.rs index 2b3b86df4c6..5856b1bb81f 100644 --- a/crates/webidl/src/util.rs +++ b/crates/webidl/src/util.rs @@ -713,6 +713,7 @@ pub fn public() -> syn::Visibility { }) } + /// When generating our web_sys APIs we default to setting slice references that /// get passed to JS as mutable in case they get mutated in JS. /// @@ -721,40 +722,63 @@ pub fn public() -> syn::Visibility { /// /// Here we implement a whitelist for those cases. This whitelist is currently /// maintained by hand. +/// +/// When adding to this whitelist add tests to crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs fn maybe_adjust<'a>(mut idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<'a> { - let immutable_f32_fns: Vec<&'static str> = vec![ - // WebGlRenderingContext - "uniform1fv", - "uniform2fv", - "uniform3fv", - "uniform4fv", - "uniformMatrix2fv", - "uniformMatrix3fv", - "uniformMatrix4fv", - "vertexAttrib1fv", - "vertexAttrib2fv", - "vertexAttrib3fv", - "vertexAttrib4fv", - // TODO: Add another type's functions here. Leave a comment header with the type name - ]; - - let mut immutable_f32_slice_whitelist: HashSet<&'static str> = HashSet::new(); - for function_name in immutable_f32_fns.into_iter() { - immutable_f32_slice_whitelist.insert(function_name); + let op = match id { + OperationId::Operation(Some(op)) => op, + _ => return idl_type + }; + + if IMMUTABLE_F32_WHITELIST.contains(op) { + flag_slices_immutable(&mut idl_type) } - // example `op`... -> "vertexAttrib1fv" - if let OperationId::Operation(Some(op)) = id { - // Look up this funtion in our whitelist and see if we should make its - // slice argument immutable. - if immutable_f32_slice_whitelist.get(op).is_some() { - if let IdlType::Union(ref mut union) = idl_type { - if let IdlType::Float32Array { ref mut immutable } = union[0] { - *immutable = true; - } - } + // TODO: Add other whitelisted slices here, such as F64 or u8.. + + idl_type + +} + +fn flag_slices_immutable(ty: &mut IdlType) { + match ty { + IdlType::Float32Array { immutable } => *immutable = true, + IdlType::Union(list) => { + for item in list { flag_slices_immutable(item); } } + + // TODO: ... other recursive cases like Nullable handled here + + // catch-all for everything else like Object + _ => {} } +} - idl_type +lazy_static! { + /// These functions will have their f32 slice arguments be immutable. + static ref IMMUTABLE_F32_WHITELIST: HashSet<&'static str> = { + let mut set = HashSet::new(); + + let fn_names = vec![ + // WebGlRenderingContext + "uniform1fv", + "uniform2fv", + "uniform3fv", + "uniform4fv", + "uniformMatrix2fv", + "uniformMatrix3fv", + "uniformMatrix4fv", + "vertexAttrib1fv", + "vertexAttrib2fv", + "vertexAttrib3fv", + "vertexAttrib4fv", + // TODO: Add another type's functions here. Leave a comment header with the type name + ]; + + for fn_name in fn_names { + set.insert(fn_name); + } + + set + }; } From ed28ce9db26f78fd06b4bd9c8c11896101b99696 Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Tue, 5 Feb 2019 13:47:46 -0500 Subject: [PATCH 12/13] Clean up --- .../wasm/whitelisted_immutable_slices.rs | 5 +- crates/webidl/Cargo.toml | 1 - crates/webidl/src/first_pass.rs | 2 + crates/webidl/src/lib.rs | 2 - crates/webidl/src/util.rs | 122 +++++++++--------- 5 files changed, 67 insertions(+), 65 deletions(-) diff --git a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs index ea8286f5fea..07804f652af 100644 --- a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs +++ b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs @@ -21,8 +21,11 @@ extern "C" { // These functions come from element.js } -// TODO: Uncomment WebGlRenderingContext test... +// TODO: Uncomment WebGlRenderingContext test. Every now and then we can check if this works +// in the latest geckodriver. +// // Currently commented out because WebGl isn't working in geckodriver. +// // It currently works in chromedriver so if you need to run this in the meantime you can // uncomment this block and run it in using chromedriver. // diff --git a/crates/webidl/Cargo.toml b/crates/webidl/Cargo.toml index c5c747ac0c6..b3e3de3219d 100644 --- a/crates/webidl/Cargo.toml +++ b/crates/webidl/Cargo.toml @@ -14,7 +14,6 @@ Support for parsing WebIDL specific to wasm-bindgen [dependencies] failure = "0.1.2" heck = "0.3" -lazy_static = "1.2.0" log = "0.4.1" proc-macro2 = "0.4.8" quote = '0.6' diff --git a/crates/webidl/src/first_pass.rs b/crates/webidl/src/first_pass.rs index c3454c1e690..eeee69abd31 100644 --- a/crates/webidl/src/first_pass.rs +++ b/crates/webidl/src/first_pass.rs @@ -22,6 +22,7 @@ use weedle::{DictionaryDefinition, PartialDictionaryDefinition}; use super::Result; use util; use util::camel_case_ident; +use std::cell::RefCell; /// Collection of constructs that may use partial. #[derive(Default)] @@ -37,6 +38,7 @@ pub(crate) struct FirstPassRecord<'src> { pub(crate) dictionaries: BTreeMap<&'src str, DictionaryData<'src>>, pub(crate) callbacks: BTreeSet<&'src str>, pub(crate) callback_interfaces: BTreeMap<&'src str, CallbackInterfaceData<'src>>, + pub(crate) immutable_f32_whitelist: RefCell> } /// We need to collect interface data during the first pass, to be used later. diff --git a/crates/webidl/src/lib.rs b/crates/webidl/src/lib.rs index 186f6fa7f4f..2e11b1282ef 100644 --- a/crates/webidl/src/lib.rs +++ b/crates/webidl/src/lib.rs @@ -21,8 +21,6 @@ extern crate quote; extern crate syn; extern crate wasm_bindgen_backend as backend; extern crate weedle; -#[macro_use] -extern crate lazy_static; mod error; mod first_pass; diff --git a/crates/webidl/src/util.rs b/crates/webidl/src/util.rs index 5856b1bb81f..6e32767cd42 100644 --- a/crates/webidl/src/util.rs +++ b/crates/webidl/src/util.rs @@ -13,7 +13,8 @@ use weedle::literal::{ConstValue, FloatLit, IntegerLit}; use first_pass::{FirstPassRecord, OperationData, OperationId, Signature}; use idl_type::{IdlType, ToIdlType}; -use std::collections::HashSet; +use std::collections::BTreeSet; +use std::cell::Ref; /// For variadic operations an overload with a `js_sys::Array` argument is generated alongside with /// `operation_name_0`, `operation_name_1`, `operation_name_2`, ..., `operation_name_n` overloads @@ -437,7 +438,7 @@ impl<'src> FirstPassRecord<'src> { } let mut idl_type = arg.ty.to_idl_type(self); - let idl_type = maybe_adjust(idl_type, id); + let idl_type = self.maybe_adjust(idl_type, id); idl_args.push(idl_type); } signatures.push((signature, idl_args)); @@ -632,6 +633,56 @@ impl<'src> FirstPassRecord<'src> { } return ret; } + + + /// When generating our web_sys APIs we default to setting slice references that + /// get passed to JS as mutable in case they get mutated in JS. + /// + /// In certain cases we know for sure that the slice will not get mutated - for + /// example when working with the WebGlRenderingContext APIs. + /// + /// Here we implement a whitelist for those cases. This whitelist is currently + /// maintained by hand. + /// + /// When adding to this whitelist add tests to crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs + fn maybe_adjust<'a>(&self, mut idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<'a> { + let op = match id { + OperationId::Operation(Some(op)) => op, + _ => return idl_type + }; + + if self.immutable_f32_whitelist().contains(op) { + flag_slices_immutable(&mut idl_type) + } + + // TODO: Add other whitelisted slices here, such as F64 or u8.. + + idl_type + } + + fn immutable_f32_whitelist(&self) -> Ref> { + if self.immutable_f32_whitelist.borrow().len() == 0 { + *self.immutable_f32_whitelist.borrow_mut() = vec![ + // WebGlRenderingContext + "uniform1fv", + "uniform2fv", + "uniform3fv", + "uniform4fv", + "uniformMatrix2fv", + "uniformMatrix3fv", + "uniformMatrix4fv", + "vertexAttrib1fv", + "vertexAttrib2fv", + "vertexAttrib3fv", + "vertexAttrib4fv", + // TODO: Add another type's functions here. Leave a comment header with the type name + ] + .into_iter() + .collect(); + } + + self.immutable_f32_whitelist.borrow() + } } /// Search for an attribute by name in some webidl object's attributes. @@ -713,72 +764,21 @@ pub fn public() -> syn::Visibility { }) } - -/// When generating our web_sys APIs we default to setting slice references that -/// get passed to JS as mutable in case they get mutated in JS. -/// -/// In certain cases we know for sure that the slice will not get mutated - for -/// example when working with the WebGlRenderingContext APIs. -/// -/// Here we implement a whitelist for those cases. This whitelist is currently -/// maintained by hand. -/// -/// When adding to this whitelist add tests to crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs -fn maybe_adjust<'a>(mut idl_type: IdlType<'a>, id: &'a OperationId) -> IdlType<'a> { - let op = match id { - OperationId::Operation(Some(op)) => op, - _ => return idl_type - }; - - if IMMUTABLE_F32_WHITELIST.contains(op) { - flag_slices_immutable(&mut idl_type) - } - - // TODO: Add other whitelisted slices here, such as F64 or u8.. - - idl_type - -} - fn flag_slices_immutable(ty: &mut IdlType) { match ty { IdlType::Float32Array { immutable } => *immutable = true, + IdlType::Nullable(item) => flag_slices_immutable(item), + IdlType::FrozenArray(item) => flag_slices_immutable(item), + IdlType::Sequence(item) => flag_slices_immutable(item), + IdlType::Promise(item) => flag_slices_immutable(item), + IdlType::Record(item1, item2) => { + flag_slices_immutable(item1); + flag_slices_immutable(item2); + }, IdlType::Union(list) => { for item in list { flag_slices_immutable(item); } } - - // TODO: ... other recursive cases like Nullable handled here - // catch-all for everything else like Object _ => {} } } - -lazy_static! { - /// These functions will have their f32 slice arguments be immutable. - static ref IMMUTABLE_F32_WHITELIST: HashSet<&'static str> = { - let mut set = HashSet::new(); - - let fn_names = vec![ - // WebGlRenderingContext - "uniform1fv", - "uniform2fv", - "uniform3fv", - "uniform4fv", - "uniformMatrix2fv", - "uniformMatrix3fv", - "uniformMatrix4fv", - "vertexAttrib1fv", - "vertexAttrib2fv", - "vertexAttrib3fv", - "vertexAttrib4fv", - // TODO: Add another type's functions here. Leave a comment header with the type name - ]; - - for fn_name in fn_names { - set.insert(fn_name); - } - - set - }; -} From acd69e97ee175fd36e099bb0e4682958e25a7e99 Mon Sep 17 00:00:00 2001 From: Chinedu Francis Nwafili Date: Thu, 7 Feb 2019 07:14:33 -0500 Subject: [PATCH 13/13] Remove RefCell --- crates/webidl/src/first_pass.rs | 3 +-- crates/webidl/src/lib.rs | 22 ++++++++++++++++++++++ crates/webidl/src/util.rs | 27 +-------------------------- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/crates/webidl/src/first_pass.rs b/crates/webidl/src/first_pass.rs index eeee69abd31..02ab48e07a1 100644 --- a/crates/webidl/src/first_pass.rs +++ b/crates/webidl/src/first_pass.rs @@ -22,7 +22,6 @@ use weedle::{DictionaryDefinition, PartialDictionaryDefinition}; use super::Result; use util; use util::camel_case_ident; -use std::cell::RefCell; /// Collection of constructs that may use partial. #[derive(Default)] @@ -38,7 +37,7 @@ pub(crate) struct FirstPassRecord<'src> { pub(crate) dictionaries: BTreeMap<&'src str, DictionaryData<'src>>, pub(crate) callbacks: BTreeSet<&'src str>, pub(crate) callback_interfaces: BTreeMap<&'src str, CallbackInterfaceData<'src>>, - pub(crate) immutable_f32_whitelist: RefCell> + pub(crate) immutable_f32_whitelist: BTreeSet<&'static str> } /// We need to collect interface data during the first pass, to be used later. diff --git a/crates/webidl/src/lib.rs b/crates/webidl/src/lib.rs index 2e11b1282ef..637070c0ab4 100644 --- a/crates/webidl/src/lib.rs +++ b/crates/webidl/src/lib.rs @@ -82,6 +82,8 @@ fn parse(webidl_source: &str, allowed_types: Option<&[&str]>) -> Result let mut first_pass_record: FirstPassRecord = Default::default(); first_pass_record.builtin_idents = builtin_idents(); + first_pass_record.immutable_f32_whitelist = immutable_f32_whitelist(); + definitions.first_pass(&mut first_pass_record, ())?; let mut program = Default::default(); let mut submodules = Vec::new(); @@ -179,6 +181,26 @@ fn builtin_idents() -> BTreeSet { ) } +fn immutable_f32_whitelist() -> BTreeSet<&'static str> { + BTreeSet::from_iter( + vec![ + // WebGlRenderingContext + "uniform1fv", + "uniform2fv", + "uniform3fv", + "uniform4fv", + "uniformMatrix2fv", + "uniformMatrix3fv", + "uniformMatrix4fv", + "vertexAttrib1fv", + "vertexAttrib2fv", + "vertexAttrib3fv", + "vertexAttrib4fv", + // TODO: Add another type's functions here. Leave a comment header with the type name + ] + ) +} + /// Run codegen on the AST to generate rust code. fn compile_ast(mut ast: Program) -> String { // Iteratively prune all entries from the AST which reference undefined diff --git a/crates/webidl/src/util.rs b/crates/webidl/src/util.rs index 6e32767cd42..f0e896247ef 100644 --- a/crates/webidl/src/util.rs +++ b/crates/webidl/src/util.rs @@ -13,9 +13,6 @@ use weedle::literal::{ConstValue, FloatLit, IntegerLit}; use first_pass::{FirstPassRecord, OperationData, OperationId, Signature}; use idl_type::{IdlType, ToIdlType}; -use std::collections::BTreeSet; -use std::cell::Ref; - /// For variadic operations an overload with a `js_sys::Array` argument is generated alongside with /// `operation_name_0`, `operation_name_1`, `operation_name_2`, ..., `operation_name_n` overloads /// which have the count of arguments for passing values to the variadic argument @@ -651,7 +648,7 @@ impl<'src> FirstPassRecord<'src> { _ => return idl_type }; - if self.immutable_f32_whitelist().contains(op) { + if self.immutable_f32_whitelist.contains(op) { flag_slices_immutable(&mut idl_type) } @@ -660,29 +657,7 @@ impl<'src> FirstPassRecord<'src> { idl_type } - fn immutable_f32_whitelist(&self) -> Ref> { - if self.immutable_f32_whitelist.borrow().len() == 0 { - *self.immutable_f32_whitelist.borrow_mut() = vec![ - // WebGlRenderingContext - "uniform1fv", - "uniform2fv", - "uniform3fv", - "uniform4fv", - "uniformMatrix2fv", - "uniformMatrix3fv", - "uniformMatrix4fv", - "vertexAttrib1fv", - "vertexAttrib2fv", - "vertexAttrib3fv", - "vertexAttrib4fv", - // TODO: Add another type's functions here. Leave a comment header with the type name - ] - .into_iter() - .collect(); - } - self.immutable_f32_whitelist.borrow() - } } /// Search for an attribute by name in some webidl object's attributes.