diff --git a/tests/wpt/meta-legacy-layout/css/compositing/mix-blend-mode/mix-blend-mode-animation.html.ini b/tests/wpt/meta-legacy-layout/css/compositing/mix-blend-mode/mix-blend-mode-animation.html.ini index a647125277a..5496474410b 100644 --- a/tests/wpt/meta-legacy-layout/css/compositing/mix-blend-mode/mix-blend-mode-animation.html.ini +++ b/tests/wpt/meta-legacy-layout/css/compositing/mix-blend-mode/mix-blend-mode-animation.html.ini @@ -1,2 +1,2 @@ [mix-blend-mode-animation.html] - expected: TIMEOUT + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-animations/animation-offscreen-to-onscreen.html.ini b/tests/wpt/meta-legacy-layout/css/css-animations/animation-offscreen-to-onscreen.html.ini new file mode 100644 index 00000000000..9876f879b14 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-animations/animation-offscreen-to-onscreen.html.ini @@ -0,0 +1,2 @@ +[animation-offscreen-to-onscreen.html] + expected: TIMEOUT diff --git a/tests/wpt/meta-legacy-layout/css/css-animations/empty-pseudo-class-with-animation.html.ini b/tests/wpt/meta-legacy-layout/css/css-animations/empty-pseudo-class-with-animation.html.ini new file mode 100644 index 00000000000..5d78e3a8de2 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-animations/empty-pseudo-class-with-animation.html.ini @@ -0,0 +1,3 @@ +[empty-pseudo-class-with-animation.html] + [Setting an "animation" style property on an element does not interfere with the :empty pseudo-class.] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-color/system-color-consistency.html.ini b/tests/wpt/meta-legacy-layout/css/css-color/system-color-consistency.html.ini index 343156ca80d..d8796787e59 100644 --- a/tests/wpt/meta-legacy-layout/css/css-color/system-color-consistency.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-color/system-color-consistency.html.ini @@ -79,3 +79,171 @@ [Property color value 'MarkText' has the same color as the color of a mark element] expected: FAIL + + [Property color value 'ButtonBorder' resolves to the same color as the border-color of a button (light)] + expected: FAIL + + [Property color value 'ButtonFace' resolves to the same color as the background-color of a button (light)] + expected: FAIL + + [Property color value 'ButtonText' resolves to the same color as text on a button (light)] + expected: FAIL + + [Property color value 'ButtonBorder' resolves to the same color as the border-color of a submit button (light)] + expected: FAIL + + [Property color value 'ButtonFace' resolves to the same color as the background-color of a submit button (light)] + expected: FAIL + + [Property color value 'ButtonText' resolves to the same color as text on a submit button (light)] + expected: FAIL + + [Property color value 'ButtonBorder' resolves to the same color as the border-color of a reset button (light)] + expected: FAIL + + [Property color value 'ButtonFace' resolves to the same color as the background-color of a reset button (light)] + expected: FAIL + + [Property color value 'ButtonText' resolves to the same color as text on a reset button (light)] + expected: FAIL + + [Property color value 'ButtonBorder' resolves to the same color as the border-color of a color picker (light)] + expected: FAIL + + [Property color value 'ButtonFace' resolves to the same color as the background-color of a color picker (light)] + expected: FAIL + + [Property color value 'ButtonText' resolves to the same color as text on a color picker (light)] + expected: FAIL + + [Property color value 'CanvasText' has the same color as the color of the html element (light)] + expected: FAIL + + [Property color value 'Field' resolves to the same color as the background-color of a text field (light)] + expected: FAIL + + [Property color value 'FieldText' resolves to the same color as text on a text field (light)] + expected: FAIL + + [Property color value 'Field' resolves to the same color as the background-color of a password field (light)] + expected: FAIL + + [Property color value 'FieldText' resolves to the same color as text on a password field (light)] + expected: FAIL + + [Property color value 'Field' resolves to the same color as the background-color of a email field (light)] + expected: FAIL + + [Property color value 'FieldText' resolves to the same color as text on a email field (light)] + expected: FAIL + + [Property color value 'Field' resolves to the same color as the background-color of a number field (light)] + expected: FAIL + + [Property color value 'FieldText' resolves to the same color as text on a number field (light)] + expected: FAIL + + [Property color value 'Field' resolves to the same color as the background-color of a date field (light)] + expected: FAIL + + [Property color value 'FieldText' resolves to the same color as text on a date field (light)] + expected: FAIL + + [Property color value 'Field' resolves to the same color as the background-color of a text area (light)] + expected: FAIL + + [Property color value 'FieldText' resolves to the same color as text on a text area (light)] + expected: FAIL + + [Property color value 'Mark' has the same color as the background-color of a mark element (light)] + expected: FAIL + + [Property color value 'MarkText' has the same color as the color of a mark element (light)] + expected: FAIL + + [Property color value 'LinkText' has the same color as the color of an anchor element (light)] + expected: FAIL + + [Property color value 'ButtonBorder' resolves to the same color as the border-color of a button (dark)] + expected: FAIL + + [Property color value 'ButtonFace' resolves to the same color as the background-color of a button (dark)] + expected: FAIL + + [Property color value 'ButtonText' resolves to the same color as text on a button (dark)] + expected: FAIL + + [Property color value 'ButtonBorder' resolves to the same color as the border-color of a submit button (dark)] + expected: FAIL + + [Property color value 'ButtonFace' resolves to the same color as the background-color of a submit button (dark)] + expected: FAIL + + [Property color value 'ButtonText' resolves to the same color as text on a submit button (dark)] + expected: FAIL + + [Property color value 'ButtonBorder' resolves to the same color as the border-color of a reset button (dark)] + expected: FAIL + + [Property color value 'ButtonFace' resolves to the same color as the background-color of a reset button (dark)] + expected: FAIL + + [Property color value 'ButtonText' resolves to the same color as text on a reset button (dark)] + expected: FAIL + + [Property color value 'ButtonBorder' resolves to the same color as the border-color of a color picker (dark)] + expected: FAIL + + [Property color value 'ButtonFace' resolves to the same color as the background-color of a color picker (dark)] + expected: FAIL + + [Property color value 'ButtonText' resolves to the same color as text on a color picker (dark)] + expected: FAIL + + [Property color value 'CanvasText' has the same color as the color of the html element (dark)] + expected: FAIL + + [Property color value 'Field' resolves to the same color as the background-color of a text field (dark)] + expected: FAIL + + [Property color value 'FieldText' resolves to the same color as text on a text field (dark)] + expected: FAIL + + [Property color value 'Field' resolves to the same color as the background-color of a password field (dark)] + expected: FAIL + + [Property color value 'FieldText' resolves to the same color as text on a password field (dark)] + expected: FAIL + + [Property color value 'Field' resolves to the same color as the background-color of a email field (dark)] + expected: FAIL + + [Property color value 'FieldText' resolves to the same color as text on a email field (dark)] + expected: FAIL + + [Property color value 'Field' resolves to the same color as the background-color of a number field (dark)] + expected: FAIL + + [Property color value 'FieldText' resolves to the same color as text on a number field (dark)] + expected: FAIL + + [Property color value 'Field' resolves to the same color as the background-color of a date field (dark)] + expected: FAIL + + [Property color value 'FieldText' resolves to the same color as text on a date field (dark)] + expected: FAIL + + [Property color value 'Field' resolves to the same color as the background-color of a text area (dark)] + expected: FAIL + + [Property color value 'FieldText' resolves to the same color as text on a text area (dark)] + expected: FAIL + + [Property color value 'Mark' has the same color as the background-color of a mark element (dark)] + expected: FAIL + + [Property color value 'MarkText' has the same color as the color of a mark element (dark)] + expected: FAIL + + [Property color value 'LinkText' has the same color as the color of an anchor element (dark)] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-pseudo/selection-background-color-001.html.ini b/tests/wpt/meta-legacy-layout/css/css-pseudo/selection-background-color-001.html.ini new file mode 100644 index 00000000000..2ba2bb4894f --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-pseudo/selection-background-color-001.html.ini @@ -0,0 +1,2 @@ +[selection-background-color-001.html] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-text/parsing/webkit-text-stroke-computed.html.ini b/tests/wpt/meta-legacy-layout/css/css-text/parsing/webkit-text-stroke-computed.html.ini new file mode 100644 index 00000000000..6b4372771dd --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-text/parsing/webkit-text-stroke-computed.html.ini @@ -0,0 +1,9 @@ +[webkit-text-stroke-computed.html] + [Property -webkit-text-stroke value 'green'] + expected: FAIL + + [Property -webkit-text-stroke value '3px'] + expected: FAIL + + [Property -webkit-text-stroke value '1px red'] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-text/white-space/text-wrap-balance-003.html.ini b/tests/wpt/meta-legacy-layout/css/css-text/white-space/text-wrap-balance-003.html.ini new file mode 100644 index 00000000000..3a4f210bbf0 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-text/white-space/text-wrap-balance-003.html.ini @@ -0,0 +1,2 @@ +[text-wrap-balance-003.html] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-transforms/animation/rotate-interpolation-math-functions-tentative.html.ini b/tests/wpt/meta-legacy-layout/css/css-transforms/animation/rotate-interpolation-math-functions-tentative.html.ini new file mode 100644 index 00000000000..ad1ee1284d2 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-transforms/animation/rotate-interpolation-math-functions-tentative.html.ini @@ -0,0 +1,144 @@ +[rotate-interpolation-math-functions-tentative.html] + [CSS Transitions: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (-1) should be [20deg\]] + expected: FAIL + + [CSS Transitions: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (0) should be [100deg\]] + expected: FAIL + + [CSS Transitions: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (0.125) should be [110deg\]] + expected: FAIL + + [CSS Transitions: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (0.875) should be [170deg\]] + expected: FAIL + + [CSS Transitions: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (1) should be [180deg\]] + expected: FAIL + + [CSS Transitions: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (2) should be [260deg\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (-1) should be [20deg\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (0) should be [100deg\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (0.125) should be [110deg\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (0.875) should be [170deg\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (1) should be [180deg\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (2) should be [260deg\]] + expected: FAIL + + [CSS Animations: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (-1) should be [20deg\]] + expected: FAIL + + [CSS Animations: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (0) should be [100deg\]] + expected: FAIL + + [CSS Animations: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (0.125) should be [110deg\]] + expected: FAIL + + [CSS Animations: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (0.875) should be [170deg\]] + expected: FAIL + + [CSS Animations: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (1) should be [180deg\]] + expected: FAIL + + [CSS Animations: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (2) should be [260deg\]] + expected: FAIL + + [Web Animations: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (-1) should be [20deg\]] + expected: FAIL + + [Web Animations: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (0) should be [100deg\]] + expected: FAIL + + [Web Animations: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (0.125) should be [110deg\]] + expected: FAIL + + [Web Animations: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (0.875) should be [170deg\]] + expected: FAIL + + [Web Animations: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (1) should be [180deg\]] + expected: FAIL + + [Web Animations: property from [100deg\] to [calc(sign(20rem - 20px) * 180deg)\] at (2) should be [260deg\]] + expected: FAIL + + [CSS Transitions: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (-1) should be [20deg\]] + expected: FAIL + + [CSS Transitions: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (0) should be [100deg\]] + expected: FAIL + + [CSS Transitions: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (0.125) should be [110deg\]] + expected: FAIL + + [CSS Transitions: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (0.875) should be [170deg\]] + expected: FAIL + + [CSS Transitions: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (1) should be [180deg\]] + expected: FAIL + + [CSS Transitions: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (2) should be [260deg\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (-1) should be [20deg\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (0) should be [100deg\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (0.125) should be [110deg\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (0.875) should be [170deg\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (1) should be [180deg\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (2) should be [260deg\]] + expected: FAIL + + [CSS Animations: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (-1) should be [20deg\]] + expected: FAIL + + [CSS Animations: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (0) should be [100deg\]] + expected: FAIL + + [CSS Animations: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (0.125) should be [110deg\]] + expected: FAIL + + [CSS Animations: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (0.875) should be [170deg\]] + expected: FAIL + + [CSS Animations: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (1) should be [180deg\]] + expected: FAIL + + [CSS Animations: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (2) should be [260deg\]] + expected: FAIL + + [Web Animations: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (-1) should be [20deg\]] + expected: FAIL + + [Web Animations: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (0) should be [100deg\]] + expected: FAIL + + [Web Animations: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (0.125) should be [110deg\]] + expected: FAIL + + [Web Animations: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (0.875) should be [170deg\]] + expected: FAIL + + [Web Animations: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (1) should be [180deg\]] + expected: FAIL + + [Web Animations: property from [calc(sign(20rem - 20px) * 100deg)\] to [calc(progress(10rem from 20px to 100px) * 180deg)\] at (2) should be [260deg\]] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-transforms/animation/scale-animation-math-functions-tentative.html.ini b/tests/wpt/meta-legacy-layout/css/css-transforms/animation/scale-animation-math-functions-tentative.html.ini new file mode 100644 index 00000000000..1df3f824ee2 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-transforms/animation/scale-animation-math-functions-tentative.html.ini @@ -0,0 +1,144 @@ +[scale-animation-math-functions-tentative.html] + [CSS Transitions: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (-1) should be [20\]] + expected: FAIL + + [CSS Transitions: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (0) should be [100\]] + expected: FAIL + + [CSS Transitions: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (0.125) should be [110\]] + expected: FAIL + + [CSS Transitions: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (0.875) should be [170\]] + expected: FAIL + + [CSS Transitions: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (1) should be [180\]] + expected: FAIL + + [CSS Transitions: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (2) should be [260\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (-1) should be [20\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (0) should be [100\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (0.125) should be [110\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (0.875) should be [170\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (1) should be [180\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (2) should be [260\]] + expected: FAIL + + [CSS Animations: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (-1) should be [20\]] + expected: FAIL + + [CSS Animations: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (0) should be [100\]] + expected: FAIL + + [CSS Animations: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (0.125) should be [110\]] + expected: FAIL + + [CSS Animations: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (0.875) should be [170\]] + expected: FAIL + + [CSS Animations: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (1) should be [180\]] + expected: FAIL + + [CSS Animations: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (2) should be [260\]] + expected: FAIL + + [Web Animations: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (-1) should be [20\]] + expected: FAIL + + [Web Animations: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (0) should be [100\]] + expected: FAIL + + [Web Animations: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (0.125) should be [110\]] + expected: FAIL + + [Web Animations: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (0.875) should be [170\]] + expected: FAIL + + [Web Animations: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (1) should be [180\]] + expected: FAIL + + [Web Animations: property from [100\] to [calc(sign(20rem - 20px) * 180)\] at (2) should be [260\]] + expected: FAIL + + [CSS Transitions: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (-1) should be [20\]] + expected: FAIL + + [CSS Transitions: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (0) should be [100\]] + expected: FAIL + + [CSS Transitions: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (0.125) should be [110\]] + expected: FAIL + + [CSS Transitions: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (0.875) should be [170\]] + expected: FAIL + + [CSS Transitions: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (1) should be [180\]] + expected: FAIL + + [CSS Transitions: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (2) should be [260\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (-1) should be [20\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (0) should be [100\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (0.125) should be [110\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (0.875) should be [170\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (1) should be [180\]] + expected: FAIL + + [CSS Transitions with transition: all: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (2) should be [260\]] + expected: FAIL + + [CSS Animations: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (-1) should be [20\]] + expected: FAIL + + [CSS Animations: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (0) should be [100\]] + expected: FAIL + + [CSS Animations: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (0.125) should be [110\]] + expected: FAIL + + [CSS Animations: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (0.875) should be [170\]] + expected: FAIL + + [CSS Animations: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (1) should be [180\]] + expected: FAIL + + [CSS Animations: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (2) should be [260\]] + expected: FAIL + + [Web Animations: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (-1) should be [20\]] + expected: FAIL + + [Web Animations: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (0) should be [100\]] + expected: FAIL + + [Web Animations: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (0.125) should be [110\]] + expected: FAIL + + [Web Animations: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (0.875) should be [170\]] + expected: FAIL + + [Web Animations: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (1) should be [180\]] + expected: FAIL + + [Web Animations: property from [calc(sign(20rem - 20px) * 100)\] to [calc(progress(10rem from 20px to 100px) * 180)\] at (2) should be [260\]] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-values/calc-size/calc-size-height.tentative.html.ini b/tests/wpt/meta-legacy-layout/css/css-values/calc-size/calc-size-height.tentative.html.ini index ba84cd6c00b..9a753b3a13b 100644 --- a/tests/wpt/meta-legacy-layout/css/css-values/calc-size/calc-size-height.tentative.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-values/calc-size/calc-size-height.tentative.html.ini @@ -79,3 +79,12 @@ [resolved height for height in definite height container: calc-size(calc-size(min-content, 30px), 15em)] expected: FAIL + + [resolved height for height in definite height container: calc(12% + calc-size(any, 31%))] + expected: FAIL + + [resolved height for height in auto height container: calc-size(any, 31% + 12px)] + expected: FAIL + + [resolved height for height in definite height container: calc-size(any, 31% + 12px)] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/dom/nodes/insertion-removing-steps/Node-append-meta-referrer-and-script-from-fragment.tentative.html.ini b/tests/wpt/meta-legacy-layout/dom/nodes/insertion-removing-steps/Node-append-meta-referrer-and-script-from-fragment.tentative.html.ini new file mode 100644 index 00000000000..0d747763bda --- /dev/null +++ b/tests/wpt/meta-legacy-layout/dom/nodes/insertion-removing-steps/Node-append-meta-referrer-and-script-from-fragment.tentative.html.ini @@ -0,0 +1,3 @@ +[Node-append-meta-referrer-and-script-from-fragment.tentative.html] + [ should apply before script, as it is an insertion step and not a post-insertion step] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/fetch/api/basic/request-upload.h2.any.js.ini b/tests/wpt/meta-legacy-layout/fetch/api/basic/request-upload.h2.any.js.ini index 40f8cb45732..e039ea7fbfc 100644 --- a/tests/wpt/meta-legacy-layout/fetch/api/basic/request-upload.h2.any.js.ini +++ b/tests/wpt/meta-legacy-layout/fetch/api/basic/request-upload.h2.any.js.ini @@ -36,6 +36,9 @@ [Streaming upload should fail on a 401 response] expected: NOTRUN + [ReadbleStream should be closed on signal.abort] + expected: NOTRUN + [request-upload.h2.any.html] expected: TIMEOUT @@ -72,6 +75,9 @@ [Streaming upload should fail on a 401 response] expected: NOTRUN + [ReadbleStream should be closed on signal.abort] + expected: NOTRUN + [request-upload.h2.any.sharedworker.html] expected: ERROR diff --git a/tests/wpt/meta-legacy-layout/fetch/api/body/formdata.any.js.ini b/tests/wpt/meta-legacy-layout/fetch/api/body/formdata.any.js.ini index 2fbdce4291b..f70c16e0801 100644 --- a/tests/wpt/meta-legacy-layout/fetch/api/body/formdata.any.js.ini +++ b/tests/wpt/meta-legacy-layout/fetch/api/body/formdata.any.js.ini @@ -5,6 +5,9 @@ [Consume empty request.formData() as FormData] expected: FAIL + [Consume multipart/form-data headers case-insensitively] + expected: FAIL + [formdata.any.html] [Consume empty response.formData() as FormData] @@ -12,3 +15,6 @@ [Consume empty request.formData() as FormData] expected: FAIL + + [Consume multipart/form-data headers case-insensitively] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html.ini b/tests/wpt/meta-legacy-layout/html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html.ini deleted file mode 100644 index 3e07e6b7d1f..00000000000 --- a/tests/wpt/meta-legacy-layout/html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[empty-iframe-load-event.html] - [Check execution order from nested timeout] - expected: FAIL - - [Check execution order on load handler] - expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html.ini b/tests/wpt/meta-legacy-layout/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html.ini index 149bcb4ff8c..b8fd22e2b81 100644 --- a/tests/wpt/meta-legacy-layout/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html.ini +++ b/tests/wpt/meta-legacy-layout/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html.ini @@ -10,3 +10,6 @@ [load & pageshow events do not fire on contentWindow of + + + diff --git a/tests/wpt/tests/html/browsers/history/the-location-interface/assign-replace-from-top-to-nested-iframe.html b/tests/wpt/tests/html/browsers/history/the-location-interface/assign-replace-from-top-to-nested-iframe.html new file mode 100644 index 00000000000..eb6e4960dc2 --- /dev/null +++ b/tests/wpt/tests/html/browsers/history/the-location-interface/assign-replace-from-top-to-nested-iframe.html @@ -0,0 +1,36 @@ + + + + Referer with location.replace and location.assign with nested iframes + + + + + + + + diff --git a/tests/wpt/tests/html/browsers/history/the-location-interface/assign-with-nested-iframe.html b/tests/wpt/tests/html/browsers/history/the-location-interface/assign-with-nested-iframe.html new file mode 100644 index 00000000000..e043623c082 --- /dev/null +++ b/tests/wpt/tests/html/browsers/history/the-location-interface/assign-with-nested-iframe.html @@ -0,0 +1,21 @@ + + + + Referer with location.assign and nested frames + + + + + + + + diff --git a/tests/wpt/tests/html/browsers/history/the-location-interface/replace-with-nested-iframe.html b/tests/wpt/tests/html/browsers/history/the-location-interface/replace-with-nested-iframe.html new file mode 100644 index 00000000000..e6620bd29c7 --- /dev/null +++ b/tests/wpt/tests/html/browsers/history/the-location-interface/replace-with-nested-iframe.html @@ -0,0 +1,21 @@ + + + + Referer with location.replace and nested frames + + + + + + + + diff --git a/tests/wpt/tests/html/browsers/history/the-location-interface/resources/iframe-contents.sub.html b/tests/wpt/tests/html/browsers/history/the-location-interface/resources/iframe-contents.sub.html new file mode 100644 index 00000000000..8ac0a264dbc --- /dev/null +++ b/tests/wpt/tests/html/browsers/history/the-location-interface/resources/iframe-contents.sub.html @@ -0,0 +1,14 @@ + + + + Resource file for test of Referer with location.replace + + +
+ + + diff --git a/tests/wpt/tests/html/browsers/history/the-location-interface/resources/iframe-postmessage-to-parent-parent.sub.html b/tests/wpt/tests/html/browsers/history/the-location-interface/resources/iframe-postmessage-to-parent-parent.sub.html new file mode 100644 index 00000000000..25c4af19a3e --- /dev/null +++ b/tests/wpt/tests/html/browsers/history/the-location-interface/resources/iframe-postmessage-to-parent-parent.sub.html @@ -0,0 +1,14 @@ + + + + Resource file for test of Referer with location.replace + + +
+ + + diff --git a/tests/wpt/tests/html/browsers/history/the-location-interface/resources/iframe-with-iframe.html b/tests/wpt/tests/html/browsers/history/the-location-interface/resources/iframe-with-iframe.html new file mode 100644 index 00000000000..675f293ffa3 --- /dev/null +++ b/tests/wpt/tests/html/browsers/history/the-location-interface/resources/iframe-with-iframe.html @@ -0,0 +1,9 @@ + + + + Resource file for test of Referer with location.replace and location.assign + + + + + diff --git a/tests/wpt/tests/html/browsers/history/the-location-interface/resources/replace-or-assign-call-on-iframe.html b/tests/wpt/tests/html/browsers/history/the-location-interface/resources/replace-or-assign-call-on-iframe.html new file mode 100644 index 00000000000..bdad8334a5e --- /dev/null +++ b/tests/wpt/tests/html/browsers/history/the-location-interface/resources/replace-or-assign-call-on-iframe.html @@ -0,0 +1,20 @@ + + + + Referer with location.replace and location.assign + + + + + + diff --git a/tests/wpt/tests/html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.detachedcanvas.html b/tests/wpt/tests/html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.detachedcanvas.html new file mode 100644 index 00000000000..e301537330e --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html index 42fb1ee8f84..dc947928676 100644 --- a/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.html index b2f6a6ac97e..56cf1bf0b1c 100644 --- a/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html index b392b189f21..0a4830568b4 100644 --- a/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative-expected.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative-expected.html new file mode 100644 index 00000000000..5adc9f53e20 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html index e5bff7e44df..22e3abe624f 100644 --- a/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative-expected.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative-expected.html new file mode 100644 index 00000000000..895d531206c --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html index ecd3830be3e..17761ce31a2 100644 --- a/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative-expected.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative-expected.html new file mode 100644 index 00000000000..c4ad790d56e --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html index 8708887f6a5..5ea5f8e0e31 100644 --- a/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative-expected.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative-expected.html new file mode 100644 index 00000000000..29e250614c2 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html index 4b296d9fd7d..0f74d9c3bfd 100644 --- a/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html index b80600c1417..a2885410570 100644 --- a/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html index 8c07a72b2b3..05984a47f82 100644 --- a/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html index 47bb891b3f8..d6e70664738 100644 --- a/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html index c24cfd23981..b85add4b664 100644 --- a/tests/wpt/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.blur.exceptions.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.blur.exceptions.html new file mode 100644 index 00000000000..7176a7d0a48 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.colorMatrix.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.colorMatrix.html new file mode 100644 index 00000000000..ef0ae0f949b --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.discrete-expected.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.discrete-expected.html new file mode 100644 index 00000000000..8419953b3d2 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.discrete.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.discrete.html new file mode 100644 index 00000000000..ef9db79547c --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.gamma-expected.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.gamma-expected.html new file mode 100644 index 00000000000..3e5d9808967 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.gamma.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.gamma.html new file mode 100644 index 00000000000..cccd07e92b9 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.identity-expected.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.identity-expected.html new file mode 100644 index 00000000000..9f1439f37b6 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.identity.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.identity.html new file mode 100644 index 00000000000..3a06353849c --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.linear-expected.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.linear-expected.html new file mode 100644 index 00000000000..f922055ff26 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.linear.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.linear.html new file mode 100644 index 00000000000..c9e744ebef0 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.table-expected.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.table-expected.html new file mode 100644 index 00000000000..0f6736d87d4 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.table.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.componentTransfer.table.html new file mode 100644 index 00000000000..eae036b142d --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.convolveMatrix.exceptions.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.convolveMatrix.exceptions.html new file mode 100644 index 00000000000..ae45cb865c5 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.dropShadow-expected.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.dropShadow-expected.html new file mode 100644 index 00000000000..1719d99b4a7 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.exceptions.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.exceptions.html new file mode 100644 index 00000000000..df5e0c7dc3e --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.html new file mode 100644 index 00000000000..ceb20bb9eb3 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.turbulence.inputTypes.html b/tests/wpt/tests/html/canvas/element/filters/2d.filter.layers.turbulence.inputTypes.html new file mode 100644 index 00000000000..26dceaae165 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.blending.html b/tests/wpt/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.blending.html index 27989c79e93..98ea67e9e96 100644 --- a/tests/wpt/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.blending.html +++ b/tests/wpt/tests/html/canvas/element/layers/2d.layer.global-states.filter.alpha.blending.html @@ -1,7 +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/tests/wpt/tests/html/canvas/element/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https.html b/tests/wpt/tests/html/canvas/element/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https.html new file mode 100644 index 00000000000..a76c49d2d47 --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https.html @@ -0,0 +1,26 @@ + + +Canvas test: 2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https + + + + + + +

                            2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https

                            +

                            getTextureFormat() returns RGBA16F for a float16 context

                            + + +

                            Actual output:

                            +

                            FAIL (fallback content)

                            + +
                              + + diff --git a/tests/wpt/tests/html/canvas/element/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba8.tentative.https.html b/tests/wpt/tests/html/canvas/element/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba8.tentative.https.html new file mode 100644 index 00000000000..ef576133742 --- /dev/null +++ b/tests/wpt/tests/html/canvas/element/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba8.tentative.https.html @@ -0,0 +1,26 @@ + + +Canvas test: 2d.webgpuaccess.getTextureFormat.rgba8.tentative.https + + + + + + +

                              2d.webgpuaccess.getTextureFormat.rgba8.tentative.https

                              +

                              getTextureFormat() returns RGBA8 or BGRA8 for a typical context

                              + + +

                              Actual output:

                              +

                              FAIL (fallback content)

                              + +
                                + + diff --git a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html index d8f14529c53..e7461eacdbd 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html +++ b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html @@ -6,11 +6,11 @@

                                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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html index ff1de6bc9cf..491d073efbc 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.w.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.w.html new file mode 100644 index 00000000000..d3a999a2426 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.worker.js b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.worker.js deleted file mode 100644 index 0e68f4899fe..00000000000 --- a/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative-expected.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative-expected.html new file mode 100644 index 00000000000..5adc9f53e20 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html index 64c30fc4177..b262f3b1d32 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.w.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.w.html new file mode 100644 index 00000000000..1fe346eacf2 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.worker.js b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.worker.js deleted file mode 100644 index d59bc699df9..00000000000 --- a/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative-expected.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative-expected.html new file mode 100644 index 00000000000..895d531206c --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html index e0d628952e0..26b6e4c7022 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.w.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.w.html new file mode 100644 index 00000000000..d2216d16479 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.worker.js b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.worker.js deleted file mode 100644 index 1b714b58ff7..00000000000 --- a/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative-expected.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative-expected.html new file mode 100644 index 00000000000..c4ad790d56e --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html index adbe557fd96..3fc3bd9eec2 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.w.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.w.html new file mode 100644 index 00000000000..054dbce9299 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.worker.js b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.worker.js deleted file mode 100644 index fb2e01876fc..00000000000 --- a/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative-expected.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative-expected.html new file mode 100644 index 00000000000..29e250614c2 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html index 47048b68a14..ef2da126eb4 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.w.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.w.html new file mode 100644 index 00000000000..f39723da8e8 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.worker.js b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.worker.js deleted file mode 100644 index 0799e73a583..00000000000 --- a/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html index 301d11f888c..08f8860e998 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.worker.js b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.worker.js index b4ce4d76b24..105ed67a758 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.worker.js +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html index 3e55e97e54f..cdd501ba8e9 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js index bd18524f28b..1d56865e687 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html index 81eb1eae453..7569304b95a 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.w.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.w.html index fe9087244a0..2a26af4ec3e 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.w.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html index 040c62a96bb..8ad2a5ccfb0 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.worker.js b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.worker.js index 1a950a9207b..16199cb0ecf 100644 --- a/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.worker.js +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.blur.exceptions.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.blur.exceptions.html new file mode 100644 index 00000000000..36dd856456c --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.blur.exceptions.worker.js b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.blur.exceptions.worker.js new file mode 100644 index 00000000000..a053b8113c4 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.colorMatrix.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.colorMatrix.html new file mode 100644 index 00000000000..9e12acbbe0b --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.colorMatrix.worker.js b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.colorMatrix.worker.js new file mode 100644 index 00000000000..12cdff38688 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete-expected.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete-expected.html new file mode 100644 index 00000000000..8419953b3d2 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete.html new file mode 100644 index 00000000000..459c2f28504 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete.w.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.discrete.w.html new file mode 100644 index 00000000000..86e1d54fb7c --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma-expected.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma-expected.html new file mode 100644 index 00000000000..3e5d9808967 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma.html new file mode 100644 index 00000000000..9012115adfc --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma.w.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.gamma.w.html new file mode 100644 index 00000000000..767bcc58e5f --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity-expected.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity-expected.html new file mode 100644 index 00000000000..9f1439f37b6 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity.html new file mode 100644 index 00000000000..901dae3bed4 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity.w.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.identity.w.html new file mode 100644 index 00000000000..2e45018755a --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear-expected.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear-expected.html new file mode 100644 index 00000000000..f922055ff26 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear.html new file mode 100644 index 00000000000..f418b72ad55 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear.w.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.linear.w.html new file mode 100644 index 00000000000..fbc29c86c17 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table-expected.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table-expected.html new file mode 100644 index 00000000000..0f6736d87d4 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table.html new file mode 100644 index 00000000000..ef5e0f847ba --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table.w.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.componentTransfer.table.w.html new file mode 100644 index 00000000000..b11f0ef6f30 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.convolveMatrix.exceptions.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.convolveMatrix.exceptions.html new file mode 100644 index 00000000000..798822f1042 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.convolveMatrix.exceptions.worker.js b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.convolveMatrix.exceptions.worker.js new file mode 100644 index 00000000000..fa3be89ba2f --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow-expected.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow-expected.html new file mode 100644 index 00000000000..1719d99b4a7 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.html new file mode 100644 index 00000000000..10392dea5ac --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.worker.js b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.worker.js new file mode 100644 index 00000000000..86b8c56af69 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.html new file mode 100644 index 00000000000..1ecf309fc4e --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.w.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.w.html new file mode 100644 index 00000000000..e73b573779e --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.turbulence.inputTypes.html b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.turbulence.inputTypes.html new file mode 100644 index 00000000000..27f7748c847 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.turbulence.inputTypes.worker.js b/tests/wpt/tests/html/canvas/offscreen/filters/2d.filter.layers.turbulence.inputTypes.worker.js new file mode 100644 index 00000000000..3728566c997 --- /dev/null +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.html b/tests/wpt/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.html index 1e5c6ad8b75..0e48cb49f79 100644 --- a/tests/wpt/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.html +++ b/tests/wpt/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.html @@ -1,7 +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/tests/wpt/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.w.html b/tests/wpt/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.w.html index 142e900fd1b..3887ed4485b 100644 --- a/tests/wpt/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.w.html +++ b/tests/wpt/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.w.html @@ -2,7 +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/tests/wpt/tests/html/canvas/offscreen/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https.html b/tests/wpt/tests/html/canvas/offscreen/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https.html new file mode 100644 index 00000000000..cd478e666fd --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https + + + + +

                                2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https

                                +

                                getTextureFormat() returns RGBA16F for a float16 context

                                + + + diff --git a/tests/wpt/tests/html/canvas/offscreen/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https.worker.js b/tests/wpt/tests/html/canvas/offscreen/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https.worker.js new file mode 100644 index 00000000000..f24b8aa8504 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https +// Description:getTextureFormat() returns RGBA16F for a float16 context +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getTextureFormat() returns RGBA16F for a float16 context"); +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', {colorSpace: "display-p3", pixelFormat: "float16"}); + + _assertSame(ctx.getTextureFormat(), "rgba16float", "ctx.getTextureFormat()", "\"rgba16float\""); + t.done(); +}); +done(); diff --git a/tests/wpt/tests/html/canvas/offscreen/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba8.tentative.https.html b/tests/wpt/tests/html/canvas/offscreen/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba8.tentative.https.html new file mode 100644 index 00000000000..d77a2984087 --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba8.tentative.https.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.webgpuaccess.getTextureFormat.rgba8.tentative.https + + + + +

                                2d.webgpuaccess.getTextureFormat.rgba8.tentative.https

                                +

                                getTextureFormat() returns RGBA8 or BGRA8 for a typical context

                                + + + diff --git a/tests/wpt/tests/html/canvas/offscreen/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba8.tentative.https.worker.js b/tests/wpt/tests/html/canvas/offscreen/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba8.tentative.https.worker.js new file mode 100644 index 00000000000..4d4137e2d3c --- /dev/null +++ b/tests/wpt/tests/html/canvas/offscreen/webgpu-access/2d.webgpuaccess.getTextureFormat.rgba8.tentative.https.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.webgpuaccess.getTextureFormat.rgba8.tentative.https +// Description:getTextureFormat() returns RGBA8 or BGRA8 for a typical context +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getTextureFormat() returns RGBA8 or BGRA8 for a typical context"); +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_regexp_match(ctx.getTextureFormat(), /^rgba8unorm|bgra8unorm$/); + t.done(); +}); +done(); diff --git a/tests/wpt/tests/html/canvas/tools/gentestutilsunion.py b/tests/wpt/tests/html/canvas/tools/gentestutilsunion.py index 4fe7f2bd42e..d7042810be8 100644 --- a/tests/wpt/tests/html/canvas/tools/gentestutilsunion.py +++ b/tests/wpt/tests/html/canvas/tools/gentestutilsunion.py @@ -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 diff --git a/tests/wpt/tests/html/canvas/tools/name2dir-canvas.yaml b/tests/wpt/tests/html/canvas/tools/name2dir-canvas.yaml index 1e0caff5b98..79b5fb61f28 100644 --- a/tests/wpt/tests/html/canvas/tools/name2dir-canvas.yaml +++ b/tests/wpt/tests/html/canvas/tools/name2dir-canvas.yaml @@ -24,3 +24,4 @@ 2d.video: "video" 2d.canvas.host: "canvas-host" 2d.canvas.context: "canvas-context" +2d.webgpuaccess: "webgpu-access" diff --git a/tests/wpt/tests/html/canvas/tools/name2dir-offscreen.yaml b/tests/wpt/tests/html/canvas/tools/name2dir-offscreen.yaml index c52acb793ba..3f59fd8eead 100644 --- a/tests/wpt/tests/html/canvas/tools/name2dir-offscreen.yaml +++ b/tests/wpt/tests/html/canvas/tools/name2dir-offscreen.yaml @@ -19,4 +19,5 @@ 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" +2d.webgpuaccess: "webgpu-access" diff --git a/tests/wpt/tests/html/canvas/tools/name2dir.yaml b/tests/wpt/tests/html/canvas/tools/name2dir.yaml index ae69c153780..b0e541289f5 100644 --- a/tests/wpt/tests/html/canvas/tools/name2dir.yaml +++ b/tests/wpt/tests/html/canvas/tools/name2dir.yaml @@ -23,3 +23,4 @@ 2d.video: "video" 2d.canvas.host: "canvas-host" 2d.canvas.context: "canvas-context" +2d.webgpuaccess: "webgpu-access" diff --git a/tests/wpt/tests/html/canvas/tools/yaml-new/drawing-images-to-the-canvas.yaml b/tests/wpt/tests/html/canvas/tools/yaml-new/drawing-images-to-the-canvas.yaml index 93c556288d7..09e9e001867 100644 --- a/tests/wpt/tests/html/canvas/tools/yaml-new/drawing-images-to-the-canvas.yaml +++ b/tests/wpt/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/tests/wpt/tests/html/canvas/tools/yaml-new/filters.yaml b/tests/wpt/tests/html/canvas/tools/yaml-new/filters.yaml index e18ab61b41e..f327b9fe949 100644 --- a/tests/wpt/tests/html/canvas/tools/yaml-new/filters.yaml +++ b/tests/wpt/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: {}}); + @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.canvasFilterObject.colorMatrix.tentative - desc: Test the functionality of ColorMatrix filters in CanvasFilter objects +- 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; + 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.canvasFilterObject.convolveMatrix.exceptions.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]]}); + {{ 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.canvasFilterObject.componentTransfer.linear.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); } + {{ 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.canvasFilterObject.componentTransfer.identity.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); } + 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.canvasFilterObject.componentTransfer.table.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); } + 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.canvasFilterObject.componentTransfer.discrete.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,13 +598,24 @@ [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); } + 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] }}{{ @@ -400,7 +666,7 @@ blur_x: 0 blur_y: 4 -- name: 2d.filter.canvasFilterObject.dropShadow.tentative +- name: 2d.filter.{{ variant_names[0] }}.dropShadow{{ tentative }} desc: Test CanvasFilter() dropShadow object. size: [520, 420] code: | @@ -413,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: | + 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.canvasFilterObject.dropShadow.exceptions.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>}); + <'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.canvasFilterObject.turbulence.inputTypes.tentative +- name: 2d.filter.{{ variant_names[0] }}.turbulence.inputTypes{{ tentative }} desc: Test exceptions on CanvasFilter() turbulence object code: | const errorTestCases = [ @@ -683,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/tests/wpt/tests/html/canvas/tools/yaml-new/layers.yaml b/tests/wpt/tests/html/canvas/tools/yaml-new/layers.yaml index 938cc74d214..437a70c3f7a 100644 --- a/tests/wpt/tests/html/canvas/tools/yaml-new/layers.yaml +++ b/tests/wpt/tests/html/canvas/tools/yaml-new/layers.yaml @@ -174,7 +174,7 @@ fuzzy: maxDifference=0-2; totalPixels=0-6766 alpha.blending: <<: *global-state-alpha-blending - fuzzy: maxDifference=0-1; totalPixels=0-2440 + fuzzy: maxDifference=0-1; totalPixels=0-2453 alpha.composite: <<: *global-state-alpha-composite fuzzy: maxDifference=0-1; totalPixels=0-5204 diff --git a/tests/wpt/tests/html/canvas/tools/yaml-new/webgpu-access.yaml b/tests/wpt/tests/html/canvas/tools/yaml-new/webgpu-access.yaml new file mode 100644 index 00000000000..fcf38d1f3d0 --- /dev/null +++ b/tests/wpt/tests/html/canvas/tools/yaml-new/webgpu-access.yaml @@ -0,0 +1,10 @@ +- name: 2d.webgpuaccess.getTextureFormat.rgba8.tentative.https + desc: getTextureFormat() returns RGBA8 or BGRA8 for a typical context + code: | + @assert ctx.getTextureFormat() =~ /^rgba8unorm|bgra8unorm$/; + +- name: 2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https + desc: getTextureFormat() returns RGBA16F for a float16 context + attributes: '{colorSpace: "display-p3", pixelFormat: "float16"}' + code: | + @assert ctx.getTextureFormat() === "rgba16float"; diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-001.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-001.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-001.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-001.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-002.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-002.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-002.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-002.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-003.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-003.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-003.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-003.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-004.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-004.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-004.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-004.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-005.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-005.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-005.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-005.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-006.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-006.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-006.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-006.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-007.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-007.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-007.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-007.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-008.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-008.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-008.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-008.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-009.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-009.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-009.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-009.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-010.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-010.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-010.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-010.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-011.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-011.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-011.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-011.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-012.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-012.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-012.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-012.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-013.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-013.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-013.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-013.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-014.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-014.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-014.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-014.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-015.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-015.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-015.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-015.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-016.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-016.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-016.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-016.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-017.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-017.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-017.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-017.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-018.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-018.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-018.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-018.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-019.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-019.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-019.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-019.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-020.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-020.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-020.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-020.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-021.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-021.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-021.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-021.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-022.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-022.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-022.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-022.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-023.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-023.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-023.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-023.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-024.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-024.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-024.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-024.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-025.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-025.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-025.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-025.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-026.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-026.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-026.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-026.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-027.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-027.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-027.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-027.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-028.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-028.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-028.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-028.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-029.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-029.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-029.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-029.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-030.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-030.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-030.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-030.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-031.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-031.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-031.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-031.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-032.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-032.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-032.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-032.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-033.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-033.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-033.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-033.html diff --git a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-034.tentative.html b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-034.html similarity index 94% rename from tests/wpt/tests/html/dom/render-blocking/element-render-blocking-034.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/element-render-blocking-034.html index 92d4a06b1a9..a505de48756 100644 --- a/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-034.tentative.html +++ b/tests/wpt/tests/html/dom/render-blocking/element-render-blocking-034.html @@ -5,7 +5,7 @@ link rel=expect should allow relative URLs - + -link rel=expect: base URL should be ignored when after link +link rel=expect: base URL should be OK with relative URLs - + + + +link rel=expect: only connected elements are eligible + + + + + +
                                + +
                                + + + +
                                + +
                                + diff --git a/tests/wpt/tests/html/rendering/widgets/field-sizing-textarea.html b/tests/wpt/tests/html/rendering/widgets/field-sizing-textarea.html index f8d90dc659b..114d60c72d0 100644 --- a/tests/wpt/tests/html/rendering/widgets/field-sizing-textarea.html +++ b/tests/wpt/tests/html/rendering/widgets/field-sizing-textarea.html @@ -3,6 +3,10 @@ +

                                + + + + + pXp + XpXpXp + XpXpXp + + + + +

                                diff --git a/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-001.html b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-001.html new file mode 100644 index 00000000000..63aa9a4da88 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-001.html @@ -0,0 +1,24 @@ + + +<semantics> - mozilla bug 468059 + + + + + + +

                                + + + + pXp + XpXpXp + XpXpXp + + + +

                                diff --git a/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-002-ref.html b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-002-ref.html new file mode 100644 index 00000000000..8abdad93dea --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-002-ref.html @@ -0,0 +1,12 @@ + +semantics element and legacy rendering rules (reference) + +

                                Empty semantics:

                                +

                                annotation: annotation

                                +

                                annotation-xml: annotation-xml

                                +

                                presentation MathML (no annotations): presentation MathML

                                +

                                content MathML (no annotations): content MathML

                                +

                                presentation MathML ; annotation: presentation MathML

                                +

                                presentation MathML ; annotation-xml: presentation MathML

                                +

                                content MathML ; annotation: content MathML

                                +

                                content MathML ; annotation-xml: content MathML

                                diff --git a/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-002.html b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-002.html new file mode 100644 index 00000000000..62028fb863e --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-002.html @@ -0,0 +1,16 @@ + +semantics element and legacy rendering rules + + + + + +

                                Empty semantics:

                                +

                                annotation: annotation

                                +

                                annotation-xml: annotation-xml

                                +

                                presentation MathML (no annotations): presentation MathML

                                +

                                content MathML (no annotations): content MathML

                                +

                                presentation MathML ; annotation: presentation MathMLannotation

                                +

                                presentation MathML ; annotation-xml: presentation MathMLannotation-xml

                                +

                                content MathML ; annotation: content MathMLannotation

                                +

                                content MathML ; annotation-xml: content MathMLannotation-xml

                                diff --git a/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-003-ref.html b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-003-ref.html new file mode 100644 index 00000000000..7b6e21a3eb8 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-003-ref.html @@ -0,0 +1,13 @@ + +semantics element and legacy rendering rules (reference) + +

                                annotation 1: Content MathML

                                +

                                annotation 2: Content MathML

                                +

                                annotation 3: Content MathML

                                +

                                annotation-xml 1: Content MathML

                                +

                                annotation-xml 2: Content MathML

                                +

                                annotation-xml 3: Content MathML

                                +

                                annotation-xml 4: Content MathML

                                +

                                annotation-xml 5: Content MathML

                                +

                                annotation-xml 6: Content MathML

                                +

                                annotation-xml 7: Content MathML

                                diff --git a/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-003.html b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-003.html new file mode 100644 index 00000000000..83572f4c8c3 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-003.html @@ -0,0 +1,17 @@ + +semantics element and legacy rendering rules + + + + + +

                                annotation 1: Content MathMLannotationerrorerror

                                +

                                annotation 2: Content MathML\sin x + 5errorerror

                                +

                                annotation 3: Content MathMLerrorannotationerror

                                +

                                annotation-xml 1: Content MathMLapplication/mathml-presentation+xmlerrorerror

                                +

                                annotation-xml 2: Content MathMLMathML-Presentationerrorerror

                                +

                                annotation-xml 3: Content MathMLimage/svg+xmlerrorerror

                                +

                                annotation-xml 4: Content MathMLSVG1.1errorerror

                                +

                                annotation-xml 5: Content MathMLapplication/xhtml+xml

                                application/xhtml+xml

                                errorerror

                                +

                                annotation-xml 6: Content MathMLtext/html

                                text/html

                                errorerror

                                +

                                annotation-xml 7: Content MathMLerrorannotation-xmlerror

                                diff --git a/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-004-ref.html b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-004-ref.html new file mode 100644 index 00000000000..855d887bbca --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-004-ref.html @@ -0,0 +1,41 @@ + + +<semantics> - mozilla bug 512418 (reference) + + +

                                + XpXpXp + + + lcm + ( + a + , + b + ) + + = + + + ( + a + + b + ) + + + gcd + ( + a + , + b + ) + + + + XpXpXp +

                                diff --git a/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-004.html b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-004.html new file mode 100644 index 00000000000..17f0f1ecd09 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-004.html @@ -0,0 +1,47 @@ + + +<semantics> - mozilla bug 512418 + + + + + + +

                                + XpXpXp + + + + lcm + ( + a + , + b + ) + + = + + + ( + a + + b + ) + + + gcd + ( + a + , + b + ) + + + + + XpXpXp +

                                diff --git a/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-005-ref.html b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-005-ref.html new file mode 100644 index 00000000000..cf722603e1d --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-005-ref.html @@ -0,0 +1,11 @@ + +<semantics> - mozilla bug 21479 (reference) + +

                                + + + + ¯ + + +

                                diff --git a/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-005.html b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-005.html new file mode 100644 index 00000000000..e4fe611c475 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/mrow/semantics-005.html @@ -0,0 +1,15 @@ + +<semantics> - mozilla bug 21479 + + + + + +

                                + + + + ¯ + + +

                                diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-1.html b/tests/wpt/tests/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-1.html new file mode 100644 index 00000000000..9f37cddc398 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-1.html @@ -0,0 +1,64 @@ + + + + Stretchy/Largeop with default fonts + + + + + + + + +

                                + + + ( + + ) + + +

                                +

                                + + + ( + + ) + + +

                                +

                                + + + ( + + ) + + +

                                +

                                + + + ( + + ) + + +

                                + + diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-2.html b/tests/wpt/tests/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-2.html new file mode 100644 index 00000000000..7c43c80acc0 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-2.html @@ -0,0 +1,132 @@ + + + + Stretchy/Largeop with default fonts + + + + + + + + +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + ⫿ + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + + +

                                +

                                + + ⫿ + +

                                + + diff --git a/tests/wpt/tests/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-3.html b/tests/wpt/tests/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-3.html new file mode 100644 index 00000000000..d588b9d4e07 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/operators/stretchy-largeop-with-default-font-3.html @@ -0,0 +1,145 @@ + + + + Stretchy/Largeop with default fonts + + + + + + + + +

                                + + + + + + +

                                +

                                + + + + + + +

                                +

                                + + + + + + +

                                +

                                + + + + + + +

                                +

                                + + + + + + +

                                +

                                + + + + + + +

                                +

                                + + + + + + +

                                +

                                + + + + + + +

                                +

                                + + + + + + +

                                +

                                + + + + ⫿ + + +

                                +

                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ⫿ + +

                                + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-001-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-001-ref.html new file mode 100644 index 00000000000..d814944f531 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-001-ref.html @@ -0,0 +1,15 @@ + + + + mmultiscript with no scripts (reference) + + + + + base + + + + + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-001.html b/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-001.html new file mode 100644 index 00000000000..e55a04e1286 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-001.html @@ -0,0 +1,17 @@ + + + + mmultiscript with no scripts + + + + + + + + + base + + + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-002-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-002-ref.html new file mode 100644 index 00000000000..33f12d7cdfa --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-002-ref.html @@ -0,0 +1,16 @@ + + + + mmultiscript with mprescripts (reference) + + + + + base + + + + + + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-002.html b/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-002.html new file mode 100644 index 00000000000..c5e426008f9 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-002.html @@ -0,0 +1,18 @@ + + + + mmultiscript with mprescripts + + + + + + + + + base + + + + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-003-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-003-ref.html new file mode 100644 index 00000000000..daac6b33467 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-003-ref.html @@ -0,0 +1,42 @@ + + + + alignment of mmultiscript sub/superscripts + + + + + + + + + + + + + + + + + + +
                                +
                                + + + + + + + + + + + + + + + + + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-003.html b/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-003.html new file mode 100644 index 00000000000..7de3e98b8ab --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/mmultiscript-003.html @@ -0,0 +1,42 @@ + + + + alignment of mmultiscript sub/superscripts + + + + + + + + + + + + + + + + + + + + +
                                +
                                + + + + + + + + + + + + + + + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/munder-mover-align-accent-false-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/munder-mover-align-accent-false-ref.html new file mode 100644 index 00000000000..db72d0c5e2f --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/munder-mover-align-accent-false-ref.html @@ -0,0 +1,70 @@ + + + + Horizontal alignment of base with munder/mover scripts (accent="false") + + + + + + + + + + + + + + + + + + + +
                                movermunder
                                Over < BaseOver > BaseUnder < BaseUnder > Base
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/munder-mover-align-accent-false.html b/tests/wpt/tests/mathml/presentation-markup/scripts/munder-mover-align-accent-false.html new file mode 100644 index 00000000000..0d4205410a9 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/munder-mover-align-accent-false.html @@ -0,0 +1,57 @@ + + + + Horizontal alignment of base with munder/mover scripts (accent="false") + + + + + + + + + + + + + + + + + + + + + + +
                                movermunder
                                Over < BaseOver > BaseUnder < BaseUnder > Base
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/munder-mover-align-accent-true-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/munder-mover-align-accent-true-ref.html new file mode 100644 index 00000000000..da1033563eb --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/munder-mover-align-accent-true-ref.html @@ -0,0 +1,70 @@ + + + + Horizontal alignment of base with munder/mover scripts (accent="true") + + + + + + + + + + + + + + + + + + + +
                                movermunder
                                Over < BaseOver > BaseUnder < BaseUnder > Base
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/munder-mover-align-accent-true.html b/tests/wpt/tests/mathml/presentation-markup/scripts/munder-mover-align-accent-true.html new file mode 100644 index 00000000000..aa70d244f33 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/munder-mover-align-accent-true.html @@ -0,0 +1,57 @@ + + + + Horizontal alignment of base with munder/mover scripts (accent="true") + + + + + + + + + + + + + + + + + + + + + + +
                                movermunder
                                Over < BaseOver > BaseUnder < BaseUnder > Base
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/munderover-align-accent-false-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/munderover-align-accent-false-ref.html new file mode 100644 index 00000000000..c339149c256 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/munderover-align-accent-false-ref.html @@ -0,0 +1,85 @@ + + + + Horizontal alignment of base with munder/mover scripts (accent="false") + + + + + + + + + + + + + + + + + + +
                                munderover
                                Over < Base < UnderOver > Base > UnderOver = Under < BaseOver = Under > Base
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/munderover-align-accent-false.html b/tests/wpt/tests/mathml/presentation-markup/scripts/munderover-align-accent-false.html new file mode 100644 index 00000000000..2c082612a25 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/munderover-align-accent-false.html @@ -0,0 +1,60 @@ + + + + Horizontal alignment of base with munder/mover scripts (accent="false") + + + + + + + + + + + + + + + + + + + + + +
                                munderover
                                Over < Base < UnderOver > Base > UnderOver = Under < BaseOver = Under > Base
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/munderover-align-accent-true-ref.html b/tests/wpt/tests/mathml/presentation-markup/scripts/munderover-align-accent-true-ref.html new file mode 100644 index 00000000000..aababcb17bb --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/munderover-align-accent-true-ref.html @@ -0,0 +1,85 @@ + + + + Horizontal alignment of base with munder/mover scripts (accent="true") + + + + + + + + + + + + + + + + + + +
                                munderover
                                Over < Base < UnderOver > Base > UnderOver = Under < BaseOver = Under > Base
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                + + diff --git a/tests/wpt/tests/mathml/presentation-markup/scripts/munderover-align-accent-true.html b/tests/wpt/tests/mathml/presentation-markup/scripts/munderover-align-accent-true.html new file mode 100644 index 00000000000..e6578ade523 --- /dev/null +++ b/tests/wpt/tests/mathml/presentation-markup/scripts/munderover-align-accent-true.html @@ -0,0 +1,60 @@ + + + + Horizontal alignment of base with munder/mover scripts (accent="true") + + + + + + + + + + + + + + + + + + + + + +
                                munderover
                                Over < Base < UnderOver > Base > UnderOver = Under < BaseOver = Under > Base
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                + + diff --git a/tests/wpt/tests/mathml/relations/html5-tree/tabindex-focus-001.tentative.html b/tests/wpt/tests/mathml/relations/html5-tree/tabindex-focus-001.tentative.html new file mode 100644 index 00000000000..2ea0390eabd --- /dev/null +++ b/tests/wpt/tests/mathml/relations/html5-tree/tabindex-focus-001.tentative.html @@ -0,0 +1,34 @@ + +Invalid tabindex + + + + + + + + + + + + + + + + diff --git a/tests/wpt/tests/mathml/relations/text-and-math/mo-glyph-height-with-default-font-ref.html b/tests/wpt/tests/mathml/relations/text-and-math/mo-glyph-height-with-default-font-ref.html new file mode 100644 index 00000000000..5c295152ba0 --- /dev/null +++ b/tests/wpt/tests/mathml/relations/text-and-math/mo-glyph-height-with-default-font-ref.html @@ -0,0 +1,13 @@ + + + + + mo glyph height with default font (reference) + + +
                                + + diff --git a/tests/wpt/tests/mathml/relations/text-and-math/mo-glyph-height-with-default-font.html b/tests/wpt/tests/mathml/relations/text-and-math/mo-glyph-height-with-default-font.html new file mode 100644 index 00000000000..262d3b92777 --- /dev/null +++ b/tests/wpt/tests/mathml/relations/text-and-math/mo-glyph-height-with-default-font.html @@ -0,0 +1,52 @@ + + + + + mo glyph height with default font + + + + + + + + | + + f + + ( + x + ) + + + + f + + ( + + x + 0 + + ) + + + + | + + +