Diff
Modified: trunk/LayoutTests/ChangeLog (87732 => 87733)
--- trunk/LayoutTests/ChangeLog 2011-05-31 16:15:27 UTC (rev 87732)
+++ trunk/LayoutTests/ChangeLog 2011-05-31 16:20:32 UTC (rev 87733)
@@ -2,6 +2,20 @@
Reviewed by Antti Koivisto.
+ Canvas/JSC: Auto-generate overloads for strokeRect()
+ https://bugs.webkit.org/show_bug.cgi?id=61641
+
+ Add a test to verify the behavior of strokeRect() when called with
+ different numbers of arguments.
+
+ * fast/canvas/canvas-overloads-strokeRect-expected.txt: Added.
+ * fast/canvas/canvas-overloads-strokeRect.html: Added.
+ * fast/canvas/script-tests/canvas-overloads-strokeRect.js: Added.
+
+2011-05-31 Andreas Kling <[email protected]>
+
+ Reviewed by Antti Koivisto.
+
Canvas/JSC: Auto-generate overloads for setFillColor()
https://bugs.webkit.org/show_bug.cgi?id=61635
Added: trunk/LayoutTests/fast/canvas/canvas-overloads-strokeRect-expected.txt (0 => 87733)
--- trunk/LayoutTests/fast/canvas/canvas-overloads-strokeRect-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/canvas/canvas-overloads-strokeRect-expected.txt 2011-05-31 16:20:32 UTC (rev 87733)
@@ -0,0 +1,15 @@
+Test the behavior of CanvasRenderingContext2D.strokeRect() when called with different numbers of arguments.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS ctx.strokeRect() is undefined
+PASS ctx.strokeRect(0) is undefined
+PASS ctx.strokeRect(0, 0) is undefined
+PASS ctx.strokeRect(0, 0, 0) is undefined
+PASS ctx.strokeRect(0, 0, 0, 0) is undefined
+PASS ctx.strokeRect(0, 0, 0, 0, 0) is undefined
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/canvas/canvas-overloads-strokeRect.html (0 => 87733)
--- trunk/LayoutTests/fast/canvas/canvas-overloads-strokeRect.html (rev 0)
+++ trunk/LayoutTests/fast/canvas/canvas-overloads-strokeRect.html 2011-05-31 16:20:32 UTC (rev 87733)
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/canvas/script-tests/canvas-overloads-strokeRect.js (0 => 87733)
--- trunk/LayoutTests/fast/canvas/script-tests/canvas-overloads-strokeRect.js (rev 0)
+++ trunk/LayoutTests/fast/canvas/script-tests/canvas-overloads-strokeRect.js 2011-05-31 16:20:32 UTC (rev 87733)
@@ -0,0 +1,15 @@
+description("Test the behavior of CanvasRenderingContext2D.strokeRect() when called with different numbers of arguments.");
+
+var ctx = document.createElement('canvas').getContext('2d');
+
+var SyntaxError = "SyntaxError: Syntax error";
+var TypeError = "TypeError: Type error";
+
+shouldBe("ctx.strokeRect()", "undefined");
+shouldBe("ctx.strokeRect(0)", "undefined");
+shouldBe("ctx.strokeRect(0, 0)", "undefined");
+shouldBe("ctx.strokeRect(0, 0, 0)", "undefined");
+shouldBe("ctx.strokeRect(0, 0, 0, 0)", "undefined");
+shouldBe("ctx.strokeRect(0, 0, 0, 0, 0)", "undefined");
+
+var successfullyParsed = true;
Modified: trunk/Source/WebCore/ChangeLog (87732 => 87733)
--- trunk/Source/WebCore/ChangeLog 2011-05-31 16:15:27 UTC (rev 87732)
+++ trunk/Source/WebCore/ChangeLog 2011-05-31 16:20:32 UTC (rev 87733)
@@ -2,6 +2,22 @@
Reviewed by Antti Koivisto.
+ Canvas/JSC: Auto-generate overloads for strokeRect()
+ https://bugs.webkit.org/show_bug.cgi?id=61641
+
+ Move CanvasRenderingContext2D.setStrokeColor() to auto-generated JSC bindings.
+
+ No behavioral change.
+
+ Test: fast/canvas/canvas-overloads-strokeRect.html
+
+ * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
+ * html/canvas/CanvasRenderingContext2D.idl:
+
+2011-05-31 Andreas Kling <[email protected]>
+
+ Reviewed by Antti Koivisto.
+
Canvas/JSC: Auto-generate overloads for setFillColor()
https://bugs.webkit.org/show_bug.cgi?id=61635
Modified: trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp (87732 => 87733)
--- trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp 2011-05-31 16:15:27 UTC (rev 87732)
+++ trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp 2011-05-31 16:20:32 UTC (rev 87733)
@@ -95,20 +95,6 @@
context->setFillStyle(toHTMLCanvasStyle(exec, value));
}
-JSValue JSCanvasRenderingContext2D::strokeRect(ExecState* exec)
-{
- CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl());
-
- if (exec->argumentCount() <= 4)
- context->strokeRect(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec),
- exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec));
- else
- context->strokeRect(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec),
- exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec), exec->argument(4).toFloat(exec));
-
- return jsUndefined();
-}
-
JSValue JSCanvasRenderingContext2D::drawImage(ExecState* exec)
{
CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl());
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl (87732 => 87733)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl 2011-05-31 16:15:27 UTC (rev 87732)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl 2011-05-31 16:20:32 UTC (rev 87733)
@@ -112,9 +112,9 @@
void setFillColor(in float r, in float g, in float b, in float a);
void setFillColor(in float c, in float m, in float y, in float k, in float a);
-#if defined(V8_BINDING) && V8_BINDING
void strokeRect(in float x, in float y, in float width, in float height, in [Optional] float lineWidth);
+#if defined(V8_BINDING) && V8_BINDING
void drawImage(in HTMLImageElement image, in float x, in float y)
raises (DOMException);
void drawImage(in HTMLImageElement image, in float x, in float y, in float width, in float height)
@@ -156,7 +156,6 @@
raises (DOMException);
#else
// FIXME: Remove 'else' once JSC supports overloads too.
- [Custom] void strokeRect(/* 4 */);
[Custom] void drawImage(/* 3 */);
[Custom] void drawImageFromRect(/* 10 */);
[Custom] void setShadow(/* 3 */);