From c0a4eee1feace81a77c54d982943bb3e11172e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=BClker?= Date: Wed, 6 Nov 2024 15:37:26 +0100 Subject: [PATCH] Add [EnforceRange] on OffscreenCanvas width/height idl attribute (#34165) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add [EnforceRange] on OffscreenCanvas width/height idl attribute Fixes https://github.com/servo/servo/issues/34161 Signed-off-by: Simon Wülker * Update WPT expectations Signed-off-by: Simon Wülker --------- Signed-off-by: Simon Wülker --- components/script/dom/webidls/OffscreenCanvas.webidl | 4 ++-- .../2d.canvas.host.size.attributes.parse.em.html.ini | 3 --- .../2d.canvas.host.size.attributes.parse.em.worker.js.ini | 3 --- .../2d.canvas.host.size.attributes.parse.junk.html.ini | 3 --- .../2d.canvas.host.size.attributes.parse.junk.worker.js.ini | 3 --- .../2d.canvas.host.size.attributes.parse.minus.html.ini | 4 ---- .../2d.canvas.host.size.attributes.parse.minus.worker.js.ini | 3 --- .../2d.canvas.host.size.attributes.parse.percent.html.ini | 3 --- ...2d.canvas.host.size.attributes.parse.percent.worker.js.ini | 3 --- ...2d.canvas.host.size.attributes.parse.trailingjunk.html.ini | 3 --- ...nvas.host.size.attributes.parse.trailingjunk.worker.js.ini | 3 --- .../2d.canvas.host.size.invalid.attributes.idl.html.ini | 3 --- .../2d.canvas.host.size.invalid.attributes.idl.worker.js.ini | 3 --- .../the-offscreen-canvas/offscreencanvas.constructor.html.ini | 3 --- .../offscreencanvas.constructor.worker.js.ini | 3 --- 15 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html.ini delete mode 100644 tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js.ini delete mode 100644 tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html.ini delete mode 100644 tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js.ini delete mode 100644 tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html.ini delete mode 100644 tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js.ini delete mode 100644 tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html.ini delete mode 100644 tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js.ini delete mode 100644 tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html.ini delete mode 100644 tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js.ini delete mode 100644 tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.invalid.attributes.idl.html.ini delete mode 100644 tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.invalid.attributes.idl.worker.js.ini delete mode 100644 tests/wpt/meta/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.html.ini delete mode 100644 tests/wpt/meta/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.worker.js.ini diff --git a/components/script/dom/webidls/OffscreenCanvas.webidl b/components/script/dom/webidls/OffscreenCanvas.webidl index 8bb87b178f9..110af8a8f99 100644 --- a/components/script/dom/webidls/OffscreenCanvas.webidl +++ b/components/script/dom/webidls/OffscreenCanvas.webidl @@ -16,8 +16,8 @@ dictionary ImageEncodeOptions { [Exposed=(Window,Worker)/*, Transferable*/, Pref="dom.offscreen_canvas.enabled"] interface OffscreenCanvas : EventTarget { [Throws] constructor([EnforceRange] unsigned long long width, [EnforceRange] unsigned long long height); - attribute /*[EnforceRange]*/ unsigned long long width; - attribute /*[EnforceRange]*/ unsigned long long height; + attribute [EnforceRange] unsigned long long width; + attribute [EnforceRange] unsigned long long height; OffscreenRenderingContext? getContext(DOMString contextId, optional any options = null); //ImageBitmap transferToImageBitmap(); diff --git a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html.ini b/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html.ini deleted file mode 100644 index d8ccbed5caa..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[2d.canvas.host.size.attributes.parse.em.html] - [Parsing of non-negative integers] - expected: FAIL diff --git a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js.ini b/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js.ini deleted file mode 100644 index aa70cb2a565..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js.ini +++ /dev/null @@ -1,3 +0,0 @@ -[2d.canvas.host.size.attributes.parse.em.worker.html] - [Parsing of non-negative integers] - expected: FAIL diff --git a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html.ini b/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html.ini deleted file mode 100644 index 2c79d5c389f..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[2d.canvas.host.size.attributes.parse.junk.html] - [Parsing of non-negative integers] - expected: FAIL diff --git a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js.ini b/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js.ini deleted file mode 100644 index 3d1ba9cd750..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js.ini +++ /dev/null @@ -1,3 +0,0 @@ -[2d.canvas.host.size.attributes.parse.junk.worker.html] - [Parsing of non-negative integers] - expected: FAIL diff --git a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html.ini b/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html.ini deleted file mode 100644 index abcdc2821c8..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[2d.canvas.host.size.attributes.parse.minus.html] - expected: CRASH - [Parsing of non-negative integers] - expected: FAIL diff --git a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js.ini b/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js.ini deleted file mode 100644 index f40514bce36..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js.ini +++ /dev/null @@ -1,3 +0,0 @@ -[2d.canvas.host.size.attributes.parse.minus.worker.html] - [Parsing of non-negative integers] - expected: FAIL diff --git a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html.ini b/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html.ini deleted file mode 100644 index 83d334905c6..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[2d.canvas.host.size.attributes.parse.percent.html] - [Parsing of non-negative integers] - expected: FAIL diff --git a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js.ini b/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js.ini deleted file mode 100644 index 864ce77b029..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js.ini +++ /dev/null @@ -1,3 +0,0 @@ -[2d.canvas.host.size.attributes.parse.percent.worker.html] - [Parsing of non-negative integers] - expected: FAIL diff --git a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html.ini b/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html.ini deleted file mode 100644 index bbac2296e3d..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[2d.canvas.host.size.attributes.parse.trailingjunk.html] - [Parsing of non-negative integers] - expected: FAIL diff --git a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js.ini b/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js.ini deleted file mode 100644 index 3535cc12f38..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js.ini +++ /dev/null @@ -1,3 +0,0 @@ -[2d.canvas.host.size.attributes.parse.trailingjunk.worker.html] - [Parsing of non-negative integers] - expected: FAIL diff --git a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.invalid.attributes.idl.html.ini b/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.invalid.attributes.idl.html.ini deleted file mode 100644 index 672798f3f81..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.invalid.attributes.idl.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[2d.canvas.host.size.invalid.attributes.idl.html] - [Getting/setting width/height IDL attributes] - expected: FAIL diff --git a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.invalid.attributes.idl.worker.js.ini b/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.invalid.attributes.idl.worker.js.ini deleted file mode 100644 index acf2210f82b..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/canvas-host/2d.canvas.host.size.invalid.attributes.idl.worker.js.ini +++ /dev/null @@ -1,3 +0,0 @@ -[2d.canvas.host.size.invalid.attributes.idl.worker.html] - [Getting/setting width/height IDL attributes] - expected: FAIL diff --git a/tests/wpt/meta/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.html.ini b/tests/wpt/meta/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.html.ini deleted file mode 100644 index ab97c6fc5c9..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[offscreencanvas.constructor.html] - [Test that OffscreenCanvas constructor handles invalid arguments correctly] - expected: FAIL diff --git a/tests/wpt/meta/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.worker.js.ini b/tests/wpt/meta/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.worker.js.ini deleted file mode 100644 index dee7f75d061..00000000000 --- a/tests/wpt/meta/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.worker.js.ini +++ /dev/null @@ -1,3 +0,0 @@ -[offscreencanvas.constructor.worker.html] - [Test that OffscreenCanvas constructor handles invalid arguments correctly in a worker] - expected: FAIL