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 18758 - Is the argument of setLineDash an array or sequence?
Summary: Is the argument of setLineDash an array or sequence?
Status: RESOLVED FIXED
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: 19934
  Show dependency treegraph
 
Reported: 2012-08-31 21:01 UTC by contributor
Modified: 2012-11-11 04:56 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2012-08-31 21:01:31 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html
Multipage: http://www.whatwg.org/C#line-styles
Complete: http://www.whatwg.org/c#line-styles

Comment:
Is the argument of setLineDash an array or sequence?

Posted from: 2620:0:100c:0:5fb:6ba9:8a9e:6846 by junov@chromium.org
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.83 Safari/537.1
Comment 1 Justin Novosad 2012-08-31 21:07:21 UTC
According to the IDL, the argument is a sequence.  In the text, the term "array" is used.

If the argument is a sequence, then it is not necessary for the spec to specify that setLineDash and getLineDash make copies of it since sequences are passed by value.

If the argument is an array, then the spec must define the correct behavior for handling array elements that are not numbers.  Are they ignored? Are they treated as zero? Does the function throw a typeMismatchError exception?
Comment 2 Ian 'Hixie' Hickson 2012-08-31 21:52:39 UTC
The term "array" in the prose is just intended in the computer science sense of "an indexed list", not in the sense of JavaScript or IDL Array with a capital A (and monospace font).

I'll try to make it clearer though, by removing "a copy of the array provided as" and changing "the array" to just a reference to the variable "a".
Comment 3 Justin Novosad 2012-09-01 03:38:12 UTC
(In reply to comment #2)
> The term "array" in the prose is just intended in the computer science sense of
> "an indexed list", not in the sense of JavaScript or IDL Array with a capital A
> (and monospace font).

That is what I thought, but when I read that the implementation was supposed to make a copy of the said array, I got confused.

> 
> I'll try to make it clearer though, by removing "a copy of the array provided
> as" and changing "the array" to just a reference to the variable "a".

Sounds good.

Also, in the description of getLineDash, perhaps it is not necessary specify "newly created array".
Comment 4 contributor 2012-11-06 01:54:32 UTC
Checked in as WHATWG revision r7508.
Check-in comment: Try to avoid using the term 'array' when it's a sequence.
http://html5.org/tools/web-apps-tracker?from=7507&to=7508