<?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>17952</bug_id>
          
          <creation_ts>2012-07-18 07:22:37 +0000</creation_ts>
          <short_desc>The type of fillStyle/strokeStyle should probably be |(DOMString or CanvasGradient or CanvasPattern)|</short_desc>
          <delta_ts>2012-09-28 04:17:30 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</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/#2dcontext</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>cabanier</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>70365</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 07:22:37 +0000</bug_when>
    <thetext>This was was cloned from bug 17284 as part of operation convergence.
Originally filed: 2012-06-01 12:36:00 +0000

================================================================================
 #0   contributor@whatwg.org                          2012-06-01 12:36:07 +0000 
--------------------------------------------------------------------------------
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

Comment:
The type of fillStyle/strokeStyle should probably be |(DOMString or
CanvasGradient or CanvasPattern)|

Posted from: 91.181.38.75 by ms2ger@gmail.com
User agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0a1) Gecko/20120108 Firefox/12.0a1
================================================================================
 #1   Ms2ger                                          2012-06-01 12:37:28 +0000 
--------------------------------------------------------------------------------
Currently the spec isn&apos;t terribly clear on what should happen for, for example, ctx.fillStyle = { valueOf: function() { return &quot;blue&quot; } }. Deferring to WebIDL would fix that.
================================================================================</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72669</commentid>
    <comment_count>1</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-08-23 22:11:43 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7260.
Check-in comment: Clean up some IDLs that use &apos;any&apos; to specify the exact type instead, and clean up some surrounding markup
http://html5.org/tools/web-apps-tracker?from=7259&amp;to=7260</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72695</commentid>
    <comment_count>2</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-08-24 07:03:30 +0000</bug_when>
    <thetext>The prose still stays:

&gt; If the value is a string but cannot be parsed as a CSS &lt;color&gt; value,
&gt; or is neither a string, a CanvasGradient, nor a CanvasPattern, then
&gt; it must be ignored, and the attribute must retain its previous value.

&quot;or is neither a string, a CanvasGradient, nor a CanvasPattern,&quot; is now handled in WebIDL, and should be dropped.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72861</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-08-27 22:19:56 +0000</bug_when>
    <thetext>Oops.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72863</commentid>
    <comment_count>4</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-08-27 22:21:48 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7287.
Check-in comment: Remove redundant text.
http://html5.org/tools/web-apps-tracker?from=7286&amp;to=7287</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72879</commentid>
    <comment_count>5</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-08-28 06:45:02 +0000</bug_when>
    <thetext>Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73149</commentid>
    <comment_count>6</comment_count>
    <who name="rcabanie">cabanier</who>
    <bug_when>2012-09-02 02:32:36 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Checked in as WHATWG revision r7260.
&gt; Check-in comment: Clean up some IDLs that use &apos;any&apos; to specify the exact type
&gt; instead, and clean up some surrounding markup
&gt; http://html5.org/tools/web-apps-tracker?from=7259&amp;to=7260

This change modifies the behavior that all browsers have.
Currently &quot;ctx.fillStyle = { valueOf: function() { return &quot;blue&quot; } }&quot; is ignored because it is not a string, canvaspattern or a gradient.
No browser will cast the object to a string.

Current behavior is to accept &apos;any&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73150</commentid>
    <comment_count>7</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-09-02 07:51:15 +0000</bug_when>
    <thetext>First of all, ToString({ valueOf: function() { return &quot;blue&quot; } }) is &quot;[object Object]&quot;. Second, why would you want this to be inconsistent with the sensible WebIDL behaviour?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73157</commentid>
    <comment_count>8</comment_count>
    <who name="rcabanie">cabanier</who>
    <bug_when>2012-09-02 21:47:13 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; First of all, ToString({ valueOf: function() { return &quot;blue&quot; } }) is &quot;[object
&gt; Object]&quot;. Second, why would you want this to be inconsistent with the sensible
&gt; WebIDL behaviour?

sorry, copy/paste error.
What is working with the IDL and not before is if you pass this:

fillStyle = { toString():  { return &quot;blue&quot;; } }

I don&apos;t disagree that this might make more sense, but it is a change of behavior (which was an IDL that took &apos;any&apos;).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74718</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-09-28 04:12:16 +0000</bug_when>
    <thetext>Changing behaviour is fine if it&apos;s an edge case and the new behaviour is saner. It&apos;s an issue if it isn&apos;t compatible with legacy content, but do we have any reason to believe that is the case?

Marking FIXED again, in the absence of such information.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74719</commentid>
    <comment_count>10</comment_count>
    <who name="rcabanie">cabanier</who>
    <bug_when>2012-09-28 04:17:30 +0000</bug_when>
    <thetext>(In reply to comment #9)
&gt; Changing behaviour is fine if it&apos;s an edge case and the new behaviour is saner.
&gt; It&apos;s an issue if it isn&apos;t compatible with legacy content, but do we have any
&gt; reason to believe that is the case?
&gt; 
&gt; Marking FIXED again, in the absence of such information.

I agree.
We did some more tests and this matches behavior on some browsers.

This will be changed in the W3 version of the spec as well.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>