From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../canvas-host/2d.canvas.host.initial.color.html | 27 +++++++ .../2d.canvas.host.initial.color.worker.js | 22 ++++++ .../2d.canvas.host.initial.reset.2dstate.html | 89 ++++++++++++++++++++++ .../2d.canvas.host.initial.reset.2dstate.worker.js | 84 ++++++++++++++++++++ .../2d.canvas.host.initial.reset.clip.html | 33 ++++++++ .../2d.canvas.host.initial.reset.clip.worker.js | 28 +++++++ .../2d.canvas.host.initial.reset.different.html | 31 ++++++++ ...d.canvas.host.initial.reset.different.worker.js | 26 +++++++ .../2d.canvas.host.initial.reset.gradient.html | 36 +++++++++ ...2d.canvas.host.initial.reset.gradient.worker.js | 31 ++++++++ .../2d.canvas.host.initial.reset.path.html | 32 ++++++++ .../2d.canvas.host.initial.reset.path.worker.js | 27 +++++++ .../2d.canvas.host.initial.reset.pattern.html | 36 +++++++++ .../2d.canvas.host.initial.reset.pattern.worker.js | 31 ++++++++ .../2d.canvas.host.initial.reset.same.html | 32 ++++++++ .../2d.canvas.host.initial.reset.same.worker.js | 27 +++++++ .../2d.canvas.host.initial.reset.transform.html | 32 ++++++++ ...d.canvas.host.initial.reset.transform.worker.js | 27 +++++++ .../canvas-host/2d.canvas.host.readonly.html | 31 ++++++++ .../canvas-host/2d.canvas.host.readonly.worker.js | 26 +++++++ .../canvas-host/2d.canvas.host.reference.html | 27 +++++++ .../canvas-host/2d.canvas.host.reference.worker.js | 22 ++++++ .../2d.canvas.host.size.attributes.default.html | 28 +++++++ ...d.canvas.host.size.attributes.default.worker.js | 23 ++++++ .../2d.canvas.host.size.attributes.idl.html | 42 ++++++++++ ...d.canvas.host.size.attributes.idl.set.zero.html | 30 ++++++++ ...vas.host.size.attributes.idl.set.zero.worker.js | 25 ++++++ .../2d.canvas.host.size.attributes.idl.worker.js | 37 +++++++++ ....canvas.host.size.attributes.parse.decimal.html | 30 ++++++++ ...as.host.size.attributes.parse.decimal.worker.js | 25 ++++++ .../2d.canvas.host.size.attributes.parse.em.html | 27 +++++++ ....canvas.host.size.attributes.parse.em.worker.js | 22 ++++++ ...2d.canvas.host.size.attributes.parse.empty.html | 30 ++++++++ ...nvas.host.size.attributes.parse.empty.worker.js | 25 ++++++ .../2d.canvas.host.size.attributes.parse.exp.html | 30 ++++++++ ...canvas.host.size.attributes.parse.exp.worker.js | 25 ++++++ .../2d.canvas.host.size.attributes.parse.hex.html | 30 ++++++++ ...canvas.host.size.attributes.parse.hex.worker.js | 25 ++++++ .../2d.canvas.host.size.attributes.parse.junk.html | 27 +++++++ ...anvas.host.size.attributes.parse.junk.worker.js | 22 ++++++ ...2d.canvas.host.size.attributes.parse.minus.html | 27 +++++++ ...nvas.host.size.attributes.parse.minus.worker.js | 22 ++++++ ...2d.canvas.host.size.attributes.parse.octal.html | 30 ++++++++ ...nvas.host.size.attributes.parse.octal.worker.js | 25 ++++++ ...anvas.host.size.attributes.parse.onlyspace.html | 30 ++++++++ ....host.size.attributes.parse.onlyspace.worker.js | 25 ++++++ ....canvas.host.size.attributes.parse.percent.html | 27 +++++++ ...as.host.size.attributes.parse.percent.worker.js | 22 ++++++ .../2d.canvas.host.size.attributes.parse.plus.html | 30 ++++++++ ...anvas.host.size.attributes.parse.plus.worker.js | 25 ++++++ ...2d.canvas.host.size.attributes.parse.space.html | 30 ++++++++ ...nvas.host.size.attributes.parse.space.worker.js | 25 ++++++ ...as.host.size.attributes.parse.trailingjunk.html | 27 +++++++ ...st.size.attributes.parse.trailingjunk.worker.js | 22 ++++++ ...nvas.host.size.attributes.parse.whitespace.html | 30 ++++++++ ...host.size.attributes.parse.whitespace.worker.js | 25 ++++++ .../2d.canvas.host.size.attributes.parse.zero.html | 30 ++++++++ ...anvas.host.size.attributes.parse.zero.worker.js | 25 ++++++ ...canvas.host.size.attributes.reflect.setidl.html | 30 ++++++++ ...s.host.size.attributes.reflect.setidl.worker.js | 25 ++++++ ...as.host.size.attributes.reflect.setidlzero.html | 30 ++++++++ ...st.size.attributes.reflect.setidlzero.worker.js | 25 ++++++ .../canvas-host/2d.canvas.host.size.large.html | 31 ++++++++ .../2d.canvas.host.size.large.worker.js | 26 +++++++ 64 files changed, 1904 insertions(+) create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.js (limited to 'testing/web-platform/tests/html/canvas/offscreen/canvas-host') diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.html new file mode 100644 index 0000000000..0793c74f39 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.color + + + + +

2d.canvas.host.initial.color

+

Initial state is transparent black

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.worker.js new file mode 100644 index 0000000000..11d6b9f098 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.color +// Description:Initial state is transparent black +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Initial state is transparent black"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertPixel(canvas, 20,20, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.html new file mode 100644 index 0000000000..36230dab77 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.html @@ -0,0 +1,89 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.2dstate + + + + +

2d.canvas.host.initial.reset.2dstate

+

Resetting the canvas state resets 2D state variables

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.worker.js new file mode 100644 index 0000000000..df0bd9f63c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.worker.js @@ -0,0 +1,84 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.2dstate +// Description:Resetting the canvas state resets 2D state variables +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Resetting the canvas state resets 2D state variables"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 100; + var default_val; + + default_val = ctx.strokeStyle; + ctx.strokeStyle = "#ff0000"; + canvas.width = 100; + _assertSame(ctx.strokeStyle, default_val, "ctx.strokeStyle", "default_val"); + + default_val = ctx.fillStyle; + ctx.fillStyle = "#ff0000"; + canvas.width = 100; + _assertSame(ctx.fillStyle, default_val, "ctx.fillStyle", "default_val"); + + default_val = ctx.globalAlpha; + ctx.globalAlpha = 0.5; + canvas.width = 100; + _assertSame(ctx.globalAlpha, default_val, "ctx.globalAlpha", "default_val"); + + default_val = ctx.lineWidth; + ctx.lineWidth = 0.5; + canvas.width = 100; + _assertSame(ctx.lineWidth, default_val, "ctx.lineWidth", "default_val"); + + default_val = ctx.lineCap; + ctx.lineCap = "round"; + canvas.width = 100; + _assertSame(ctx.lineCap, default_val, "ctx.lineCap", "default_val"); + + default_val = ctx.lineJoin; + ctx.lineJoin = "round"; + canvas.width = 100; + _assertSame(ctx.lineJoin, default_val, "ctx.lineJoin", "default_val"); + + default_val = ctx.miterLimit; + ctx.miterLimit = 0.5; + canvas.width = 100; + _assertSame(ctx.miterLimit, default_val, "ctx.miterLimit", "default_val"); + + default_val = ctx.shadowOffsetX; + ctx.shadowOffsetX = 5; + canvas.width = 100; + _assertSame(ctx.shadowOffsetX, default_val, "ctx.shadowOffsetX", "default_val"); + + default_val = ctx.shadowOffsetY; + ctx.shadowOffsetY = 5; + canvas.width = 100; + _assertSame(ctx.shadowOffsetY, default_val, "ctx.shadowOffsetY", "default_val"); + + default_val = ctx.shadowBlur; + ctx.shadowBlur = 5; + canvas.width = 100; + _assertSame(ctx.shadowBlur, default_val, "ctx.shadowBlur", "default_val"); + + default_val = ctx.shadowColor; + ctx.shadowColor = "#ff0000"; + canvas.width = 100; + _assertSame(ctx.shadowColor, default_val, "ctx.shadowColor", "default_val"); + + default_val = ctx.globalCompositeOperation; + ctx.globalCompositeOperation = "copy"; + canvas.width = 100; + _assertSame(ctx.globalCompositeOperation, default_val, "ctx.globalCompositeOperation", "default_val"); + + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.html new file mode 100644 index 0000000000..fc53240795 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.clip + + + + +

2d.canvas.host.initial.reset.clip

+

Resetting the canvas state resets the current clip region

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.worker.js new file mode 100644 index 0000000000..80554b0a3f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.clip +// Description:Resetting the canvas state resets the current clip region +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Resetting the canvas state resets the current clip region"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 100; + ctx.rect(0, 0, 1, 1); + ctx.clip(); + canvas.width = 100; + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 20,20, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.html new file mode 100644 index 0000000000..3771a5e37a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.different + + + + +

2d.canvas.host.initial.reset.different

+

Changing size resets canvas to transparent black

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.worker.js new file mode 100644 index 0000000000..6074d4f2a2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.different +// Description:Changing size resets canvas to transparent black +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Changing size resets canvas to transparent black"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 50, 50); + _assertPixel(canvas, 20,20, 255,0,0,255); + canvas.width = 50; + _assertPixel(canvas, 20,20, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.html new file mode 100644 index 0000000000..387b4d1f1e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.gradient + + + + +

2d.canvas.host.initial.reset.gradient

+

Resetting the canvas state does not invalidate any existing gradients

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.worker.js new file mode 100644 index 0000000000..9029b48056 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.gradient +// Description:Resetting the canvas state does not invalidate any existing gradients +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Resetting the canvas state does not invalidate any existing gradients"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 50; + var g = ctx.createLinearGradient(0, 0, 100, 0); + g.addColorStop(0, '#0f0'); + g.addColorStop(1, '#0f0'); + canvas.width = 100; + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.fillStyle = g; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.html new file mode 100644 index 0000000000..3a887a8f1f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.path + + + + +

2d.canvas.host.initial.reset.path

+

Resetting the canvas state resets the current path

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.worker.js new file mode 100644 index 0000000000..0ab12872ae --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.path +// Description:Resetting the canvas state resets the current path +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Resetting the canvas state resets the current path"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 100; + ctx.rect(0, 0, 100, 50); + canvas.width = 100; + ctx.fillStyle = '#f00'; + ctx.fill(); + _assertPixel(canvas, 20,20, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.html new file mode 100644 index 0000000000..d822f90917 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.pattern + + + + +

2d.canvas.host.initial.reset.pattern

+

Resetting the canvas state does not invalidate any existing patterns

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.worker.js new file mode 100644 index 0000000000..c4870a6f99 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.pattern +// Description:Resetting the canvas state does not invalidate any existing patterns +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Resetting the canvas state does not invalidate any existing patterns"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 30; + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 30, 50); + var p = ctx.createPattern(canvas, 'repeat-x'); + canvas.width = 100; + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.fillStyle = p; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.html new file mode 100644 index 0000000000..19394def37 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.same + + + + +

2d.canvas.host.initial.reset.same

+

Setting size (not changing the value) resets canvas to transparent black

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.worker.js new file mode 100644 index 0000000000..48d24750ac --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.same +// Description:Setting size (not changing the value) resets canvas to transparent black +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting size (not changing the value) resets canvas to transparent black"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 100; + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 50, 50); + _assertPixel(canvas, 20,20, 255,0,0,255); + canvas.width = 100; + _assertPixel(canvas, 20,20, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.html new file mode 100644 index 0000000000..ee3b5abf10 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.transform + + + + +

2d.canvas.host.initial.reset.transform

+

Resetting the canvas state resets the current transformation matrix

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.worker.js new file mode 100644 index 0000000000..218e64fa5d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.transform +// Description:Resetting the canvas state resets the current transformation matrix +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Resetting the canvas state resets the current transformation matrix"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 100; + ctx.scale(0.1, 0.1); + canvas.width = 100; + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 20,20, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.html new file mode 100644 index 0000000000..0e7e10cd24 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.canvas.host.readonly + + + + +

2d.canvas.host.readonly

+

canvas is readonly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.worker.js new file mode 100644 index 0000000000..bbe50dcf61 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.readonly +// Description:canvas is readonly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("canvas is readonly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + var d = ctx.canvas; + _assertDifferent(offscreenCanvas2, d, "offscreenCanvas2", "d"); + ctx.canvas = offscreenCanvas2; + _assertSame(ctx.canvas, d, "ctx.canvas", "d"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.html new file mode 100644 index 0000000000..b5de73f403 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.reference + + + + +

2d.canvas.host.reference

+

canvas refers back to its canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.worker.js new file mode 100644 index 0000000000..7a1f0c5ab4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.reference +// Description:canvas refers back to its canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("canvas refers back to its canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.canvas, canvas, "ctx.canvas", "canvas"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.html new file mode 100644 index 0000000000..dc7b894b20 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.default + + + + +

2d.canvas.host.size.attributes.default

+

Default width/height when attributes are missing

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.worker.js new file mode 100644 index 0000000000..78fce5aef8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.default +// Description:Default width/height when attributes are missing +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Default width/height when attributes are missing"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(canvas.width, 100, "canvas.width", "100"); + _assertSame(canvas.height, 50, "canvas.height", "50"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.html new file mode 100644 index 0000000000..7030103524 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.idl + + + + +

2d.canvas.host.size.attributes.idl

+

Getting/setting width/height IDL attributes

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.html new file mode 100644 index 0000000000..347c460cd7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.idl.set.zero + + + + +

2d.canvas.host.size.attributes.idl.set.zero

+

Setting width/height IDL attributes to 0

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.worker.js new file mode 100644 index 0000000000..21535da0eb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.idl.set.zero +// Description:Setting width/height IDL attributes to 0 +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting width/height IDL attributes to 0"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 0; + canvas.height = 0; + _assertSame(canvas.width, 0, "canvas.width", "0"); + _assertSame(canvas.height, 0, "canvas.height", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.worker.js new file mode 100644 index 0000000000..a00201f18c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.idl +// Description:Getting/setting width/height IDL attributes +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Getting/setting width/height IDL attributes"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = "100"; + canvas.height = "100"; + _assertSame(canvas.width, 100, "canvas.width", "100"); + _assertSame(canvas.height, 100, "canvas.height", "100"); + canvas.width = "+1.5e2"; + canvas.height = "0x96"; + _assertSame(canvas.width, 150, "canvas.width", "150"); + _assertSame(canvas.height, 150, "canvas.height", "150"); + canvas.width = 301.999; + canvas.height = 301.001; + _assertSame(canvas.width, 301, "canvas.width", "301"); + _assertSame(canvas.height, 301, "canvas.height", "301"); + assert_throws_js(TypeError, function() { canvas.width = "400x"; }); + assert_throws_js(TypeError, function() { canvas.height = "foo"; }); + _assertSame(canvas.width, 301, "canvas.width", "301"); + _assertSame(canvas.height, 301, "canvas.height", "301"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html new file mode 100644 index 0000000000..c3fa3b4ba6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.decimal + + + + +

2d.canvas.host.size.attributes.parse.decimal

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.worker.js new file mode 100644 index 0000000000..1267bb205a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.decimal +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = '100.999'; + canvas.height = '100.999'; + _assertSame(canvas.width, 100, "canvas.width", "100"); + _assertSame(canvas.height, 100, "canvas.height", "100"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html new file mode 100644 index 0000000000..ea6f811b8f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.em + + + + +

2d.canvas.host.size.attributes.parse.em

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js new file mode 100644 index 0000000000..2f0642d997 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.em +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { canvas.width = '100em'; }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.html new file mode 100644 index 0000000000..d38c159a6e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.empty + + + + +

2d.canvas.host.size.attributes.parse.empty

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.worker.js new file mode 100644 index 0000000000..b1eee3a5b2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.empty +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = ''; + canvas.height = ''; + _assertSame(canvas.width, 0, "canvas.width", "0"); + _assertSame(canvas.height, 0, "canvas.height", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.html new file mode 100644 index 0000000000..2aa8245a49 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.exp + + + + +

2d.canvas.host.size.attributes.parse.exp

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.worker.js new file mode 100644 index 0000000000..8c8b4cc715 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.exp +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = '100e1'; + canvas.height = '100e1'; + _assertSame(canvas.width, 1000.0, "canvas.width", "1000.0"); + _assertSame(canvas.height, 1000.0, "canvas.height", "1000.0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.html new file mode 100644 index 0000000000..4b0e47b53f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.hex + + + + +

2d.canvas.host.size.attributes.parse.hex

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.worker.js new file mode 100644 index 0000000000..b685aaffa2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.hex +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = '0x100'; + canvas.height = '0x100'; + _assertSame(canvas.width, 256, "canvas.width", "256"); + _assertSame(canvas.height, 256, "canvas.height", "256"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html new file mode 100644 index 0000000000..a619651f78 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.junk + + + + +

2d.canvas.host.size.attributes.parse.junk

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js new file mode 100644 index 0000000000..f4822f4bd9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.junk +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { canvas.width = '#!?'; }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html new file mode 100644 index 0000000000..c7f12fdb02 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.minus + + + + +

2d.canvas.host.size.attributes.parse.minus

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js new file mode 100644 index 0000000000..322b992eda --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.minus +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { canvas.width = '-100'; }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.html new file mode 100644 index 0000000000..7bfb7658d4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.octal + + + + +

2d.canvas.host.size.attributes.parse.octal

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.worker.js new file mode 100644 index 0000000000..ce518e35c7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.octal +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = '0100'; + canvas.height = '0100'; + _assertSame(canvas.width, 100, "canvas.width", "100"); + _assertSame(canvas.height, 100, "canvas.height", "100"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html new file mode 100644 index 0000000000..16dace16ea --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.onlyspace + + + + +

2d.canvas.host.size.attributes.parse.onlyspace

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.worker.js new file mode 100644 index 0000000000..c186a4c08b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.onlyspace +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = ' '; + canvas.height = ' '; + _assertSame(canvas.width, 0, "canvas.width", "0"); + _assertSame(canvas.height, 0, "canvas.height", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html new file mode 100644 index 0000000000..040a775ec7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.percent + + + + +

2d.canvas.host.size.attributes.parse.percent

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js new file mode 100644 index 0000000000..f38a1862d4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.percent +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { canvas.width = '100%'; }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.html new file mode 100644 index 0000000000..50c8467e2c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.plus + + + + +

2d.canvas.host.size.attributes.parse.plus

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.worker.js new file mode 100644 index 0000000000..bb45a1e4fa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.plus +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = '+100'; + canvas.height = '+100'; + _assertSame(canvas.width, 100, "canvas.width", "100"); + _assertSame(canvas.height, 100, "canvas.height", "100"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.html new file mode 100644 index 0000000000..cb1f3ae840 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.space + + + + +

2d.canvas.host.size.attributes.parse.space

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.worker.js new file mode 100644 index 0000000000..967a0939d8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.space +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = ' 100'; + canvas.height = ' 100'; + _assertSame(canvas.width, 100, "canvas.width", "100"); + _assertSame(canvas.height, 100, "canvas.height", "100"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html new file mode 100644 index 0000000000..8d8d481aef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.trailingjunk + + + + +

2d.canvas.host.size.attributes.parse.trailingjunk

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js new file mode 100644 index 0000000000..ffebcd97f1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.trailingjunk +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { canvas.width = '100#!?'; }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html new file mode 100644 index 0000000000..f6e29d6cb6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.whitespace + + + + +

2d.canvas.host.size.attributes.parse.whitespace

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.worker.js new file mode 100644 index 0000000000..fb7ba47975 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.whitespace +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = ' 100'; + canvas.height = ' 100'; + _assertSame(canvas.width, 100, "canvas.width", "100"); + _assertSame(canvas.height, 100, "canvas.height", "100"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.html new file mode 100644 index 0000000000..07e924a603 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.zero + + + + +

2d.canvas.host.size.attributes.parse.zero

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.worker.js new file mode 100644 index 0000000000..1363bff772 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.zero +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = '0'; + canvas.height = '0'; + _assertSame(canvas.width, 0, "canvas.width", "0"); + _assertSame(canvas.height, 0, "canvas.height", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.html new file mode 100644 index 0000000000..d24b2cc49f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.reflect.setidl + + + + +

2d.canvas.host.size.attributes.reflect.setidl

+

Setting IDL attributes updates IDL and content attributes

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.worker.js new file mode 100644 index 0000000000..3b3ced124a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.reflect.setidl +// Description:Setting IDL attributes updates IDL and content attributes +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting IDL attributes updates IDL and content attributes"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 120; + canvas.height = 60; + _assertSame(canvas.width, 120, "canvas.width", "120"); + _assertSame(canvas.height, 60, "canvas.height", "60"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.html new file mode 100644 index 0000000000..c4839afb0e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.reflect.setidlzero + + + + +

2d.canvas.host.size.attributes.reflect.setidlzero

+

Setting IDL attributes to 0 updates IDL and content attributes

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.worker.js new file mode 100644 index 0000000000..d440a9d807 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.reflect.setidlzero +// Description:Setting IDL attributes to 0 updates IDL and content attributes +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting IDL attributes to 0 updates IDL and content attributes"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 0; + canvas.height = 0; + _assertSame(canvas.width, 0, "canvas.width", "0"); + _assertSame(canvas.height, 0, "canvas.height", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.html new file mode 100644 index 0000000000..b220f8f2ed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.large + + + + +

2d.canvas.host.size.large

+

+ +

Not sure how reasonable this is, but the spec doesn't say there's an upper limit on the size. + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.js new file mode 100644 index 0000000000..a763704131 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.large +// Description: +// Note:

Not sure how reasonable this is, but the spec doesn't say there's an upper limit on the size. + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var n = 2147483647; // 2^31 - 1, which should be supported by any sensible definition of "long" + canvas.width = n; + canvas.height = n; + _assertSame(canvas.width, n, "canvas.width", "n"); + _assertSame(canvas.height, n, "canvas.height", "n"); + t.done(); +}); +done(); -- cgit v1.2.3