[webkit-changes] cvs commit: WebCore/layout-tests/fast/dom quadraticCurveTo-expected.txt quadraticCurveTo.xml

Geoffrey ggaren at opensource.apple.com
Wed Jun 29 10:41:40 PDT 2005


ggaren      05/06/29 10:41:39

  Modified:    .        ChangeLog
               khtml/ecma kjs_html.cpp
  Added:       layout-tests/fast/dom quadraticCurveTo-expected.txt
                        quadraticCurveTo.xml
  Log:
  	Patch by Antoine Quint <ml at 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:
  
  Revision  Changes    Path
  1.4326    +15 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4325
  retrieving revision 1.4326
  diff -u -r1.4325 -r1.4326
  --- ChangeLog	29 Jun 2005 17:18:12 -0000	1.4325
  +++ ChangeLog	29 Jun 2005 17:41:34 -0000	1.4326
  @@ -1,5 +1,20 @@
   2005-06-29  Geoffrey Garen  <ggaren at apple.com>
   
  +	Patch by Antoine Quint <ml at 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 at apple.com>
  +
   	Patch by Hanspeter Schaub <Hanspeterschaub at mac.com>
   
   	-fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3317
  
  
  
  1.120     +1 -1      WebCore/khtml/ecma/kjs_html.cpp
  
  Index: kjs_html.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_html.cpp,v
  retrieving revision 1.119
  retrieving revision 1.120
  diff -u -r1.119 -r1.120
  --- kjs_html.cpp	24 Jun 2005 05:53:25 -0000	1.119
  +++ kjs_html.cpp	29 Jun 2005 17:41:38 -0000	1.120
  @@ -4475,7 +4475,7 @@
     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
  
  
  
  1.1                  WebCore/layout-tests/fast/dom/quadraticCurveTo-expected.txt
  
  Index: quadraticCurveTo-expected.txt
  ===================================================================
  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
  
  
  
  1.1                  WebCore/layout-tests/fast/dom/quadraticCurveTo.xml
  
  Index: quadraticCurveTo.xml
  ===================================================================
  <!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>
  
  



More information about the webkit-changes mailing list