Bug 17954 - Canvas arc() with radius of 0 throws exception
: Canvas arc() with radius of 0 throws exception
Product: WebKit
Classification: Unclassified
Component: HTML DOM
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To: Nobody
: HasReduction, InRadar, ReviewedForRadar
Depends on:
  Show dependency treegraph
Reported: 2008-03-19 12:08 PDT by John Resig
Modified: 2008-03-19 15:29 PDT (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description John Resig 2008-03-19 12:08:40 PDT
See the following reduction:

Which throws the following error:
Error: INDEX_SIZE_ERR: DOM Exception 1
http://ejohn.org/files/bugs/arc/ (line 5)

According to the canvas spec:

"Negative values for radius must cause the implementation to raise an INDEX_SIZE_ERR exception."

However, that is not the case for arcs with a radius of 0.
Comment 1 John Resig 2008-03-19 12:12:47 PDT
For posterity, here's the reduction:

<canvas width="100" height="100" id="canvas"></canvas>
<script>window.onload = function(){
var c = document.getElementsByTagName("canvas")[0];
var context = c.getContext("2d");
context.arc( 10, 10, 0, 0, 180, false );
Comment 2 Mark Rowe (bdash) 2008-03-19 13:11:34 PDT
Comment 3 Oliver Hunt 2008-03-19 15:29:11 PDT
Landed r31162