<?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>17891</bug_id>
          
          <creation_ts>2012-07-18 07:13:11 +0000</creation_ts>
          <short_desc>createPattern(canvas, null) now throws rather than &apos;repeat&apos;</short_desc>
          <delta_ts>2013-09-14 06:32:52 +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></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>needs-testcase</keywords>
          <priority>P3</priority>
          <bug_severity>blocker</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          <blocked>17760</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>cabanier</cc>
    
    <cc>ian</cc>
    
    <cc>krisk</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>70252</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 07:13:11 +0000</bug_when>
    <thetext>This was was cloned from bug 17760 as part of operation convergence.
Originally filed: 2012-07-12 15:56:00 +0000
Original reporter: kkrueger &lt;krisk@microsoft.com&gt;

================================================================================
 #0   kkrueger                                        2012-07-12 15:56:19 +0000 
--------------------------------------------------------------------------------
For compatibility and interoperability it would seem far safer to not throw an exception when createPattern(canvas, null) is used.  In the below list of browsers that treat this as a &apos;repeat&apos; e.g. createPattern(canvas, &apos;repeat&apos;).

The previous version of the spec had a normative statement that matched the majority of browsers.  The latest version of the spec changed this normative statement.

Previous Spec
&apos;If the empty string or null is specified, repeat must be assumed. If an unrecognized value is given, then the user agent must raise a SYNTAX_ERR exception&apos;

Current working draft has changed to 
&apos;If the empty string is specified, repeat must be assumed. If an unrecognized value is given, then the user agent must raise a SYNTAX_ERR exception.&apos;


Treats null as &apos;repeat&apos;
Firefox 13.1
Internet Explorer 9
Chrome 20

Opera 12 does indeed raise an exception when passed &apos;null&apos;

Test Case
http://www.w3c-test.org/html/tests/submission/PhilipTaylor/canvas/2d.pattern.repeat.null.html
Related Bug
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17141
================================================================================
 #1   Ms2ger                                          2012-07-17 15:32:52 +0000 
--------------------------------------------------------------------------------
Nightly also throws.
================================================================================</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72268</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-08-16 04:05:49 +0000</bug_when>
    <thetext>I plan to fix this to match implementations (by changing the method&apos;s declaration to have its second argument&apos;s type be &quot;DOMString?&quot; instead of &quot;DOMString&quot;).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72270</commentid>
    <comment_count>2</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-08-16 07:04:50 +0000</bug_when>
    <thetext>Note that two implementations do, in fact, follow the spec. I don&apos;t see a reason to change the spec here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72320</commentid>
    <comment_count>3</comment_count>
    <who name="rcabanie">cabanier</who>
    <bug_when>2012-08-16 21:34:53 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Note that two implementations do, in fact, follow the spec. I don&apos;t see a
&gt; reason to change the spec here.

the majority of browsers doesn&apos;t follow it though.
Only 1 shipping browser has this feature which was introduced by accident.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72342</commentid>
    <comment_count>4</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-08-17 07:52:02 +0000</bug_when>
    <thetext>Stringifying null to &apos;null&apos; was a deliberate decision, not an accident.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72360</commentid>
    <comment_count>5</comment_count>
    <who name="rcabanie">cabanier</who>
    <bug_when>2012-08-17 16:27:34 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Stringifying null to &apos;null&apos; was a deliberate decision, not an accident.

Can you elaborate?
Was the change in the spec deliberate or the change in Opera or nightly?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72457</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-08-20 23:32:39 +0000</bug_when>
    <thetext>Upon further testing, both Firefox and Opera do this right. So actually I don&apos;t think we should change the spec.

(What the spec says now makes more sense than what it used to say, so even though the change was accidental I don&apos;t think it&apos;s a problem. I would only recommend changing it back if the browsers all interoperated on the less ideal behaviour, which they don&apos;t.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72459</commentid>
    <comment_count>7</comment_count>
    <who name="rcabanie">cabanier</who>
    <bug_when>2012-08-20 23:37:29 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; Upon further testing, both Firefox and Opera do this right. So actually I don&apos;t
&gt; think we should change the spec.
&gt; 
&gt; (What the spec says now makes more sense than what it used to say, so even
&gt; though the change was accidental I don&apos;t think it&apos;s a problem. I would only
&gt; recommend changing it back if the browsers all interoperated on the less ideal
&gt; behaviour, which they don&apos;t.)

FYI 
Current shipping Firefox does not implement this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72607</commentid>
    <comment_count>8</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-08-23 14:13:36 +0000</bug_when>
    <thetext>I&apos;m reverting the development versions of Firefox to the shipping behavior for now, for what it&apos;s worth.  I don&apos;t think there&apos;s anything to be had from changing the behavior of Gecko here in a way that might cause web pages to throw when they used to not throw.  Accordingly, I think the spec should grow a [TreatNullAs=EmptyString] here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93379</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-09-14 04:12:10 +0000</bug_when>
    <thetext>I updated the spec, since none of the browsers moved to the saner behaviour.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93380</commentid>
    <comment_count>10</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2013-09-14 06:32:52 +0000</bug_when>
    <thetext>Adding &quot;needs-testcase&quot; keyword to flag that http://w3c-test.org/testrunner/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.null.html needs to be updated.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>