-fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3648
quadraticCurveTo() method in <canvas> APIs JS bindings does not exist
Reviewed by Darin.
Test cases added:
* layout-tests/fast/dom/quadraticCurveTo-expected.txt: Added.
* layout-tests/fast/dom/quadraticCurveTo.xml: Added.
* khtml/ecma/kjs_html.cpp:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9520
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x414
+ RenderBlock {HTML} at (0,0) size 800x414
+ RenderBody {BODY} at (8,16) size 784x18
+ RenderBlock {P} at (0,0) size 784x18
+ RenderText {TEXT} at (0,0) size 420x18
+ text run at (0,0) width 358: "\x{9}\x{9}\x{9}This test case should produce a sine-wave stroked with 1"
+ text run at (358,0) width 62: "px black. "
+ text run at (420,0) width 0: "\x{9}\x{9}"
+ RenderBlock (anonymous) at (0,50) size 800x364
+ RenderCanvasImage {CANVAS} at (0,0) size 480x360
--- /dev/null
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+
+ <head>
+ <title>Context2D.quadraticCurveTo Test Case</title>
+ <script>
+
+ var ctx;
+ var current_point;
+ var current_center;
+
+ function M (x, y) {
+ ctx.beginPath();
+ ctx.moveTo(x,y);
+ current_point = [x,y];
+ current_center = [x,y];
+ }
+
+ function q (x1, y1, x, y) {
+ x1 += current_point[0];
+ y1 += current_point[1];
+ x += current_point[0];
+ y += current_point[1];
+ ctx.quadraticCurveTo(x1, y1, x, y);
+ current_point = [x,y];
+ current_center = [x1,y1];
+ }
+
+ function t (x, y) {
+ var x1 = current_point[0] * 2 - current_center[0];
+ var y1 = current_point[1] * 2 - current_center[1];
+ x += current_point[0];
+ y += current_point[1];
+ ctx.quadraticCurveTo(x1, y1, x, y);
+ current_point = [x,y];
+ current_center = [x1,y1];
+ }
+
+ function z () {
+ ctx.closePath();
+ }
+
+ ////////////////////
+
+ // setup canvas and context
+ var canvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas');
+ canvas.setAttribute('width', 480);
+ canvas.setAttribute('height', 360);
+ document.documentElement.appendChild(canvas);
+ ctx = canvas.getContext('2d');
+
+ // draw shapes equivalent to SVG path data "M 240 296 q 25 -100 47 0 t 47 0 t 47 0 t 47 0 t 47 0 z"
+ M(10,60);
+ q(25,-100,47,0);
+ t(47,0);
+ t(47,0);
+ t(47,0);
+ t(47,0);
+ z();
+
+ // stroke it
+ ctx.stroke();
+
+ </script>
+ </head>
+
+ <body>
+
+ <p>
+ This test case should produce a sine-wave stroked with 1px black.
+ </p>
+
+ </body>
+
+</html>
\ No newline at end of file
+2005-06-29 Geoffrey Garen <ggaren@apple.com>
+
+ Patch by Antoine Quint <ml@graougraou.com>
+
+ -fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3648
+ quadraticCurveTo() method in <canvas> APIs JS bindings does not exist
+
+ Reviewed by Darin.
+
+ Test cases added:
+ * layout-tests/fast/dom/quadraticCurveTo-expected.txt: Added.
+ * layout-tests/fast/dom/quadraticCurveTo.xml: Added.
+
+ * khtml/ecma/kjs_html.cpp:
+
2005-06-29 Geoffrey Garen <ggaren@apple.com>
Patch by Hanspeter Schaub <Hanspeterschaub@mac.com>
stroke Context2D::Stroke DontDelete|Function 0
moveTo Context2D::MoveTo DontDelete|Function 2
lineTo Context2D::LineTo DontDelete|Function 2
- quadraticCurveToPoint Context2D::QuadraticCurveTo DontDelete|Function 4
+ quadraticCurveTo Context2D::QuadraticCurveTo DontDelete|Function 4
bezierCurveTo Context2D::BezierCurveTo DontDelete|Function 6
arcTo Context2D::ArcTo DontDelete|Function 5
arc Context2D::Arc DontDelete|Function 6