<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>16524</bug_id>
          
          <creation_ts>2012-03-26 14:29:36 +0000</creation_ts>
          <short_desc>ask about reasons to use getter/setter for lineDash</short_desc>
          <delta_ts>2012-03-29 03:17:47 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML Canvas 2D Context</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#top</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>guanqun.lu</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>66047</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-03-26 14:29:36 +0000</bug_when>
    <thetext>Specification: http://dev.w3.org/html5/2dcontext/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:
Hi Ian,

I&apos;ve some comments about the recent added line dashes. Right now, the mozilla
and webkit implements this as an attribute, but in this version, it uses
setLineDash() and getLineDash(). These setter/getter are not consistent with
the other line styles, such as lineWidth. (There&apos;s no such functions called
setLineWidth() and getLineWidth()). What&apos;s the reason behind this API design?

Thanks!
guanqun.lu@intel.com

Posted from: 134.134.139.76
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66103</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-03-27 06:36:10 +0000</bug_when>
    <thetext>There&apos;s not really a good way to make array-based attributes work. I&apos;ll post a more detailed comment in response to the WHATWG e-mail Mozilla sent suggesting the methods (they intend to remove the attributes).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66200</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-03-28 21:57:21 +0000</bug_when>
    <thetext>Basically, the reason is that there&apos;s no way to make it work with an attribute:

context.lineDash = [1,2,3];
context.lineDash[0] = 2; // what should happen?

var a = [1,2,3];
context.lineDash = a;
a[0] = 2; // what should happen to context.lineDash?

If you look at the feedback Mozilla sent the WHATWG list you&apos;ll see they had the same concern with their implementation.


(I&apos;m marking the bug resolved since this was just a question, not feedback. Feel free to e-mail the WHATWG list or me directly or indeed to chat on the #whatwg IRC channel on Freenode if you have any questions.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66209</commentid>
    <comment_count>3</comment_count>
    <who name="Lu Guanqun">guanqun.lu</who>
    <bug_when>2012-03-29 03:17:47 +0000</bug_when>
    <thetext>Thanks for your explanation, Ian.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>