Commit 72f9333e authored by oliver@apple.com's avatar oliver@apple.com

Bug 17954: Canvas arc() with radius of 0 throws exception

http://bugs.webkit.org/show_bug.cgi?id=17954

Reviewed by Antti

Simple fix -- use >= instead of > when validating the radius.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31162 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 14613b12
2008-03-19 Oliver Hunt <oliver@apple.com>
Reviewed by Antti.
Test case for Canvas.arc with zero-length radius needed to
be updated for current html5 spec.
* fast/canvas/canvas-with-incorrect-args-expected.txt:
* fast/canvas/canvas-with-incorrect-args.html:
2008-03-19 Justin Garcia <justin.garcia@apple.com>
Reviewed by Oliver.
......@@ -14,7 +14,7 @@ PASS called rect 0*0 rect without throwing an exception.
UNDEFINED called rect with inf*inf rect without throwing an exception.
UNDEFINED threw exception code 1 on nan*nan rect.
PASS called fill with an empty path without throwing an exception.
PASS threw exception code 1 on arc with zero-length radius
PASS did not throw exception on arc with zero-length radius
PASS threw exception code 1 on arc with negative-length radius
UNDEFINED did not throw exception on arc with infinite radius
UNDEFINED threw exception code 1 on arc with nan-length radius
......
......@@ -94,9 +94,9 @@ function runTest() {
}
try {
context.arc(2, 2, 0, 0, 90, true);
fail("did not throw exception on arc with zero-length radius");
pass("did not throw exception on arc with zero-length radius");
} catch (e) {
pass("threw exception code " + e.code + " on arc with zero-length radius");
fail("threw exception code " + e.code + " on arc with zero-length radius");
}
try {
context.arc(2, 2, -10, 0, 90, true);
......
2008-03-19 Oliver Hunt <oliver@apple.com>
Reviewed by Antti.
Bug 17954: Canvas arc() with radius of 0 throws exception
http://bugs.webkit.org/show_bug.cgi?id=17954
Simple fix -- use >= instead of > when validating the radius.
* html/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::arc):
2008-03-19 Justin Garcia <justin.garcia@apple.com>
Reviewed by Oliver.
......@@ -468,7 +468,7 @@ void CanvasRenderingContext2D::arcTo(float x0, float y0, float x1, float y1, flo
void CanvasRenderingContext2D::arc(float x, float y, float r, float sa, float ea, bool anticlockwise, ExceptionCode& ec)
{
ec = 0;
if (!(r > 0)) {
if (!(r >= 0)) {
ec = INDEX_SIZE_ERR;
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment