This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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
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?
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".
(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".
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