<?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>11739</bug_id>
          
          <creation_ts>2011-01-11 22:51:44 +0000</creation_ts>
          <short_desc>&lt;canvas&gt;: clearPath() that clears pixels the way clearRect() does, but using a path</short_desc>
          <delta_ts>2014-09-26 21:31:31 +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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-clearrect</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Needs Impl Interest</target_milestone>
          <dependson>9236</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>jackalmage</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>robin</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>44243</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-01-11 22:51:44 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html
Section: http://www.whatwg.org/specs/web-apps/current-work/complete.html#complex-shapes-(paths)

Comment:
I would like to see a clearPath or clearStroke functions similar to clearRect
but to clear lines, not just full rectangles

Posted from: 71.9.39.98</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44245</commentid>
    <comment_count>1</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2011-01-11 23:00:52 +0000</bug_when>
    <thetext>This can be achieved currently by making a path, calling clip(), *then* calling clearRect with a bounding rectangle specified.

That technique is fairly unintuitive, though.  A clear() method that clears out a path would be nice.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45357</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-02-11 01:27:04 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Partially Accepted
Change Description: see diff given below
Rationale: That might make sense, but in a future version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45364</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-02-11 01:33:19 +0000</bug_when>
    <thetext>&gt; Change Description: see diff given below

That should read &quot;none yet&quot;, my apologies.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52678</commentid>
    <comment_count>4</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:03:35 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64766</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-02-29 22:11:36 +0000</bug_when>
    <thetext>What&apos;s the use case for this, exactly? Having played with canvas quite a bit recently I&apos;ve never found myself needing anything but clearRect() applied to the entire canvas...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64767</commentid>
    <comment_count>6</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2012-02-29 22:16:00 +0000</bug_when>
    <thetext>I&apos;ve used the technique I outlined in Comment #1 for a Worms-like game before.  When your gun hit, I did a clearRect() (clipped to a path) to remove pixels from the &quot;level&quot; canvas.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64781</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-02-29 22:45:06 +0000</bug_when>
    <thetext>I guess that makes sense.

So basically this is just a shorthand for:

   .save();
   .clip();
   .setTranform(identity)
   .clearRect(entire canvas)
   .restore();

...?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64782</commentid>
    <comment_count>8</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2012-02-29 22:46:39 +0000</bug_when>
    <thetext>Yup.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64789</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-02-29 22:54:52 +0000</bug_when>
    <thetext>I&apos;m going to punt on this for now, and review it at a later date to see how much demand there has been for it. So far it seems like it would be little more than a convenience method and I haven&apos;t heard much demand for it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82059</commentid>
    <comment_count>10</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2013-01-24 07:38:04 +0000</bug_when>
    <thetext>This bug was cloned to create HTML WG bug 19026.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84674</commentid>
    <comment_count>11</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-03-19 22:56:28 +0000</bug_when>
    <thetext>Any implementation interest on this? How compelling a use case is it? If it&apos;s not needed by many people, since it&apos;s only a convenience API essentially, maybe it&apos;s not worth doing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112320</commentid>
    <comment_count>12</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-09-26 21:31:31 +0000</bug_when>
    <thetext>Marking WONTFIX since it&apos;s gotten no vendor interest and it&apos;s equivalent to five lines of simple code anyway.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>