Skip to content

Commit e7a549f

Browse files
Make canvas filter input a flat dictionary
As initially specced, CanvasFilter inputs had a single key that was the name of the filter: ctx.filter = new CanvasFilter({gaussianBlur: {stdDeviation: 5}}); As the result of the debate here (whatwg/html#6763) the interface is changed to have a "filter" key that names the filter type: ctx.filter = new CanvasFilter( {filter: "gaussianBlur", stdDeviation: 5}}); Bug: 1169216 Change-Id: If3fdd9185c1f02dd2dece7db0c92aba76f2d97e1
1 parent 21f16b1 commit e7a549f

File tree

32 files changed

+241
-228
lines changed

32 files changed

+241
-228
lines changed

html/canvas/element/filters/2d.filter.canvasFilterObject.blur.exceptions.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ <h1>2d.filter.canvasFilterObject.blur.exceptions</h1>
1919
var t = async_test("Test exceptions on CanvasFilter() blur.object");
2020
_addTest(function(canvas, ctx) {
2121

22-
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({blur: null}); });
23-
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({blur: {}}); });
24-
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({blur: {stdDevation: null}}); });
25-
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({blur: {stdDeviation: "foo"}}); });
22+
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({filter: "gaussianBlur"}); });
23+
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({filter: "gaussianBlur", stdDevation: null}); });
24+
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({filter: "gaussianBlur", stdDeviation: "foo"}); });
2625

2726

2827
});

html/canvas/element/filters/2d.filter.canvasFilterObject.colorMatrix.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,44 @@ <h1>2d.filter.canvasFilterObject.colorMatrix</h1>
1313

1414
<p class="output">Actual output:</p>
1515
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
16-
<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
16+
1717
<ul id="d"></ul>
1818
<script>
1919
var t = async_test("Test the functionality of ColorMatrix filters in CanvasFilter objects");
2020
_addTest(function(canvas, ctx) {
2121

22-
assert_throws_js(TypeError, function() { new CanvasFilter({colorMatrix: {values: undefined}}); });
23-
assert_throws_js(TypeError, function() { new CanvasFilter({colorMatrix: {values: "foo"}}); });
24-
assert_throws_js(TypeError, function() { new CanvasFilter({colorMatrix: {values: null}}); });
25-
assert_throws_js(TypeError, function() { new CanvasFilter({colorMatrix: {values: [1, 2, 3]}}); });
26-
assert_throws_js(TypeError, function() { new CanvasFilter({colorMatrix: {values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, "a"]}}); });
27-
assert_throws_js(TypeError, function() { new CanvasFilter({colorMatrix: {values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, Infinity]}}); });
22+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "colorMatrix", values: undefined}); });
23+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "colorMatrix", values: "foo"}); });
24+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "colorMatrix", values: null}); });
25+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "colorMatrix", values: [1, 2, 3]}); });
26+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "colorMatrix", values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, "a"]}); });
27+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "colorMatrix", values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, Infinity]}); });
2828
ctx.fillStyle = "#f00";
29-
ctx.filter = new CanvasFilter({colorMatrix: {type: "hueRotate", values: 0}});
29+
ctx.filter = new CanvasFilter({filter: "colorMatrix", type: "hueRotate", values: 0});
3030
ctx.fillRect(0, 0, 100, 50);
3131
_assertPixelApprox(canvas, 10,10, 255,0,0,255, "10,10", "255,0,0,255", 2);
32-
ctx.filter = new CanvasFilter({colorMatrix: {type: "hueRotate", values: 90}});
32+
ctx.filter = new CanvasFilter({filter: "colorMatrix", type: "hueRotate", values: 90});
3333
ctx.fillRect(0, 0, 100, 50);
3434
_assertPixelApprox(canvas, 10,10, 0,91,0,255, "10,10", "0,91,0,255", 2);
35-
ctx.filter = new CanvasFilter({colorMatrix: {type: "hueRotate", values: 180}});
35+
ctx.filter = new CanvasFilter({filter: "colorMatrix", type: "hueRotate", values: 180});
3636
ctx.fillRect(0, 0, 100, 50);
3737
_assertPixelApprox(canvas, 10,10, 0,109,109,255, "10,10", "0,109,109,255", 2);
38-
ctx.filter = new CanvasFilter({colorMatrix: {type: "hueRotate", values: 270}});
38+
ctx.filter = new CanvasFilter({filter: "colorMatrix", type: "hueRotate", values: 270});
3939
ctx.fillRect(0, 0, 100, 50);
4040
_assertPixelApprox(canvas, 10,10, 109,18,255,255, "10,10", "109,18,255,255", 2);
41-
ctx.filter = new CanvasFilter({colorMatrix: {type: "saturate", values: 0.5}});
41+
ctx.filter = new CanvasFilter({filter: "colorMatrix", type: "saturate", values: 0.5});
4242
ctx.fillRect(0, 0, 100, 50);
4343
_assertPixelApprox(canvas, 10,10, 155,27,27,255, "10,10", "155,27,27,255", 2);
4444
ctx.clearRect(0, 0, 100, 50);
45-
ctx.filter = new CanvasFilter({colorMatrix: {type: "luminanceToAlpha"}});
45+
ctx.filter = new CanvasFilter({filter: "colorMatrix", type: "luminanceToAlpha"});
4646
ctx.fillRect(0, 0, 100, 50);
4747
_assertPixelApprox(canvas, 10,10, 0,0,0,54, "10,10", "0,0,0,54", 2);
48-
ctx.filter = new CanvasFilter({colorMatrix: {values: [
48+
ctx.filter = new CanvasFilter({filter: "colorMatrix", values: [
4949
0, 0, 0, 0, 0,
5050
1, 1, 1, 1, 0,
5151
0, 0, 0, 0, 0,
5252
0, 0, 0, 1, 0
53-
]}});
53+
]});
5454
ctx.fillRect(0, 0, 50, 25);
5555
ctx.fillStyle = "#0f0";
5656
ctx.fillRect(50, 0, 50, 25);

html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ <h1>2d.filter.canvasFilterObject.componentTransfer.discrete</h1>
4040
tableValuesR = [0, 0, 1, 1];
4141
tableValuesG = [2, 0, 0.5, 3];
4242
tableValuesB = [1, -1, 5, 0];
43-
ctx.filter = new CanvasFilter({componentTransfer: {
43+
ctx.filter = new CanvasFilter({filter: "componentTransfer",
4444
funcR: {type: "discrete", tableValues: tableValuesR},
4545
funcG: {type: "discrete", tableValues: tableValuesG},
4646
funcB: {type: "discrete", tableValues: tableValuesB},
47-
}});
47+
});
4848

4949
const inputColors = [
5050
[255, 255, 255],

html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ <h1>2d.filter.canvasFilterObject.componentTransfer.gamma</h1>
3131
const amplitudes = [2, 1.1, 0.5];
3232
const exponents = [5, 3, 1];
3333
const offsets = [0.25, 0, 0.5];
34-
ctx.filter = new CanvasFilter({componentTransfer: {
34+
ctx.filter = new CanvasFilter({filter: "componentTransfer",
3535
funcR: {type: "gamma", amplitude: amplitudes[0], exponent: exponents[0], offset: offsets[0]},
3636
funcG: {type: "gamma", amplitude: amplitudes[1], exponent: exponents[1], offset: offsets[1]},
3737
funcB: {type: "gamma", amplitude: amplitudes[2], exponent: exponents[2], offset: offsets[2]},
38-
}});
38+
});
3939

4040
const inputColors = [
4141
[255, 255, 255],

html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ <h1>2d.filter.canvasFilterObject.componentTransfer.identity</h1>
1919
var t = async_test("Test pixels on CanvasFilter() componentTransfer with identity type");
2020
_addTest(function(canvas, ctx) {
2121

22-
ctx.filter = new CanvasFilter({componentTransfer: {
22+
ctx.filter = new CanvasFilter({filter: "componentTransfer",
2323
funcR: {type: "identity"},
2424
funcG: {type: "identity"},
2525
funcB: {type: "identity"},
26-
}});
26+
});
2727

2828
const inputColors = [
2929
[255, 255, 255],

html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ <h1>2d.filter.canvasFilterObject.componentTransfer.linear</h1>
3030

3131
const slopes = [0.5, 1.2, -0.2];
3232
const intercepts = [0.25, 0, 0.5];
33-
ctx.filter = new CanvasFilter({componentTransfer: {
33+
ctx.filter = new CanvasFilter({filter: "componentTransfer",
3434
funcR: {type: "linear", slope: slopes[0], intercept: intercepts[0]},
3535
funcG: {type: "linear", slope: slopes[1], intercept: intercepts[1]},
3636
funcB: {type: "linear", slope: slopes[2], intercept: intercepts[2]},
37-
}});
37+
});
3838

3939
const inputColors = [
4040
[255, 255, 255],

html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ <h1>2d.filter.canvasFilterObject.componentTransfer.table</h1>
4040
tableValuesR = [0, 0, 1, 1];
4141
tableValuesG = [2, 0, 0.5, 3];
4242
tableValuesB = [1, -1, 5, 0];
43-
ctx.filter = new CanvasFilter({componentTransfer: {
43+
ctx.filter = new CanvasFilter({filter: "componentTransfer",
4444
funcR: {type: "table", tableValues: tableValuesR},
4545
funcG: {type: "table", tableValues: tableValuesG},
4646
funcB: {type: "table", tableValues: tableValuesB},
47-
}});
47+
});
4848

4949
const inputColors = [
5050
[255, 255, 255],
@@ -60,6 +60,7 @@ <h1>2d.filter.canvasFilterObject.componentTransfer.table</h1>
6060
ctx.fillRect(0, 0, 10, 10);
6161
_assertPixelApprox(canvas, 5, 5, outputColor[0],outputColor[1],outputColor[2],255, "5,5", `${outputColor[0]},${outputColor[1]},${outputColor[2]}`, 2);
6262
}
63+
t.done()
6364

6465

6566
});

html/canvas/element/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.html

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@ <h1>2d.filter.canvasFilterObject.convolveMatrix.exceptions</h1>
1919
var t = async_test("Test exceptions on CanvasFilter() convolveMatrix");
2020
_addTest(function(canvas, ctx) {
2121

22-
assert_throws_js(TypeError, function() { new CanvasFilter({convolveMatrix: {}}); });
23-
assert_throws_js(TypeError, function() { new CanvasFilter({convolveMatrix: null}); });
24-
assert_throws_js(TypeError, function() { new CanvasFilter({convolveMatrix: {divisor: 2}}); });
25-
assert_throws_js(TypeError, function() { new CanvasFilter({convolveMatrix: {kernelMatrix: null}}); });
26-
assert_throws_js(TypeError, function() { new CanvasFilter({convolveMatrix: {kernelMatrix: 1}}); });
27-
assert_throws_js(TypeError, function() { new CanvasFilter({convolveMatrix: {kernelMatrix: [[1, 0], [0]]}}); });
28-
assert_throws_js(TypeError, function() { new CanvasFilter({convolveMatrix: {kernelMatrix: [[1, "a"], [0]]}}); });
29-
assert_throws_js(TypeError, function() { new CanvasFilter({convolveMatrix: {kernelMatrix: [[1, 0], 0]}}); });
30-
assert_throws_js(TypeError, function() { new CanvasFilter({convolveMatrix: {kernelMatrix: [[1, 0], [0, Infinity]]}}); });
31-
assert_throws_js(TypeError, function() { new CanvasFilter({convolveMatrix: {kernelMatrix: []}}); });
22+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "convolveMatrix"}); });
23+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "convolveMatrix", divisor: 2}); });
24+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "convolveMatrix", kernelMatrix: null}); });
25+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "convolveMatrix", kernelMatrix: 1}); });
26+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "convolveMatrix", kernelMatrix: [[1, 0], [0]]}); });
27+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "convolveMatrix", kernelMatrix: [[1, "a"], [0]]}); });
28+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "convolveMatrix", kernelMatrix: [[1, 0], 0]}); });
29+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "convolveMatrix", kernelMatrix: [[1, 0], [0, Infinity]]}); });
30+
assert_throws_js(TypeError, function() { new CanvasFilter({filter: "convolveMatrix", kernelMatrix: []}); });
3231
// This should not throw an error
33-
ctx.filter = new CanvasFilter({convolveMatrix: {kernelMatrix: [[]]}});
32+
ctx.filter = new CanvasFilter({filter: "convolveMatrix", kernelMatrix: [[]]});
3433

3534

3635
});

html/canvas/element/filters/2d.filter.canvasFilterObject.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ <h1>2d.filter.canvasFilterObject</h1>
2222
_assert(ctx.filter == 'none', "ctx.filter == 'none'");
2323
ctx.filter = 'blur(5px)';
2424
_assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'");
25-
ctx.filter = new CanvasFilter({blur: {stdDeviation: 5}});
25+
ctx.filter = new CanvasFilter({filter: "gaussianBlur", stdDeviation: 5});
2626
_assert(ctx.filter.toString() == '[object CanvasFilter]', "ctx.filter.toString() == '[object CanvasFilter]'");
27-
ctx.filter = new CanvasFilter([{blur: {stdDeviation: 5}}, {blur: {stdDeviation: 10}}]);
27+
ctx.filter = new CanvasFilter([
28+
{filter: "gaussianBlur", stdDeviation: 5},
29+
{filter: "gaussianBlur", stdDeviation: 10}
30+
]);
2831
_assert(ctx.filter.toString() == '[object CanvasFilter]', "ctx.filter.toString() == '[object CanvasFilter]'");
2932
var canvas2 = document.createElement('canvas');
3033
var ctx2 = canvas2.getContext('2d');
@@ -34,7 +37,7 @@ <h1>2d.filter.canvasFilterObject</h1>
3437
_assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'");
3538
ctx.filter = 'none';
3639
_assert(ctx.filter == 'none', "ctx.filter == 'none'");
37-
ctx.filter = new CanvasFilter({blur: {stdDeviation: 5}});
40+
ctx.filter = new CanvasFilter({filter: "gaussianBlur", stdDeviation: 5});
3841
ctx.filter = "this string is not a filter and should do nothing";
3942
_assert(ctx.filter.toString() == '[object CanvasFilter]', "ctx.filter.toString() == '[object CanvasFilter]'");
4043

html/canvas/element/manual/filters/canvas-filter-object-blur.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
<script>
88
var canvas = document.getElementById('canvas');
99
var ctx = canvas.getContext('2d');
10-
ctx.filter = new CanvasFilter({blur: {stdDeviation: 2}});
10+
ctx.filter = new CanvasFilter({filter: "gaussianBlur", stdDeviation: 2});
1111
ctx.fillStyle = 'yellow';
1212
ctx.fillRect(10,10,100,100);
13-
ctx.filter = new CanvasFilter({blur: {stdDeviation: 5}});
13+
ctx.filter = new CanvasFilter({filter: "gaussianBlur", stdDeviation: 5});
1414
ctx.fillStyle = 'magenta';
1515
ctx.fillRect(120, 10, 100, 100);
16-
ctx.filter = new CanvasFilter([{
17-
blur: {stdDeviation: 5}}, {blur: {stdDeviation: 10}}]);
16+
ctx.filter = new CanvasFilter([
17+
{filter: "gaussianBlur", stdDeviation: 5},
18+
{filter: "gaussianBlur", stdDeviation: 10}]);
1819
ctx.fillStyle = 'cyan';
1920
ctx.fillRect(10, 120, 100, 100);
2021
ctx.filter = 'none';

html/canvas/element/manual/filters/canvas-filter-object-component-transfer.html

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,49 @@
1414
grad.addColorStop(1, "#000");
1515
ctx.fillStyle = grad;
1616

17-
const identityFilter = new CanvasFilter({componentTransfer:{
17+
const identityFilter = new CanvasFilter({
18+
filter: "componentTransfer",
1819
funcR: {type: "identity"},
1920
funcG: {type: "identity"},
2021
funcB: {type: "identity"},
2122
funcA: {type: "identity"},
22-
}});
23+
});
2324
ctx.filter = identityFilter;
2425
ctx.fillRect(10, 10, 480, 10);
2526

26-
const tableFilter = new CanvasFilter({componentTransfer: {
27+
const tableFilter = new CanvasFilter({
28+
filter: "componentTransfer",
2729
funcR: {type: "table", tableValues: [0, 2, 0.5, 1]},
2830
funcG: {type: "table", tableValues: [1, -1, 5, 0]},
2931
funcB: {type: "table", tableValues: [0, 1, 1, 0]},
30-
}});
32+
});
3133
ctx.filter = tableFilter;
3234
ctx.fillRect(10, 30, 480, 10);
3335

34-
const discreteFilter = new CanvasFilter({componentTransfer: {
36+
const discreteFilter = new CanvasFilter({
37+
filter: "componentTransfer",
3538
funcR: {type: "discrete", tableValues: [0, 2, 0.5, 1]},
3639
funcG: {type: "discrete", tableValues: [1, -1, 5, 0]},
3740
funcB: {type: "discrete", tableValues: [0, 1, 1, 0]},
38-
}});
41+
});
3942
ctx.filter = discreteFilter;
4043
ctx.fillRect(10, 50, 480, 10);
4144

42-
const linearFilter = new CanvasFilter({componentTransfer: {
45+
const linearFilter = new CanvasFilter({
46+
filter: "componentTransfer",
4347
funcR: {type: "linear", slope: 0.5, intercept: 0.25},
4448
funcG: {type: "linear", slope: 1.5, intercept: 0},
4549
funcB: {type: "linear", slope: -0.5, intercept: 0.5},
46-
}});
50+
});
4751
ctx.filter = linearFilter;
4852
ctx.fillRect(10, 70, 480, 10);
4953

50-
const gammaFilter = new CanvasFilter({componentTransfer: {
54+
const gammaFilter = new CanvasFilter({
55+
filter: "componentTransfer",
5156
funcR: {type: "gamma", amplitude: 2, exponent: 5, offset: -0.5},
5257
funcG: {type: "gamma", amplitude: 0.9, exponent: 3, offset: 0.3},
5358
funcB: {type: "gamma", amplitude: 1.1, exponent: 1, offset: 0.1},
54-
}});
59+
});
5560
ctx.filter = gammaFilter;
5661
ctx.fillRect(10, 90, 480, 10);
5762
</script>

html/canvas/element/manual/filters/canvas-filter-object-convolve-matrix.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
[0, 0, -3],
1818
];
1919

20-
options = Object.assign(options, {kernelMatrix: KERNEL_MATRIX});
21-
return new CanvasFilter({convolveMatrix: options});
20+
options = Object.assign(options, {
21+
kernelMatrix: KERNEL_MATRIX, filter: "convolveMatrix"});
22+
return new CanvasFilter(options);
2223
}
2324

2425
const test_cases = [

html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ <h1>2d.filter.canvasFilterObject.blur.exceptions</h1>
2020
var offscreenCanvas = new OffscreenCanvas(100, 50);
2121
var ctx = offscreenCanvas.getContext('2d');
2222

23-
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({blur: null}); });
24-
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({blur: {}}); });
25-
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({blur: {stdDevation: null}}); });
26-
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({blur: {stdDeviation: "foo"}}); });
23+
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({filter: "gaussianBlur"}); });
24+
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({filter: "gaussianBlur", stdDevation: null}); });
25+
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({filter: "gaussianBlur", stdDeviation: "foo"}); });
2726
t.done();
2827

2928
});

html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.worker.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ t.step(function() {
1616
var offscreenCanvas = new OffscreenCanvas(100, 50);
1717
var ctx = offscreenCanvas.getContext('2d');
1818

19-
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({blur: null}); });
20-
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({blur: {}}); });
21-
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({blur: {stdDevation: null}}); });
22-
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({blur: {stdDeviation: "foo"}}); });
19+
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({filter: "gaussianBlur"}); });
20+
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({filter: "gaussianBlur", stdDevation: null}); });
21+
assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({filter: "gaussianBlur", stdDeviation: "foo"}); });
2322
t.done();
2423

2524
});

0 commit comments

Comments
 (0)