Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2011-05-31 Andreas Kling <kling@webkit.org>
Reviewed by Antti Koivisto. Canvas/JSC: Auto-generate overloads for setFillColor() https://bugs.webkit.org/show_bug.cgi?id=61635 Move CanvasRenderingContext2D.setStrokeColor() to auto-generated JSC bindings. There is a subtle difference to the previous behavior: invalid numbers of arguments now raise TypeError instead of SyntaxError. This is in accordance with Web IDL, but doesn't matter much anyway since this method is WebKit-only. Test: fast/canvas/canvas-overloads-setFillColor.html * bindings/js/JSCanvasRenderingContext2DCustom.cpp: * html/canvas/CanvasRenderingContext2D.idl: 2011-05-31 Andreas Kling <kling@webkit.org> Reviewed by Antti Koivisto. Canvas/JSC: Auto-generate overloads for setFillColor() https://bugs.webkit.org/show_bug.cgi?id=61635 Add a test to verify the behavior of setFillColor() when called with different numbers of arguments. * fast/canvas/canvas-overloads-setFillColor-expected.txt: Added. * fast/canvas/canvas-overloads-setFillColor.html: Added. * fast/canvas/script-tests/canvas-overloads-setFillColor.js: Added. Canonical link: https://commits.webkit.org/77212@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Andreas Kling
committed
May 31, 2011
1 parent
910c9f0
commit cf6b330
Showing
7 changed files
with
79 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
LayoutTests/fast/canvas/canvas-overloads-setFillColor-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Test the behavior of CanvasRenderingContext2D.setFillColor() when called with different numbers of arguments. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS ctx.setFillColor() threw exception TypeError: Type error. | ||
PASS ctx.setFillColor('red') is undefined | ||
PASS ctx.setFillColor(0) is undefined | ||
PASS ctx.setFillColor(0, 0) is undefined | ||
PASS ctx.setFillColor(0, 0, 0) threw exception TypeError: Type error. | ||
PASS ctx.setFillColor(0, 0, 0, 0) is undefined | ||
PASS ctx.setFillColor(0, 0, 0, 0, 0) is undefined | ||
PASS ctx.setFillColor(0, 0, 0, 0, 0, 0) threw exception TypeError: Type error. | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
13 changes: 13 additions & 0 deletions
13
LayoutTests/fast/canvas/canvas-overloads-setFillColor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="../js/resources/js-test-style.css"> | ||
<script src="../js/resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<p id="description"></p> | ||
<div id="console"></div> | ||
<script src="script-tests/canvas-overloads-setFillColor.js"></script> | ||
<script src="../js/resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
16 changes: 16 additions & 0 deletions
16
LayoutTests/fast/canvas/script-tests/canvas-overloads-setFillColor.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
description("Test the behavior of CanvasRenderingContext2D.setFillColor() when called with different numbers of arguments."); | ||
|
||
var ctx = document.createElement('canvas').getContext('2d'); | ||
|
||
var TypeError = "TypeError: Type error"; | ||
|
||
shouldThrow("ctx.setFillColor()", "TypeError"); | ||
shouldBe("ctx.setFillColor('red')", "undefined"); | ||
shouldBe("ctx.setFillColor(0)", "undefined"); | ||
shouldBe("ctx.setFillColor(0, 0)", "undefined"); | ||
shouldThrow("ctx.setFillColor(0, 0, 0)", "TypeError"); | ||
shouldBe("ctx.setFillColor(0, 0, 0, 0)", "undefined"); | ||
shouldBe("ctx.setFillColor(0, 0, 0, 0, 0)", "undefined"); | ||
shouldThrow("ctx.setFillColor(0, 0, 0, 0, 0, 0)", "TypeError"); | ||
|
||
var successfullyParsed = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters