[html5] r7179 - [giow] (0) Add removeHitRegion() to canvas, since Microsoft want it. Affected to [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Jul 17 13:48:42 PDT 2012


Author: ianh
Date: 2012-07-17 13:48:37 -0700 (Tue, 17 Jul 2012)
New Revision: 7179

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Add removeHitRegion() to canvas, since Microsoft want it.
Affected topics: Canvas

Modified: complete.html
===================================================================
--- complete.html	2012-07-17 07:45:34 UTC (rev 7178)
+++ complete.html	2012-07-17 20:48:37 UTC (rev 7179)
@@ -35845,6 +35845,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>(double sw, double sh);
@@ -39529,6 +39530,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
@@ -39564,7 +39580,7 @@
    steps.</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.</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
@@ -39610,7 +39626,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.</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
@@ -39624,13 +39640,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.</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>.</li>
 
+   <li><p><a href=#garbage-collect-the-regions>Garbage-collect the regions</a> of <var title="">ancestor</var>.</li>
+
+  </ol><p>To <dfn id=garbage-collect-the-regions>garbage-collect the regions</dfn> of a
+  <code><a href=#the-canvas-element>canvas</a></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.</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
@@ -39898,6 +39924,24 @@
    <li><p>Add <var title="">region</var> to the <code><a href=#the-canvas-element>canvas</a></code>
    element's <a href=#hit-region-list>hit region list</a>.</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><a href=#the-canvas-element>canvas</a></code> element, if any. If no such region currently
+   exists, abort these steps.</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><a href=#the-canvas-element>canvas</a></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.</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>.</li>
+
   </ol></div>
 
   <hr><p>The <code><a href=#mouseevent>MouseEvent</a></code> interface is extended to support hit

Modified: index
===================================================================
--- index	2012-07-17 07:45:34 UTC (rev 7178)
+++ index	2012-07-17 20:48:37 UTC (rev 7179)
@@ -35845,6 +35845,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>(double sw, double sh);
@@ -39529,6 +39530,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
@@ -39564,7 +39580,7 @@
    steps.</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.</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
@@ -39610,7 +39626,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.</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
@@ -39624,13 +39640,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.</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>.</li>
 
+   <li><p><a href=#garbage-collect-the-regions>Garbage-collect the regions</a> of <var title="">ancestor</var>.</li>
+
+  </ol><p>To <dfn id=garbage-collect-the-regions>garbage-collect the regions</dfn> of a
+  <code><a href=#the-canvas-element>canvas</a></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.</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
@@ -39898,6 +39924,24 @@
    <li><p>Add <var title="">region</var> to the <code><a href=#the-canvas-element>canvas</a></code>
    element's <a href=#hit-region-list>hit region list</a>.</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><a href=#the-canvas-element>canvas</a></code> element, if any. If no such region currently
+   exists, abort these steps.</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><a href=#the-canvas-element>canvas</a></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.</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>.</li>
+
   </ol></div>
 
   <hr><p>The <code><a href=#mouseevent>MouseEvent</a></code> interface is extended to support hit

Modified: source
===================================================================
--- source	2012-07-17 07:45:34 UTC (rev 7178)
+++ source	2012-07-17 20:48:37 UTC (rev 7179)
@@ -41767,6 +41767,7 @@
 
   // hit regions
   void <span title="dom-context-2d-addHitRegion">addHitRegion</span>(<span>HitRegionOptions</span> options);
+  void <span title="dom-context-2d-removeHitRegion">removeHitRegion</span>(<span>HitRegionOptions</span> options);
 
   // pixel manipulation
   <span>ImageData</span> <span title="dom-context-2d-createImageData">createImageData</span>(double sw, double sh);
@@ -46126,6 +46127,22 @@
 
    </dd>
 
+   <dt><var title="">context</var> . <code title="dom-context-2d-removeHitRegion">removeHitRegion</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">addHitRegion()</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">
@@ -46176,7 +46193,7 @@
    steps.</p></li>
 
    <li><p>Let <var title="">list</var> be the <span>hit region
-   list</span> associatd with <var title="">ancestor</var>'s
+   list</span> associated with <var title="">ancestor</var>'s
    bitmap.</p></li>
 
    <li><p>If there is a <span>hit region</span> in <var
@@ -46244,7 +46261,7 @@
   <ol>
 
    <li><p>Let <var title="">list</var> be the <span>hit region
-   list</span> associatd with <var title="">ancestor</var>'s
+   list</span> associated with <var title="">ancestor</var>'s
    bitmap.</p></li>
 
    <li><p>If there is a <span>hit region</span> in <var
@@ -46265,13 +46282,28 @@
   <ol>
 
    <li><p>Let <var title="">list</var> be the <span>hit region
-   list</span> associatd with <var title="">ancestor</var>'s
+   list</span> associated with <var title="">ancestor</var>'s
    bitmap.</p></li>
 
    <li><p>Remove all pixels in <var title="">pixels</var> from the
    <span title="hit region's set of pixels">set of pixels</span> of
    each <span>hit region</span> in <var title="">list</var>.</p></li>
 
+   <li><p><span>Garbage-collect the regions</span> of <var
+   title="">ancestor</var>.</p></li>
+
+  </ol>
+
+  <p>To <dfn>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 <span>hit region
+   list</span> associated with <var title="">ancestor</var>'s
+   bitmap.</p></li>
+
    <li><p><i>Loop</i>: Let <var title="">victim</var> be the first
    <span>hit region</span> in <var title="">list</var> to have an
    empty <span title="hit region's set of pixels">set of
@@ -46605,6 +46637,30 @@
 
   </ol>
 
+  <p>When the <dfn
+  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 <span>the region
+   identified by the ID</span> 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 <span title="hit
+   region">hit regions</span> for which it is an <span>ancestor
+   region</span>, from the <code>canvas</code> element's <span>hit
+   region list</span>; then, if it had a <span title="hit region's
+   parent">parent</span> region, decrement that <span>hit region's
+   child count</span> by one.</p></li> <!-- we garbage collect the
+   regions below -->
+
+   <li><p><span>Garbage-collect the regions</span> of <var
+   title="">ancestor</var>.</p></li>
+
+  </ol>
+
   </div>
 
   <hr>




More information about the Commit-Watchers mailing list