Bug 632476 - Handle non-finite values for fillRect, strokeRect per spec; r=peterv
authorMs2ger <ms2ger@gmail.com>
Tue, 12 Apr 2011 14:32:02 +0200
changeset 68020 2af8fcb04ee692b0c3ba00effc01e2a042c2bbf3
parent 68019 55f92ef9873c723b95a3d4862299b2dbb26fef65
child 68021 1310ee06580ed9b702cb8ab4c77fb70c189075a1
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs632476
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 632476 - Handle non-finite values for fillRect, strokeRect per spec; r=peterv
content/canvas/src/nsCanvasRenderingContext2D.cpp
content/canvas/test/test_canvas.html
--- a/content/canvas/src/nsCanvasRenderingContext2D.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp
@@ -1961,17 +1961,17 @@ nsCanvasRenderingContext2D::ClearRect(fl
 
     return RedrawUser(mThebes->GetUserPathExtent());
 }
 
 nsresult
 nsCanvasRenderingContext2D::DrawRect(const gfxRect& rect, Style style)
 {
     if (!FloatValidate(rect.pos.x, rect.pos.y, rect.size.width, rect.size.height))
-        return NS_ERROR_DOM_SYNTAX_ERR;
+        return NS_OK;
 
     PathAutoSaveRestore pathSR(this);
 
     mThebes->NewPath();
     mThebes->Rectangle(rect);
 
     gfxRect dirty;
     nsresult rv = DrawPath(style, &dirty);
--- a/content/canvas/test/test_canvas.html
+++ b/content/canvas/test/test_canvas.html
@@ -3838,17 +3838,17 @@ ctx.fillRect(0, Infinity, Infinity, Infi
 ctx.fillRect(0, Infinity, 100, Infinity);
 ctx.fillRect(0, 0, Infinity, Infinity);
 
 isPixel(ctx, 50,25, 0,255,0,255, 0);
 
 } catch (e) {
     _thrown_outer = true;
 }
-todo(!_thrown_outer, 'should not throw exception');
+ok(!_thrown_outer, 'should not throw exception');
 
 
 }
 </script>
 
 <!-- [[[ test_2d.fillRect.path.html ]]] -->
 
 <p>Canvas test: 2d.fillRect.path</p>
@@ -18195,17 +18195,17 @@ ctx.strokeRect(0, Infinity, Infinity, In
 ctx.strokeRect(0, Infinity, 100, Infinity);
 ctx.strokeRect(0, 0, Infinity, Infinity);
 
 isPixel(ctx, 50,25, 0,255,0,255, 0);
 
 } catch (e) {
     _thrown_outer = true;
 }
-todo(!_thrown_outer, 'should not throw exception');
+ok(!_thrown_outer, 'should not throw exception');
 
 
 }
 </script>
 
 <!-- [[[ test_2d.strokeRect.path.html ]]] -->
 
 <p>Canvas test: 2d.strokeRect.path</p>