mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
Auto merge of #7104 - dzbarsky:add_color_stop, r=Ms2ger
CanvasGradient#addColorStop should throw for invalid colors and offsets The new test failure is because the color stop has a value of 'currentColor' which we don't support yet. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7104) <!-- Reviewable:end -->
This commit is contained in:
commit
d9925f5f92
7 changed files with 24 additions and 24 deletions
|
@ -0,0 +1,5 @@
|
|||
[2d.gradient.object.current.html]
|
||||
type: testharness
|
||||
[Canvas test: 2d.gradient.object.current]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[2d.gradient.object.invalidcolour.html]
|
||||
type: testharness
|
||||
[Canvas test: 2d.gradient.object.invalidcolour]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[2d.gradient.object.invalidoffset.html]
|
||||
type: testharness
|
||||
[Canvas test: 2d.gradient.object.invalidoffset]
|
||||
expected: FAIL
|
||||
|
|
@ -22,9 +22,9 @@ _addTest(function(canvas, ctx) {
|
|||
var g = ctx.createLinearGradient(0, 0, 100, 0);
|
||||
assert_throws("INDEX_SIZE_ERR", function() { g.addColorStop(-1, '#000'); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { g.addColorStop(2, '#000'); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { g.addColorStop(Infinity, '#000'); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { g.addColorStop(-Infinity, '#000'); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { g.addColorStop(NaN, '#000'); });
|
||||
assert_throws(new TypeError(), function() { g.addColorStop(Infinity, '#000'); });
|
||||
assert_throws(new TypeError(), function() { g.addColorStop(-Infinity, '#000'); });
|
||||
assert_throws(new TypeError(), function() { g.addColorStop(NaN, '#000'); });
|
||||
|
||||
|
||||
});
|
||||
|
|
|
@ -2013,9 +2013,9 @@
|
|||
var g = ctx.createLinearGradient(0, 0, 100, 0);
|
||||
@assert throws INDEX_SIZE_ERR g.addColorStop(-1, '#000');
|
||||
@assert throws INDEX_SIZE_ERR g.addColorStop(2, '#000');
|
||||
@assert throws INDEX_SIZE_ERR g.addColorStop(Infinity, '#000');
|
||||
@assert throws INDEX_SIZE_ERR g.addColorStop(-Infinity, '#000');
|
||||
@assert throws INDEX_SIZE_ERR g.addColorStop(NaN, '#000');
|
||||
@assert throws TypeError g.addColorStop(Infinity, '#000');
|
||||
@assert throws TypeError g.addColorStop(-Infinity, '#000');
|
||||
@assert throws TypeError g.addColorStop(NaN, '#000');
|
||||
|
||||
- name: 2d.gradient.object.invalidcolour
|
||||
testing:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue