- From: Sam Ruby via cvs-syncmail <cvsmail@w3.org>
- Date: Sat, 01 Sep 2012 03:14:48 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/2dcontext In directory hutz:/tmp/cvs-serv21089 Modified Files: Overview.html Log Message: commit 24203f1d7e46b36f6a141028699d17befa0fc909 Author: ianh <ianh@340c8d12-0b0e-0410-8428-c7bf67bfef74> Date: Tue Jul 17 20:48:37 2012 +0000 [giow] (0) Add removeHitRegion() to canvas, since Microsoft want it. Affected topics: Canvas git-svn-id: http://svn.whatwg.org/webapps@7179 340c8d12-0b0e-0410-8428-c7bf67bfef74 Index: Overview.html =================================================================== RCS file: /sources/public/html5/2dcontext/Overview.html,v retrieving revision 1.140 retrieving revision 1.141 diff -u -d -r1.140 -r1.141 --- Overview.html 30 Aug 2012 00:14:46 -0000 1.140 +++ Overview.html 1 Sep 2012 03:14:46 -0000 1.141 @@ -321,7 +321,7 @@ <h1>HTML Canvas 2D Context</h1> <h2 class="no-num no-toc" id=generatedID></h2> - <h2 class="no-num no-toc" id="editor's-draft-date-1-january-1970">Editor's Draft 30 August 2012</h2> + <h2 class="no-num no-toc" id="editor's-draft-date-1-january-1970">Editor's Draft 1 September 2012</h2> <dl><dt>Latest Published Version:</dt> <dd><a href=http://www.w3.org/TR/2dcontext/>http://www.w3.org/TR/2dcontext/</a></dd> <dt>Latest Editor's Draft:</dt> @@ -501,7 +501,7 @@ Group</a> is the W3C working group responsible for this specification's progress along the W3C Recommendation track. - This specification is the 30 August 2012 Editor's Draft. + This specification is the 1 September 2012 Editor's Draft. </p> @@ -686,6 +686,7 @@ // hit regions void <a href=#dom-context-2d-addhitregion title=dom-context-2d-addHitRegion>addHitRegion</a>(<a href=#hitregionoptions>HitRegionOptions</a> options); + void <a href=#dom-context-2d-removehitregion title=dom-context-2d-removeHitRegion>removeHitRegion</a>(<a href=#hitregionoptions>HitRegionOptions</a> options); // pixel manipulation <a href=#imagedata>ImageData</a> <a href=#dom-context-2d-createimagedata title=dom-context-2d-createImageData>createImageData</a>(unrestricted double sw, unrestricted double sh); @@ -4327,6 +4328,21 @@ </ul></dd> + <dt><var title="">context</var> . <code title=dom-context-2d-removeHitRegion><a href=#dom-context-2d-removehitregion>removeHitRegion</a></code>(<var title="">options</var>)</dt> + + <dd> + + <p>Removes a hit region (and all its ancestors) from the canvas + bitmap. The argument is the ID of a region added using <code title=dom-context-2d-addHitRegion><a href=#dom-context-2d-addhitregion>addHitRegion()</a></code>.</p> + + <p>The pixels that were covered by this region and its descendants + are effectively cleared by this operation, leaving the regions + non-interactive. In particular, regions that occupied the same + pixels before the removed regions were added, overlapping them, do + not resume their previous role.</p> + + </dd> + </dl><div class=impl> <p>A <a href=#hit-region>hit region</a> <var title="">A</var> is an @@ -4362,7 +4378,7 @@ steps.</p></li> <li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region - list</a> associatd with <var title="">ancestor</var>'s + list</a> associated with <var title="">ancestor</var>'s bitmap.</p></li> <li><p>If there is a <a href=#hit-region>hit region</a> in <var title="">list</var> whose <a href="#hit-region's-control" title="hit region's @@ -4408,7 +4424,7 @@ <a href=#hit-region>hit region</a> or nothing):</p> <ol><li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region - list</a> associatd with <var title="">ancestor</var>'s + list</a> associated with <var title="">ancestor</var>'s bitmap.</p></li> <li><p>If there is a <a href=#hit-region>hit region</a> in <var title="">list</var> whose <a href="#hit-region's-set-of-pixels" title="hit region's set of @@ -4422,13 +4438,23 @@ steps:</p> <ol><li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region - list</a> associatd with <var title="">ancestor</var>'s + list</a> associated with <var title="">ancestor</var>'s bitmap.</p></li> <li><p>Remove all pixels in <var title="">pixels</var> from the <a href="#hit-region's-set-of-pixels" title="hit region's set of pixels">set of pixels</a> of each <a href=#hit-region>hit region</a> in <var title="">list</var>.</p></li> + <li><p><a href=#garbage-collect-the-regions>Garbage-collect the regions</a> of <var title="">ancestor</var>.</p></li> + + </ol><p>To <dfn id=garbage-collect-the-regions>garbage-collect the regions</dfn> of a + <code>canvas</code> element <var title="">ancestor</var>, the user + agent must run the following steps:</p> + + <ol><li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region + list</a> associated with <var title="">ancestor</var>'s + bitmap.</p></li> + <li><p><i>Loop</i>: Let <var title="">victim</var> be the first <a href=#hit-region>hit region</a> in <var title="">list</var> to have an empty <a href="#hit-region's-set-of-pixels" title="hit region's set of pixels">set of @@ -4696,6 +4722,24 @@ <li><p>Add <var title="">region</var> to the <code>canvas</code> element's <a href=#hit-region-list>hit region list</a>.</p></li> + </ol><p>When the <dfn id=dom-context-2d-removehitregion title=dom-context-2d-removeHitRegion><code>removeHitRegion()</code></dfn> + method is invoked, the user agent must run the following steps:</p> + + <ol><li><p>Let <var title="">region</var> be <a href=#the-region-identified-by-the-id>the region + identified by the ID</a> given by the method's argument in this + <code>canvas</code> element, if any. If no such region currently + exists, abort these steps.</p></li> + + <li><p>Remove <var title="">region</var>, and all <a href=#hit-region title="hit + region">hit regions</a> for which it is an <a href=#ancestor-region>ancestor + region</a>, from the <code>canvas</code> element's <a href=#hit-region-list>hit + region list</a>; then, if it had a <a href="#hit-region's-parent" title="hit region's + parent">parent</a> region, decrement that <a href="#hit-region's-child-count">hit region's + child count</a> by one.</p></li> <!-- we garbage collect the + regions below --> + + <li><p><a href=#garbage-collect-the-regions>Garbage-collect the regions</a> of <var title="">ancestor</var>.</p></li> + </ol></div> <hr><p>The <code>MouseEvent</code> interface is extended to support hit
Received on Saturday, 1 September 2012 03:14:50 UTC