This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21873 - <canvas>: anticlockwise parameter of ellipse is optional or not.
Summary: <canvas>: anticlockwise parameter of ellipse is optional or not.
Status: RESOLVED INVALID
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-30 06:18 UTC by Dongseong Hwang
Modified: 2013-05-06 07:09 UTC (History)
3 users (show)

See Also:


Attachments

Description Dongseong Hwang 2013-04-30 06:18:35 UTC
Web IDL clarifies anticlockwise parameter of ellipse is not optional while arc's is optional.
  void arc(unrestricted double x, unrestricted double y, unrestricted double radius, unrestricted double startAngle, unrestricted double endAngle, optional boolean anticlockwise = false); 
  void ellipse(unrestricted double x, unrestricted double y, unrestricted double radiusX, unrestricted double radiusY,  unrestricted double rotation, unrestricted double startAngle, unrestricted double endAngle, boolean anticlockwise);

However, ellipse explanation seems to imply that anticlockwise parameter of ellipse is optional. Focus on "(defaulting to clockwise)".
context . ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise)
path . ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise)
Adds points to the subpath such that the arc described by the circumference of the ellipse described by the arguments, starting at the given start angle and ending at the given end angle, going in the given direction (defaulting to clockwise), is added to the path, connected to the previous point by a straight line.

I think anticlockwise parameter of ellipse should be optional to match arc's.
Comment 1 rcabanie 2013-04-30 16:23:28 UTC
Shouldn't everything after RadiusX be optional?
This also applies to arc()
Comment 2 Dongseong Hwang 2013-04-30 18:34:21 UTC
(In reply to comment #1)
> Shouldn't everything after RadiusX be optional?
> This also applies to arc()

No, only anticlockwise argument of arc is optional. So I think anticlockwise argument of ellipse also should be optional.
Now arc() in WebKit implemented all arguments are optional. It is wrong.
I submitted the issue for Blink: https://codereview.chromium.org/14654002/
Comment 3 rcabanie 2013-04-30 18:49:37 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Shouldn't everything after RadiusX be optional?
> > This also applies to arc()
> 
> No, only anticlockwise argument of arc is optional. So I think anticlockwise
> argument of ellipse also should be optional.
> Now arc() in WebKit implemented all arguments are optional. It is wrong.
> I submitted the issue for Blink: https://codereview.chromium.org/14654002/

sure.
My point is that in order to draw a simple circle, you have to provide a bunch of parameters. Seems unnecessary
Comment 4 Dongseong Hwang 2013-04-30 18:54:15 UTC
(In reply to comment #3)
> sure.
> My point is that in order to draw a simple circle, you have to provide a
> bunch of parameters. Seems unnecessary

I agree with you. 
I'm fine about convenient overloaded arc and ellipse functions. I think we can suggest this in another bug.

What I want in this bug is making ellipse consistent with arc.
Comment 5 rcabanie 2013-05-01 17:06:56 UTC
> What I want in this bug is making ellipse consistent with arc.

If you look at the history of ellipse in the whatwg mail archive, you will see that Ian did this intentionally.
Comment 6 Dongseong Hwang 2013-05-03 12:13:43 UTC
(In reply to comment #5)
> > What I want in this bug is making ellipse consistent with arc.
> 
> If you look at the history of ellipse in the whatwg mail archive, you will
> see that Ian did this intentionally.

Thanks for good information.
Unfortunately, I could not find it. If you know the link, could you let me know?

BTW, What I found is this mail: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-March/035239.html
Ian used ellipse like this: context.ellipse(x, y, width/2, height/2, angle, 0, Math.PI*2);
At that time, Ian may thought the last parameter (a.k.a anticlockwise) is optional.
Comment 7 rcabanie 2013-05-03 17:36:09 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > > What I want in this bug is making ellipse consistent with arc.
> > 
> > If you look at the history of ellipse in the whatwg mail archive, you will
> > see that Ian did this intentionally.
> 
> Thanks for good information.
> Unfortunately, I could not find it. If you know the link, could you let me
> know?
> 
see : http://lists.w3.org/Archives/Public/public-whatwg-archive/2012Sep/0321.html
Comment 8 Dongseong Hwang 2013-05-06 07:09:00 UTC
(In reply to comment #7)
> see :
> http://lists.w3.org/Archives/Public/public-whatwg-archive/2012Sep/0321.html

Thanks a lot. It is intended.
Ok, I agree. This bug is resolved.