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 22218 - CanvasFillRule arguments should be [TreatUndefinedAs=Missing]
Summary: CanvasFillRule arguments should be [TreatUndefinedAs=Missing]
Status: RESOLVED WONTFIX
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-30 17:50 UTC by contributor
Modified: 2013-06-24 07:57 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2013-05-30 17:50:06 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html
Multipage: http://www.whatwg.org/C#2dcontext
Complete: http://www.whatwg.org/c#2dcontext
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/

Comment:
CanvasFillRule arguments should be [TreatUndefinedAs=Missing]

Posted from: 98.110.194.206 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20130521 Firefox/24.0
Comment 1 Boris Zbarsky 2013-05-30 17:50:36 UTC
See https://bugzilla.mozilla.org/show_bug.cgi?id=861938
Comment 2 rcabanie 2013-05-30 18:13:51 UTC
(In reply to comment #1)
> See https://bugzilla.mozilla.org/show_bug.cgi?id=861938

If WebIDL could specify this as the default behavior (which seems to be what people want), we won't have to change the spec.
Comment 3 Ian 'Hixie' Hickson 2013-06-12 17:58:14 UTC
heycam, is this something that you're planning on doing to WebIDL?
Comment 4 Cameron McCormack 2013-06-12 23:59:03 UTC
Yeah, I'm going to change how undefined works soon (next week probably), to match how ES6 handles it, which is that undefined for an optional argument is like not specifying it at all.
Comment 5 rcabanie 2013-06-13 04:41:04 UTC
(In reply to comment #4)
> Yeah, I'm going to change how undefined works soon (next week probably), to
> match how ES6 handles it, which is that undefined for an optional argument
> is like not specifying it at all.

What if you pass a different argument type  (i.e. an object). Will your change automatically promote it to undefined and missing?
Comment 6 Boris Zbarsky 2013-06-13 04:53:11 UTC
No, and that doesn't happen with [TreatUndefinedAs=Missing].  If you do that with these APIs, they will throw (unless your object's toString produces an element of this enum).  Which seems fine to me, frankly.
Comment 7 rcabanie 2013-06-13 05:48:17 UTC
(In reply to comment #6)
> No, and that doesn't happen with [TreatUndefinedAs=Missing].  If you do that
> with these APIs, they will throw (unless your object's toString produces an
> element of this enum).  Which seems fine to me, frankly.

ah, I was under the impression that we were trying to allow any argument. Rereading the linked bug, this is just about [undefined].

With Cameron's change, the spec doesn't have to be updated so this bug can be closed.
Comment 8 Ian 'Hixie' Hickson 2013-06-20 22:55:30 UTC
Closing per comment 7; if you disagree please don't hesitate to reopen it.

heycam, if there are implications of your change on what I say anywhere in the HTML spec that you know of, please file a bug on me to fix it (or drop me a mail, whichever), thanks!
Comment 9 Cameron McCormack 2013-06-24 07:57:17 UTC
The Web IDL changes have been made now, so undefined will be treated as a missing optional argument (and fill in the default value) automatically.