From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../2d.drawImage.detachedcanvas.html | 28 + ...nvasFilterObject.blur.exceptions.tentative.html | 22 +- ...r.canvasFilterObject.colorMatrix.tentative.html | 69 +- ...ponentTransfer.discrete.tentative-expected.html | 50 ++ ...bject.componentTransfer.discrete.tentative.html | 49 +- ...componentTransfer.gamma.tentative-expected.html | 44 ++ ...erObject.componentTransfer.gamma.tentative.html | 49 +- ...ponentTransfer.identity.tentative-expected.html | 27 + ...bject.componentTransfer.identity.tentative.html | 31 +- ...omponentTransfer.linear.tentative-expected.html | 43 ++ ...rObject.componentTransfer.linear.tentative.html | 40 +- ...componentTransfer.table.tentative-expected.html | 51 ++ ...erObject.componentTransfer.table.tentative.html | 49 +- ...Object.convolveMatrix.exceptions.tentative.html | 48 +- ...lterObject.dropShadow.exceptions.tentative.html | 320 +++++++--- ...er.canvasFilterObject.dropShadow.tentative.html | 56 +- ....gaussianBlur.isotropic.tentative-expected.html | 15 + ...terObject.gaussianBlur.isotropic.tentative.html | 20 + ...t.gaussianBlur.mostly-x.tentative-expected.html | 15 + ...lterObject.gaussianBlur.mostly-x.tentative.html | 20 + ...t.gaussianBlur.mostly-y.tentative-expected.html | 15 + ...lterObject.gaussianBlur.mostly-y.tentative.html | 20 + ....gaussianBlur.tentative.isotropic-expected.html | 15 - ...terObject.gaussianBlur.tentative.isotropic.html | 20 - ...t.gaussianBlur.tentative.mostly-x-expected.html | 15 - ...lterObject.gaussianBlur.tentative.mostly-x.html | 20 - ...t.gaussianBlur.tentative.mostly-y-expected.html | 15 - ...lterObject.gaussianBlur.tentative.mostly-y.html | 20 - ...ect.gaussianBlur.tentative.x-only-expected.html | 15 - ...FilterObject.gaussianBlur.tentative.x-only.html | 20 - ...ect.gaussianBlur.tentative.y-only-expected.html | 15 - ...FilterObject.gaussianBlur.tentative.y-only.html | 20 - ...ect.gaussianBlur.x-only.tentative-expected.html | 15 + ...FilterObject.gaussianBlur.x-only.tentative.html | 20 + ...ect.gaussianBlur.y-only.tentative-expected.html | 15 + ...FilterObject.gaussianBlur.y-only.tentative.html | 20 + ...lterObject.turbulence.inputTypes.tentative.html | 4 +- .../filters/2d.filter.layers.blur.exceptions.html | 37 ++ .../filters/2d.filter.layers.colorMatrix.html | 104 +++ ...layers.componentTransfer.discrete-expected.html | 50 ++ ...d.filter.layers.componentTransfer.discrete.html | 38 ++ ...er.layers.componentTransfer.gamma-expected.html | 44 ++ .../2d.filter.layers.componentTransfer.gamma.html | 41 ++ ...layers.componentTransfer.identity-expected.html | 27 + ...d.filter.layers.componentTransfer.identity.html | 34 + ...r.layers.componentTransfer.linear-expected.html | 44 ++ .../2d.filter.layers.componentTransfer.linear.html | 37 ++ ...er.layers.componentTransfer.table-expected.html | 51 ++ .../2d.filter.layers.componentTransfer.table.html | 38 ++ ...2d.filter.layers.convolveMatrix.exceptions.html | 60 ++ .../2d.filter.layers.dropShadow-expected.html | 57 ++ .../2d.filter.layers.dropShadow.exceptions.html | 269 ++++++++ .../filters/2d.filter.layers.dropShadow.html | 94 +++ ...ter.layers.gaussianBlur.isotropic-expected.html | 15 + .../2d.filter.layers.gaussianBlur.isotropic.html | 21 + ...lter.layers.gaussianBlur.mostly-x-expected.html | 15 + .../2d.filter.layers.gaussianBlur.mostly-x.html | 21 + ...lter.layers.gaussianBlur.mostly-y-expected.html | 15 + .../2d.filter.layers.gaussianBlur.mostly-y.html | 21 + ...filter.layers.gaussianBlur.x-only-expected.html | 15 + .../2d.filter.layers.gaussianBlur.x-only.html | 21 + ...filter.layers.gaussianBlur.y-only-expected.html | 15 + .../2d.filter.layers.gaussianBlur.y-only.html | 21 + .../2d.filter.layers.turbulence.inputTypes.html | 130 ++++ .../layers/2d.layer.ctm.filter-expected.html | 25 + .../canvas/element/layers/2d.layer.ctm.filter.html | 29 + .../element/layers/2d.layer.ctm.getTransform.html | 31 + .../2d.layer.ctm.resetTransform-expected.html | 19 + .../layers/2d.layer.ctm.resetTransform.html | 28 + .../layers/2d.layer.ctm.setTransform-expected.html | 20 + .../element/layers/2d.layer.ctm.setTransform.html | 28 + ...r.ctm.shadow-in-transformed-layer-expected.html | 27 + .../2d.layer.ctm.shadow-in-transformed-layer.html | 31 + .../layers/2d.layer.drawImage-expected.html | 29 + .../canvas/element/layers/2d.layer.drawImage.html | 33 + ....layer.global-states.filter.alpha.blending.html | 1 + ...layer.global-states.filter.alpha.composite.html | 1 + .../2d.layer.global-states.filter.alpha.html | 1 + ...2d.layer.global-states.filter.alpha.shadow.html | 1 + .../canvas-filter-object-turbulence-expected.html | 16 +- .../tentative/canvas-filter-object-turbulence.html | 14 +- ...nvasFilterObject.blur.exceptions.tentative.html | 22 +- ...ilterObject.blur.exceptions.tentative.worker.js | 22 +- ...r.canvasFilterObject.colorMatrix.tentative.html | 69 +- ...vasFilterObject.colorMatrix.tentative.worker.js | 69 +- ...ponentTransfer.discrete.tentative-expected.html | 50 ++ ...bject.componentTransfer.discrete.tentative.html | 53 +- ...ect.componentTransfer.discrete.tentative.w.html | 54 ++ ....componentTransfer.discrete.tentative.worker.js | 62 -- ...componentTransfer.gamma.tentative-expected.html | 44 ++ ...erObject.componentTransfer.gamma.tentative.html | 53 +- ...Object.componentTransfer.gamma.tentative.w.html | 57 ++ ...ect.componentTransfer.gamma.tentative.worker.js | 53 -- ...ponentTransfer.identity.tentative-expected.html | 27 + ...bject.componentTransfer.identity.tentative.html | 35 +- ...ect.componentTransfer.identity.tentative.w.html | 50 ++ ....componentTransfer.identity.tentative.worker.js | 40 -- ...omponentTransfer.linear.tentative-expected.html | 43 ++ ...rObject.componentTransfer.linear.tentative.html | 44 +- ...bject.componentTransfer.linear.tentative.w.html | 53 ++ ...ct.componentTransfer.linear.tentative.worker.js | 52 -- ...componentTransfer.table.tentative-expected.html | 51 ++ ...erObject.componentTransfer.table.tentative.html | 53 +- ...Object.componentTransfer.table.tentative.w.html | 54 ++ ...ect.componentTransfer.table.tentative.worker.js | 62 -- ...Object.convolveMatrix.exceptions.tentative.html | 48 +- ...t.convolveMatrix.exceptions.tentative.worker.js | 48 +- ...lterObject.dropShadow.exceptions.tentative.html | 320 +++++++--- ...bject.dropShadow.exceptions.tentative.worker.js | 320 +++++++--- ...er.canvasFilterObject.dropShadow.tentative.html | 56 +- ....canvasFilterObject.dropShadow.tentative.w.html | 56 +- ....gaussianBlur.isotropic.tentative-expected.html | 15 + ...terObject.gaussianBlur.isotropic.tentative.html | 23 + ...rObject.gaussianBlur.isotropic.tentative.w.html | 37 ++ ...t.gaussianBlur.mostly-x.tentative-expected.html | 15 + ...lterObject.gaussianBlur.mostly-x.tentative.html | 23 + ...erObject.gaussianBlur.mostly-x.tentative.w.html | 37 ++ ...t.gaussianBlur.mostly-y.tentative-expected.html | 15 + ...lterObject.gaussianBlur.mostly-y.tentative.html | 23 + ...erObject.gaussianBlur.mostly-y.tentative.w.html | 37 ++ ....gaussianBlur.tentative.isotropic-expected.html | 15 - ...terObject.gaussianBlur.tentative.isotropic.html | 23 - ...rObject.gaussianBlur.tentative.isotropic.w.html | 37 -- ...t.gaussianBlur.tentative.mostly-x-expected.html | 15 - ...lterObject.gaussianBlur.tentative.mostly-x.html | 23 - ...erObject.gaussianBlur.tentative.mostly-x.w.html | 37 -- ...t.gaussianBlur.tentative.mostly-y-expected.html | 15 - ...lterObject.gaussianBlur.tentative.mostly-y.html | 23 - ...erObject.gaussianBlur.tentative.mostly-y.w.html | 37 -- ...ect.gaussianBlur.tentative.x-only-expected.html | 15 - ...FilterObject.gaussianBlur.tentative.x-only.html | 23 - ...lterObject.gaussianBlur.tentative.x-only.w.html | 37 -- ...ect.gaussianBlur.tentative.y-only-expected.html | 15 - ...FilterObject.gaussianBlur.tentative.y-only.html | 23 - ...lterObject.gaussianBlur.tentative.y-only.w.html | 37 -- ...ect.gaussianBlur.x-only.tentative-expected.html | 15 + ...FilterObject.gaussianBlur.x-only.tentative.html | 23 + ...lterObject.gaussianBlur.x-only.tentative.w.html | 37 ++ ...ect.gaussianBlur.y-only.tentative-expected.html | 15 + ...FilterObject.gaussianBlur.y-only.tentative.html | 23 + ...lterObject.gaussianBlur.y-only.tentative.w.html | 37 ++ ...lterObject.turbulence.inputTypes.tentative.html | 4 +- ...bject.turbulence.inputTypes.tentative.worker.js | 4 +- .../filters/2d.filter.layers.blur.exceptions.html | 38 ++ .../2d.filter.layers.blur.exceptions.worker.js | 33 + .../filters/2d.filter.layers.colorMatrix.html | 105 +++ .../filters/2d.filter.layers.colorMatrix.worker.js | 100 +++ ...layers.componentTransfer.discrete-expected.html | 50 ++ ...d.filter.layers.componentTransfer.discrete.html | 41 ++ ...filter.layers.componentTransfer.discrete.w.html | 55 ++ ...er.layers.componentTransfer.gamma-expected.html | 44 ++ .../2d.filter.layers.componentTransfer.gamma.html | 44 ++ ...2d.filter.layers.componentTransfer.gamma.w.html | 58 ++ ...layers.componentTransfer.identity-expected.html | 27 + ...d.filter.layers.componentTransfer.identity.html | 37 ++ ...filter.layers.componentTransfer.identity.w.html | 51 ++ ...r.layers.componentTransfer.linear-expected.html | 44 ++ .../2d.filter.layers.componentTransfer.linear.html | 40 ++ ...d.filter.layers.componentTransfer.linear.w.html | 54 ++ ...er.layers.componentTransfer.table-expected.html | 51 ++ .../2d.filter.layers.componentTransfer.table.html | 41 ++ ...2d.filter.layers.componentTransfer.table.w.html | 55 ++ ...2d.filter.layers.convolveMatrix.exceptions.html | 61 ++ ...lter.layers.convolveMatrix.exceptions.worker.js | 56 ++ .../2d.filter.layers.dropShadow-expected.html | 57 ++ .../2d.filter.layers.dropShadow.exceptions.html | 270 ++++++++ ...d.filter.layers.dropShadow.exceptions.worker.js | 265 ++++++++ .../filters/2d.filter.layers.dropShadow.html | 97 +++ .../filters/2d.filter.layers.dropShadow.w.html | 111 ++++ ...ter.layers.gaussianBlur.isotropic-expected.html | 15 + .../2d.filter.layers.gaussianBlur.isotropic.html | 24 + .../2d.filter.layers.gaussianBlur.isotropic.w.html | 38 ++ ...lter.layers.gaussianBlur.mostly-x-expected.html | 15 + .../2d.filter.layers.gaussianBlur.mostly-x.html | 24 + .../2d.filter.layers.gaussianBlur.mostly-x.w.html | 38 ++ ...lter.layers.gaussianBlur.mostly-y-expected.html | 15 + .../2d.filter.layers.gaussianBlur.mostly-y.html | 24 + .../2d.filter.layers.gaussianBlur.mostly-y.w.html | 38 ++ ...filter.layers.gaussianBlur.x-only-expected.html | 15 + .../2d.filter.layers.gaussianBlur.x-only.html | 24 + .../2d.filter.layers.gaussianBlur.x-only.w.html | 38 ++ ...filter.layers.gaussianBlur.y-only-expected.html | 15 + .../2d.filter.layers.gaussianBlur.y-only.html | 24 + .../2d.filter.layers.gaussianBlur.y-only.w.html | 38 ++ .../2d.filter.layers.turbulence.inputTypes.html | 131 ++++ ...d.filter.layers.turbulence.inputTypes.worker.js | 126 ++++ .../layers/2d.layer.ctm.filter-expected.html | 25 + .../offscreen/layers/2d.layer.ctm.filter.html | 32 + .../offscreen/layers/2d.layer.ctm.filter.w.html | 46 ++ .../layers/2d.layer.ctm.getTransform.html | 32 + .../layers/2d.layer.ctm.getTransform.worker.js | 27 + .../2d.layer.ctm.resetTransform-expected.html | 19 + .../layers/2d.layer.ctm.resetTransform.html | 31 + .../layers/2d.layer.ctm.resetTransform.w.html | 45 ++ .../layers/2d.layer.ctm.setTransform-expected.html | 20 + .../layers/2d.layer.ctm.setTransform.html | 31 + .../layers/2d.layer.ctm.setTransform.w.html | 45 ++ ...r.ctm.shadow-in-transformed-layer-expected.html | 27 + .../2d.layer.ctm.shadow-in-transformed-layer.html | 34 + ...2d.layer.ctm.shadow-in-transformed-layer.w.html | 48 ++ .../layers/2d.layer.drawImage-expected.html | 29 + .../offscreen/layers/2d.layer.drawImage.html | 36 ++ .../offscreen/layers/2d.layer.drawImage.w.html | 50 ++ ....layer.global-states.filter.alpha.blending.html | 1 + ...ayer.global-states.filter.alpha.blending.w.html | 1 + ...layer.global-states.filter.alpha.composite.html | 1 + ...yer.global-states.filter.alpha.composite.w.html | 1 + .../2d.layer.global-states.filter.alpha.html | 1 + ...2d.layer.global-states.filter.alpha.shadow.html | 1 + ....layer.global-states.filter.alpha.shadow.w.html | 1 + .../2d.layer.global-states.filter.alpha.w.html | 1 + .../tests/html/canvas/tools/gentestutilsunion.py | 213 ++++--- .../html/canvas/tools/name2dir-offscreen.yaml | 2 +- .../yaml-new/drawing-images-to-the-canvas.yaml | 8 + .../tests/html/canvas/tools/yaml-new/filters.yaml | 706 +++++++++++++++------ .../tests/html/canvas/tools/yaml-new/layers.yaml | 204 +++++- 216 files changed, 8055 insertions(+), 1967 deletions(-) create mode 100644 testing/web-platform/tests/html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.detachedcanvas.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative.html delete mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic-expected.html delete mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.html delete mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x-expected.html delete mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.html delete mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y-expected.html delete mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.html delete mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only-expected.html delete mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.html delete mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only-expected.html delete mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.blur.exceptions.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.colorMatrix.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.discrete-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.discrete.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.gamma-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.gamma.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.identity-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.identity.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.linear-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.linear.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.table-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.table.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.convolveMatrix.exceptions.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.exceptions.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.isotropic-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.isotropic.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-x-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-x.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-y-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-y.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.x-only-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.x-only.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.y-only-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.y-only.html create mode 100644 testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.turbulence.inputTypes.html create mode 100644 testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.filter-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.filter.html create mode 100644 testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.getTransform.html create mode 100644 testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.resetTransform-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.resetTransform.html create mode 100644 testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.setTransform-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.setTransform.html create mode 100644 testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.shadow-in-transformed-layer-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.shadow-in-transformed-layer.html create mode 100644 testing/web-platform/tests/html/canvas/element/layers/2d.layer.drawImage-expected.html create mode 100644 testing/web-platform/tests/html/canvas/element/layers/2d.layer.drawImage.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.w.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.w.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.w.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.w.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.w.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative.w.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic-expected.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.w.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x-expected.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.w.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y-expected.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.w.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only-expected.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.w.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only-expected.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.html delete mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.blur.exceptions.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.blur.exceptions.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.colorMatrix.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.colorMatrix.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.convolveMatrix.exceptions.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.convolveMatrix.exceptions.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.isotropic-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.isotropic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.isotropic.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-x-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-x.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-x.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-y-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-y.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-y.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.x-only-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.x-only.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.x-only.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.y-only-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.y-only.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.y-only.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.turbulence.inputTypes.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.turbulence.inputTypes.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.getTransform.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.getTransform.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.resetTransform-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.resetTransform.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.resetTransform.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.setTransform-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.setTransform.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.setTransform.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.shadow-in-transformed-layer-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.shadow-in-transformed-layer.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.shadow-in-transformed-layer.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.drawImage-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.drawImage.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.drawImage.w.html (limited to 'testing/web-platform/tests/html/canvas') diff --git a/testing/web-platform/tests/html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.detachedcanvas.html b/testing/web-platform/tests/html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.detachedcanvas.html new file mode 100644 index 0000000000..e301537330 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.detachedcanvas.html @@ -0,0 +1,28 @@ + + +Canvas test: 2d.drawImage.detachedcanvas + + + + + + +

2d.drawImage.detachedcanvas

+

drawImage with detached OffscreenCanvas as the source should throw exception

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html index 42fb1ee8f8..dc94792867 100644 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html @@ -8,7 +8,7 @@

2d.filter.canvasFilterObject.blur.exceptions.tentative

-

Test exceptions on CanvasFilter() blur.object

+

Test exceptions on gaussianBlur filter

Actual output:

@@ -16,15 +16,21 @@ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.html index b2f6a6ac97..56cf1bf0b1 100644 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.html +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.html @@ -8,7 +8,7 @@

2d.filter.canvasFilterObject.colorMatrix.tentative

-

Test the functionality of ColorMatrix filters in CanvasFilter objects

+

Test the functionality of ColorMatrix filters

Actual output:

@@ -16,41 +16,70 @@ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html index b392b189f2..0a4830568b 100644 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html @@ -1,41 +1,16 @@ + + Canvas test: 2d.filter.canvasFilterObject.componentTransfer.discrete.tentative - - - - - -

2d.filter.canvasFilterObject.componentTransfer.discrete.tentative

Test pixels on CanvasFilter() componentTransfer with discrete type

- - -

Actual output:

-

FAIL (fallback content)

- - + +

FAIL (fallback content)

+
- diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative-expected.html new file mode 100644 index 0000000000..5adc9f53e2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative-expected.html @@ -0,0 +1,44 @@ + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.gamma.tentative +

2d.filter.canvasFilterObject.componentTransfer.gamma.tentative

+

Test pixels on CanvasFilter() componentTransfer with gamma type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html index e5bff7e44d..22e3abe624 100644 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html @@ -1,40 +1,27 @@ + + Canvas test: 2d.filter.canvasFilterObject.componentTransfer.gamma.tentative - - - - - -

2d.filter.canvasFilterObject.componentTransfer.gamma.tentative

Test pixels on CanvasFilter() componentTransfer with gamma type

- - -

Actual output:

-

FAIL (fallback content)

- - + +

FAIL (fallback content)

+
- diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative-expected.html new file mode 100644 index 0000000000..895d531206 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative-expected.html @@ -0,0 +1,27 @@ + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.identity.tentative +

2d.filter.canvasFilterObject.componentTransfer.identity.tentative

+

Test pixels on CanvasFilter() componentTransfer with identity type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html index ecd3830be3..17761ce31a 100644 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html @@ -1,23 +1,15 @@ + Canvas test: 2d.filter.canvasFilterObject.componentTransfer.identity.tentative - - - - - -

2d.filter.canvasFilterObject.componentTransfer.identity.tentative

Test pixels on CanvasFilter() componentTransfer with identity type

- - -

Actual output:

-

FAIL (fallback content)

- - + +

FAIL (fallback content)

+
- diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative-expected.html new file mode 100644 index 0000000000..c4ad790d56 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative-expected.html @@ -0,0 +1,43 @@ + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.linear.tentative +

2d.filter.canvasFilterObject.componentTransfer.linear.tentative

+

Test pixels on CanvasFilter() componentTransfer with linear type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html index 8708887f6a..5ea5f8e0e3 100644 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html @@ -1,32 +1,16 @@ + + Canvas test: 2d.filter.canvasFilterObject.componentTransfer.linear.tentative - - - - - -

2d.filter.canvasFilterObject.componentTransfer.linear.tentative

Test pixels on CanvasFilter() componentTransfer with linear type

- - -

Actual output:

-

FAIL (fallback content)

- - + +

FAIL (fallback content)

+
- diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative-expected.html new file mode 100644 index 0000000000..29e250614c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative-expected.html @@ -0,0 +1,51 @@ + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.table.tentative +

2d.filter.canvasFilterObject.componentTransfer.table.tentative

+

Test pixels on CanvasFilter() componentTransfer with table type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html index 4b296d9fd7..0f74d9c3bf 100644 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html @@ -1,41 +1,16 @@ + + Canvas test: 2d.filter.canvasFilterObject.componentTransfer.table.tentative - - - - - -

2d.filter.canvasFilterObject.componentTransfer.table.tentative

Test pixels on CanvasFilter() componentTransfer with table type

- - -

Actual output:

-

FAIL (fallback content)

- - + +

FAIL (fallback content)

+
- diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html index b80600c141..a288541057 100644 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html @@ -19,23 +19,39 @@ var t = async_test("Test exceptions on CanvasFilter() convolveMatrix"); _addTest(function(canvas, ctx) { - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', divisor: 2}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: null}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: 1}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], [0]]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 'a'], [0]]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], 0]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], [0, Infinity]]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: []}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [1]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [1, 2, 3, 4]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[], []]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 2], []]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[], [1, 2]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', divisor: 2}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: null}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: 1}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 0], [0]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 'a'], [0]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 0], 0]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 0], [0, Infinity]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: []}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [1]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [1, 2, 3, 4]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[], []]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 2], []]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[], [1, 2]]}); }); // This should not throw an error - ctx.filter = new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[]]}); - ctx.filter = new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1]]}); + ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[]]}); + ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1]]}); }); diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html index 8c07a72b2b..05984a47f8 100644 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html @@ -19,104 +19,250 @@ var t = async_test("Test exceptions on CanvasFilter() dropShadow object"); _addTest(function(canvas, ctx) { + // Should not throw an error. // dx - _assert(new CanvasFilter({name: 'dropShadow', dx: 10}), "new CanvasFilter({name: 'dropShadow', dx: 10})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: -1}), "new CanvasFilter({name: 'dropShadow', dx: -1})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: 0.5}), "new CanvasFilter({name: 'dropShadow', dx: 0.5})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: null}), "new CanvasFilter({name: 'dropShadow', dx: null})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: true}), "new CanvasFilter({name: 'dropShadow', dx: true})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: false}), "new CanvasFilter({name: 'dropShadow', dx: false})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: []}), "new CanvasFilter({name: 'dropShadow', dx: []})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: [20]}), "new CanvasFilter({name: 'dropShadow', dx: [\""+(20)+"\"]})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: '30'}), "new CanvasFilter({name: 'dropShadow', dx: '30'})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: '30'}); // dy - _assert(new CanvasFilter({name: 'dropShadow', dy: 10}), "new CanvasFilter({name: 'dropShadow', dy: 10})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: -1}), "new CanvasFilter({name: 'dropShadow', dy: -1})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: 0.5}), "new CanvasFilter({name: 'dropShadow', dy: 0.5})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: null}), "new CanvasFilter({name: 'dropShadow', dy: null})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: true}), "new CanvasFilter({name: 'dropShadow', dy: true})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: false}), "new CanvasFilter({name: 'dropShadow', dy: false})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: []}), "new CanvasFilter({name: 'dropShadow', dy: []})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: [20]}), "new CanvasFilter({name: 'dropShadow', dy: [\""+(20)+"\"]})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: '30'}), "new CanvasFilter({name: 'dropShadow', dy: '30'})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: '30'}); // floodOpacity - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: 10}), "new CanvasFilter({name: 'dropShadow', floodOpacity: 10})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: -1}), "new CanvasFilter({name: 'dropShadow', floodOpacity: -1})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: 0.5}), "new CanvasFilter({name: 'dropShadow', floodOpacity: 0.5})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: null}), "new CanvasFilter({name: 'dropShadow', floodOpacity: null})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: true}), "new CanvasFilter({name: 'dropShadow', floodOpacity: true})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: false}), "new CanvasFilter({name: 'dropShadow', floodOpacity: false})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: []}), "new CanvasFilter({name: 'dropShadow', floodOpacity: []})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: [20]}), "new CanvasFilter({name: 'dropShadow', floodOpacity: [\""+(20)+"\"]})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: '30'}), "new CanvasFilter({name: 'dropShadow', floodOpacity: '30'})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: '30'}); + // dx + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: '30'}); + // dy + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: '30'}); + // floodOpacity + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: '30'}); // stdDeviation - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: 10}), "new CanvasFilter({name: 'dropShadow', stdDeviation: 10})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: -1}), "new CanvasFilter({name: 'dropShadow', stdDeviation: -1})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: 0.5}), "new CanvasFilter({name: 'dropShadow', stdDeviation: 0.5})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: null}), "new CanvasFilter({name: 'dropShadow', stdDeviation: null})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: true}), "new CanvasFilter({name: 'dropShadow', stdDeviation: true})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: false}), "new CanvasFilter({name: 'dropShadow', stdDeviation: false})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: []}), "new CanvasFilter({name: 'dropShadow', stdDeviation: []})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [20]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [\""+(20)+"\"]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: '30'}), "new CanvasFilter({name: 'dropShadow', stdDeviation: '30'})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [10, -1]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [10, -1]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [0.5, null]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [0.5, null]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [true, false]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [true, false]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [[], [20]]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [[], [\""+(20)+"\"]]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: ['30', ['40']]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: ['30', ['40']]})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: '30'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [10, -1]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [0.5, null]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [true, false]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [[], [20]]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: ['30', ['40']]}); // floodColor - _assert(new CanvasFilter({name: 'dropShadow', floodColor: 'red'}), "new CanvasFilter({name: 'dropShadow', floodColor: 'red'})"); - _assert(new CanvasFilter({name: 'dropShadow', floodColor: 'canvas'}), "new CanvasFilter({name: 'dropShadow', floodColor: 'canvas'})"); - _assert(new CanvasFilter({name: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'}), "new CanvasFilter({name: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'})"); - _assert(new CanvasFilter({name: 'dropShadow', floodColor: '#aabbccdd'}), "new CanvasFilter({name: 'dropShadow', floodColor: '#aabbccdd'})"); - _assert(new CanvasFilter({name: 'dropShadow', floodColor: '#abcd'}), "new CanvasFilter({name: 'dropShadow', floodColor: '#abcd'})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'red'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'canvas'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: '#aabbccdd'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: '#abcd'}); + // Should throw a TypeError. // dx - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: NaN}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: -Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: {}}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: [1, 2]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: -Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: {}}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: [1, 2]}); }); // dy - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: NaN}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: -Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: {}}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: [1, 2]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: -Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: {}}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: [1, 2]}); }); // floodOpacity - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: NaN}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: -Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: {}}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: [1, 2]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: -Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: {}}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: [1, 2]}); }); // stdDeviation - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: NaN}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: -Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: {}}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, 2, 3]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, NaN]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, Infinity]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, -Infinity]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, undefined]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, 'test']}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, {}]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, [2, 3]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: -Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: {}}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, 2, 3]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, NaN]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, Infinity]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, -Infinity]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, undefined]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, 'test']}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, {}]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, [2, 3]]}); }); // floodColor - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: 'rgba(NaN, 3, 2, 1)'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: 10}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: null}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'rgba(NaN, 3, 2, 1)'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 10}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: null}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: NaN}); }); }); diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html index 47bb891b3f..d6e7066473 100644 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html @@ -22,86 +22,58 @@ // Parameter defaults. ctx.filter = new CanvasFilter({name: 'dropShadow'}); ctx.fillRect(10, 10, 80, 80); - // All parameters specified. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, floodColor: 'purple', floodOpacity: 0.7}); ctx.fillRect(110, 10, 80, 80); - // Named color. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'purple'}); ctx.fillRect(10, 110, 80, 80); - // System color. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'LinkText'}); ctx.fillRect(110, 110, 80, 80); - // Numerical color. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'rgba(20, 50, 130, 1)'}); ctx.fillRect(210, 110, 80, 80); - // Transparent floodColor. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'rgba(20, 50, 130, 0.7)'}); ctx.fillRect(310, 110, 80, 80); - // Transparent floodColor and floodOpacity. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'rgba(20, 50, 130, 0.7)', floodOpacity: 0.7}); ctx.fillRect(410, 110, 80, 80); - // No blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 0, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 0, floodColor: 'purple'}); ctx.fillRect(10, 210, 80, 80); - // Single float blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, floodColor: 'purple'}); ctx.fillRect(110, 210, 80, 80); - // Single negative float blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: -5, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: -5, floodColor: 'purple'}); ctx.fillRect(210, 210, 80, 80); - // Two floats (X&Y) blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [3, 5], + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [3, 5], floodColor: 'purple'}); ctx.fillRect(310, 210, 80, 80); - // Two negative floats (X&Y) blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [-3, -5], + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [-3, -5], floodColor: 'purple'}); ctx.fillRect(410, 210, 80, 80); - // Degenerate parameter values. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: [-5], dy: [], stdDeviation: null, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: [-5], dy: [], stdDeviation: null, floodColor: 'purple', floodOpacity: [2]}); ctx.fillRect(10, 310, 80, 80); - - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: null, dy: '5', stdDeviation: [[-5], ['3']], + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: null, dy: '5', stdDeviation: [[-5], ['3']], floodColor: 'purple', floodOpacity: '0.8'}); ctx.fillRect(110, 310, 80, 80); - - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: true, dy: ['10'], stdDeviation: false, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: true, dy: ['10'], stdDeviation: false, floodColor: 'purple', floodOpacity: ['0.4']}); ctx.fillRect(210, 310, 80, 80); diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative-expected.html new file mode 100644 index 0000000000..dac31c97f1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative +

2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative.html new file mode 100644 index 0000000000..f4c8c1033a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative.html @@ -0,0 +1,20 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative +

2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative-expected.html new file mode 100644 index 0000000000..88d0cb2de2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative +

2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative.html new file mode 100644 index 0000000000..b3efcb8c3e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative.html @@ -0,0 +1,20 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative +

2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative-expected.html new file mode 100644 index 0000000000..744983d4ae --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative +

2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative.html new file mode 100644 index 0000000000..d5cc6e0058 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative.html @@ -0,0 +1,20 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative +

2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic-expected.html deleted file mode 100644 index f9571f208e..0000000000 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic-expected.html +++ /dev/null @@ -1,15 +0,0 @@ - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic -

2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic

-

Test CanvasFilter() with gaussianBlur.

- - - - - - - diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.html deleted file mode 100644 index 6376d07b0e..0000000000 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.html +++ /dev/null @@ -1,20 +0,0 @@ - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic -

2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x-expected.html deleted file mode 100644 index e76613271f..0000000000 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x-expected.html +++ /dev/null @@ -1,15 +0,0 @@ - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x -

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x

-

Test CanvasFilter() with gaussianBlur.

- - - - - - - diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.html deleted file mode 100644 index 145cb32757..0000000000 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.html +++ /dev/null @@ -1,20 +0,0 @@ - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x -

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y-expected.html deleted file mode 100644 index 0f214fca9f..0000000000 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y-expected.html +++ /dev/null @@ -1,15 +0,0 @@ - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y -

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y

-

Test CanvasFilter() with gaussianBlur.

- - - - - - - diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.html deleted file mode 100644 index e921e0eaa6..0000000000 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.html +++ /dev/null @@ -1,20 +0,0 @@ - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y -

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only-expected.html deleted file mode 100644 index 285a641726..0000000000 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only-expected.html +++ /dev/null @@ -1,15 +0,0 @@ - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only -

2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only

-

Test CanvasFilter() with gaussianBlur.

- - - - - - - diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.html deleted file mode 100644 index fd6ac687f9..0000000000 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.html +++ /dev/null @@ -1,20 +0,0 @@ - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only -

2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only-expected.html deleted file mode 100644 index d59945b5da..0000000000 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only-expected.html +++ /dev/null @@ -1,15 +0,0 @@ - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only -

2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only

-

Test CanvasFilter() with gaussianBlur.

- - - - - - - diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.html deleted file mode 100644 index 6442433e7c..0000000000 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.html +++ /dev/null @@ -1,20 +0,0 @@ - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only -

2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative-expected.html new file mode 100644 index 0000000000..e611113e42 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative +

2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative.html new file mode 100644 index 0000000000..4e8576fe74 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative.html @@ -0,0 +1,20 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative +

2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative-expected.html new file mode 100644 index 0000000000..c6d915cb07 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative +

2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative.html new file mode 100644 index 0000000000..ec0a2353cf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative.html @@ -0,0 +1,20 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative +

2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html index c24cfd2398..b85add4b66 100644 --- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html @@ -116,12 +116,12 @@ _addTest(function(canvas, ctx) { for (testCase of errorTestCases) { const filterOptions = {...{name: 'turbulence'}, ...testCase}; - assert_throws_js(TypeError, function() { new CanvasFilter(filterOptions); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter(filterOptions); }); } for (testCase of workingTestCases) { const filterOptions = {...{name: 'turbulence'}, ...testCase}; - _assert(new CanvasFilter(filterOptions) != null, "new CanvasFilter(filterOptions) != null"); + ctx.filter = new CanvasFilter(filterOptions); } }); diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.blur.exceptions.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.blur.exceptions.html new file mode 100644 index 0000000000..7176a7d0a4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.blur.exceptions.html @@ -0,0 +1,37 @@ + + +Canvas test: 2d.filter.layers.blur.exceptions + + + + + + +

2d.filter.layers.blur.exceptions

+

Test exceptions on gaussianBlur filter

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.colorMatrix.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.colorMatrix.html new file mode 100644 index 0000000000..ef0ae0f949 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.colorMatrix.html @@ -0,0 +1,104 @@ + + +Canvas test: 2d.filter.layers.colorMatrix + + + + + + +

2d.filter.layers.colorMatrix

+

Test the functionality of ColorMatrix filters

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.discrete-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.discrete-expected.html new file mode 100644 index 0000000000..8419953b3d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.discrete-expected.html @@ -0,0 +1,50 @@ + + +Canvas test: 2d.filter.layers.componentTransfer.discrete +

2d.filter.layers.componentTransfer.discrete

+

Test pixels on CanvasFilter() componentTransfer with discrete type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.discrete.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.discrete.html new file mode 100644 index 0000000000..ef9db79547 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.discrete.html @@ -0,0 +1,38 @@ + + + + +Canvas test: 2d.filter.layers.componentTransfer.discrete +

2d.filter.layers.componentTransfer.discrete

+

Test pixels on CanvasFilter() componentTransfer with discrete type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.gamma-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.gamma-expected.html new file mode 100644 index 0000000000..3e5d980896 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.gamma-expected.html @@ -0,0 +1,44 @@ + + +Canvas test: 2d.filter.layers.componentTransfer.gamma +

2d.filter.layers.componentTransfer.gamma

+

Test pixels on CanvasFilter() componentTransfer with gamma type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.gamma.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.gamma.html new file mode 100644 index 0000000000..cccd07e92b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.gamma.html @@ -0,0 +1,41 @@ + + + + +Canvas test: 2d.filter.layers.componentTransfer.gamma +

2d.filter.layers.componentTransfer.gamma

+

Test pixels on CanvasFilter() componentTransfer with gamma type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.identity-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.identity-expected.html new file mode 100644 index 0000000000..9f1439f37b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.identity-expected.html @@ -0,0 +1,27 @@ + + +Canvas test: 2d.filter.layers.componentTransfer.identity +

2d.filter.layers.componentTransfer.identity

+

Test pixels on CanvasFilter() componentTransfer with identity type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.identity.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.identity.html new file mode 100644 index 0000000000..3a06353849 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.identity.html @@ -0,0 +1,34 @@ + + + +Canvas test: 2d.filter.layers.componentTransfer.identity +

2d.filter.layers.componentTransfer.identity

+

Test pixels on CanvasFilter() componentTransfer with identity type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.linear-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.linear-expected.html new file mode 100644 index 0000000000..f922055ff2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.linear-expected.html @@ -0,0 +1,44 @@ + + +Canvas test: 2d.filter.layers.componentTransfer.linear +

2d.filter.layers.componentTransfer.linear

+

Test pixels on CanvasFilter() componentTransfer with linear type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.linear.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.linear.html new file mode 100644 index 0000000000..c9e744ebef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.linear.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.filter.layers.componentTransfer.linear +

2d.filter.layers.componentTransfer.linear

+

Test pixels on CanvasFilter() componentTransfer with linear type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.table-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.table-expected.html new file mode 100644 index 0000000000..0f6736d87d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.table-expected.html @@ -0,0 +1,51 @@ + + +Canvas test: 2d.filter.layers.componentTransfer.table +

2d.filter.layers.componentTransfer.table

+

Test pixels on CanvasFilter() componentTransfer with table type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.table.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.table.html new file mode 100644 index 0000000000..eae036b142 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.table.html @@ -0,0 +1,38 @@ + + + + +Canvas test: 2d.filter.layers.componentTransfer.table +

2d.filter.layers.componentTransfer.table

+

Test pixels on CanvasFilter() componentTransfer with table type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.convolveMatrix.exceptions.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.convolveMatrix.exceptions.html new file mode 100644 index 0000000000..ae45cb865c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.convolveMatrix.exceptions.html @@ -0,0 +1,60 @@ + + +Canvas test: 2d.filter.layers.convolveMatrix.exceptions + + + + + + +

2d.filter.layers.convolveMatrix.exceptions

+

Test exceptions on CanvasFilter() convolveMatrix

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow-expected.html new file mode 100644 index 0000000000..1719d99b4a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow-expected.html @@ -0,0 +1,57 @@ + + +Canvas test: 2d.filter.layers.dropShadow +

2d.filter.layers.dropShadow

+

Test CanvasFilter() dropShadow object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.exceptions.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.exceptions.html new file mode 100644 index 0000000000..df5e0c7dc3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.exceptions.html @@ -0,0 +1,269 @@ + + +Canvas test: 2d.filter.layers.dropShadow.exceptions + + + + + + +

2d.filter.layers.dropShadow.exceptions

+

Test exceptions on CanvasFilter() dropShadow object

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.html new file mode 100644 index 0000000000..ceb20bb9eb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.html @@ -0,0 +1,94 @@ + + + +Canvas test: 2d.filter.layers.dropShadow +

2d.filter.layers.dropShadow

+

Test CanvasFilter() dropShadow object.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.isotropic-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.isotropic-expected.html new file mode 100644 index 0000000000..4f93754862 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.isotropic-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.layers.gaussianBlur.isotropic +

2d.filter.layers.gaussianBlur.isotropic

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.isotropic.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.isotropic.html new file mode 100644 index 0000000000..a2cc098896 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.isotropic.html @@ -0,0 +1,21 @@ + + + +Canvas test: 2d.filter.layers.gaussianBlur.isotropic +

2d.filter.layers.gaussianBlur.isotropic

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-x-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-x-expected.html new file mode 100644 index 0000000000..255270c192 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-x-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.layers.gaussianBlur.mostly-x +

2d.filter.layers.gaussianBlur.mostly-x

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-x.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-x.html new file mode 100644 index 0000000000..0090e0e71e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-x.html @@ -0,0 +1,21 @@ + + + +Canvas test: 2d.filter.layers.gaussianBlur.mostly-x +

2d.filter.layers.gaussianBlur.mostly-x

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-y-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-y-expected.html new file mode 100644 index 0000000000..76a46b1533 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-y-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.layers.gaussianBlur.mostly-y +

2d.filter.layers.gaussianBlur.mostly-y

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-y.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-y.html new file mode 100644 index 0000000000..5c481cbe25 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.mostly-y.html @@ -0,0 +1,21 @@ + + + +Canvas test: 2d.filter.layers.gaussianBlur.mostly-y +

2d.filter.layers.gaussianBlur.mostly-y

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.x-only-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.x-only-expected.html new file mode 100644 index 0000000000..26741f9847 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.x-only-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.layers.gaussianBlur.x-only +

2d.filter.layers.gaussianBlur.x-only

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.x-only.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.x-only.html new file mode 100644 index 0000000000..f7940eb921 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.x-only.html @@ -0,0 +1,21 @@ + + + +Canvas test: 2d.filter.layers.gaussianBlur.x-only +

2d.filter.layers.gaussianBlur.x-only

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.y-only-expected.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.y-only-expected.html new file mode 100644 index 0000000000..d00eec6b57 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.y-only-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.layers.gaussianBlur.y-only +

2d.filter.layers.gaussianBlur.y-only

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.y-only.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.y-only.html new file mode 100644 index 0000000000..59421a1ff3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.gaussianBlur.y-only.html @@ -0,0 +1,21 @@ + + + +Canvas test: 2d.filter.layers.gaussianBlur.y-only +

2d.filter.layers.gaussianBlur.y-only

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.turbulence.inputTypes.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.turbulence.inputTypes.html new file mode 100644 index 0000000000..26dceaae16 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.turbulence.inputTypes.html @@ -0,0 +1,130 @@ + + +Canvas test: 2d.filter.layers.turbulence.inputTypes + + + + + + +

2d.filter.layers.turbulence.inputTypes

+

Test exceptions on CanvasFilter() turbulence object

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.filter-expected.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.filter-expected.html new file mode 100644 index 0000000000..5fc1ac9acd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.filter-expected.html @@ -0,0 +1,25 @@ + + +Canvas test: 2d.layer.ctm.filter +

2d.layer.ctm.filter

+

Checks that parent transforms affect layer filters.

+ + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.filter.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.filter.html new file mode 100644 index 0000000000..3d56ac3601 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.filter.html @@ -0,0 +1,29 @@ + + + +Canvas test: 2d.layer.ctm.filter +

2d.layer.ctm.filter

+

Checks that parent transforms affect layer filters.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.getTransform.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.getTransform.html new file mode 100644 index 0000000000..7a69c59527 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.getTransform.html @@ -0,0 +1,31 @@ + + +Canvas test: 2d.layer.ctm.getTransform + + + + + + +

2d.layer.ctm.getTransform

+

Tests getTransform inside layers.

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.resetTransform-expected.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.resetTransform-expected.html new file mode 100644 index 0000000000..fd4c1746c7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.resetTransform-expected.html @@ -0,0 +1,19 @@ + + +Canvas test: 2d.layer.ctm.resetTransform +

2d.layer.ctm.resetTransform

+

Tests resetTransform inside layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.resetTransform.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.resetTransform.html new file mode 100644 index 0000000000..9291f8f3f2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.resetTransform.html @@ -0,0 +1,28 @@ + + + +Canvas test: 2d.layer.ctm.resetTransform +

2d.layer.ctm.resetTransform

+

Tests resetTransform inside layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.setTransform-expected.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.setTransform-expected.html new file mode 100644 index 0000000000..45a3d095e1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.setTransform-expected.html @@ -0,0 +1,20 @@ + + +Canvas test: 2d.layer.ctm.setTransform +

2d.layer.ctm.setTransform

+

Tests setTransform inside layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.setTransform.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.setTransform.html new file mode 100644 index 0000000000..b5d98ba45f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.setTransform.html @@ -0,0 +1,28 @@ + + + +Canvas test: 2d.layer.ctm.setTransform +

2d.layer.ctm.setTransform

+

Tests setTransform inside layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.shadow-in-transformed-layer-expected.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.shadow-in-transformed-layer-expected.html new file mode 100644 index 0000000000..312ca19b4c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.shadow-in-transformed-layer-expected.html @@ -0,0 +1,27 @@ + + +Canvas test: 2d.layer.ctm.shadow-in-transformed-layer +

2d.layer.ctm.shadow-in-transformed-layer

+

Check shadows inside of a transformed layer.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.shadow-in-transformed-layer.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.shadow-in-transformed-layer.html new file mode 100644 index 0000000000..f047bd30b2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.ctm.shadow-in-transformed-layer.html @@ -0,0 +1,31 @@ + + + +Canvas test: 2d.layer.ctm.shadow-in-transformed-layer +

2d.layer.ctm.shadow-in-transformed-layer

+

Check shadows inside of a transformed layer.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.drawImage-expected.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.drawImage-expected.html new file mode 100644 index 0000000000..26f6e75214 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.drawImage-expected.html @@ -0,0 +1,29 @@ + + +Canvas test: 2d.layer.drawImage +

2d.layer.drawImage

+

Checks that drawImage writes the image to the layer and not the parent directly.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.drawImage.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.drawImage.html new file mode 100644 index 0000000000..58206c3eb8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.drawImage.html @@ -0,0 +1,33 @@ + + + +Canvas test: 2d.layer.drawImage +

2d.layer.drawImage

+

Checks that drawImage writes the image to the layer and not the parent directly.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.blending.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.blending.html index 17e0f0c8c5..98ea67e9e9 100644 --- a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.blending.html +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.blending.html @@ -1,6 +1,7 @@ + Canvas test: 2d.layer.global-states.filter.alpha.blending

2d.layer.global-states.filter.alpha.blending

Checks that layers with filters correctly use global render states.

diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.composite.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.composite.html index 71a27cf710..29041d4933 100644 --- a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.composite.html +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.composite.html @@ -1,6 +1,7 @@ + Canvas test: 2d.layer.global-states.filter.alpha.composite

2d.layer.global-states.filter.alpha.composite

Checks that layers with filters correctly use global render states.

diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.html index 5133aa170e..85718cffba 100644 --- a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.html +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.html @@ -1,6 +1,7 @@ + Canvas test: 2d.layer.global-states.filter.alpha

2d.layer.global-states.filter.alpha

Checks that layers with filters correctly use global render states.

diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.shadow.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.shadow.html index 6aa8e75a95..aaeb167ccf 100644 --- a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.shadow.html +++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.shadow.html @@ -1,6 +1,7 @@ + Canvas test: 2d.layer.global-states.filter.alpha.shadow

2d.layer.global-states.filter.alpha.shadow

Checks that layers with filters correctly use global render states.

diff --git a/testing/web-platform/tests/html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence-expected.html b/testing/web-platform/tests/html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence-expected.html index ff0eebe2e0..ea5600b006 100644 --- a/testing/web-platform/tests/html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence-expected.html +++ b/testing/web-platform/tests/html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence-expected.html @@ -1,28 +1,28 @@ > - + - + - + - + - + - + - + \ No newline at end of file + diff --git a/testing/web-platform/tests/html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence.html b/testing/web-platform/tests/html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence.html index b5b494825e..eb0803e42e 100644 --- a/testing/web-platform/tests/html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence.html +++ b/testing/web-platform/tests/html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence.html @@ -5,14 +5,14 @@

2d.filter.canvasFilterObject.blur.exceptions.tentative

-

Test exceptions on CanvasFilter() blur.object

+

Test exceptions on gaussianBlur filter

2d.filter.canvasFilterObject.colorMatrix.tentative

-

Test the functionality of ColorMatrix filters in CanvasFilter objects

+

Test the functionality of ColorMatrix filters

diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html index ff1de6bc9c..491d073efb 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html @@ -1,42 +1,16 @@ -OffscreenCanvas test: 2d.filter.canvasFilterObject.componentTransfer.discrete.tentative - - - - + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.discrete.tentative

2d.filter.canvasFilterObject.componentTransfer.discrete.tentative

Test pixels on CanvasFilter() componentTransfer with discrete type

- - + +

FAIL (fallback content)

+
diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.w.html new file mode 100644 index 0000000000..d3a999a242 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.w.html @@ -0,0 +1,54 @@ + + + + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.discrete.tentative +

2d.filter.canvasFilterObject.componentTransfer.discrete.tentative

+

Test pixels on CanvasFilter() componentTransfer with discrete type

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.worker.js deleted file mode 100644 index 0e68f4899f..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.worker.js +++ /dev/null @@ -1,62 +0,0 @@ -// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.componentTransfer.discrete.tentative -// Description:Test pixels on CanvasFilter() componentTransfer with discrete type -// Note: - -importScripts("/resources/testharness.js"); -importScripts("/html/canvas/resources/canvas-tests.js"); - -var t = async_test("Test pixels on CanvasFilter() componentTransfer with discrete type"); -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'); - - // From https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement - function getTransformedValue(C, V) { - // Get the right interval - const n = V.length; - const k = C == 1 ? n - 1 : Math.floor(C * n); - return V[k]; - } - - function getColor(inputColor, tableValues) { - const result = [0, 0, 0]; - for (const i in inputColor) { - const C = inputColor[i]/255; - const Cprime = getTransformedValue(C, tableValues[i]); - result[i] = Math.max(0, Math.min(1, Cprime)) * 255; - } - return result; - } - - tableValuesR = [0, 0, 1, 1]; - tableValuesG = [2, 0, 0.5, 3]; - tableValuesB = [1, -1, 5, 0]; - ctx.filter = new CanvasFilter({name: 'componentTransfer', - funcR: {type: 'discrete', tableValues: tableValuesR}, - funcG: {type: 'discrete', tableValues: tableValuesG}, - funcB: {type: 'discrete', tableValues: tableValuesB}, - }); - - const inputColors = [ - [255, 255, 255], - [0, 0, 0], - [127, 0, 34], - [252, 186, 3], - [50, 68, 87], - ]; - - for (const color of inputColors) { - let outputColor = getColor(color, [tableValuesR, tableValuesG, tableValuesB]); - ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; - ctx.fillRect(0, 0, 10, 10); - _assertPixelApprox(canvas, 5, 5, outputColor[0],outputColor[1],outputColor[2],255, 2); - } - t.done(); -}); -done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative-expected.html new file mode 100644 index 0000000000..5adc9f53e2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative-expected.html @@ -0,0 +1,44 @@ + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.gamma.tentative +

2d.filter.canvasFilterObject.componentTransfer.gamma.tentative

+

Test pixels on CanvasFilter() componentTransfer with gamma type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html index 64c30fc417..b262f3b1d3 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html @@ -1,41 +1,27 @@ -OffscreenCanvas test: 2d.filter.canvasFilterObject.componentTransfer.gamma.tentative - - - - + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.gamma.tentative

2d.filter.canvasFilterObject.componentTransfer.gamma.tentative

Test pixels on CanvasFilter() componentTransfer with gamma type

- - + +

FAIL (fallback content)

+
diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.w.html new file mode 100644 index 0000000000..1fe346eacf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.w.html @@ -0,0 +1,57 @@ + + + + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.gamma.tentative +

2d.filter.canvasFilterObject.componentTransfer.gamma.tentative

+

Test pixels on CanvasFilter() componentTransfer with gamma type

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.worker.js deleted file mode 100644 index d59bc699df..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.worker.js +++ /dev/null @@ -1,53 +0,0 @@ -// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.componentTransfer.gamma.tentative -// Description:Test pixels on CanvasFilter() componentTransfer with gamma type -// Note: - -importScripts("/resources/testharness.js"); -importScripts("/html/canvas/resources/canvas-tests.js"); - -var t = async_test("Test pixels on CanvasFilter() componentTransfer with gamma type"); -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'); - - // From https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement - function getColor(inputColor, amplitude, exponent, offset) { - return [ - Math.max(0, Math.min(1, Math.pow(inputColor[0]/255, exponent[0]) * amplitude[0] + offset[0])) * 255, - Math.max(0, Math.min(1, Math.pow(inputColor[1]/255, exponent[1]) * amplitude[1] + offset[1])) * 255, - Math.max(0, Math.min(1, Math.pow(inputColor[2]/255, exponent[2]) * amplitude[2] + offset[2])) * 255, - ]; - } - - const amplitudes = [2, 1.1, 0.5]; - const exponents = [5, 3, 1]; - const offsets = [0.25, 0, 0.5]; - ctx.filter = new CanvasFilter({name: 'componentTransfer', - funcR: {type: 'gamma', amplitude: amplitudes[0], exponent: exponents[0], offset: offsets[0]}, - funcG: {type: 'gamma', amplitude: amplitudes[1], exponent: exponents[1], offset: offsets[1]}, - funcB: {type: 'gamma', amplitude: amplitudes[2], exponent: exponents[2], offset: offsets[2]}, - }); - - const inputColors = [ - [255, 255, 255], - [0, 0, 0], - [127, 0, 34], - [252, 186, 3], - [50, 68, 87], - ]; - - for (const color of inputColors) { - let outputColor = getColor(color, amplitudes, exponents, offsets); - ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; - ctx.fillRect(0, 0, 10, 10); - _assertPixelApprox(canvas, 5, 5, outputColor[0],outputColor[1],outputColor[2],255, 2); - } - t.done(); -}); -done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative-expected.html new file mode 100644 index 0000000000..895d531206 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative-expected.html @@ -0,0 +1,27 @@ + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.identity.tentative +

2d.filter.canvasFilterObject.componentTransfer.identity.tentative

+

Test pixels on CanvasFilter() componentTransfer with identity type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html index e0d628952e..26b6e4c702 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html @@ -1,24 +1,15 @@ -OffscreenCanvas test: 2d.filter.canvasFilterObject.componentTransfer.identity.tentative - - - - + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.identity.tentative

2d.filter.canvasFilterObject.componentTransfer.identity.tentative

Test pixels on CanvasFilter() componentTransfer with identity type

- - + +

FAIL (fallback content)

+
diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.w.html new file mode 100644 index 0000000000..d2216d1647 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.w.html @@ -0,0 +1,50 @@ + + + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.identity.tentative +

2d.filter.canvasFilterObject.componentTransfer.identity.tentative

+

Test pixels on CanvasFilter() componentTransfer with identity type

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.worker.js deleted file mode 100644 index 1b714b58ff..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.worker.js +++ /dev/null @@ -1,40 +0,0 @@ -// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.componentTransfer.identity.tentative -// Description:Test pixels on CanvasFilter() componentTransfer with identity type -// Note: - -importScripts("/resources/testharness.js"); -importScripts("/html/canvas/resources/canvas-tests.js"); - -var t = async_test("Test pixels on CanvasFilter() componentTransfer with identity type"); -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.filter = new CanvasFilter({name: 'componentTransfer', - funcR: {type: 'identity'}, - funcG: {type: 'identity'}, - funcB: {type: 'identity'}, - }); - - const inputColors = [ - [255, 255, 255], - [0, 0, 0], - [127, 0, 34], - [252, 186, 3], - [50, 68, 87], - ]; - - for (const color of inputColors) { - ctx.fillStyle = `rgba(${color[0]}, ${color[1]}, ${color[2]}, 1)`, - ctx.fillRect(0, 0, 10, 10); - _assertPixel(canvas, 5, 5, color[0],color[1],color[2],255); - } - t.done(); -}); -done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative-expected.html new file mode 100644 index 0000000000..c4ad790d56 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative-expected.html @@ -0,0 +1,43 @@ + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.linear.tentative +

2d.filter.canvasFilterObject.componentTransfer.linear.tentative

+

Test pixels on CanvasFilter() componentTransfer with linear type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html index adbe557fd9..3fc3bd9eec 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html @@ -1,33 +1,16 @@ -OffscreenCanvas test: 2d.filter.canvasFilterObject.componentTransfer.linear.tentative - - - - + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.linear.tentative

2d.filter.canvasFilterObject.componentTransfer.linear.tentative

Test pixels on CanvasFilter() componentTransfer with linear type

- - + +

FAIL (fallback content)

+
diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.w.html new file mode 100644 index 0000000000..054dbce929 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.w.html @@ -0,0 +1,53 @@ + + + + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.linear.tentative +

2d.filter.canvasFilterObject.componentTransfer.linear.tentative

+

Test pixels on CanvasFilter() componentTransfer with linear type

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.worker.js deleted file mode 100644 index fb2e01876f..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.worker.js +++ /dev/null @@ -1,52 +0,0 @@ -// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.componentTransfer.linear.tentative -// Description:Test pixels on CanvasFilter() componentTransfer with linear type -// Note: - -importScripts("/resources/testharness.js"); -importScripts("/html/canvas/resources/canvas-tests.js"); - -var t = async_test("Test pixels on CanvasFilter() componentTransfer with linear type"); -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'); - - // From https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement - function getColor(inputColor, slopes, intercepts) { - return [ - Math.max(0, Math.min(1, inputColor[0]/255 * slopes[0] + intercepts[0])) * 255, - Math.max(0, Math.min(1, inputColor[1]/255 * slopes[1] + intercepts[1])) * 255, - Math.max(0, Math.min(1, inputColor[2]/255 * slopes[2] + intercepts[2])) * 255, - ]; - } - - const slopes = [0.5, 1.2, -0.2]; - const intercepts = [0.25, 0, 0.5]; - ctx.filter = new CanvasFilter({name: 'componentTransfer', - funcR: {type: 'linear', slope: slopes[0], intercept: intercepts[0]}, - funcG: {type: 'linear', slope: slopes[1], intercept: intercepts[1]}, - funcB: {type: 'linear', slope: slopes[2], intercept: intercepts[2]}, - }); - - const inputColors = [ - [255, 255, 255], - [0, 0, 0], - [127, 0, 34], - [252, 186, 3], - [50, 68, 87], - ]; - - for (const color of inputColors) { - let outputColor = getColor(color, slopes, intercepts); - ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; - ctx.fillRect(0, 0, 10, 10); - _assertPixelApprox(canvas, 5, 5, outputColor[0],outputColor[1],outputColor[2],255, 2); - } - t.done(); -}); -done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative-expected.html new file mode 100644 index 0000000000..29e250614c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative-expected.html @@ -0,0 +1,51 @@ + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.table.tentative +

2d.filter.canvasFilterObject.componentTransfer.table.tentative

+

Test pixels on CanvasFilter() componentTransfer with table type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html index 47048b68a1..ef2da126eb 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html @@ -1,42 +1,16 @@ -OffscreenCanvas test: 2d.filter.canvasFilterObject.componentTransfer.table.tentative - - - - + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.table.tentative

2d.filter.canvasFilterObject.componentTransfer.table.tentative

Test pixels on CanvasFilter() componentTransfer with table type

- - + +

FAIL (fallback content)

+
diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.w.html new file mode 100644 index 0000000000..f39723da8e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.w.html @@ -0,0 +1,54 @@ + + + + + +Canvas test: 2d.filter.canvasFilterObject.componentTransfer.table.tentative +

2d.filter.canvasFilterObject.componentTransfer.table.tentative

+

Test pixels on CanvasFilter() componentTransfer with table type

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.worker.js deleted file mode 100644 index 0799e73a58..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.worker.js +++ /dev/null @@ -1,62 +0,0 @@ -// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.componentTransfer.table.tentative -// Description:Test pixels on CanvasFilter() componentTransfer with table type -// Note: - -importScripts("/resources/testharness.js"); -importScripts("/html/canvas/resources/canvas-tests.js"); - -var t = async_test("Test pixels on CanvasFilter() componentTransfer with table type"); -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'); - - // From https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement - function getTransformedValue(C, V) { - // Get the right interval - const n = V.length - 1; - const k = C == 1 ? n - 1 : Math.floor(C * n); - return V[k] + (C - k/n) * n * (V[k + 1] - V[k]); - } - - function getColor(inputColor, tableValues) { - const result = [0, 0, 0]; - for (const i in inputColor) { - const C = inputColor[i]/255; - const Cprime = getTransformedValue(C, tableValues[i]); - result[i] = Math.max(0, Math.min(1, Cprime)) * 255; - } - return result; - } - - tableValuesR = [0, 0, 1, 1]; - tableValuesG = [2, 0, 0.5, 3]; - tableValuesB = [1, -1, 5, 0]; - ctx.filter = new CanvasFilter({name: 'componentTransfer', - funcR: {type: 'table', tableValues: tableValuesR}, - funcG: {type: 'table', tableValues: tableValuesG}, - funcB: {type: 'table', tableValues: tableValuesB}, - }); - - const inputColors = [ - [255, 255, 255], - [0, 0, 0], - [127, 0, 34], - [252, 186, 3], - [50, 68, 87], - ]; - - for (const color of inputColors) { - let outputColor = getColor(color, [tableValuesR, tableValuesG, tableValuesB]); - ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; - ctx.fillRect(0, 0, 10, 10); - _assertPixelApprox(canvas, 5, 5, outputColor[0],outputColor[1],outputColor[2],255, 2); - } - t.done(); -}); -done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html index 301d11f888..08f8860e99 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html @@ -20,23 +20,39 @@ t.step(function() { var canvas = new OffscreenCanvas(100, 50); var ctx = canvas.getContext('2d'); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', divisor: 2}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: null}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: 1}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], [0]]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 'a'], [0]]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], 0]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], [0, Infinity]]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: []}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [1]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [1, 2, 3, 4]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[], []]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 2], []]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[], [1, 2]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', divisor: 2}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: null}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: 1}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 0], [0]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 'a'], [0]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 0], 0]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 0], [0, Infinity]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: []}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [1]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [1, 2, 3, 4]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[], []]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 2], []]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[], [1, 2]]}); }); // This should not throw an error - ctx.filter = new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[]]}); - ctx.filter = new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1]]}); + ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[]]}); + ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1]]}); t.done(); }); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.worker.js index b4ce4d76b2..105ed67a75 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.worker.js +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.worker.js @@ -16,23 +16,39 @@ t.step(function() { var canvas = new OffscreenCanvas(100, 50); var ctx = canvas.getContext('2d'); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', divisor: 2}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: null}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: 1}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], [0]]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 'a'], [0]]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], 0]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], [0, Infinity]]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: []}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [1]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [1, 2, 3, 4]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[], []]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 2], []]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[], [1, 2]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', divisor: 2}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: null}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: 1}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 0], [0]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 'a'], [0]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 0], 0]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 0], [0, Infinity]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: []}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [1]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [1, 2, 3, 4]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[], []]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1, 2], []]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[], [1, 2]]}); }); // This should not throw an error - ctx.filter = new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[]]}); - ctx.filter = new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1]]}); + ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[]]}); + ctx.filter = new CanvasFilter( + {name: 'convolveMatrix', kernelMatrix: [[1]]}); t.done(); }); done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html index 3e55e97e54..cdd501ba8e 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html @@ -20,104 +20,250 @@ t.step(function() { var canvas = new OffscreenCanvas(100, 50); var ctx = canvas.getContext('2d'); + // Should not throw an error. // dx - _assert(new CanvasFilter({name: 'dropShadow', dx: 10}), "new CanvasFilter({name: 'dropShadow', dx: 10})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: -1}), "new CanvasFilter({name: 'dropShadow', dx: -1})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: 0.5}), "new CanvasFilter({name: 'dropShadow', dx: 0.5})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: null}), "new CanvasFilter({name: 'dropShadow', dx: null})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: true}), "new CanvasFilter({name: 'dropShadow', dx: true})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: false}), "new CanvasFilter({name: 'dropShadow', dx: false})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: []}), "new CanvasFilter({name: 'dropShadow', dx: []})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: [20]}), "new CanvasFilter({name: 'dropShadow', dx: [\""+(20)+"\"]})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: '30'}), "new CanvasFilter({name: 'dropShadow', dx: '30'})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: '30'}); // dy - _assert(new CanvasFilter({name: 'dropShadow', dy: 10}), "new CanvasFilter({name: 'dropShadow', dy: 10})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: -1}), "new CanvasFilter({name: 'dropShadow', dy: -1})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: 0.5}), "new CanvasFilter({name: 'dropShadow', dy: 0.5})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: null}), "new CanvasFilter({name: 'dropShadow', dy: null})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: true}), "new CanvasFilter({name: 'dropShadow', dy: true})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: false}), "new CanvasFilter({name: 'dropShadow', dy: false})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: []}), "new CanvasFilter({name: 'dropShadow', dy: []})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: [20]}), "new CanvasFilter({name: 'dropShadow', dy: [\""+(20)+"\"]})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: '30'}), "new CanvasFilter({name: 'dropShadow', dy: '30'})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: '30'}); // floodOpacity - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: 10}), "new CanvasFilter({name: 'dropShadow', floodOpacity: 10})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: -1}), "new CanvasFilter({name: 'dropShadow', floodOpacity: -1})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: 0.5}), "new CanvasFilter({name: 'dropShadow', floodOpacity: 0.5})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: null}), "new CanvasFilter({name: 'dropShadow', floodOpacity: null})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: true}), "new CanvasFilter({name: 'dropShadow', floodOpacity: true})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: false}), "new CanvasFilter({name: 'dropShadow', floodOpacity: false})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: []}), "new CanvasFilter({name: 'dropShadow', floodOpacity: []})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: [20]}), "new CanvasFilter({name: 'dropShadow', floodOpacity: [\""+(20)+"\"]})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: '30'}), "new CanvasFilter({name: 'dropShadow', floodOpacity: '30'})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: '30'}); + // dx + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: '30'}); + // dy + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: '30'}); + // floodOpacity + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: '30'}); // stdDeviation - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: 10}), "new CanvasFilter({name: 'dropShadow', stdDeviation: 10})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: -1}), "new CanvasFilter({name: 'dropShadow', stdDeviation: -1})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: 0.5}), "new CanvasFilter({name: 'dropShadow', stdDeviation: 0.5})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: null}), "new CanvasFilter({name: 'dropShadow', stdDeviation: null})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: true}), "new CanvasFilter({name: 'dropShadow', stdDeviation: true})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: false}), "new CanvasFilter({name: 'dropShadow', stdDeviation: false})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: []}), "new CanvasFilter({name: 'dropShadow', stdDeviation: []})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [20]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [\""+(20)+"\"]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: '30'}), "new CanvasFilter({name: 'dropShadow', stdDeviation: '30'})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [10, -1]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [10, -1]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [0.5, null]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [0.5, null]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [true, false]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [true, false]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [[], [20]]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [[], [\""+(20)+"\"]]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: ['30', ['40']]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: ['30', ['40']]})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: '30'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [10, -1]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [0.5, null]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [true, false]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [[], [20]]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: ['30', ['40']]}); // floodColor - _assert(new CanvasFilter({name: 'dropShadow', floodColor: 'red'}), "new CanvasFilter({name: 'dropShadow', floodColor: 'red'})"); - _assert(new CanvasFilter({name: 'dropShadow', floodColor: 'canvas'}), "new CanvasFilter({name: 'dropShadow', floodColor: 'canvas'})"); - _assert(new CanvasFilter({name: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'}), "new CanvasFilter({name: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'})"); - _assert(new CanvasFilter({name: 'dropShadow', floodColor: '#aabbccdd'}), "new CanvasFilter({name: 'dropShadow', floodColor: '#aabbccdd'})"); - _assert(new CanvasFilter({name: 'dropShadow', floodColor: '#abcd'}), "new CanvasFilter({name: 'dropShadow', floodColor: '#abcd'})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'red'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'canvas'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: '#aabbccdd'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: '#abcd'}); + // Should throw a TypeError. // dx - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: NaN}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: -Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: {}}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: [1, 2]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: -Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: {}}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: [1, 2]}); }); // dy - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: NaN}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: -Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: {}}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: [1, 2]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: -Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: {}}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: [1, 2]}); }); // floodOpacity - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: NaN}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: -Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: {}}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: [1, 2]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: -Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: {}}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: [1, 2]}); }); // stdDeviation - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: NaN}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: -Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: {}}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, 2, 3]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, NaN]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, Infinity]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, -Infinity]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, undefined]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, 'test']}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, {}]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, [2, 3]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: -Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: {}}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, 2, 3]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, NaN]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, Infinity]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, -Infinity]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, undefined]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, 'test']}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, {}]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, [2, 3]]}); }); // floodColor - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: 'rgba(NaN, 3, 2, 1)'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: 10}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: null}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'rgba(NaN, 3, 2, 1)'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 10}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: null}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: NaN}); }); t.done(); }); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js index bd18524f28..1d56865e68 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js @@ -16,104 +16,250 @@ t.step(function() { var canvas = new OffscreenCanvas(100, 50); var ctx = canvas.getContext('2d'); + // Should not throw an error. // dx - _assert(new CanvasFilter({name: 'dropShadow', dx: 10}), "new CanvasFilter({name: 'dropShadow', dx: 10})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: -1}), "new CanvasFilter({name: 'dropShadow', dx: -1})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: 0.5}), "new CanvasFilter({name: 'dropShadow', dx: 0.5})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: null}), "new CanvasFilter({name: 'dropShadow', dx: null})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: true}), "new CanvasFilter({name: 'dropShadow', dx: true})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: false}), "new CanvasFilter({name: 'dropShadow', dx: false})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: []}), "new CanvasFilter({name: 'dropShadow', dx: []})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: [20]}), "new CanvasFilter({name: 'dropShadow', dx: [\""+(20)+"\"]})"); - _assert(new CanvasFilter({name: 'dropShadow', dx: '30'}), "new CanvasFilter({name: 'dropShadow', dx: '30'})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: '30'}); // dy - _assert(new CanvasFilter({name: 'dropShadow', dy: 10}), "new CanvasFilter({name: 'dropShadow', dy: 10})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: -1}), "new CanvasFilter({name: 'dropShadow', dy: -1})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: 0.5}), "new CanvasFilter({name: 'dropShadow', dy: 0.5})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: null}), "new CanvasFilter({name: 'dropShadow', dy: null})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: true}), "new CanvasFilter({name: 'dropShadow', dy: true})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: false}), "new CanvasFilter({name: 'dropShadow', dy: false})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: []}), "new CanvasFilter({name: 'dropShadow', dy: []})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: [20]}), "new CanvasFilter({name: 'dropShadow', dy: [\""+(20)+"\"]})"); - _assert(new CanvasFilter({name: 'dropShadow', dy: '30'}), "new CanvasFilter({name: 'dropShadow', dy: '30'})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: '30'}); // floodOpacity - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: 10}), "new CanvasFilter({name: 'dropShadow', floodOpacity: 10})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: -1}), "new CanvasFilter({name: 'dropShadow', floodOpacity: -1})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: 0.5}), "new CanvasFilter({name: 'dropShadow', floodOpacity: 0.5})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: null}), "new CanvasFilter({name: 'dropShadow', floodOpacity: null})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: true}), "new CanvasFilter({name: 'dropShadow', floodOpacity: true})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: false}), "new CanvasFilter({name: 'dropShadow', floodOpacity: false})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: []}), "new CanvasFilter({name: 'dropShadow', floodOpacity: []})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: [20]}), "new CanvasFilter({name: 'dropShadow', floodOpacity: [\""+(20)+"\"]})"); - _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: '30'}), "new CanvasFilter({name: 'dropShadow', floodOpacity: '30'})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: '30'}); + // dx + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: '30'}); + // dy + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: '30'}); + // floodOpacity + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: '30'}); // stdDeviation - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: 10}), "new CanvasFilter({name: 'dropShadow', stdDeviation: 10})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: -1}), "new CanvasFilter({name: 'dropShadow', stdDeviation: -1})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: 0.5}), "new CanvasFilter({name: 'dropShadow', stdDeviation: 0.5})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: null}), "new CanvasFilter({name: 'dropShadow', stdDeviation: null})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: true}), "new CanvasFilter({name: 'dropShadow', stdDeviation: true})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: false}), "new CanvasFilter({name: 'dropShadow', stdDeviation: false})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: []}), "new CanvasFilter({name: 'dropShadow', stdDeviation: []})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [20]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [\""+(20)+"\"]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: '30'}), "new CanvasFilter({name: 'dropShadow', stdDeviation: '30'})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [10, -1]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [10, -1]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [0.5, null]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [0.5, null]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [true, false]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [true, false]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [[], [20]]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [[], [\""+(20)+"\"]]})"); - _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: ['30', ['40']]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: ['30', ['40']]})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: 10}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: -1}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: 0.5}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: null}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: true}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: false}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: []}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [20]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: '30'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [10, -1]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [0.5, null]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [true, false]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [[], [20]]}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: ['30', ['40']]}); // floodColor - _assert(new CanvasFilter({name: 'dropShadow', floodColor: 'red'}), "new CanvasFilter({name: 'dropShadow', floodColor: 'red'})"); - _assert(new CanvasFilter({name: 'dropShadow', floodColor: 'canvas'}), "new CanvasFilter({name: 'dropShadow', floodColor: 'canvas'})"); - _assert(new CanvasFilter({name: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'}), "new CanvasFilter({name: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'})"); - _assert(new CanvasFilter({name: 'dropShadow', floodColor: '#aabbccdd'}), "new CanvasFilter({name: 'dropShadow', floodColor: '#aabbccdd'})"); - _assert(new CanvasFilter({name: 'dropShadow', floodColor: '#abcd'}), "new CanvasFilter({name: 'dropShadow', floodColor: '#abcd'})"); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'red'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'canvas'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: '#aabbccdd'}); + ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: '#abcd'}); + // Should throw a TypeError. // dx - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: NaN}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: -Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: {}}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: [1, 2]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: -Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: {}}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dx: [1, 2]}); }); // dy - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: NaN}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: -Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: {}}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: [1, 2]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: -Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: {}}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', dy: [1, 2]}); }); // floodOpacity - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: NaN}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: -Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: {}}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: [1, 2]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: -Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: {}}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodOpacity: [1, 2]}); }); // stdDeviation - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: NaN}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: -Infinity}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: {}}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, 2, 3]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, NaN]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, Infinity]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, -Infinity]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, undefined]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, 'test']}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, {}]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, [2, 3]]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: -Infinity}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: {}}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, 2, 3]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, NaN]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, Infinity]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, -Infinity]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, undefined]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, 'test']}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, {}]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', stdDeviation: [1, [2, 3]]}); }); // floodColor - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: 'test'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: 'rgba(NaN, 3, 2, 1)'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: 10}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: null}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'test'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 'rgba(NaN, 3, 2, 1)'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: 10}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: null}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'dropShadow', floodColor: NaN}); }); t.done(); }); done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html index 81eb1eae45..7569304b95 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html @@ -22,86 +22,58 @@ // Parameter defaults. ctx.filter = new CanvasFilter({name: 'dropShadow'}); ctx.fillRect(10, 10, 80, 80); - // All parameters specified. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, floodColor: 'purple', floodOpacity: 0.7}); ctx.fillRect(110, 10, 80, 80); - // Named color. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'purple'}); ctx.fillRect(10, 110, 80, 80); - // System color. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'LinkText'}); ctx.fillRect(110, 110, 80, 80); - // Numerical color. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'rgba(20, 50, 130, 1)'}); ctx.fillRect(210, 110, 80, 80); - // Transparent floodColor. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'rgba(20, 50, 130, 0.7)'}); ctx.fillRect(310, 110, 80, 80); - // Transparent floodColor and floodOpacity. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'rgba(20, 50, 130, 0.7)', floodOpacity: 0.7}); ctx.fillRect(410, 110, 80, 80); - // No blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 0, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 0, floodColor: 'purple'}); ctx.fillRect(10, 210, 80, 80); - // Single float blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, floodColor: 'purple'}); ctx.fillRect(110, 210, 80, 80); - // Single negative float blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: -5, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: -5, floodColor: 'purple'}); ctx.fillRect(210, 210, 80, 80); - // Two floats (X&Y) blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [3, 5], + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [3, 5], floodColor: 'purple'}); ctx.fillRect(310, 210, 80, 80); - // Two negative floats (X&Y) blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [-3, -5], + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [-3, -5], floodColor: 'purple'}); ctx.fillRect(410, 210, 80, 80); - // Degenerate parameter values. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: [-5], dy: [], stdDeviation: null, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: [-5], dy: [], stdDeviation: null, floodColor: 'purple', floodOpacity: [2]}); ctx.fillRect(10, 310, 80, 80); - - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: null, dy: '5', stdDeviation: [[-5], ['3']], + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: null, dy: '5', stdDeviation: [[-5], ['3']], floodColor: 'purple', floodOpacity: '0.8'}); ctx.fillRect(110, 310, 80, 80); - - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: true, dy: ['10'], stdDeviation: false, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: true, dy: ['10'], stdDeviation: false, floodColor: 'purple', floodOpacity: ['0.4']}); ctx.fillRect(210, 310, 80, 80); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.w.html index fe9087244a..2a26af4ec3 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.w.html +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.w.html @@ -24,86 +24,58 @@ // Parameter defaults. ctx.filter = new CanvasFilter({name: 'dropShadow'}); ctx.fillRect(10, 10, 80, 80); - // All parameters specified. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, floodColor: 'purple', floodOpacity: 0.7}); ctx.fillRect(110, 10, 80, 80); - // Named color. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'purple'}); ctx.fillRect(10, 110, 80, 80); - // System color. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'LinkText'}); ctx.fillRect(110, 110, 80, 80); - // Numerical color. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'rgba(20, 50, 130, 1)'}); ctx.fillRect(210, 110, 80, 80); - // Transparent floodColor. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'rgba(20, 50, 130, 0.7)'}); ctx.fillRect(310, 110, 80, 80); - // Transparent floodColor and floodOpacity. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, floodColor: 'rgba(20, 50, 130, 0.7)', floodOpacity: 0.7}); ctx.fillRect(410, 110, 80, 80); - // No blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 0, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 0, floodColor: 'purple'}); ctx.fillRect(10, 210, 80, 80); - // Single float blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, floodColor: 'purple'}); ctx.fillRect(110, 210, 80, 80); - // Single negative float blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: -5, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: -5, floodColor: 'purple'}); ctx.fillRect(210, 210, 80, 80); - // Two floats (X&Y) blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [3, 5], + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [3, 5], floodColor: 'purple'}); ctx.fillRect(310, 210, 80, 80); - // Two negative floats (X&Y) blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [-3, -5], + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [-3, -5], floodColor: 'purple'}); ctx.fillRect(410, 210, 80, 80); - // Degenerate parameter values. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: [-5], dy: [], stdDeviation: null, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: [-5], dy: [], stdDeviation: null, floodColor: 'purple', floodOpacity: [2]}); ctx.fillRect(10, 310, 80, 80); - - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: null, dy: '5', stdDeviation: [[-5], ['3']], + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: null, dy: '5', stdDeviation: [[-5], ['3']], floodColor: 'purple', floodOpacity: '0.8'}); ctx.fillRect(110, 310, 80, 80); - - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: true, dy: ['10'], stdDeviation: false, + ctx.filter = new CanvasFilter({name: 'dropShadow', dx: true, dy: ['10'], stdDeviation: false, floodColor: 'purple', floodOpacity: ['0.4']}); ctx.fillRect(210, 310, 80, 80); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative-expected.html new file mode 100644 index 0000000000..dac31c97f1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative +

2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative.html new file mode 100644 index 0000000000..801e6fdb8c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative +

2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative.w.html new file mode 100644 index 0000000000..6c7c7f7649 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative +

2d.filter.canvasFilterObject.gaussianBlur.isotropic.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative-expected.html new file mode 100644 index 0000000000..88d0cb2de2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative +

2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative.html new file mode 100644 index 0000000000..ba986d8e7b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative +

2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative.w.html new file mode 100644 index 0000000000..86fe086327 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative +

2d.filter.canvasFilterObject.gaussianBlur.mostly-x.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative-expected.html new file mode 100644 index 0000000000..744983d4ae --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative +

2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative.html new file mode 100644 index 0000000000..0265cfa6c4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative +

2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative.w.html new file mode 100644 index 0000000000..c22b320857 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative +

2d.filter.canvasFilterObject.gaussianBlur.mostly-y.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic-expected.html deleted file mode 100644 index f9571f208e..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic-expected.html +++ /dev/null @@ -1,15 +0,0 @@ - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic -

2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic

-

Test CanvasFilter() with gaussianBlur.

- - - - - - - diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.html deleted file mode 100644 index 4417a1917c..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.html +++ /dev/null @@ -1,23 +0,0 @@ - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic -

2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.w.html deleted file mode 100644 index d2024ad205..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.w.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic -

2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- - - diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x-expected.html deleted file mode 100644 index e76613271f..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x-expected.html +++ /dev/null @@ -1,15 +0,0 @@ - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x -

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x

-

Test CanvasFilter() with gaussianBlur.

- - - - - - - diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.html deleted file mode 100644 index 2ea26359fe..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.html +++ /dev/null @@ -1,23 +0,0 @@ - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x -

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.w.html deleted file mode 100644 index fa49ea4682..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.w.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x -

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- - - diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y-expected.html deleted file mode 100644 index 0f214fca9f..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y-expected.html +++ /dev/null @@ -1,15 +0,0 @@ - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y -

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y

-

Test CanvasFilter() with gaussianBlur.

- - - - - - - diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.html deleted file mode 100644 index a9783ccb6a..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.html +++ /dev/null @@ -1,23 +0,0 @@ - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y -

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.w.html deleted file mode 100644 index ab83f50ea0..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.w.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y -

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- - - diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only-expected.html deleted file mode 100644 index 285a641726..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only-expected.html +++ /dev/null @@ -1,15 +0,0 @@ - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only -

2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only

-

Test CanvasFilter() with gaussianBlur.

- - - - - - - diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.html deleted file mode 100644 index 3028c2a700..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.html +++ /dev/null @@ -1,23 +0,0 @@ - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only -

2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.w.html deleted file mode 100644 index e8482cf3ed..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.w.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only -

2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- - - diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only-expected.html deleted file mode 100644 index d59945b5da..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only-expected.html +++ /dev/null @@ -1,15 +0,0 @@ - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only -

2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only

-

Test CanvasFilter() with gaussianBlur.

- - - - - - - diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.html deleted file mode 100644 index fca324716b..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.html +++ /dev/null @@ -1,23 +0,0 @@ - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only -

2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.w.html deleted file mode 100644 index 50cfb3083a..0000000000 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.w.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - -Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only -

2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only

-

Test CanvasFilter() with gaussianBlur.

- -

FAIL (fallback content)

-
- - - diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative-expected.html new file mode 100644 index 0000000000..e611113e42 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative +

2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative.html new file mode 100644 index 0000000000..3ed8e9ddf9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative +

2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative.w.html new file mode 100644 index 0000000000..35cbc1b365 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative +

2d.filter.canvasFilterObject.gaussianBlur.x-only.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative-expected.html new file mode 100644 index 0000000000..c6d915cb07 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative +

2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative.html new file mode 100644 index 0000000000..f563ad9d77 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative +

2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative.w.html new file mode 100644 index 0000000000..171a41caa8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative +

2d.filter.canvasFilterObject.gaussianBlur.y-only.tentative

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html index 040c62a96b..8ad2a5ccfb 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html @@ -117,12 +117,12 @@ t.step(function() { for (testCase of errorTestCases) { const filterOptions = {...{name: 'turbulence'}, ...testCase}; - assert_throws_js(TypeError, function() { new CanvasFilter(filterOptions); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter(filterOptions); }); } for (testCase of workingTestCases) { const filterOptions = {...{name: 'turbulence'}, ...testCase}; - _assert(new CanvasFilter(filterOptions) != null, "new CanvasFilter(filterOptions) != null"); + ctx.filter = new CanvasFilter(filterOptions); } t.done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.worker.js index 1a950a9207..16199cb0ec 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.worker.js +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.worker.js @@ -113,12 +113,12 @@ t.step(function() { for (testCase of errorTestCases) { const filterOptions = {...{name: 'turbulence'}, ...testCase}; - assert_throws_js(TypeError, function() { new CanvasFilter(filterOptions); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter(filterOptions); }); } for (testCase of workingTestCases) { const filterOptions = {...{name: 'turbulence'}, ...testCase}; - _assert(new CanvasFilter(filterOptions) != null, "new CanvasFilter(filterOptions) != null"); + ctx.filter = new CanvasFilter(filterOptions); } t.done(); }); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.blur.exceptions.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.blur.exceptions.html new file mode 100644 index 0000000000..36dd856456 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.blur.exceptions.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.filter.layers.blur.exceptions + + + + +

2d.filter.layers.blur.exceptions

+

Test exceptions on gaussianBlur filter

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.blur.exceptions.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.blur.exceptions.worker.js new file mode 100644 index 0000000000..a053b8113c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.blur.exceptions.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.layers.blur.exceptions +// Description:Test exceptions on gaussianBlur filter +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test exceptions on gaussianBlur filter"); +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() { ctx.beginLayer({filter: + {name: 'gaussianBlur'}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'gaussianBlur', stdDeviation: undefined}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'gaussianBlur', stdDeviation: 'foo'}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'gaussianBlur', stdDeviation: [1,2,3]}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'gaussianBlur', stdDeviation: NaN}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'gaussianBlur', stdDeviation: {}}}); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.colorMatrix.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.colorMatrix.html new file mode 100644 index 0000000000..9e12acbbe0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.colorMatrix.html @@ -0,0 +1,105 @@ + + +OffscreenCanvas test: 2d.filter.layers.colorMatrix + + + + +

2d.filter.layers.colorMatrix

+

Test the functionality of ColorMatrix filters

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.colorMatrix.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.colorMatrix.worker.js new file mode 100644 index 0000000000..12cdff3868 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.colorMatrix.worker.js @@ -0,0 +1,100 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.layers.colorMatrix +// Description:Test the functionality of ColorMatrix filters +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test the functionality of ColorMatrix filters"); +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() { ctx.beginLayer({filter: + {name: 'colorMatrix', values: undefined}}); }); + + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'colorMatrix', values: 'foo'}}); }); + + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'colorMatrix', values: null}}); }); + + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'colorMatrix', values: [1, 2, 3]}}); }); + + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'colorMatrix', + values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 'a']}}); }); + + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'colorMatrix', + values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, Infinity]}}); }); + + ctx.fillStyle = '#f00'; + ctx.beginLayer({filter: + {name: 'colorMatrix', type: 'hueRotate', values: 0}}); + ctx.fillRect(0, 0, 100, 50); + ctx.endLayer(); + _assertPixelApprox(canvas, 10,10, 255,0,0,255, 2); + + ctx.beginLayer({filter: + {name: 'colorMatrix', type: 'hueRotate', values: 90}}); + ctx.fillRect(0, 0, 100, 50); + ctx.endLayer(); + _assertPixelApprox(canvas, 10,10, 0,91,0,255, 2); + + ctx.beginLayer({filter: + {name: 'colorMatrix', type: 'hueRotate', values: 180}}); + ctx.fillRect(0, 0, 100, 50); + ctx.endLayer(); + _assertPixelApprox(canvas, 10,10, 0,109,109,255, 2); + + ctx.beginLayer({filter: + {name: 'colorMatrix', type: 'hueRotate', values: 270}}); + ctx.fillRect(0, 0, 100, 50); + ctx.endLayer(); + _assertPixelApprox(canvas, 10,10, 109,18,255,255, 2); + + ctx.beginLayer({filter: + {name: 'colorMatrix', type: 'saturate', values: 0.5}}); + ctx.fillRect(0, 0, 100, 50); + ctx.endLayer(); + _assertPixelApprox(canvas, 10,10, 155,27,27,255, 2); + + ctx.clearRect(0, 0, 100, 50); + ctx.beginLayer({filter: + {name: 'colorMatrix', type: 'luminanceToAlpha'}}); + ctx.fillRect(0, 0, 100, 50); + ctx.endLayer(); + _assertPixelApprox(canvas, 10,10, 0,0,0,54, 2); + + ctx.beginLayer({filter: + {name: 'colorMatrix', values: [ + 0, 0, 0, 0, 0, + 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0 + ]}}); + ctx.fillRect(0, 0, 50, 25); + ctx.fillStyle = '#0f0'; + ctx.fillRect(50, 0, 50, 25); + ctx.fillStyle = '#00f'; + ctx.fillRect(0, 25, 50, 25); + ctx.fillStyle = '#fff'; + ctx.fillRect(50, 25, 50, 25); + ctx.endLayer(); + _assertPixelApprox(canvas, 10,10, 0,255,0,255, 2); + _assertPixelApprox(canvas, 60,10, 0,255,0,255, 2); + _assertPixelApprox(canvas, 10,30, 0,255,0,255, 2); + _assertPixelApprox(canvas, 60,30, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete-expected.html new file mode 100644 index 0000000000..8419953b3d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete-expected.html @@ -0,0 +1,50 @@ + + +Canvas test: 2d.filter.layers.componentTransfer.discrete +

2d.filter.layers.componentTransfer.discrete

+

Test pixels on CanvasFilter() componentTransfer with discrete type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete.html new file mode 100644 index 0000000000..459c2f2850 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete.html @@ -0,0 +1,41 @@ + + + + +Canvas test: 2d.filter.layers.componentTransfer.discrete +

2d.filter.layers.componentTransfer.discrete

+

Test pixels on CanvasFilter() componentTransfer with discrete type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete.w.html new file mode 100644 index 0000000000..86e1d54fb7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete.w.html @@ -0,0 +1,55 @@ + + + + + +Canvas test: 2d.filter.layers.componentTransfer.discrete +

2d.filter.layers.componentTransfer.discrete

+

Test pixels on CanvasFilter() componentTransfer with discrete type

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma-expected.html new file mode 100644 index 0000000000..3e5d980896 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma-expected.html @@ -0,0 +1,44 @@ + + +Canvas test: 2d.filter.layers.componentTransfer.gamma +

2d.filter.layers.componentTransfer.gamma

+

Test pixels on CanvasFilter() componentTransfer with gamma type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma.html new file mode 100644 index 0000000000..9012115adf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma.html @@ -0,0 +1,44 @@ + + + + +Canvas test: 2d.filter.layers.componentTransfer.gamma +

2d.filter.layers.componentTransfer.gamma

+

Test pixels on CanvasFilter() componentTransfer with gamma type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma.w.html new file mode 100644 index 0000000000..767bcc58e5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma.w.html @@ -0,0 +1,58 @@ + + + + + +Canvas test: 2d.filter.layers.componentTransfer.gamma +

2d.filter.layers.componentTransfer.gamma

+

Test pixels on CanvasFilter() componentTransfer with gamma type

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity-expected.html new file mode 100644 index 0000000000..9f1439f37b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity-expected.html @@ -0,0 +1,27 @@ + + +Canvas test: 2d.filter.layers.componentTransfer.identity +

2d.filter.layers.componentTransfer.identity

+

Test pixels on CanvasFilter() componentTransfer with identity type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity.html new file mode 100644 index 0000000000..901dae3bed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity.html @@ -0,0 +1,37 @@ + + + +Canvas test: 2d.filter.layers.componentTransfer.identity +

2d.filter.layers.componentTransfer.identity

+

Test pixels on CanvasFilter() componentTransfer with identity type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity.w.html new file mode 100644 index 0000000000..2e45018755 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity.w.html @@ -0,0 +1,51 @@ + + + + +Canvas test: 2d.filter.layers.componentTransfer.identity +

2d.filter.layers.componentTransfer.identity

+

Test pixels on CanvasFilter() componentTransfer with identity type

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear-expected.html new file mode 100644 index 0000000000..f922055ff2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear-expected.html @@ -0,0 +1,44 @@ + + +Canvas test: 2d.filter.layers.componentTransfer.linear +

2d.filter.layers.componentTransfer.linear

+

Test pixels on CanvasFilter() componentTransfer with linear type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear.html new file mode 100644 index 0000000000..f418b72ad5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear.html @@ -0,0 +1,40 @@ + + + + +Canvas test: 2d.filter.layers.componentTransfer.linear +

2d.filter.layers.componentTransfer.linear

+

Test pixels on CanvasFilter() componentTransfer with linear type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear.w.html new file mode 100644 index 0000000000..fbc29c86c1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear.w.html @@ -0,0 +1,54 @@ + + + + + +Canvas test: 2d.filter.layers.componentTransfer.linear +

2d.filter.layers.componentTransfer.linear

+

Test pixels on CanvasFilter() componentTransfer with linear type

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table-expected.html new file mode 100644 index 0000000000..0f6736d87d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table-expected.html @@ -0,0 +1,51 @@ + + +Canvas test: 2d.filter.layers.componentTransfer.table +

2d.filter.layers.componentTransfer.table

+

Test pixels on CanvasFilter() componentTransfer with table type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table.html new file mode 100644 index 0000000000..ef5e0f847b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table.html @@ -0,0 +1,41 @@ + + + + +Canvas test: 2d.filter.layers.componentTransfer.table +

2d.filter.layers.componentTransfer.table

+

Test pixels on CanvasFilter() componentTransfer with table type

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table.w.html new file mode 100644 index 0000000000..b11f0ef6f3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table.w.html @@ -0,0 +1,55 @@ + + + + + +Canvas test: 2d.filter.layers.componentTransfer.table +

2d.filter.layers.componentTransfer.table

+

Test pixels on CanvasFilter() componentTransfer with table type

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.convolveMatrix.exceptions.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.convolveMatrix.exceptions.html new file mode 100644 index 0000000000..798822f104 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.convolveMatrix.exceptions.html @@ -0,0 +1,61 @@ + + +OffscreenCanvas test: 2d.filter.layers.convolveMatrix.exceptions + + + + +

2d.filter.layers.convolveMatrix.exceptions

+

Test exceptions on CanvasFilter() convolveMatrix

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.convolveMatrix.exceptions.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.convolveMatrix.exceptions.worker.js new file mode 100644 index 0000000000..fa3be89ba2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.convolveMatrix.exceptions.worker.js @@ -0,0 +1,56 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.layers.convolveMatrix.exceptions +// Description:Test exceptions on CanvasFilter() convolveMatrix +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test exceptions on CanvasFilter() convolveMatrix"); +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() { ctx.beginLayer({filter: + {name: 'convolveMatrix'}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'convolveMatrix', divisor: 2}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: null}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: 1}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: [[1, 0], [0]]}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: [[1, 'a'], [0]]}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: [[1, 0], 0]}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: [[1, 0], [0, Infinity]]}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: []}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: [1]}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: [1, 2, 3, 4]}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: [[], []]}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: [[1, 2], []]}}); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: [[], [1, 2]]}}); }); + // This should not throw an error + ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: [[]]}}); + ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'convolveMatrix', kernelMatrix: [[1]]}}); + ctx.endLayer(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow-expected.html new file mode 100644 index 0000000000..1719d99b4a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow-expected.html @@ -0,0 +1,57 @@ + + +Canvas test: 2d.filter.layers.dropShadow +

2d.filter.layers.dropShadow

+

Test CanvasFilter() dropShadow object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.html new file mode 100644 index 0000000000..10392dea5a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.html @@ -0,0 +1,270 @@ + + +OffscreenCanvas test: 2d.filter.layers.dropShadow.exceptions + + + + +

2d.filter.layers.dropShadow.exceptions

+

Test exceptions on CanvasFilter() dropShadow object

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.worker.js new file mode 100644 index 0000000000..86b8c56af6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.worker.js @@ -0,0 +1,265 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.layers.dropShadow.exceptions +// Description:Test exceptions on CanvasFilter() dropShadow object +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test exceptions on CanvasFilter() dropShadow object"); +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'); + + // Should not throw an error. + // dx + ctx.beginLayer({filter: + {name: 'dropShadow', dx: 10}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: -1}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: 0.5}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: null}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: true}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: false}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: []}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: [20]}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: '30'}}); ctx.endLayer(); + // dy + ctx.beginLayer({filter: + {name: 'dropShadow', dy: 10}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: -1}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: 0.5}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: null}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: true}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: false}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: []}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: [20]}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: '30'}}); ctx.endLayer(); + // floodOpacity + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: 10}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: -1}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: 0.5}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: null}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: true}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: false}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: []}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: [20]}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: '30'}}); ctx.endLayer(); + // dx + ctx.beginLayer({filter: + {name: 'dropShadow', dx: 10}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: -1}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: 0.5}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: null}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: true}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: false}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: []}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: [20]}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dx: '30'}}); ctx.endLayer(); + // dy + ctx.beginLayer({filter: + {name: 'dropShadow', dy: 10}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: -1}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: 0.5}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: null}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: true}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: false}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: []}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: [20]}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', dy: '30'}}); ctx.endLayer(); + // floodOpacity + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: 10}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: -1}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: 0.5}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: null}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: true}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: false}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: []}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: [20]}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: '30'}}); ctx.endLayer(); + // stdDeviation + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: 10}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: -1}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: 0.5}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: null}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: true}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: false}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: []}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: [20]}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: '30'}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: [10, -1]}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: [0.5, null]}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: [true, false]}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: [[], [20]]}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: ['30', ['40']]}}); ctx.endLayer(); + // floodColor + ctx.beginLayer({filter: + {name: 'dropShadow', floodColor: 'red'}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodColor: 'canvas'}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodColor: '#aabbccdd'}}); ctx.endLayer(); + ctx.beginLayer({filter: + {name: 'dropShadow', floodColor: '#abcd'}}); ctx.endLayer(); + + // Should throw a TypeError. + // dx + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dx: NaN}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dx: Infinity}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dx: -Infinity}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dx: undefined}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dx: 'test'}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dx: {}}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dx: [1, 2]}}); ctx.endLayer(); }); + // dy + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dy: NaN}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dy: Infinity}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dy: -Infinity}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dy: undefined}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dy: 'test'}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dy: {}}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', dy: [1, 2]}}); ctx.endLayer(); }); + // floodOpacity + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: NaN}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: Infinity}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: -Infinity}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: undefined}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: 'test'}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: {}}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', floodOpacity: [1, 2]}}); ctx.endLayer(); }); + // stdDeviation + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: NaN}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: Infinity}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: -Infinity}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: undefined}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: 'test'}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: {}}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: [1, 2, 3]}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: [1, NaN]}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: [1, Infinity]}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: [1, -Infinity]}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: [1, undefined]}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: [1, 'test']}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: [1, {}]}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', stdDeviation: [1, [2, 3]]}}); ctx.endLayer(); }); + // floodColor + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', floodColor: 'test'}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', floodColor: 'rgba(NaN, 3, 2, 1)'}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', floodColor: 10}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', floodColor: undefined}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', floodColor: null}}); ctx.endLayer(); }); + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: + {name: 'dropShadow', floodColor: NaN}}); ctx.endLayer(); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.html new file mode 100644 index 0000000000..1ecf309fc4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.html @@ -0,0 +1,97 @@ + + + +Canvas test: 2d.filter.layers.dropShadow +

2d.filter.layers.dropShadow

+

Test CanvasFilter() dropShadow object.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.w.html new file mode 100644 index 0000000000..e73b573779 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.w.html @@ -0,0 +1,111 @@ + + + + +Canvas test: 2d.filter.layers.dropShadow +

2d.filter.layers.dropShadow

+

Test CanvasFilter() dropShadow object.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.isotropic-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.isotropic-expected.html new file mode 100644 index 0000000000..4f93754862 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.isotropic-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.layers.gaussianBlur.isotropic +

2d.filter.layers.gaussianBlur.isotropic

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.isotropic.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.isotropic.html new file mode 100644 index 0000000000..50a98df1be --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.isotropic.html @@ -0,0 +1,24 @@ + + + +Canvas test: 2d.filter.layers.gaussianBlur.isotropic +

2d.filter.layers.gaussianBlur.isotropic

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.isotropic.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.isotropic.w.html new file mode 100644 index 0000000000..a68b8e78a2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.isotropic.w.html @@ -0,0 +1,38 @@ + + + + +Canvas test: 2d.filter.layers.gaussianBlur.isotropic +

2d.filter.layers.gaussianBlur.isotropic

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-x-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-x-expected.html new file mode 100644 index 0000000000..255270c192 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-x-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.layers.gaussianBlur.mostly-x +

2d.filter.layers.gaussianBlur.mostly-x

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-x.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-x.html new file mode 100644 index 0000000000..efc634796c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-x.html @@ -0,0 +1,24 @@ + + + +Canvas test: 2d.filter.layers.gaussianBlur.mostly-x +

2d.filter.layers.gaussianBlur.mostly-x

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-x.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-x.w.html new file mode 100644 index 0000000000..7d20d78503 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-x.w.html @@ -0,0 +1,38 @@ + + + + +Canvas test: 2d.filter.layers.gaussianBlur.mostly-x +

2d.filter.layers.gaussianBlur.mostly-x

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-y-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-y-expected.html new file mode 100644 index 0000000000..76a46b1533 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-y-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.layers.gaussianBlur.mostly-y +

2d.filter.layers.gaussianBlur.mostly-y

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-y.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-y.html new file mode 100644 index 0000000000..bdc6e66fe5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-y.html @@ -0,0 +1,24 @@ + + + +Canvas test: 2d.filter.layers.gaussianBlur.mostly-y +

2d.filter.layers.gaussianBlur.mostly-y

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-y.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-y.w.html new file mode 100644 index 0000000000..dfd6438b19 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.mostly-y.w.html @@ -0,0 +1,38 @@ + + + + +Canvas test: 2d.filter.layers.gaussianBlur.mostly-y +

2d.filter.layers.gaussianBlur.mostly-y

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.x-only-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.x-only-expected.html new file mode 100644 index 0000000000..26741f9847 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.x-only-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.layers.gaussianBlur.x-only +

2d.filter.layers.gaussianBlur.x-only

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.x-only.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.x-only.html new file mode 100644 index 0000000000..0d42acb8b5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.x-only.html @@ -0,0 +1,24 @@ + + + +Canvas test: 2d.filter.layers.gaussianBlur.x-only +

2d.filter.layers.gaussianBlur.x-only

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.x-only.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.x-only.w.html new file mode 100644 index 0000000000..b235c7ad38 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.x-only.w.html @@ -0,0 +1,38 @@ + + + + +Canvas test: 2d.filter.layers.gaussianBlur.x-only +

2d.filter.layers.gaussianBlur.x-only

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.y-only-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.y-only-expected.html new file mode 100644 index 0000000000..d00eec6b57 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.y-only-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.layers.gaussianBlur.y-only +

2d.filter.layers.gaussianBlur.y-only

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.y-only.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.y-only.html new file mode 100644 index 0000000000..c9bc85d699 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.y-only.html @@ -0,0 +1,24 @@ + + + +Canvas test: 2d.filter.layers.gaussianBlur.y-only +

2d.filter.layers.gaussianBlur.y-only

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.y-only.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.y-only.w.html new file mode 100644 index 0000000000..5deb96c255 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.y-only.w.html @@ -0,0 +1,38 @@ + + + + +Canvas test: 2d.filter.layers.gaussianBlur.y-only +

2d.filter.layers.gaussianBlur.y-only

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.turbulence.inputTypes.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.turbulence.inputTypes.html new file mode 100644 index 0000000000..27f7748c84 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.turbulence.inputTypes.html @@ -0,0 +1,131 @@ + + +OffscreenCanvas test: 2d.filter.layers.turbulence.inputTypes + + + + +

2d.filter.layers.turbulence.inputTypes

+

Test exceptions on CanvasFilter() turbulence object

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.turbulence.inputTypes.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.turbulence.inputTypes.worker.js new file mode 100644 index 0000000000..3728566c99 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.turbulence.inputTypes.worker.js @@ -0,0 +1,126 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.layers.turbulence.inputTypes +// Description:Test exceptions on CanvasFilter() turbulence object +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test exceptions on CanvasFilter() turbulence object"); +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'); + + const errorTestCases = [ + {baseFrequency: {}}, + {baseFrequency: -1}, + {baseFrequency: [0, -1]}, + {baseFrequency: NaN}, + {baseFrequency: Infinity}, + {baseFrequency: undefined}, + {baseFrequency: -Infinity}, + {baseFrequency: 'test'}, + + {numOctaves: {}}, + {numOctaves: -1}, + {numOctaves: NaN}, + {numOctaves: Infinity}, + {numOctaves: undefined}, + {numOctaves: -Infinity}, + {numOctaves: [1, 1]}, + {numOctaves: 'test'}, + + {seed: {}}, + {seed: NaN}, + {seed: Infinity}, + {seed: undefined}, + {seed: -Infinity}, + {seed: [1, 1]}, + {seed: 'test'}, + + {stitchTiles: {}}, + {stitchTiles: NaN}, + {stitchTiles: Infinity}, + {stitchTiles: undefined}, + {stitchTiles: -Infinity}, + {stitchTiles: [1, 1]}, + {stitchTiles: 'test'}, + {stitchTiles: null}, + {stitchTiles: []}, + {stitchTiles: [10]}, + {stitchTiles: 30}, + {stitchTiles: false}, + {stitchTiles: true}, + {stitchTiles: '10'}, + {stitchTiles: -1}, + + {type: {}}, + {type: NaN}, + {type: Infinity}, + {type: undefined}, + {type: -Infinity}, + {type: [1, 1]}, + {type: 'test'}, + {type: null}, + {type: []}, + {type: [10]}, + {type: 30}, + {type: false}, + {type: true}, + {type: '10'}, + {type: -1}, + ] + + // null and [] = 0 when parsed as number + const workingTestCases = [ + {baseFrequency: null}, + {baseFrequency: []}, + {baseFrequency: [10]}, + {baseFrequency: [10, 3]}, + {baseFrequency: 30}, + {baseFrequency: false}, + {baseFrequency: true}, + {baseFrequency: '10'}, + + {numOctaves: null}, + {numOctaves: []}, + {numOctaves: [10]}, + {numOctaves: 30}, + {numOctaves: false}, + {numOctaves: true}, + {numOctaves: '10'}, + + {seed: null}, + {seed: []}, + {seed: [10]}, + {seed: 30}, + {seed: false}, + {seed: true}, + {seed: '10'}, + {seed: -1}, + + {stitchTiles: 'stitch'}, + {stitchTiles: 'noStitch'}, + + {type: 'fractalNoise'}, + {type: 'turbulence'}, + ] + + for (testCase of errorTestCases) { + const filterOptions = {...{name: 'turbulence'}, ...testCase}; + assert_throws_js(TypeError, function() { ctx.beginLayer({filter: filterOptions}); }); + } + + for (testCase of workingTestCases) { + const filterOptions = {...{name: 'turbulence'}, ...testCase}; + ctx.beginLayer({filter: filterOptions}); + ctx.endLayer(); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter-expected.html new file mode 100644 index 0000000000..5fc1ac9acd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter-expected.html @@ -0,0 +1,25 @@ + + +Canvas test: 2d.layer.ctm.filter +

2d.layer.ctm.filter

+

Checks that parent transforms affect layer filters.

+ + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter.html new file mode 100644 index 0000000000..e5efc24bcc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter.html @@ -0,0 +1,32 @@ + + + +Canvas test: 2d.layer.ctm.filter +

2d.layer.ctm.filter

+

Checks that parent transforms affect layer filters.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter.w.html new file mode 100644 index 0000000000..760a65e2c8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.filter.w.html @@ -0,0 +1,46 @@ + + + + +Canvas test: 2d.layer.ctm.filter +

2d.layer.ctm.filter

+

Checks that parent transforms affect layer filters.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.getTransform.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.getTransform.html new file mode 100644 index 0000000000..b2306d95ac --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.getTransform.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.layer.ctm.getTransform + + + + +

2d.layer.ctm.getTransform

+

Tests getTransform inside layers.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.getTransform.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.getTransform.worker.js new file mode 100644 index 0000000000..54b1fee5d0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.getTransform.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.layer.ctm.getTransform +// Description:Tests getTransform inside layers. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Tests getTransform inside layers."); +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.translate(10, 20); + ctx.beginLayer(); + ctx.scale(2, 3); + const m = ctx.getTransform(); + assert_array_equals([m.a, m.b, m.c, m.d, m.e, m.f], [2, 0, 0, 3, 10, 20]); + ctx.endLayer(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.resetTransform-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.resetTransform-expected.html new file mode 100644 index 0000000000..fd4c1746c7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.resetTransform-expected.html @@ -0,0 +1,19 @@ + + +Canvas test: 2d.layer.ctm.resetTransform +

2d.layer.ctm.resetTransform

+

Tests resetTransform inside layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.resetTransform.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.resetTransform.html new file mode 100644 index 0000000000..9508b34044 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.resetTransform.html @@ -0,0 +1,31 @@ + + + +Canvas test: 2d.layer.ctm.resetTransform +

2d.layer.ctm.resetTransform

+

Tests resetTransform inside layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.resetTransform.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.resetTransform.w.html new file mode 100644 index 0000000000..7bf63e1473 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.resetTransform.w.html @@ -0,0 +1,45 @@ + + + + +Canvas test: 2d.layer.ctm.resetTransform +

2d.layer.ctm.resetTransform

+

Tests resetTransform inside layers.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.setTransform-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.setTransform-expected.html new file mode 100644 index 0000000000..45a3d095e1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.setTransform-expected.html @@ -0,0 +1,20 @@ + + +Canvas test: 2d.layer.ctm.setTransform +

2d.layer.ctm.setTransform

+

Tests setTransform inside layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.setTransform.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.setTransform.html new file mode 100644 index 0000000000..91034943b6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.setTransform.html @@ -0,0 +1,31 @@ + + + +Canvas test: 2d.layer.ctm.setTransform +

2d.layer.ctm.setTransform

+

Tests setTransform inside layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.setTransform.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.setTransform.w.html new file mode 100644 index 0000000000..8b1ea1ce51 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.setTransform.w.html @@ -0,0 +1,45 @@ + + + + +Canvas test: 2d.layer.ctm.setTransform +

2d.layer.ctm.setTransform

+

Tests setTransform inside layers.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.shadow-in-transformed-layer-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.shadow-in-transformed-layer-expected.html new file mode 100644 index 0000000000..312ca19b4c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.shadow-in-transformed-layer-expected.html @@ -0,0 +1,27 @@ + + +Canvas test: 2d.layer.ctm.shadow-in-transformed-layer +

2d.layer.ctm.shadow-in-transformed-layer

+

Check shadows inside of a transformed layer.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.shadow-in-transformed-layer.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.shadow-in-transformed-layer.html new file mode 100644 index 0000000000..59305076f0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.shadow-in-transformed-layer.html @@ -0,0 +1,34 @@ + + + +Canvas test: 2d.layer.ctm.shadow-in-transformed-layer +

2d.layer.ctm.shadow-in-transformed-layer

+

Check shadows inside of a transformed layer.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.shadow-in-transformed-layer.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.shadow-in-transformed-layer.w.html new file mode 100644 index 0000000000..486a028335 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.ctm.shadow-in-transformed-layer.w.html @@ -0,0 +1,48 @@ + + + + +Canvas test: 2d.layer.ctm.shadow-in-transformed-layer +

2d.layer.ctm.shadow-in-transformed-layer

+

Check shadows inside of a transformed layer.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.drawImage-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.drawImage-expected.html new file mode 100644 index 0000000000..26f6e75214 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.drawImage-expected.html @@ -0,0 +1,29 @@ + + +Canvas test: 2d.layer.drawImage +

2d.layer.drawImage

+

Checks that drawImage writes the image to the layer and not the parent directly.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.drawImage.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.drawImage.html new file mode 100644 index 0000000000..37718f6f2c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.drawImage.html @@ -0,0 +1,36 @@ + + + +Canvas test: 2d.layer.drawImage +

2d.layer.drawImage

+

Checks that drawImage writes the image to the layer and not the parent directly.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.drawImage.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.drawImage.w.html new file mode 100644 index 0000000000..78a235597d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.drawImage.w.html @@ -0,0 +1,50 @@ + + + + +Canvas test: 2d.layer.drawImage +

2d.layer.drawImage

+

Checks that drawImage writes the image to the layer and not the parent directly.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.html index be6f962b33..0e48cb49f7 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.html +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.html @@ -1,6 +1,7 @@ + Canvas test: 2d.layer.global-states.filter.alpha.blending

2d.layer.global-states.filter.alpha.blending

Checks that layers with filters correctly use global render states.

diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.w.html index 2b53ad7c1e..3887ed4485 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.w.html +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.w.html @@ -2,6 +2,7 @@ + Canvas test: 2d.layer.global-states.filter.alpha.blending

2d.layer.global-states.filter.alpha.blending

Checks that layers with filters correctly use global render states.

diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.html index 087fea88af..1a9bc8b733 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.html +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.html @@ -1,6 +1,7 @@ + Canvas test: 2d.layer.global-states.filter.alpha.composite

2d.layer.global-states.filter.alpha.composite

Checks that layers with filters correctly use global render states.

diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.w.html index 6aa83a3278..5c90fe95aa 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.w.html +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.w.html @@ -2,6 +2,7 @@ + Canvas test: 2d.layer.global-states.filter.alpha.composite

2d.layer.global-states.filter.alpha.composite

Checks that layers with filters correctly use global render states.

diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.html index f1d631c25c..f64e8925f0 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.html +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.html @@ -1,6 +1,7 @@ + Canvas test: 2d.layer.global-states.filter.alpha

2d.layer.global-states.filter.alpha

Checks that layers with filters correctly use global render states.

diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.html index 2548c21181..5e8911ee17 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.html +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.html @@ -1,6 +1,7 @@ + Canvas test: 2d.layer.global-states.filter.alpha.shadow

2d.layer.global-states.filter.alpha.shadow

Checks that layers with filters correctly use global render states.

diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.w.html index 5e1494422e..b3be7e1ac8 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.w.html +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.w.html @@ -2,6 +2,7 @@ + Canvas test: 2d.layer.global-states.filter.alpha.shadow

2d.layer.global-states.filter.alpha.shadow

Checks that layers with filters correctly use global render states.

diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.w.html index e75d668ad5..21e55f856c 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.w.html +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.w.html @@ -2,6 +2,7 @@ + Canvas test: 2d.layer.global-states.filter.alpha

2d.layer.global-states.filter.alpha

Checks that layers with filters correctly use global render states.

diff --git a/testing/web-platform/tests/html/canvas/tools/gentestutilsunion.py b/testing/web-platform/tests/html/canvas/tools/gentestutilsunion.py index cf141f2f07..d7042810be 100644 --- a/testing/web-platform/tests/html/canvas/tools/gentestutilsunion.py +++ b/testing/web-platform/tests/html/canvas/tools/gentestutilsunion.py @@ -28,7 +28,7 @@ # # * Test the tests, add new ones to Git, remove deleted ones from Git, etc. -from typing import Any, List, Mapping, Optional, Set, Tuple +from typing import Any, DefaultDict, List, Mapping, Optional, Set, Tuple import re import collections @@ -184,6 +184,10 @@ def _remove_extra_newlines(text: str) -> str: return text def _expand_test_code(code: str) -> str: + code = re.sub(r' @moz-todo', '', code) + + code = re.sub(r'@moz-UniversalBrowserRead;', '', code) + code = _remove_extra_newlines(code) # Unroll expressions with a cross-product-style parameter expansion. @@ -202,11 +206,13 @@ def _expand_test_code(code: str) -> str: code = re.sub(r'@assert pixel (\d+,\d+) ==~ (\d+,\d+,\d+,\d+) \+/- (\d+);', r'_assertPixelApprox(canvas, \1, \2, \3);', code) - code = re.sub(r'@assert throws (\S+_ERR) (.*);', - r'assert_throws_dom("\1", function() { \2; });', code) + code = re.sub(r'@assert throws (\S+_ERR) (.*?);$', + r'assert_throws_dom("\1", function() { \2; });', code, + flags=re.MULTILINE | re.DOTALL) - code = re.sub(r'@assert throws (\S+Error) (.*);', - r'assert_throws_js(\1, function() { \2; });', code) + code = re.sub(r'@assert throws (\S+Error) (.*?);$', + r'assert_throws_js(\1, function() { \2; });', code, + flags=re.MULTILINE | re.DOTALL) code = re.sub( r'@assert (.*) === (.*);', lambda m: '_assertSame(%s, %s, "%s", "%s");' @@ -226,10 +232,6 @@ def _expand_test_code(code: str) -> str: r'@assert (.*);', lambda m: '_assert(%s, "%s");' % (m.group( 1), _escapeJS(m.group(1))), code) - code = re.sub(r' @moz-todo', '', code) - - code = re.sub(r'@moz-UniversalBrowserRead;', '', code) - assert ('@' not in code) return code @@ -376,45 +378,50 @@ def _write_testharness_test(jinja_env: jinja2.Environment, 'utf-8') +def _generate_expected_image(expected: str, name: str, sub_dir: str, + enabled_canvas_types: Set[CanvasType], + html_canvas_cfg: TestConfig, + offscreen_canvas_cfg: TestConfig) -> str: + """Creates a reference image using Cairo and returns the file location.""" + if expected == 'green': + return '/images/green-100x50.png' + if expected == 'clear': + return '/images/clear-100x50.png' + if ';' in expected: + print('Found semicolon in %s' % name) + expected = re.sub( + r'^size (\d+) (\d+)', + r'surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, \1, \2)' + r'\ncr = cairo.Context(surface)', expected) + + if CanvasType.HTML_CANVAS in enabled_canvas_types: + expected_canvas = ( + expected + "\nsurface.write_to_png('%s.png')\n" % + os.path.join(html_canvas_cfg.image_out_dir, sub_dir, name)) + eval(compile(expected_canvas, '' % name, 'exec'), {}, + {'cairo': cairo}) + + if {CanvasType.OFFSCREEN_CANVAS, CanvasType.WORKER} & enabled_canvas_types: + expected_offscreen = ( + expected + "\nsurface.write_to_png('%s.png')\n" % + os.path.join(offscreen_canvas_cfg.image_out_dir, sub_dir, name)) + eval(compile(expected_offscreen, '' % name, 'exec'), {}, + {'cairo': cairo}) + + return '%s.png' % name + + def _generate_test(test: Mapping[str, Any], jinja_env: jinja2.Environment, - sub_dir: str, enabled_tests: Set[CanvasType], + name_to_sub_dir: Mapping[str, str], + used_tests: DefaultDict[str, Set[CanvasType]], html_canvas_cfg: TestConfig, offscreen_canvas_cfg: TestConfig) -> None: _validate_test(test) name = test['name'] - expected_img = None - if 'expected' in test and test['expected'] is not None: - expected = test['expected'] - if expected == 'green': - expected_img = '/images/green-100x50.png' - elif expected == 'clear': - expected_img = '/images/clear-100x50.png' - else: - if ';' in expected: - print('Found semicolon in %s' % name) - expected = re.sub( - r'^size (\d+) (\d+)', - r'surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, \1, \2)' - r'\ncr = cairo.Context(surface)', expected) - - if CanvasType.HTML_CANVAS in enabled_tests: - expected_canvas = ( - expected + "\nsurface.write_to_png('%s.png')\n" % - os.path.join(html_canvas_cfg.image_out_dir, sub_dir, name)) - eval(compile(expected_canvas, '' % name, 'exec'), {}, - {'cairo': cairo}) - - if {CanvasType.OFFSCREEN_CANVAS, CanvasType.WORKER} & enabled_tests: - expected_offscreen = ( - expected + - "\nsurface.write_to_png('%s.png')\n" % os.path.join( - offscreen_canvas_cfg.image_out_dir, sub_dir, name)) - eval(compile(expected_offscreen, '' % name, 'exec'), - {}, {'cairo': cairo}) - - expected_img = '%s.png' % name + sub_dir = _get_test_sub_dir(name, name_to_sub_dir) + enabled_canvas_types = _get_enabled_canvas_types(test) # Defaults: params = { @@ -423,11 +430,29 @@ def _generate_test(test: Mapping[str, Any], jinja_env: jinja2.Environment, } params.update(test) + + # Render parameters used in the test name. + name = jinja_env.from_string(name).render(params) + print('\r(%s)' % name, ' ' * 32, '\t') + + expected_img = None + if 'expected' in test and test['expected'] is not None: + expected_img = _generate_expected_image(test['expected'], name, + sub_dir, enabled_canvas_types, + html_canvas_cfg, + offscreen_canvas_cfg) + params.update({ 'code': _expand_test_code(test['code']), 'expected_img': expected_img }) + already_tested = used_tests[name].intersection(enabled_canvas_types) + if already_tested: + raise InvalidTestDefinitionError( + f'Test {name} is defined twice for types {already_tested}') + used_tests[name].update(enabled_canvas_types) + canvas_path = os.path.join(html_canvas_cfg.out_dir, sub_dir, name) offscreen_path = os.path.join(offscreen_canvas_cfg.out_dir, sub_dir, name) if 'manual' in test: @@ -435,11 +460,55 @@ def _generate_test(test: Mapping[str, Any], jinja_env: jinja2.Environment, offscreen_path += '-manual' if 'reference' in test or 'html_reference' in test: - _write_reference_test(jinja_env, params, enabled_tests, + _write_reference_test(jinja_env, params, enabled_canvas_types, canvas_path, offscreen_path) else: - _write_testharness_test(jinja_env, params, enabled_tests, canvas_path, - offscreen_path) + _write_testharness_test(jinja_env, params, enabled_canvas_types, + canvas_path, offscreen_path) + + +def _recursive_expand_variant_matrix(test_list: List[Mapping[str, Any]], + variant_matrix: List[Mapping[str, Any]], + current_selection: List[Tuple[str, Any]], + original_test: Mapping[str, Any]): + if len(current_selection) == len(variant_matrix): + # Selection for each variant is done, so add a new test to test_list. + test = original_test.copy() + variant_name_list = [] + should_append_variant_names = original_test.get( + 'append_variants_to_name', True) + for variant_name, variant_params in current_selection: + variant_name_list.append(variant_name) + # Append variant name. Variant names starting with '_' are + # not appended, which is useful to create variants with the same + # name in different folders (element vs. offscreen). + if (should_append_variant_names + and not variant_name.startswith('_')): + test['name'] += '.' + variant_name + test.update(variant_params) + # Expose variant names as a list so they can be used from the yaml + # files, which helps with better naming of tests. + test.update({'variant_names': variant_name_list}) + test_list.append(test) + else: + # Continue the recursion with each possible selection for the current + # variant. + variant = variant_matrix[len(current_selection)] + for variant_options in variant.items(): + current_selection.append(variant_options) + _recursive_expand_variant_matrix(test_list, variant_matrix, + current_selection, original_test) + current_selection.pop() + + +def _expand_variant_matrix( + variant_matrix: List[Mapping[str, Any]], + original_test: Mapping[str, Any]) -> List[Mapping[str, Any]]: + current_selection = [] + matrix_tests = [] + _recursive_expand_variant_matrix(matrix_tests, variant_matrix, + current_selection, original_test) + return matrix_tests def genTestUtils_union(NAME2DIRFILE: str) -> None: @@ -495,41 +564,25 @@ def genTestUtils_union(NAME2DIRFILE: str) -> None: pass # Ignore if it already exists, used_tests = collections.defaultdict(set) - for original_test in tests: - variants = original_test.get('variants', {'': dict()}) - for variant_name, variant_params in variants.items(): - test = original_test.copy() - if variant_name or variant_params: - # Append variant name. Variant names starting with '_' are - # not appended, which is useful to create variants with the same - # name in different folders (element vs. offscreen). - if not variant_name.startswith('_'): - test['name'] += '.' + variant_name - test.update(variant_params) - - name = test['name'] - print('\r(%s)' % name, ' ' * 32, '\t') - - enabled_canvas_types = _get_enabled_canvas_types(test) - - already_tested = used_tests[name].intersection( - enabled_canvas_types) - if already_tested: - raise InvalidTestDefinitionError( - f'Test {name} is defined twice for types {already_tested}') - used_tests[name].update(enabled_canvas_types) - - sub_dir = _get_test_sub_dir(name, name_to_sub_dir) - _generate_test( - test, - jinja_env, - sub_dir, - enabled_canvas_types, - html_canvas_cfg=TestConfig( - out_dir=CANVASOUTPUTDIR, - image_out_dir=CANVASIMAGEOUTPUTDIR), - offscreen_canvas_cfg=TestConfig( - out_dir=OFFSCREENCANVASOUTPUTDIR, - image_out_dir=OFFSCREENCANVASIMAGEOUTPUTDIR)) + for test in tests: + if 'variant_matrix' in test: + variants = _expand_variant_matrix(test['variant_matrix'], test) + elif 'variants' in test: + variant_matrix = [test['variants']] + variants = _expand_variant_matrix(variant_matrix, test) + else: + variants = [test] + + for variant in variants: + _generate_test(variant, + jinja_env, + name_to_sub_dir, + used_tests, + html_canvas_cfg=TestConfig( + out_dir=CANVASOUTPUTDIR, + image_out_dir=CANVASIMAGEOUTPUTDIR), + offscreen_canvas_cfg=TestConfig( + out_dir=OFFSCREENCANVASOUTPUTDIR, + image_out_dir=OFFSCREENCANVASIMAGEOUTPUTDIR)) print() diff --git a/testing/web-platform/tests/html/canvas/tools/name2dir-offscreen.yaml b/testing/web-platform/tests/html/canvas/tools/name2dir-offscreen.yaml index c52acb793b..6e4b3f42b2 100644 --- a/testing/web-platform/tests/html/canvas/tools/name2dir-offscreen.yaml +++ b/testing/web-platform/tests/html/canvas/tools/name2dir-offscreen.yaml @@ -19,4 +19,4 @@ 2d.missingargs: "conformance-requirements" 2d.voidreturn: "conformance-requirements" 2d.canvas.host: "canvas-host" -2d.canvas.context: "canvas-context" \ No newline at end of file +2d.canvas.context: "canvas-context" diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-images-to-the-canvas.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-images-to-the-canvas.yaml index 93c556288d..09e9e00186 100644 --- a/testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-images-to-the-canvas.yaml +++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-images-to-the-canvas.yaml @@ -638,3 +638,11 @@ @nonfinite ctx.drawImage(, <0 Infinity -Infinity NaN>, <0 Infinity -Infinity NaN>, <100 Infinity -Infinity NaN>, <50 Infinity -Infinity NaN>, <0 Infinity -Infinity NaN>, <0 Infinity -Infinity NaN>, <100 Infinity -Infinity NaN>, <50 Infinity -Infinity NaN>); @assert pixel 50,25 == 0,255,0,255; expected: green + +- name: 2d.drawImage.detachedcanvas + desc: drawImage with detached OffscreenCanvas as the source should throw exception + canvasType: ['HTMLCanvas'] + code: | + var canvas2 = new OffscreenCanvas(80, 80); + (new MessageChannel()).port1.postMessage(canvas2, [canvas2]); + @assert throws INVALID_STATE_ERR ctx.drawImage(canvas2, 0, 0); diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/filters.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/filters.yaml index 01c83a33e2..f327b9fe94 100644 --- a/testing/web-platform/tests/html/canvas/tools/yaml-new/filters.yaml +++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/filters.yaml @@ -89,51 +89,102 @@ ctx.filter = 'this string is not a filter and should do nothing'; @assert ctx.filter.toString() == '[object CanvasFilter]'; -- name: 2d.filter.canvasFilterObject.blur.exceptions.tentative - desc: Test exceptions on CanvasFilter() blur.object +- name: 2d.filter.{{ variant_names[0] }}.blur.exceptions{{ tentative }} + desc: Test exceptions on gaussianBlur filter code: | - @assert throws TypeError ctx.filter = new CanvasFilter({name: 'gaussianBlur'}); - @assert throws TypeError ctx.filter = new CanvasFilter({name: 'gaussianBlur', stdDeviation: undefined}); - @assert throws TypeError ctx.filter = new CanvasFilter({name: 'gaussianBlur', stdDeviation: 'foo'}); - @assert throws TypeError ctx.filter = new CanvasFilter({name: 'gaussianBlur', stdDeviation: [1,2,3]}); - @assert throws TypeError ctx.filter = new CanvasFilter({name: 'gaussianBlur', stdDeviation: NaN}); - @assert throws TypeError ctx.filter = new CanvasFilter({name: 'gaussianBlur', stdDeviation: {}}); - -- name: 2d.filter.canvasFilterObject.colorMatrix.tentative - desc: Test the functionality of ColorMatrix filters in CanvasFilter objects + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'gaussianBlur'}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'gaussianBlur', stdDeviation: undefined}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'gaussianBlur', stdDeviation: 'foo'}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'gaussianBlur', stdDeviation: [1,2,3]}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'gaussianBlur', stdDeviation: NaN}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'gaussianBlur', stdDeviation: {}}") }}; + append_variants_to_name: false + variants: + layers: + filter_declaration: |- + ctx.beginLayer({filter: + param}) + canvasFilterObject: + filter_declaration: |- + ctx.filter = new CanvasFilter( + param) + tentative: .tentative + +- name: 2d.filter.{{ variant_names[0] }}.colorMatrix{{ tentative }} + desc: Test the functionality of ColorMatrix filters code: | - @assert throws TypeError new CanvasFilter({name: 'colorMatrix', values: undefined}); - @assert throws TypeError new CanvasFilter({name: 'colorMatrix', values: 'foo'}); - @assert throws TypeError new CanvasFilter({name: 'colorMatrix', values: null}); - @assert throws TypeError new CanvasFilter({name: 'colorMatrix', values: [1, 2, 3]}); - @assert throws TypeError new CanvasFilter({name: 'colorMatrix', values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 'a']}); - @assert throws TypeError new CanvasFilter({name: 'colorMatrix', values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, Infinity]}); + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'colorMatrix', values: undefined}") }}; + + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'colorMatrix', values: 'foo'}") }}; + + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'colorMatrix', values: null}") }}; + + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'colorMatrix', values: [1, 2, 3]}") }}; + + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'colorMatrix', + values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 'a']}") }}; + + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'colorMatrix', + values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, Infinity]}") }}; + ctx.fillStyle = '#f00'; - ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'hueRotate', values: 0}); + {{ filter_declaration | replace("param", + "{name: 'colorMatrix', type: 'hueRotate', values: 0}") }}; ctx.fillRect(0, 0, 100, 50); + {{ close_layer -}} @assert pixel 10,10 ==~ 255,0,0,255; - ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'hueRotate', values: 90}); + + {{ filter_declaration | replace("param", + "{name: 'colorMatrix', type: 'hueRotate', values: 90}") }}; ctx.fillRect(0, 0, 100, 50); + {{ close_layer -}} @assert pixel 10,10 ==~ 0,91,0,255; - ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'hueRotate', values: 180}); + + {{ filter_declaration | replace("param", + "{name: 'colorMatrix', type: 'hueRotate', values: 180}") }}; ctx.fillRect(0, 0, 100, 50); + {{ close_layer -}} @assert pixel 10,10 ==~ 0,109,109,255; - ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'hueRotate', values: 270}); + + {{ filter_declaration | replace("param", + "{name: 'colorMatrix', type: 'hueRotate', values: 270}") }}; ctx.fillRect(0, 0, 100, 50); + {{ close_layer -}} @assert pixel 10,10 ==~ 109,18,255,255; - ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'saturate', values: 0.5}); + + {{ filter_declaration | replace("param", + "{name: 'colorMatrix', type: 'saturate', values: 0.5}") }}; ctx.fillRect(0, 0, 100, 50); + {{ close_layer -}} @assert pixel 10,10 ==~ 155,27,27,255; + ctx.clearRect(0, 0, 100, 50); - ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'luminanceToAlpha'}); + {{ filter_declaration | replace("param", + "{name: 'colorMatrix', type: 'luminanceToAlpha'}") }}; ctx.fillRect(0, 0, 100, 50); + {{ close_layer -}} @assert pixel 10,10 ==~ 0,0,0,54; - ctx.filter = new CanvasFilter({name: 'colorMatrix', values: [ - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0 - ]}); + + {{ filter_declaration | replace("param", "{name: 'colorMatrix', values: [ + 0, 0, 0, 0, 0, + 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0 + ]}") }}; ctx.fillRect(0, 0, 50, 25); ctx.fillStyle = '#0f0'; ctx.fillRect(50, 0, 50, 25); @@ -141,51 +192,120 @@ ctx.fillRect(0, 25, 50, 25); ctx.fillStyle = '#fff'; ctx.fillRect(50, 25, 50, 25); + {{ close_layer -}} @assert pixel 10,10 ==~ 0,255,0,255; @assert pixel 60,10 ==~ 0,255,0,255; @assert pixel 10,30 ==~ 0,255,0,255; @assert pixel 60,30 ==~ 0,255,0,255; - -- name: 2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative + append_variants_to_name: false + variants: + layers: + filter_declaration: |- + ctx.beginLayer({filter: + param}) + close_layer: | + ctx.endLayer(); + canvasFilterObject: + filter_declaration: |- + ctx.filter = new CanvasFilter( + param) + tentative: .tentative + +- name: 2d.filter.{{ variant_names[0] }}.convolveMatrix.exceptions{{ tentative }} desc: Test exceptions on CanvasFilter() convolveMatrix code: | - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix'}); - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix', divisor: 2}); - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix', kernelMatrix: null}); - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix', kernelMatrix: 1}); - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], [0]]}); - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 'a'], [0]]}); - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], 0]}); - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], [0, Infinity]]}); - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix', kernelMatrix: []}); - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [1]}); - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [1, 2, 3, 4]}); - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[], []]}); - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 2], []]}); - @assert throws TypeError new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[], [1, 2]]}); + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix'}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', divisor: 2}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: null}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: 1}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: [[1, 0], [0]]}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: [[1, 'a'], [0]]}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: [[1, 0], 0]}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: [[1, 0], [0, Infinity]]}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: []}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: [1]}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: [1, 2, 3, 4]}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: [[], []]}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: [[1, 2], []]}") }}; + @assert throws TypeError {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: [[], [1, 2]]}") }}; // This should not throw an error - ctx.filter = new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[]]}); - ctx.filter = new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1]]}); - -- name: 2d.filter.canvasFilterObject.componentTransfer.linear.tentative + {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: [[]]}") }}; + {{ close_layer -}} + {{ filter_declaration | replace("param", + "{name: 'convolveMatrix', kernelMatrix: [[1]]}") }}; + {{ close_layer -}} + append_variants_to_name: false + variants: + layers: + filter_declaration: |- + ctx.beginLayer({filter: + param}) + close_layer: | + ctx.endLayer(); + canvasFilterObject: + filter_declaration: |- + ctx.filter = new CanvasFilter( + param) + tentative: .tentative + +- name: >- + 2d.filter.{{ variant_names[0] }}.componentTransfer.linear{{ tentative }} desc: Test pixels on CanvasFilter() componentTransfer with linear type + size: [100, 100] + fuzzy: maxDifference=0-2; totalPixels=0-500 code: | + const slopes = [0.5, 1.2, -0.2]; + const intercepts = [0.25, 0, 0.5]; + {{ filter_declaration | replace("param", "{name: 'componentTransfer', + funcR: {type: 'linear', slope: slopes[0], intercept: intercepts[0]}, + funcG: {type: 'linear', slope: slopes[1], intercept: intercepts[1]}, + funcB: {type: 'linear', slope: slopes[2], intercept: intercepts[2]}, + }") }}; + + const inputColors = [ + [255, 255, 255], + [0, 0, 0], + [127, 0, 34], + [252, 186, 3], + [50, 68, 87], + ]; + + for (let i = 0 ; i < inputColors.length ; ++i) { + const color = inputColors[i]; + ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; + ctx.fillRect(i * 10, i * 10, 10, 10); + } + {{ close_layer }} + reference: | // From https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement function getColor(inputColor, slopes, intercepts) { return [ - Math.max(0, Math.min(1, inputColor[0]/255 * slopes[0] + intercepts[0])) * 255, - Math.max(0, Math.min(1, inputColor[1]/255 * slopes[1] + intercepts[1])) * 255, - Math.max(0, Math.min(1, inputColor[2]/255 * slopes[2] + intercepts[2])) * 255, + Math.max(0, Math.min(1, + inputColor[0]/255 * slopes[0] + intercepts[0])) * 255, + Math.max(0, Math.min(1, + inputColor[1]/255 * slopes[1] + intercepts[1])) * 255, + Math.max(0, Math.min(1, + inputColor[2]/255 * slopes[2] + intercepts[2])) * 255, ]; } const slopes = [0.5, 1.2, -0.2]; const intercepts = [0.25, 0, 0.5]; - ctx.filter = new CanvasFilter({name: 'componentTransfer', - funcR: {type: 'linear', slope: slopes[0], intercept: intercepts[0]}, - funcG: {type: 'linear', slope: slopes[1], intercept: intercepts[1]}, - funcB: {type: 'linear', slope: slopes[2], intercept: intercepts[2]}, - }); const inputColors = [ [255, 255, 255], @@ -195,21 +315,35 @@ [50, 68, 87], ]; - for (const color of inputColors) { + for (let i = 0 ; i < inputColors.length ; ++i) { + const color = inputColors[i]; let outputColor = getColor(color, slopes, intercepts); - ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; - ctx.fillRect(0, 0, 10, 10); - _assertPixelApprox(canvas, 5, 5, outputColor[0],outputColor[1],outputColor[2],255, 2); + ctx.fillStyle = `rgb(${outputColor[0]}, ${outputColor[1]}, + ${outputColor[2]})`; + ctx.fillRect(i * 10, i * 10, 10, 10); } - -- name: 2d.filter.canvasFilterObject.componentTransfer.identity.tentative + {{ close_layer }} + append_variants_to_name: false + variants: + layers: + filter_declaration: |- + ctx.beginLayer({filter: param}) + close_layer: ctx.endLayer(); + canvasFilterObject: + filter_declaration: |- + ctx.filter = new CanvasFilter(param) + tentative: .tentative + +- name: >- + 2d.filter.{{ variant_names[0] }}.componentTransfer.identity{{ tentative }} desc: Test pixels on CanvasFilter() componentTransfer with identity type + size: [100, 100] code: | - ctx.filter = new CanvasFilter({name: 'componentTransfer', + {{ filter_declaration | replace("param", "{name: 'componentTransfer', funcR: {type: 'identity'}, funcG: {type: 'identity'}, funcB: {type: 'identity'}, - }); + }") }}; const inputColors = [ [255, 255, 255], @@ -219,32 +353,86 @@ [50, 68, 87], ]; - for (const color of inputColors) { - ctx.fillStyle = `rgba(${color[0]}, ${color[1]}, ${color[2]}, 1)`, - ctx.fillRect(0, 0, 10, 10); - _assertPixel(canvas, 5, 5, color[0],color[1],color[2],255); + for (let i = 0 ; i < inputColors.length ; ++i) { + const color = inputColors[i]; + ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; + ctx.fillRect(i * 10, i * 10, 10, 10); } + {{ close_layer }} + reference: | + const inputColors = [ + [255, 255, 255], + [0, 0, 0], + [127, 0, 34], + [252, 186, 3], + [50, 68, 87], + ]; -- name: 2d.filter.canvasFilterObject.componentTransfer.gamma.tentative + for (let i = 0 ; i < inputColors.length ; ++i) { + let outputColor = inputColors[i]; + ctx.fillStyle = `rgb(${outputColor[0]}, ${outputColor[1]}, + ${outputColor[2]})`; + ctx.fillRect(i * 10, i * 10, 10, 10); + } + append_variants_to_name: false + variants: + layers: + filter_declaration: |- + ctx.beginLayer({filter: param}) + close_layer: ctx.endLayer(); + canvasFilterObject: + filter_declaration: |- + ctx.filter = new CanvasFilter(param) + tentative: .tentative + +- name: >- + 2d.filter.{{ variant_names[0] }}.componentTransfer.gamma{{ tentative }} desc: Test pixels on CanvasFilter() componentTransfer with gamma type + size: [100, 100] + fuzzy: maxDifference=0-2; totalPixels=0-500 code: | + const amplitudes = [2, 1.1, 0.5]; + const exponents = [5, 3, 1]; + const offsets = [0.25, 0, 0.5]; + {{ filter_declaration | replace("param", "{name: 'componentTransfer', + funcR: {type: 'gamma', amplitude: amplitudes[0], + exponent: exponents[0], offset: offsets[0]}, + funcG: {type: 'gamma', amplitude: amplitudes[1], + exponent: exponents[1], offset: offsets[1]}, + funcB: {type: 'gamma', amplitude: amplitudes[2], + exponent: exponents[2], offset: offsets[2]}, + }") }}; + + const inputColors = [ + [255, 255, 255], + [0, 0, 0], + [127, 0, 34], + [252, 186, 3], + [50, 68, 87], + ]; + + for (let i = 0 ; i < inputColors.length ; ++i) { + const color = inputColors[i]; + ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; + ctx.fillRect(i * 10, i * 10, 10, 10); + } + {{ close_layer }} + reference: | // From https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement function getColor(inputColor, amplitude, exponent, offset) { return [ - Math.max(0, Math.min(1, Math.pow(inputColor[0]/255, exponent[0]) * amplitude[0] + offset[0])) * 255, - Math.max(0, Math.min(1, Math.pow(inputColor[1]/255, exponent[1]) * amplitude[1] + offset[1])) * 255, - Math.max(0, Math.min(1, Math.pow(inputColor[2]/255, exponent[2]) * amplitude[2] + offset[2])) * 255, + Math.max(0, Math.min(1, Math.pow(inputColor[0]/255, + exponent[0]) * amplitude[0] + offset[0])) * 255, + Math.max(0, Math.min(1, Math.pow(inputColor[1]/255, + exponent[1]) * amplitude[1] + offset[1])) * 255, + Math.max(0, Math.min(1, Math.pow(inputColor[2]/255, + exponent[2]) * amplitude[2] + offset[2])) * 255, ]; } const amplitudes = [2, 1.1, 0.5]; const exponents = [5, 3, 1]; const offsets = [0.25, 0, 0.5]; - ctx.filter = new CanvasFilter({name: 'componentTransfer', - funcR: {type: 'gamma', amplitude: amplitudes[0], exponent: exponents[0], offset: offsets[0]}, - funcG: {type: 'gamma', amplitude: amplitudes[1], exponent: exponents[1], offset: offsets[1]}, - funcB: {type: 'gamma', amplitude: amplitudes[2], exponent: exponents[2], offset: offsets[2]}, - }); const inputColors = [ [255, 255, 255], @@ -254,16 +442,54 @@ [50, 68, 87], ]; - for (const color of inputColors) { + for (let i = 0 ; i < inputColors.length ; ++i) { + const color = inputColors[i]; let outputColor = getColor(color, amplitudes, exponents, offsets); - ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; - ctx.fillRect(0, 0, 10, 10); - _assertPixelApprox(canvas, 5, 5, outputColor[0],outputColor[1],outputColor[2],255, 2); + ctx.fillStyle = `rgb(${outputColor[0]}, ${outputColor[1]}, + ${outputColor[2]})`; + ctx.fillRect(i * 10, i * 10, 10, 10); } - -- name: 2d.filter.canvasFilterObject.componentTransfer.table.tentative + append_variants_to_name: false + variants: + layers: + filter_declaration: |- + ctx.beginLayer({filter: param}) + close_layer: ctx.endLayer(); + canvasFilterObject: + filter_declaration: |- + ctx.filter = new CanvasFilter(param) + tentative: .tentative + +- name: >- + 2d.filter.{{ variant_names[0] }}.componentTransfer.table{{ tentative }} desc: Test pixels on CanvasFilter() componentTransfer with table type + size: [100, 100] + fuzzy: maxDifference=0-2; totalPixels=0-500 code: | + tableValuesR = [0, 0, 1, 1]; + tableValuesG = [2, 0, 0.5, 3]; + tableValuesB = [1, -1, 5, 0]; + {{ filter_declaration | replace("param", "{name: 'componentTransfer', + funcR: {type: 'table', tableValues: tableValuesR}, + funcG: {type: 'table', tableValues: tableValuesG}, + funcB: {type: 'table', tableValues: tableValuesB}, + }") }}; + + const inputColors = [ + [255, 255, 255], + [0, 0, 0], + [127, 0, 34], + [252, 186, 3], + [50, 68, 87], + ]; + + for (let i = 0 ; i < inputColors.length ; ++i) { + const color = inputColors[i]; + ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; + ctx.fillRect(i * 10, i * 10, 10, 10); + } + {{ close_layer }} + reference: | // From https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement function getTransformedValue(C, V) { // Get the right interval @@ -285,11 +511,6 @@ tableValuesR = [0, 0, 1, 1]; tableValuesG = [2, 0, 0.5, 3]; tableValuesB = [1, -1, 5, 0]; - ctx.filter = new CanvasFilter({name: 'componentTransfer', - funcR: {type: 'table', tableValues: tableValuesR}, - funcG: {type: 'table', tableValues: tableValuesG}, - funcB: {type: 'table', tableValues: tableValuesB}, - }); const inputColors = [ [255, 255, 255], @@ -299,16 +520,55 @@ [50, 68, 87], ]; - for (const color of inputColors) { - let outputColor = getColor(color, [tableValuesR, tableValuesG, tableValuesB]); - ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; - ctx.fillRect(0, 0, 10, 10); - _assertPixelApprox(canvas, 5, 5, outputColor[0],outputColor[1],outputColor[2],255, 2); + for (let i = 0 ; i < inputColors.length ; ++i) { + const color = inputColors[i]; + let outputColor = getColor( + color, [tableValuesR, tableValuesG, tableValuesB]); + ctx.fillStyle = `rgb(${outputColor[0]}, ${outputColor[1]}, + ${outputColor[2]})`; + ctx.fillRect(i * 10, i * 10, 10, 10); } - -- name: 2d.filter.canvasFilterObject.componentTransfer.discrete.tentative + append_variants_to_name: false + variants: + layers: + filter_declaration: |- + ctx.beginLayer({filter: param}) + close_layer: ctx.endLayer(); + canvasFilterObject: + filter_declaration: |- + ctx.filter = new CanvasFilter(param) + tentative: .tentative + +- name: >- + 2d.filter.{{ variant_names[0] }}.componentTransfer.discrete{{ tentative }} desc: Test pixels on CanvasFilter() componentTransfer with discrete type + size: [100, 100] + fuzzy: maxDifference=0-2; totalPixels=0-500 code: | + tableValuesR = [0, 0, 1, 1]; + tableValuesG = [2, 0, 0.5, 3]; + tableValuesB = [1, -1, 5, 0]; + {{ filter_declaration | replace("param", "{name: 'componentTransfer', + funcR: {type: 'discrete', tableValues: tableValuesR}, + funcG: {type: 'discrete', tableValues: tableValuesG}, + funcB: {type: 'discrete', tableValues: tableValuesB}, + }") }}; + + const inputColors = [ + [255, 255, 255], + [0, 0, 0], + [127, 0, 34], + [252, 186, 3], + [50, 68, 87], + ]; + + for (let i = 0 ; i < inputColors.length ; ++i) { + const color = inputColors[i]; + ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; + ctx.fillRect(i * 10, i * 10, 10, 10); + } + {{ close_layer }} + reference: | // From https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement function getTransformedValue(C, V) { // Get the right interval @@ -330,11 +590,6 @@ tableValuesR = [0, 0, 1, 1]; tableValuesG = [2, 0, 0.5, 3]; tableValuesB = [1, -1, 5, 0]; - ctx.filter = new CanvasFilter({name: 'componentTransfer', - funcR: {type: 'discrete', tableValues: tableValuesR}, - funcG: {type: 'discrete', tableValues: tableValuesG}, - funcB: {type: 'discrete', tableValues: tableValuesB}, - }); const inputColors = [ [255, 255, 255], @@ -343,24 +598,38 @@ [252, 186, 3], [50, 68, 87], ]; - - for (const color of inputColors) { - let outputColor = getColor(color, [tableValuesR, tableValuesG, tableValuesB]); - ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; - ctx.fillRect(0, 0, 10, 10); - _assertPixelApprox(canvas, 5, 5, outputColor[0],outputColor[1],outputColor[2],255, 2); + for (let i = 0 ; i < inputColors.length ; ++i) { + const color = inputColors[i]; + let outputColor = getColor( + color, [tableValuesR, tableValuesG, tableValuesB]); + ctx.fillStyle = `rgb(${outputColor[0]}, ${outputColor[1]}, + ${outputColor[2]})`; + ctx.fillRect(i * 10, i * 10, 10, 10); } - -- name: 2d.filter.canvasFilterObject.gaussianBlur.tentative + append_variants_to_name: false + variants: + layers: + filter_declaration: |- + ctx.beginLayer({filter: param}) + close_layer: ctx.endLayer(); + canvasFilterObject: + filter_declaration: |- + ctx.filter = new CanvasFilter(param) + tentative: .tentative + +- name: >- + 2d.filter.{{ variant_names[0] }}.gaussianBlur.{{ variant_names[1] }}{{ + tentative }} desc: Test CanvasFilter() with gaussianBlur. size: [100, 100] code: | ctx.fillStyle = 'teal'; - ctx.filter = new CanvasFilter({ + {{ filter_declaration | replace("param", "{ name: 'gaussianBlur', stdDeviation: [{{ blur_x }}, {{blur_y}}], - }); + }") }} ctx.fillRect(25, 25, 50, 50); + {{ close_layer }} html_reference: | - variants: - x-only: - blur_x: 4 - blur_y: 0 - mostly-x: - blur_x: 4 - blur_y: 1 - isotropic: - blur_x: 4 - blur_y: 4 - mostly-y: - blur_x: 1 - blur_y: 4 - y-only: - blur_x: 0 - blur_y: 4 - -- name: 2d.filter.canvasFilterObject.dropShadow.tentative + append_variants_to_name: false + variant_matrix: + - layers: + filter_declaration: |- + ctx.beginLayer({filter: param}); + close_layer: ctx.endLayer(); + canvasFilterObject: + filter_declaration: |- + ctx.filter = new CanvasFilter(param); + tentative: .tentative + - x-only: + blur_x: 4 + blur_y: 0 + mostly-x: + blur_x: 4 + blur_y: 1 + isotropic: + blur_x: 4 + blur_y: 4 + mostly-y: + blur_x: 1 + blur_y: 4 + y-only: + blur_x: 0 + blur_y: 4 + +- name: 2d.filter.{{ variant_names[0] }}.dropShadow{{ tentative }} desc: Test CanvasFilter() dropShadow object. size: [520, 420] code: | @@ -401,90 +679,91 @@ ctx.fillStyle = 'crimson'; // Parameter defaults. - ctx.filter = new CanvasFilter({name: 'dropShadow'}); + {{ filter_declaration | replace("param", "{name: 'dropShadow'}") }} ctx.fillRect(10, 10, 80, 80); + {{ close_layer -}} // All parameters specified. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, - floodColor: 'purple', floodOpacity: 0.7}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, + floodColor: 'purple', floodOpacity: 0.7}") }} ctx.fillRect(110, 10, 80, 80); + {{ close_layer -}} // Named color. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, - floodColor: 'purple'}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + floodColor: 'purple'}") }} ctx.fillRect(10, 110, 80, 80); + {{ close_layer -}} // System color. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, - floodColor: 'LinkText'}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + floodColor: 'LinkText'}") }} ctx.fillRect(110, 110, 80, 80); + {{ close_layer -}} // Numerical color. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, - floodColor: 'rgba(20, 50, 130, 1)'}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + floodColor: 'rgba(20, 50, 130, 1)'}") }} ctx.fillRect(210, 110, 80, 80); + {{ close_layer -}} // Transparent floodColor. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, - floodColor: 'rgba(20, 50, 130, 0.7)'}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + floodColor: 'rgba(20, 50, 130, 0.7)'}") }} ctx.fillRect(310, 110, 80, 80); + {{ close_layer -}} // Transparent floodColor and floodOpacity. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, - floodColor: 'rgba(20, 50, 130, 0.7)', floodOpacity: 0.7}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 3, + floodColor: 'rgba(20, 50, 130, 0.7)', floodOpacity: 0.7}") }} ctx.fillRect(410, 110, 80, 80); + {{ close_layer -}} // No blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 0, - floodColor: 'purple'}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 0, + floodColor: 'purple'}") }} ctx.fillRect(10, 210, 80, 80); + {{ close_layer -}} // Single float blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, - floodColor: 'purple'}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: 9, dy: 12, stdDeviation: 5, + floodColor: 'purple'}") }} ctx.fillRect(110, 210, 80, 80); + {{ close_layer -}} // Single negative float blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: -5, - floodColor: 'purple'}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: 9, dy: 12, stdDeviation: -5, + floodColor: 'purple'}") }} ctx.fillRect(210, 210, 80, 80); + {{ close_layer -}} // Two floats (X&Y) blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [3, 5], - floodColor: 'purple'}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [3, 5], + floodColor: 'purple'}") }} ctx.fillRect(310, 210, 80, 80); + {{ close_layer -}} // Two negative floats (X&Y) blur. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [-3, -5], - floodColor: 'purple'}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: 9, dy: 12, stdDeviation: [-3, -5], + floodColor: 'purple'}") }} ctx.fillRect(410, 210, 80, 80); + {{ close_layer -}} // Degenerate parameter values. - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: [-5], dy: [], stdDeviation: null, - floodColor: 'purple', floodOpacity: [2]}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: [-5], dy: [], stdDeviation: null, + floodColor: 'purple', floodOpacity: [2]}") }} ctx.fillRect(10, 310, 80, 80); + {{ close_layer -}} - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: null, dy: '5', stdDeviation: [[-5], ['3']], - floodColor: 'purple', floodOpacity: '0.8'}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: null, dy: '5', stdDeviation: [[-5], ['3']], + floodColor: 'purple', floodOpacity: '0.8'}") }} ctx.fillRect(110, 310, 80, 80); + {{ close_layer -}} - ctx.filter = new CanvasFilter( - {name: 'dropShadow', dx: true, dy: ['10'], stdDeviation: false, - floodColor: 'purple', floodOpacity: ['0.4']}); + {{ filter_declaration | replace("param", "{name: 'dropShadow', dx: true, dy: ['10'], stdDeviation: false, + floodColor: 'purple', floodOpacity: ['0.4']}") }} ctx.fillRect(210, 310, 80, 80); + {{ close_layer -}} html_reference: | - -- name: 2d.filter.canvasFilterObject.dropShadow.exceptions.tentative + append_variants_to_name: false + variants: + layers: + filter_declaration: |- + ctx.beginLayer({filter: param}); + close_layer: | + ctx.endLayer(); + canvasFilterObject: + filter_declaration: |- + ctx.filter = new CanvasFilter(param); + tentative: .tentative + +- name: 2d.filter.{{ variant_names[0] }}.dropShadow.exceptions{{ tentative }} desc: Test exceptions on CanvasFilter() dropShadow object code: | - @unroll @assert new CanvasFilter({\- + // Should not throw an error. + @unroll {{ filter_declaration | replace("param", "{\- name: 'dropShadow', \- : \- - <10 | -1 | 0.5 | null | true | false | [] | [20] | '30'>}); - @unroll @assert new CanvasFilter({\- + <10 | -1 | 0.5 | null | true | false | [] | [20] | '30'>}") }}; + @unroll {{ filter_declaration | replace("param", "{\- + name: 'dropShadow', \- + : \- + <10 | -1 | 0.5 | null | true | false | [] | [20] | '30'>}") }}; + @unroll {{ filter_declaration | replace("param", "{\- name: 'dropShadow', \- : \- <10 | -1 | 0.5 | null | true | false | [] | [20] | '30' | \- [10, -1] | [0.5, null] | [true, false] | [[], [20]] | \- - ['30', ['40']]>}); - @unroll @assert new CanvasFilter({\- + ['30', ['40']]>}") }}; + @unroll {{ filter_declaration | replace("param", "{\- name: 'dropShadow', \- : \- - <'red' | 'canvas' | 'rgba(4, -3, 0.5, 1)' | '#aabbccdd' | '#abcd'>}); + <'red' | 'canvas' | 'rgba(4, -3, 0.5, 1)' | '#aabbccdd' | + '#abcd'>}") }}; - @unroll @assert throws TypeError new CanvasFilter({\- - name: 'dropShadow', \- + // Should throw a TypeError. + @unroll @assert throws TypeError {{ filter_declaration | replace("param", \- + "{name: 'dropShadow', \- : \- - }); - @unroll @assert throws TypeError new CanvasFilter({\- - name: 'dropShadow', \- + }") }}; + @unroll @assert throws TypeError {{ filter_declaration | replace("param", \- + "{name: 'dropShadow', \- : \- }); - @unroll @assert throws TypeError new CanvasFilter({\- - name: 'dropShadow', \- + [1, 'test'] | [1, {}] | [1, [2, 3]]>}") }}; + @unroll @assert throws TypeError {{ filter_declaration | replace("param", \- + "{name: 'dropShadow', \- : \- - <'test' | 'rgba(NaN, 3, 2, 1)' | 10 | undefined | null | NaN>}); - -- name: 2d.filter.canvasFilterObject.turbulence.inputTypes.tentative + <'test' | 'rgba(NaN, 3, 2, 1)' | 10 | undefined | null | NaN>}") }}; + append_variants_to_name: false + variants: + layers: + filter_declaration: |- + ctx.beginLayer({filter: + param}); ctx.endLayer() + canvasFilterObject: + filter_declaration: |- + ctx.filter = new CanvasFilter( + param) + tentative: .tentative + +- name: 2d.filter.{{ variant_names[0] }}.turbulence.inputTypes{{ tentative }} desc: Test exceptions on CanvasFilter() turbulence object code: | const errorTestCases = [ @@ -671,10 +979,22 @@ for (testCase of errorTestCases) { const filterOptions = {...{name: 'turbulence'}, ...testCase}; - @assert throws TypeError new CanvasFilter(filterOptions); + @assert throws TypeError {{ filter_declaration | + replace("param", "filterOptions") }}; } for (testCase of workingTestCases) { const filterOptions = {...{name: 'turbulence'}, ...testCase}; - @assert new CanvasFilter(filterOptions) != null; + {{ filter_declaration | replace("param", "filterOptions") }}; + {{- close_layer }} } + append_variants_to_name: false + variants: + layers: + filter_declaration: |- + ctx.beginLayer({filter: param}) + close_layer: "\n ctx.endLayer();" + canvasFilterObject: + filter_declaration: |- + ctx.filter = new CanvasFilter(param) + tentative: .tentative diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/layers.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/layers.yaml index a44cb2ea2c..437a70c3f7 100644 --- a/testing/web-platform/tests/html/canvas/tools/yaml-new/layers.yaml +++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/layers.yaml @@ -44,7 +44,7 @@ variants: &global-state-variants no-global-states: render_states: // No global states. - alpha: + alpha: &global-state-alpha render_states: ctx.globalAlpha = 0.6; blending: render_states: ctx.globalCompositeOperation = 'multiply'; @@ -56,15 +56,15 @@ ctx.shadowOffsetY = 10; ctx.shadowColor = 'rgba(255, 165, 0, 0.5)'; ctx.shadowBlur = 3; - alpha.blending: + alpha.blending: &global-state-alpha-blending render_states: |- ctx.globalAlpha = 0.6; ctx.globalCompositeOperation = 'multiply'; - alpha.composite: + alpha.composite: &global-state-alpha-composite render_states: |- ctx.globalAlpha = 0.6; ctx.globalCompositeOperation = 'source-in'; - alpha.shadow: + alpha.shadow: &global-state-alpha-shadow render_states: |- ctx.globalAlpha = 0.5; ctx.shadowOffsetX = -10; @@ -167,7 +167,20 @@ ctx.drawImage(img, 0, 0); }; img.src = 'data:image/svg+xml;base64,' + btoa(svg); - variants: *global-state-variants + variants: + <<: *global-state-variants + alpha: + <<: *global-state-alpha + fuzzy: maxDifference=0-2; totalPixels=0-6766 + alpha.blending: + <<: *global-state-alpha-blending + fuzzy: maxDifference=0-1; totalPixels=0-2453 + alpha.composite: + <<: *global-state-alpha-composite + fuzzy: maxDifference=0-1; totalPixels=0-5204 + alpha.shadow: + <<: *global-state-alpha-shadow + fuzzy: maxDifference=0-2; totalPixels=0-6311 - name: 2d.layer.global-filter desc: Tests that layers ignore the global context filter. @@ -334,6 +347,144 @@ ctx.drawImage(canvas2, 0, 0); +- name: 2d.layer.ctm.filter + desc: Checks that parent transforms affect layer filters. + size: [200, 200] + code: | + // Transforms inside the layer should not apply to the layer's filter. + ctx.beginLayer({filter: 'drop-shadow(5px 5px 0px grey)'}); + ctx.translate(30, 90); + ctx.scale(2, 2); + ctx.rotate(Math.PI / 2); + ctx.fillRect(-30, -5, 60, 10); + ctx.endLayer(); + + // Transforms in the layer's parent should apply to the layer's filter. + ctx.translate(80, 90); + ctx.scale(2, 2); + ctx.rotate(Math.PI / 2); + ctx.beginLayer({filter: 'drop-shadow(5px 5px 0px grey)'}); + ctx.fillRect(-30, -5, 60, 10); + ctx.endLayer(); + html_reference: | + + + + + + + + + + + + + + + + + + +- name: 2d.layer.ctm.shadow-in-transformed-layer + desc: Check shadows inside of a transformed layer. + size: [200, 200] + code: | + ctx.translate(80, 90); + ctx.scale(2, 2); + ctx.rotate(Math.PI / 2); + + ctx.beginLayer(); + ctx.shadowOffsetX = 10; + ctx.shadowOffsetY = 10; + ctx.shadowColor = 'grey'; + ctx.fillRect(-30, -5, 60, 10); + + const canvas2 = new OffscreenCanvas(100, 100); + const ctx2 = canvas2.getContext('2d'); + ctx2.fillStyle = 'blue'; + ctx2.fillRect(0, 0, 40, 10); + ctx.drawImage(canvas2, -30, -30); + + ctx.endLayer(); + reference: | + ctx.translate(80, 90); + ctx.scale(2, 2); + ctx.rotate(Math.PI / 2); + + ctx.shadowOffsetX = 10; + ctx.shadowOffsetY = 10; + ctx.shadowColor = 'grey'; + ctx.fillRect(-30, -5, 60, 10); + + const canvas2 = new OffscreenCanvas(100, 100); + const ctx2 = canvas2.getContext('2d'); + ctx2.fillStyle = 'blue'; + ctx2.fillRect(0, 0, 40, 10); + ctx.drawImage(canvas2, -30, -30); + +- name: 2d.layer.ctm.getTransform + desc: Tests getTransform inside layers. + code: | + ctx.translate(10, 20); + ctx.beginLayer(); + ctx.scale(2, 3); + const m = ctx.getTransform(); + assert_array_equals([m.a, m.b, m.c, m.d, m.e, m.f], [2, 0, 0, 3, 10, 20]); + ctx.endLayer(); + +- name: 2d.layer.ctm.setTransform + desc: Tests setTransform inside layers. + code: | + ctx.translate(80, 0); + + ctx.beginLayer(); + ctx.rotate(2); + ctx.beginLayer(); + ctx.scale(5, 6); + ctx.setTransform(4, 0, 0, 2, 20, 10); + ctx.fillStyle = 'blue'; + ctx.fillRect(0, 0, 10, 10); + ctx.endLayer(); + ctx.endLayer(); + + ctx.fillStyle = 'green'; + ctx.fillRect(0, 0, 20, 20); + reference: | + ctx.translate(80, 0); + ctx.fillStyle = 'green'; + ctx.fillRect(0, 0, 20, 20); + + ctx.setTransform(4, 0, 0, 2, 20, 10); + ctx.fillStyle = 'blue'; + ctx.fillRect(0, 0, 10, 10); + +- name: 2d.layer.ctm.resetTransform + desc: Tests resetTransform inside layers. + code: | + ctx.translate(40, 0); + + ctx.beginLayer(); + ctx.rotate(2); + ctx.beginLayer(); + ctx.scale(5, 6); + ctx.resetTransform(); + ctx.fillStyle = 'blue'; + ctx.fillRect(0, 0, 20, 20); + ctx.endLayer(); + ctx.endLayer(); + + ctx.fillStyle = 'green'; + ctx.fillRect(0, 0, 20, 20); + reference: | + ctx.fillStyle = 'blue'; + ctx.fillRect(0, 0, 20, 20); + + ctx.translate(40, 0); + ctx.fillStyle = 'green'; + ctx.fillRect(0, 0, 20, 20); + - name: 2d.layer.clip-inside desc: Check clipping set inside the layer size: [100, 100] @@ -627,6 +778,49 @@ ctx.fillStyle = 'blue'; ctx.fillRect(10, 10, 80, 50); +- name: 2d.layer.drawImage + size: [200, 200] + desc: >- + Checks that drawImage writes the image to the layer and not the parent + directly. + code: | + ctx.fillStyle = 'skyblue'; + ctx.fillRect(0, 0, 100, 100); + + ctx.beginLayer({filter: {name: 'dropShadow', dx: -10, dy: -10, + stdDeviation: 0, floodColor: 'navy'}}); + + ctx.fillStyle = 'maroon'; + ctx.fillRect(20, 20, 50, 50); + + ctx.globalCompositeOperation = 'xor'; + + // The image should xor only with the layer content, not the parents'. + const canvas_image = new OffscreenCanvas(200,200); + const ctx_image = canvas_image.getContext("2d"); + ctx_image.fillStyle = 'pink'; + ctx_image.fillRect(40, 40, 50, 50); + ctx.drawImage(canvas_image, 0, 0); + + ctx.endLayer(); + reference: | + ctx.fillStyle = 'skyblue'; + ctx.fillRect(0, 0, 100, 100); + + ctx.beginLayer({filter: {name: 'dropShadow', dx: -10, dy: -10, + stdDeviation: 0, floodColor: 'navy'}}); + + ctx.fillStyle = 'maroon'; + ctx.fillRect(20, 20, 50, 50); + + ctx.globalCompositeOperation = 'xor'; + + // Should xor only with the layer content, not the parents'. + ctx.fillStyle = 'pink'; + ctx.fillRect(40, 40, 50, 50); + + ctx.endLayer(); + - name: 2d.layer.valid-calls desc: No exception raised on {{ variant_desc }}. variants: -- cgit v1.2.3