[html5] r7821 - [e] (0) Cleanup Affected topics: Canvas, HTML
whatwg at whatwg.org
whatwg at whatwg.org
Fri Apr 12 14:58:10 PDT 2013
Author: ianh
Date: 2013-04-12 14:58:09 -0700 (Fri, 12 Apr 2013)
New Revision: 7821
Modified:
complete.html
index
source
Log:
[e] (0) Cleanup
Affected topics: Canvas, HTML
Modified: complete.html
===================================================================
--- complete.html 2013-04-12 21:31:10 UTC (rev 7820)
+++ complete.html 2013-04-12 21:58:09 UTC (rev 7821)
@@ -1836,7 +1836,10 @@
<p class=impl>This is an implementation requirement.</p>
+ <p>In an algorithm, steps in <a href=#synchronous-section title="synchronous section">synchronous sections</a> are
+ marked with ⌛.</p>
+
<h3 id=fingerprint><span class=secno>1.10 </span>Privacy concerns</h3>
<p><i>This section is non-normative.</i></p>
@@ -35260,240 +35263,197 @@
<li><p>Return the <code><a href=#path>Path</a></code> object as the constructed
object.</li>
- </ol><hr><p>The <dfn id=dom-path-addpath title=dom-path-addPath><code>addPath(<var title="">b</var>, <var title="">transform</var>)</code></dfn>
- method, when invoked on a <code><a href=#path>Path</a></code> object <var title="">a</var>, must run the following steps:</p>
+ </ol><hr><p>The <dfn id=dom-path-addpath title=dom-path-addPath><code>addPath(<var title="">b</var>, <var title="">transform</var>)</code></dfn> method, when invoked on a <code><a href=#path>Path</a></code> object <var title="">a</var>, must run the following steps:</p>
- <ol><li><p>If the <code><a href=#path>Path</a></code> object <var title="">b</var> has
- no subpaths, abort these steps.</li>
+ <ol><li><p>If the <code><a href=#path>Path</a></code> object <var title="">b</var> has no subpaths, abort these
+ steps.</li>
- <li><p>Create a copy of all the subpaths in <var title="">b</var>.
- Let this copy be known as <var title="">c</var>.</li>
+ <li><p>Create a copy of all the subpaths in <var title="">b</var>. Let this copy be known as <var title="">c</var>.</li>
- <li><p>Transform all the coordinates and lines in <var title="">c</var> by the transform matrix <var title="">transform</var>, if it is not null.</li>
+ <li><p>Transform all the coordinates and lines in <var title="">c</var> by the transform matrix
+ <var title="">transform</var>, if it is not null.</li>
- <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
- last point in the last subpath of <var title="">c</var>.</li>
+ <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the last point in the last subpath
+ of <var title="">c</var>.</li>
<li><p>Add all the subpaths in <var title="">c</var> to <var title="">a</var>.</li>
- <li><p>Create a new subpath in <var title="">a</var> with (<var title="">x</var>, <var title="">y</var>) as the only point in the
- subpath.</li>
+ <li><p>Create a new subpath in <var title="">a</var> with (<var title="">x</var>, <var title="">y</var>) as the only point in the subpath.</li>
- </ol><hr><p>The <dfn id=dom-path-addpathbystrokingpath title=dom-path-addPathByStrokingPath><code>addPathByStrokingPath(<var title="">b</var>, <var title="">styles</var>, <var title="">transform</var>)</code></dfn> method, when invoked on a
- <code><a href=#path>Path</a></code> object <var title="">a</var>, must run the
- following steps:</p>
+ </ol><hr><p>The <dfn id=dom-path-addpathbystrokingpath title=dom-path-addPathByStrokingPath><code>addPathByStrokingPath(<var title="">b</var>, <var title="">styles</var>, <var title="">transform</var>)</code></dfn> method,
+ when invoked on a <code><a href=#path>Path</a></code> object <var title="">a</var>, must run the following
+ steps:</p>
- <ol><li><p>If the <code><a href=#path>Path</a></code> object <var title="">b</var> has
- no subpaths, abort these steps.</li>
+ <ol><li><p>If the <code><a href=#path>Path</a></code> object <var title="">b</var> has no subpaths, abort these
+ steps.</li>
- <li><p>Create a copy of all the subpaths in <var title="">b</var>.
- Let this copy be known as <var title="">c</var>.</li>
+ <li><p>Create a copy of all the subpaths in <var title="">b</var>. Let this copy be known as <var title="">c</var>.</li>
- <li><p>Transform all the coordinates and lines in <var title="">c</var> by transformation matrix <var title="">transform</var>, if it is not null.</li>
+ <li><p>Transform all the coordinates and lines in <var title="">c</var> by transformation matrix
+ <var title="">transform</var>, if it is not null.</li>
- <li><p>Let a new list of subpaths <var title="">d</var> be the
- result of <a href=#trace-a-path title="trace a path">tracing</a> <var title="">c</var>, using the <var title="">styles</var> argument for
- the line styles.</p>
+ <li><p>Let a new list of subpaths <var title="">d</var> be the result of <a href=#trace-a-path title="trace a
+ path">tracing</a> <var title="">c</var>, using the <var title="">styles</var> argument for the
+ line styles.</p>
- <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
- last point in the last subpath of <var title="">d</var>.</li>
+ <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the last point in the last subpath
+ of <var title="">d</var>.</li>
<li><p>Add all the subpaths in <var title="">d</var> to <var title="">a</var>.</li>
- <li><p>Create a new subpath in <var title="">a</var> with (<var title="">x</var>, <var title="">y</var>) as the only point in the
- subpath.</li>
+ <li><p>Create a new subpath in <var title="">a</var> with (<var title="">x</var>, <var title="">y</var>) as the only point in the subpath.</li>
- </ol><hr><p>The <dfn id=dom-path-addtext title=dom-path-addText><code>addText()</code></dfn>
- and <dfn id=dom-path-addpathbystrokingtext title=dom-path-addPathByStrokingText><code>addPathByStrokingText()</code></dfn>
- methods each come in two variants: one rendering text at a given
- coordinate, and one rendering text along a given path. In both
- cases, the methods take a <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object
- argument for the text and (if appropriate) line styles to use, an
- <code><a href=#svgmatrix>SVGMatrix</a></code> object <var title="">transform</var> (which
- can be null), and a maximum width can optionally be provided.</p>
+ </ol><hr><p>The <dfn id=dom-path-addtext title=dom-path-addText><code>addText()</code></dfn> and <dfn id=dom-path-addpathbystrokingtext title=dom-path-addPathByStrokingText><code>addPathByStrokingText()</code></dfn> methods each
+ come in two variants: one rendering text at a given coordinate, and one rendering text along a
+ given path. In both cases, the methods take a <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object argument for
+ the text and (if appropriate) line styles to use, an <code><a href=#svgmatrix>SVGMatrix</a></code> object <var title="">transform</var> (which can be null), and a maximum width can optionally be provided.</p>
- <p>When one of the <code title=dom-path-addText><a href=#dom-path-addtext>addText()</a></code> and <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code> variants
- that take as argument an (<var title="">x</var>, <var title="">y</var>) coordinate is invoked, the method must run the
- following algorithm:</p>
+ <p>When one of the <code title=dom-path-addText><a href=#dom-path-addtext>addText()</a></code> and <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code> variants that take as
+ argument an (<var title="">x</var>, <var title="">y</var>) coordinate is invoked, the method must
+ run the following algorithm:</p>
- <ol><li><p>Run the <a href=#text-preparation-algorithm>text preparation algorithm</a>, passing it
- <var title="">text</var>, the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code>
- object argument, and, if the <var title="">maxWidth</var> argument
- was provided, that argument. Let <var title="">glyphs</var> be the
- result.</p>
+ <ol><li><p>Run the <a href=#text-preparation-algorithm>text preparation algorithm</a>, passing it <var title="">text</var>, the
+ <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object argument, and, if the <var title="">maxWidth</var>
+ argument was provided, that argument. Let <var title="">glyphs</var> be the result.</p>
- <li><p>Move all the shapes in <var title="">glyphs</var> to the
- right by <var title="">x</var> CSS pixels and down by <var title="">y</var> CSS pixels.</li>
+ <li><p>Move all the shapes in <var title="">glyphs</var> to the right by <var title="">x</var>
+ CSS pixels and down by <var title="">y</var> CSS pixels.</li>
- <li><p>Let <var title="">glyph subpaths</var> be a
- <a href=#path>path</a> describing the shapes given in <var title="">glyphs</var>, with each CSS pixel in the coordinate space
- of <var title="">glyphs</var> mapped to one coordinate space unit
- in <var title="">glyph subpaths</var>. Subpaths in <var title="">glyph subpaths</var> must wind clockwise, regardless of
- how the user agent's font subsystem renders fonts and regardless of
- how the fonts themselves are defined.</p>
+ <li><p>Let <var title="">glyph subpaths</var> be a <a href=#path>path</a> describing the shapes given
+ in <var title="">glyphs</var>, with each CSS pixel in the coordinate space of <var title="">glyphs</var> mapped to one coordinate space unit in <var title="">glyph subpaths</var>.
+ Subpaths in <var title="">glyph subpaths</var> must wind clockwise, regardless of how the user
+ agent's font subsystem renders fonts and regardless of how the fonts themselves are defined.</p>
- <li><p>If the method is <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code>,
- replace <var title="">glyph subpaths</var> by the result of <a href=#trace-a-path title="trace a path">tracing</a> <var title="">glyph
- subpaths</var>, using the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object
- argument for the line styles.</p>
+ <li><p>If the method is <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code>, replace <var title="">glyph subpaths</var> by the result of <a href=#trace-a-path title="trace a path">tracing</a> <var title="">glyph subpaths</var>, using the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object argument for the
+ line styles.</p>
- <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the transformation matrix <var title="">transform</var>, if it is not null.</li>
+ <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the
+ transformation matrix <var title="">transform</var>, if it is not null.</li>
- <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) be the last point in the
- last subpath of <var title="">glyph subpaths</var>.</li>
+ <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) be the last point in the last subpath of <var title="">glyph
+ subpaths</var>.</li>
- <li><p>Add all the subpaths in <var title="">glyph
- subpaths</var> to the <code><a href=#path>Path</a></code> object.</li>
+ <li><p>Add all the subpaths in <var title="">glyph subpaths</var> to the <code><a href=#path>Path</a></code>
+ object.</li>
- <li><p>Create a new subpath in the <code><a href=#path>Path</a></code> object with
- (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) as the only point in the
- subpath.</li>
+ <li><p>Create a new subpath in the <code><a href=#path>Path</a></code> object with (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) as the only point in
+ the subpath.</li>
- </ol><p>When one of the <code title=dom-path-addText><a href=#dom-path-addtext>addText()</a></code> and <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code>
- variants that take as argument a <code><a href=#path>Path</a></code> object is
- invoked, the method must run the following algorithm:</p>
+ </ol><p>When one of the <code title=dom-path-addText><a href=#dom-path-addtext>addText()</a></code> and <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code> variants that take as
+ argument a <code><a href=#path>Path</a></code> object is invoked, the method must run the following algorithm:</p>
- <ol><li><p>Let <var title="">target</var> be the <code><a href=#path>Path</a></code>
- object on which the method was invoked.</li>
+ <ol><li><p>Let <var title="">target</var> be the <code><a href=#path>Path</a></code> object on which the method was
+ invoked.</li>
- <li><p>Let <var title="">path</var> be the <code><a href=#path>Path</a></code> object
- that was provided in the method's arguments.</li>
+ <li><p>Let <var title="">path</var> be the <code><a href=#path>Path</a></code> object that was provided in the
+ method's arguments.</li>
- <li><p>Run the <a href=#text-preparation-algorithm>text preparation algorithm</a>, passing it
- <var title="">text</var>, the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code>
- object argument, and, if the <var title="">maxWidth</var> argument
- was provided, that argument. Let <var title="">glyphs</var> be the
- resulting array, and <var title="">physical alignment</var> be the
- resulting alignment value.</p>
+ <li><p>Run the <a href=#text-preparation-algorithm>text preparation algorithm</a>, passing it <var title="">text</var>, the
+ <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object argument, and, if the <var title="">maxWidth</var>
+ argument was provided, that argument. Let <var title="">glyphs</var> be the resulting array, and
+ <var title="">physical alignment</var> be the resulting alignment value.</p>
- <li><p>Let <var title="">width</var> be the aggregate length of all
- the subpaths in <var title="">path</var>, including the distances
- from the last point of each closed subpath to the first point of
- that subpath.</li>
+ <li><p>Let <var title="">width</var> be the aggregate length of all the subpaths in <var title="">path</var>, including the distances from the last point of each closed subpath to the
+ first point of that subpath.</li>
- <li><p>Define <var title="">L</var> to be a linear coordinate line
- for of all the subpaths in <var title="">path</var>, with
- additional lines drawn between the last point and the first point
- of each closed subpath, such that the first point of the first
- subpath is defined as point 0, and the last point of the last
- subpath, if the last subpath is not closed, or the second
- occurrence first point of that subpath, if it is closed, is defined
- as point <var title="">width</var>.</li>
+ <li><p>Define <var title="">L</var> to be a linear coordinate line for of all the subpaths in
+ <var title="">path</var>, with additional lines drawn between the last point and the first point
+ of each closed subpath, such that the first point of the first subpath is defined as point 0, and
+ the last point of the last subpath, if the last subpath is not closed, or the second occurrence
+ first point of that subpath, if it is closed, is defined as point <var title="">width</var>.</li>
<li>
- <p>Let <var title="">offset</var> be determined according to the
- appropriate step below:</p>
+ <p>Let <var title="">offset</var> be determined according to the appropriate step below:</p>
- <dl class=switch><dt>If <var title="">physical alignment</var> is <i>left</i></dt>
- <dd>Let <var title="">offset</var> be zero.</dd>
+ <dl class=switch><dt>If <var title="">physical alignment</var> is <i>left</i></dt> <dd>Let <var title="">offset</var> be zero.</dd>
- <dt>If <var title="">physical alignment</var> is <i>right</i></dt>
- <dd>Let <var title="">offset</var> be <var title="">width</var>.</dd>
+ <dt>If <var title="">physical alignment</var> is <i>right</i></dt> <dd>Let <var title="">offset</var> be <var title="">width</var>.</dd>
- <dt>If <var title="">physical alignment</var> is <i title="">center</i></dt>
- <dd>Let <var title="">offset</var> be half of <var title="">width</var>.</dd>
+ <dt>If <var title="">physical alignment</var> is <i title="">center</i></dt> <dd>Let <var title="">offset</var> be half of <var title="">width</var>.</dd>
</dl></li>
- <li><p>Move all the shapes in <var title="">glyphs</var> to the
- right by <var title="">offset</var> CSS pixels.</li>
+ <li><p>Move all the shapes in <var title="">glyphs</var> to the right by <var title="">offset</var> CSS pixels.</li>
<li>
- <p>For each glyph <var title="">glyph</var> in the <var title="">glyphs</var> array, run these substeps:</p>
+ <p>For each glyph <var title="">glyph</var> in the <var title="">glyphs</var> array, run these
+ substeps:</p>
- <ol><li><p>Let <var title="">dx</var> be the <var title="">x</var>-coordinate of the horizontal center of the
- bounding box of the shape described by <var title="">glyph</var>, in CSS pixels.</li>
+ <ol><li><p>Let <var title="">dx</var> be the <var title="">x</var>-coordinate of the horizontal
+ center of the bounding box of the shape described by <var title="">glyph</var>, in CSS
+ pixels.</li>
- <li><p>If <var title="">dx</var> is negative or greater than <var title="">width</var>, skip the remainder of these substeps for
- this glyph.</li>
+ <li><p>If <var title="">dx</var> is negative or greater than <var title="">width</var>, skip
+ the remainder of these substeps for this glyph.</li>
- <li><p>Recast <var title="">dx</var> to coordinate spaces units
- in <var title="">path</var>. (This just changes the
- dimensionality of <var title="">dx</var>, not its numeric
- value.)</p> <!-- hide this step if people get confused by the
- pedancy -->
+ <li><p>Recast <var title="">dx</var> to coordinate spaces units in <var title="">path</var>.
+ (This just changes the dimensionality of <var title="">dx</var>, not its numeric value.)</p>
+ <!-- hide this step if people get confused by the pedancy -->
- <li><p>Find the point <var title="">p</var> on <var title="">path</var> (or implied closing lines in <var title="">path</var>) that corresponds to the position <var title="">dx</var> on the coordinate line <var title="">L</var>.</p>
+ <li><p>Find the point <var title="">p</var> on <var title="">path</var> (or implied closing
+ lines in <var title="">path</var>) that corresponds to the position <var title="">dx</var> on
+ the coordinate line <var title="">L</var>.</p>
- <li><p>Let <var title="">θ</var> be the clockwise angle
- from the positive x-axis to the side of the line that is
- tangential to <var title="">path</var> at the point <var title="">p</var> that is going in the same direction as the line
- at point <var title="">p</var>.</li>
+ <li><p>Let <var title="">θ</var> be the clockwise angle from the positive x-axis to the
+ side of the line that is tangential to <var title="">path</var> at the point <var title="">p</var> that is going in the same direction as the line at point <var title="">p</var>.</li>
- <li><p>Rotate the shape described by <var title="">glyph</var>
- clockwise by <var title="">θ</var> about the point that is
- at the <var title="">dx</var> coordinate horizontally and the
- zero coordinate vertically.</li>
+ <li><p>Rotate the shape described by <var title="">glyph</var> clockwise by <var title="">θ</var> about the point that is at the <var title="">dx</var> coordinate
+ horizontally and the zero coordinate vertically.</li>
- <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
- coordinate of the point <var title="">p</var>.</li>
+ <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the coordinate of the point <var title="">p</var>.</li>
- <li><p>Move the shape described by <var title="">glyph</var> to
- the right by <var title="">x</var> and down by <var title="">y</var>.</li>
+ <li><p>Move the shape described by <var title="">glyph</var> to the right by <var title="">x</var> and down by <var title="">y</var>.</li>
- <li><p>Let <var title="">glyph subpaths</var> be a list of
- subpaths describing the shape given in <var title="">glyph</var>,
- with each CSS pixel in the coordinate space of <var title="">glyph</var> mapped to one coordinate space unit in <var title="">glyph subpaths</var>. Subpaths in <var title="">glyph
- subpaths</var> must wind clockwise, regardless of how the user
- agent's font subsystem renders fonts and regardless of how the
- fonts themselves are defined.</p>
+ <li><p>Let <var title="">glyph subpaths</var> be a list of subpaths describing the shape given
+ in <var title="">glyph</var>, with each CSS pixel in the coordinate space of <var title="">glyph</var> mapped to one coordinate space unit in <var title="">glyph subpaths</var>.
+ Subpaths in <var title="">glyph subpaths</var> must wind clockwise, regardless of how the user
+ agent's font subsystem renders fonts and regardless of how the fonts themselves are
+ defined.</p>
- <li><p>If the method is <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code>,
- replace <var title="">glyph subpaths</var> by the result of <a href=#trace-a-path title="trace a path">tracing</a> <var title="">glyph
- subpaths</var>, using the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object
- argument for the line styles.</p>
+ <li><p>If the method is <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code>, replace <var title="">glyph subpaths</var> by the result of <a href=#trace-a-path title="trace a path">tracing</a> <var title="">glyph subpaths</var>, using the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object argument for
+ the line styles.</p>
- <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the transformation matrix <var title="">transform</var>, if it is not null.</li>
+ <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the
+ transformation matrix <var title="">transform</var>, if it is not null.</li>
- <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) be the last point in
- the last subpath of <var title="">glyph subpaths</var>. (This
- coordinate is only used if this is the last glyph
- processed.)</li>
+ <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) be the last point in the last subpath of <var title="">glyph
+ subpaths</var>. (This coordinate is only used if this is the last glyph processed.)</li>
- <li><p>Add all the subpaths in <var title="">glyph subpaths</var>
- to <var title="">target</var>.</li>
+ <li><p>Add all the subpaths in <var title="">glyph subpaths</var> to <var title="">target</var>.</li>
</ol></li>
- <li><p>Create a new subpath in the <code><a href=#path>Path</a></code> object with
- (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) as the only point in the
- subpath.</li>
+ <li><p>Create a new subpath in the <code><a href=#path>Path</a></code> object with (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) as the only point in
+ the subpath.</li>
</ol></div>
<h6 id=transformations><span class=secno>4.8.11.2.8 </span><dfn title=dom-context-2d-transformation>Transformations</dfn></h6>
- <p>Each <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object has a
- <i>current transformation matrix</i>, as well as methods (described
- in this section) to manipulate it. When a
- <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object is created, its
- transformation matrix must be initialized to the identity
- transform.</p>
+ <p>Each <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object has a <i>current transformation matrix</i>,
+ as well as methods (described in this section) to manipulate it. When a
+ <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object is created, its transformation matrix must be
+ initialized to the identity transform.</p>
- <p>The transformation matrix is applied to coordinates when creating
- the <a href=#current-default-path>current default path</a>, and when painting text,
- shapes, and <code><a href=#path>Path</a></code> objects, on
- <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> objects.</p> <!-- conformance
- criteria for actual drawing are described in the various sections
- below -->
+ <p>The transformation matrix is applied to coordinates when creating the <a href=#current-default-path>current default
+ path</a>, and when painting text, shapes, and <code><a href=#path>Path</a></code> objects, on
+ <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> objects.</p> <!-- conformance criteria for actual drawing
+ are described in the various sections below -->
- <p class=note>Most of the API uses <code><a href=#svgmatrix>SVGMatrix</a></code> objects
- rather than this API. This API remains mostly for historical
- reasons.</p>
+ <p class=note>Most of the API uses <code><a href=#svgmatrix>SVGMatrix</a></code> objects rather than this API. This API
+ remains mostly for historical reasons.</p>
<div class=impl>
<p>The transformations must be performed in reverse order.</p>
- <p class=note>For instance, if a scale transformation that doubles
- the width is applied to the canvas, followed by a rotation
- transformation that rotates drawing operations by a quarter turn,
- and a rectangle twice as wide as it is tall is then drawn on the
- canvas, the actual result will be a square.</p> <!-- q.v.
- http://goo.gl/5RLrN -->
+ <p class=note>For instance, if a scale transformation that doubles the width is applied to the
+ canvas, followed by a rotation transformation that rotates drawing operations by a quarter turn,
+ and a rectangle twice as wide as it is tall is then drawn on the canvas, the actual result will be
+ a square.</p> <!-- q.v. http://goo.gl/5RLrN -->
</div>
@@ -35557,38 +35517,32 @@
</dl><div class=impl>
- <p>The <dfn id=dom-context-2d-currenttransform title=dom-context-2d-currentTransform><code>currentTransform</code></dfn>,
- on getting, must return the last object that it was set to. On
- setting, its value must be changed to the new value, and the
- transformation matrix must be updated to match the matrix described
- by the new value. When the <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code>
- object is created, the <code title=dom-context-2d-currentTransform><a href=#dom-context-2d-currenttransform>currentTransform</a></code>
- attribute must be set a newly created <code><a href=#svgmatrix>SVGMatrix</a></code> object.
- When the transformation matrix is mutated by the methods described
- in this section, the last <code><a href=#svgmatrix>SVGMatrix</a></code> object to which the
- attribute has been set must be mutated in a corresponding
- fashion.</p>
+ <p>The <dfn id=dom-context-2d-currenttransform title=dom-context-2d-currentTransform><code>currentTransform</code></dfn>, on
+ getting, must return the last object that it was set to. On setting, its value must be changed to
+ the new value, and the transformation matrix must be updated to match the matrix described by the
+ new value. When the <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object is created, the <code title=dom-context-2d-currentTransform><a href=#dom-context-2d-currenttransform>currentTransform</a></code> attribute must be set a newly
+ created <code><a href=#svgmatrix>SVGMatrix</a></code> object. When the transformation matrix is mutated by the methods
+ described in this section, the last <code><a href=#svgmatrix>SVGMatrix</a></code> object to which the attribute has been
+ set must be mutated in a corresponding fashion.</p>
- <p>The <dfn id=dom-context-2d-scale title=dom-context-2d-scale><code>scale(<var title="">x</var>, <var title="">y</var>)</code></dfn> method must
- add the scaling transformation described by the arguments to the
- transformation matrix. The <var title="">x</var> argument represents
- the scale factor in the horizontal direction and the <var title="">y</var> argument represents the scale factor in the
- vertical direction. The factors are multiples.</p>
+ <p>The <dfn id=dom-context-2d-scale title=dom-context-2d-scale><code>scale(<var title="">x</var>, <var title="">y</var>)</code></dfn> method must add the scaling transformation described by the
+ arguments to the transformation matrix. The <var title="">x</var> argument represents the scale
+ factor in the horizontal direction and the <var title="">y</var> argument represents the scale
+ factor in the vertical direction. The factors are multiples.</p>
- <p>The <dfn id=dom-context-2d-rotate title=dom-context-2d-rotate><code>rotate(<var title="">angle</var>)</code></dfn> method must add the rotation
- transformation described by the argument to the transformation
- matrix. The <var title="">angle</var> argument represents a
- clockwise rotation angle expressed in radians.</p>
+ <p>The <dfn id=dom-context-2d-rotate title=dom-context-2d-rotate><code>rotate(<var title="">angle</var>)</code></dfn>
+ method must add the rotation transformation described by the argument to the transformation
+ matrix. The <var title="">angle</var> argument represents a clockwise rotation angle expressed in
+ radians.</p>
- <p>The <dfn id=dom-context-2d-translate title=dom-context-2d-translate><code>translate(<var title="">x</var>, <var title="">y</var>)</code></dfn> method must
- add the translation transformation described by the arguments to the
- transformation matrix. The <var title="">x</var> argument represents
- the translation distance in the horizontal direction and the <var title="">y</var> argument represents the translation distance in the
- vertical direction. The arguments are in coordinate space units.</p>
+ <p>The <dfn id=dom-context-2d-translate title=dom-context-2d-translate><code>translate(<var title="">x</var>, <var title="">y</var>)</code></dfn> method must add the translation transformation described by the
+ arguments to the transformation matrix. The <var title="">x</var> argument represents the
+ translation distance in the horizontal direction and the <var title="">y</var> argument represents
+ the translation distance in the vertical direction. The arguments are in coordinate space
+ units.</p>
- <p>The <dfn id=dom-context-2d-transform title=dom-context-2d-transform><code>transform(<var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>, <var title="">f</var>)</code></dfn> method must replace the current
- transformation matrix with the result of multiplying the current
- transformation matrix with the matrix described by:</p>
+ <p>The <dfn id=dom-context-2d-transform title=dom-context-2d-transform><code>transform(<var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>, <var title="">f</var>)</code></dfn> method must replace the current transformation matrix with the
+ result of multiplying the current transformation matrix with the matrix described by:</p>
</div>
@@ -35601,21 +35555,21 @@
<tr><td>0</td>
<td>0</td>
<td>1</td>
- </table><p class=note>The arguments <var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>, and <var title="">f</var> are sometimes called
- <var title="">m11</var>, <var title="">m12</var>, <var title="">m21</var>, <var title="">m22</var>, <var title="">dx</var>,
- and <var title="">dy</var> or <var title="">m11</var>, <var title="">m21</var>, <var title="">m12</var>, <var title="">m22</var>, <var title="">dx</var>, and <var title="">dy</var>. Care should be taken in particular with the order
- of the second and third arguments (<var title="">b</var> and <var title="">c</var>) as their order varies from API to API and APIs
- sometimes use the notation <var title="">m12</var>/<var title="">m21</var> and sometimes <var title="">m21</var>/<var title="">m12</var> for those positions.</p>
+ </table><p class=note>The arguments <var title="">a</var>, <var title="">b</var>, <var title="">c</var>,
+ <var title="">d</var>, <var title="">e</var>, and <var title="">f</var> are sometimes called <var title="">m11</var>, <var title="">m12</var>, <var title="">m21</var>, <var title="">m22</var>,
+ <var title="">dx</var>, and <var title="">dy</var> or <var title="">m11</var>, <var title="">m21</var>, <var title="">m12</var>, <var title="">m22</var>, <var title="">dx</var>, and
+ <var title="">dy</var>. Care should be taken in particular with the order of the second and third
+ arguments (<var title="">b</var> and <var title="">c</var>) as their order varies from API to API
+ and APIs sometimes use the notation <var title="">m12</var>/<var title="">m21</var> and sometimes
+ <var title="">m21</var>/<var title="">m12</var> for those positions.</p>
<div class=impl>
- <p>The <dfn id=dom-context-2d-settransform title=dom-context-2d-setTransform><code>setTransform(<var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>,
- <var title="">f</var>)</code></dfn> method must reset the current
- transform to the identity matrix, and then invoke the <code><a href=#dom-context-2d-transform title=dom-context-2d-transform>transform</a>(<var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>,
- <var title="">f</var>)</code> method with the same arguments.</p>
+ <p>The <dfn id=dom-context-2d-settransform title=dom-context-2d-setTransform><code>setTransform(<var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>, <var title="">f</var>)</code></dfn> method must reset the current transform to the identity matrix, and
+ then invoke the <code><a href=#dom-context-2d-transform title=dom-context-2d-transform>transform</a>(<var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>, <var title="">f</var>)</code> method with the same arguments.</p>
- <p>The <dfn id=dom-context-2d-resettransform title=dom-context-2d-resetTransform><code>resetTransform()</code></dfn>
- method must reset the current transform to the identity matrix.</p>
+ <p>The <dfn id=dom-context-2d-resettransform title=dom-context-2d-resetTransform><code>resetTransform()</code></dfn> method must
+ reset the current transform to the identity matrix.</p>
</div>
@@ -35652,9 +35606,11 @@
steps.</li>
<li><p>If the <var title="">image</var> argument is an <code><a href=#htmlcanvaselement>HTMLCanvasElement</a></code> object with
- either a horizontal dimension or a vertical dimension equal to zero, then the implementation
- throw an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception and return <i>aborted</i>.</p>
+ either a horizontal dimension or a vertical dimension equal to zero, then throw an
+ <code><a href=#invalidstateerror>InvalidStateError</a></code> exception and return <i>aborted</i>.</p>
+ <li><p>Return <i>good</i>.</li>
+
</ol><p>When a <code><a href=#canvasimagesource>CanvasImageSource</a></code> object represents an <code><a href=#htmlimageelement>HTMLImageElement</a></code>, the
element's image must be used as the source image.</p>
@@ -37076,29 +37032,23 @@
bitmap that surrounds the <a href="#hit-region's-set-of-pixels">hit region's set of pixels</a> as they stood when it was
created.</li>
-<!--CLEANUP-->
- <li><p>Optionally, a non-empty string representing an <dfn id="hit-region's-id" title="hit region's ID">ID</dfn> for distinguishing the region
- from others.</li>
+ <li><p>Optionally, a non-empty string representing an <dfn id="hit-region's-id" title="hit region's ID">ID</dfn> for
+ distinguishing the region from others.</li>
- <li><p>Optionally, a reference to another region that acts as the
- <dfn id="hit-region's-parent" title="hit region's parent">parent</dfn> for this
- one.</li>
+ <li><p>Optionally, a reference to another region that acts as the <dfn id="hit-region's-parent" title="hit region's
+ parent">parent</dfn> for this one.</li>
- <li><p>A count of regions that have this one as their <a href="#hit-region's-parent" title="hit region's parent">parent</a>, known as the <dfn id="hit-region's-child-count">hit
- region's child count</dfn>.</li>
+ <li><p>A count of regions that have this one as their <a href="#hit-region's-parent" title="hit region's
+ parent">parent</a>, known as the <dfn id="hit-region's-child-count">hit region's child count</dfn>.</li>
- <li><p>A <dfn id="hit-region's-cursor-specification" title="hit region's cursor specification">cursor
- specification</dfn>, in the form of either a CSS cursor value, or
- the string "<code title="">inherit</code>" meaning that the cursor
- of the <a href="#hit-region's-parent">hit region's parent</a>, if any, or of the
- <code><a href=#the-canvas-element>canvas</a></code> element, if not, is to be used
- instead.</li>
+ <li><p>A <dfn id="hit-region's-cursor-specification" title="hit region's cursor specification">cursor specification</dfn>, in the form
+ of either a CSS cursor value, or the string "<code title="">inherit</code>" meaning that the
+ cursor of the <a href="#hit-region's-parent">hit region's parent</a>, if any, or of the <code><a href=#the-canvas-element>canvas</a></code> element, if
+ not, is to be used instead.</li>
<li>
- <p>Optionally, either a <a href="#hit-region's-control" title="hit region's
- control">control</a>, or an <a href="#hit-region's-unbacked-region-description" title="hit region's unbacked
- region description">unbacked region description</a>.</p>
+ <p>Optionally, either a <a href="#hit-region's-control" title="hit region's control">control</a>, or an <a href="#hit-region's-unbacked-region-description" title="hit region's unbacked region description">unbacked region description</a>.</p>
<p>A <dfn id="hit-region's-control" title="hit region's control">control</dfn> is just a reference to an
<code><a href=#element>Element</a></code> node, to which, in certain conditions, the user agent will route events,
@@ -37106,16 +37056,13 @@
accessibility tools. (The control is ignored when it is not a descendant of the
<code><a href=#the-canvas-element>canvas</a></code> element.)</p>
- <p>An <dfn id="hit-region's-unbacked-region-description" title="hit region's unbacked region
- description">unbacked region description</dfn> consists of the
- following:</p>
+ <p>An <dfn id="hit-region's-unbacked-region-description" title="hit region's unbacked region description">unbacked region description</dfn>
+ consists of the following:</p>
- <ul class=brief><li><p>Optionally, a <dfn id="hit-region's-label" title="hit region's
- label">label</dfn>.</p>
+ <ul class=brief><li><p>Optionally, a <dfn id="hit-region's-label" title="hit region's label">label</dfn>.</p>
- <li><p>An <dfn id="hit-region's-aria-role" title="hit region's ARIA role">ARIA role</dfn>,
- which, if the <a href="#hit-region's-unbacked-region-description" title="hit region's unbacked region
- description">unbacked region description</a> also has a label,
+ <li><p>An <dfn id="hit-region's-aria-role" title="hit region's ARIA role">ARIA role</dfn>, which, if the <a href="#hit-region's-unbacked-region-description" title="hit
+ region's unbacked region description">unbacked region description</a> also has a label,
could be the empty string.</li>
</ul></li>
@@ -37128,10 +37075,10 @@
<dl><dt><code title=dom-HitRegionOptions-path>path</code> (default null)
- <dd>A <code><a href=#path>Path</a></code> object that describes the pixels that
- form part of the region. If this member is not provided or is set
- to null, the <a href=#current-default-path>current default path</a> is used
+ <dd>A <code><a href=#path>Path</a></code> object that describes the pixels that form part of the region. If this
+ member is not provided or is set to null, the <a href=#current-default-path>current default path</a> is used
instead.</dd>
+
<!--
<dt><code title="dom-HitRegionOptions-transform">transform</code> (default null)
@@ -37139,58 +37086,54 @@
transformation to apply to the path described by the <code
title="dom-HitRegionOptions-path">path</code> member.</dd>
-->
+
<dt><code title=dom-HitRegionOptions-id>id</code> (default empty string)
- <dd>The ID to use for this region. This is used in
- <code><a href=#mouseevent>MouseEvent</a></code> events on the <code><a href=#the-canvas-element>canvas</a></code> (<code title=dom-MouseEvent-region><a href=#dom-mouseevent-region>event.region</a></code>) and as a way
- to reference this region in later calls to <code title=dom-context-2d-addHitRegion><a href=#dom-context-2d-addhitregion>addHitRegion()</a></code>.</dd>
+ <dd>The ID to use for this region. This is used in <code><a href=#mouseevent>MouseEvent</a></code> events on the
+ <code><a href=#the-canvas-element>canvas</a></code> (<code title=dom-MouseEvent-region><a href=#dom-mouseevent-region>event.region</a></code>) and as a way to
+ reference this region in later calls to <code title=dom-context-2d-addHitRegion><a href=#dom-context-2d-addhitregion>addHitRegion()</a></code>.</dd>
<dt><code title=dom-HitRegionOptions-parentID>parentID</code> (default null)
- <dd>The ID of the parent region, for purposes of navigation by
- accessibility tools and for cursor fallback.</dd>
+ <dd>The ID of the parent region, for purposes of navigation by accessibility tools and for
+ cursor fallback.</dd>
<dt><code title=dom-HitRegionOptions-cursor>cursor</code> (default "<code title="">inherit</code>")
- <dd>The cursor to use when the mouse is over this region. The
- value "<code title="">inherit</code>" means to use the cursor for
- the parent region (as specified by the <code title=dom-HitRegionOptions-parentID>parentID</code> member), if
- any, or to use the <code><a href=#the-canvas-element>canvas</a></code> element's cursor if the
- region has no parent.</dd>
+ <dd>The cursor to use when the mouse is over this region. The value "<code title="">inherit</code>" means to use the cursor for the parent region (as specified by the
+ <code title=dom-HitRegionOptions-parentID>parentID</code> member), if any, or to use the
+ <code><a href=#the-canvas-element>canvas</a></code> element's cursor if the region has no parent.</dd>
<dt><code title=dom-HitRegionOptions-control>control</code> (default null)
- <dd>An element (that is a descendant of the <code><a href=#the-canvas-element>canvas</a></code>)
- to which events are to be routed, and which accessibility tools
- are to use as a surrogate for describing and interacting with
- this region.</dd>
+ <dd>An element (that is a descendant of the <code><a href=#the-canvas-element>canvas</a></code>) to which events are to be
+ routed, and which accessibility tools are to use as a surrogate for describing and interacting
+ with this region.</dd>
<dt><code title=dom-HitRegionOptions-label>label</code> (default null)
- <dd>A text label for accessibility tools to use as a description
- of this region, if there is no control.</dd>
+ <dd>A text label for accessibility tools to use as a description of this region, if there is no
+ control.</dd>
<dt><code title=dom-HitRegionOptions-role>role</code> (default null)
- <dd>An ARIA role for accessibility tools to use to determine how
- to represent this region, if there is no control.</dd>
+ <dd>An ARIA role for accessibility tools to use to determine how to represent this region, if
+ there is no control.</dd>
</dl><p>Hit regions can be used for a variety of purposes:</p>
- <ul><li>With an ID, they can make hit detection easier by having the
- user agent check which region the mouse is over and include the
- ID in the mouse events.</li>
+ <ul><li>With an ID, they can make hit detection easier by having the user agent check which region
+ the mouse is over and include the ID in the mouse events.</li>
- <li>With a control, they can make routing events to DOM elements
- automatic, allowing e.g. clicks on a <code><a href=#the-canvas-element>canvas</a></code> to automatically
- submit a form via a <code><a href=#the-button-element>button</a></code> element.</li>
+ <li>With a control, they can make routing events to DOM elements automatic, allowing e.g.
+ clicks on a <code><a href=#the-canvas-element>canvas</a></code> to automatically submit a form via a <code><a href=#the-button-element>button</a></code>
+ element.</li>
- <li>With a label, they can make it easier for users to explore a
- <code><a href=#the-canvas-element>canvas</a></code> without seeing it, e.g. by touch on a mobile device.</li>
+ <li>With a label, they can make it easier for users to explore a <code><a href=#the-canvas-element>canvas</a></code> without
+ seeing it, e.g. by touch on a mobile device.</li>
- <li>With a cursor, they can make it easier for different regions
- of the <code><a href=#the-canvas-element>canvas</a></code> to have different cursors, with the user agent
- automatically switching between them.</li>
+ <li>With a cursor, they can make it easier for different regions of the <code><a href=#the-canvas-element>canvas</a></code> to
+ have different cursors, with the user agent automatically switching between them.</li>
</ul></dd>
@@ -37198,81 +37141,72 @@
<dd>
- <p>Removes a hit region (and all its descendants) 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>Removes a hit region (and all its descendants) 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>
+ <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
- <dfn id=ancestor-region>ancestor region</dfn> of a <a href=#hit-region>hit region</a> <var title="">B</var> if <var title="">B</var> has a <a href="#hit-region's-parent" title="hit
- region's parent">parent</a> and its <a href="#hit-region's-parent" title="hit region's
- parent">parent</a> is either <var title="">A</var> or another
- <a href=#hit-region>hit region</a> for which <var title="">A</var> is an
+ <p>A <a href=#hit-region>hit region</a> <var title="">A</var> is an <dfn id=ancestor-region>ancestor region</dfn> of a <a href=#hit-region>hit
+ region</a> <var title="">B</var> if <var title="">B</var> has a <a href="#hit-region's-parent" title="hit region's
+ parent">parent</a> and its <a href="#hit-region's-parent" title="hit region's parent">parent</a> is either <var title="">A</var> or another <a href=#hit-region>hit region</a> for which <var title="">A</var> is an
<a href=#ancestor-region>ancestor region</a>.</p>
<p><dfn id=the-region-identified-by-the-id>The region identified by the ID</dfn> <var title="">ID</var> in a bitmap <var title="">bitmap</var> is the value returned by the following algorithm (which can return a
<a href=#hit-region>hit region</a> or nothing):</p>
- <ol><li><p>If <var title="">ID</var> is null, return nothing and abort
- these steps.</li>
+ <ol><li><p>If <var title="">ID</var> is null, return nothing and abort these steps.</li>
- <li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region
- list</a> associated with <var title="">bitmap</var>.</li>
+ <li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region list</a> associated with <var title="">bitmap</var>.</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-id" title="hit region's ID">ID</a>
- is a <a href=#case-sensitive>case-sensitive</a> match for <var title="">ID</var>,
- then return that <a href=#hit-region>hit region</a> and abort these
- steps.</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-id" title="hit
+ region's ID">ID</a> is a <a href=#case-sensitive>case-sensitive</a> match for <var title="">ID</var>, then
+ return that <a href=#hit-region>hit region</a> and abort these steps.</li>
<li><p>Otherwise, return nothing.</li>
</ol><p><dfn id=the-region-representing-the-control>The region representing the control</dfn> <var title="">control</var> for a bitmap <var title="">bitmap</var> is the value returned by the following algorithm (which can return a
<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> associated with <var title="">bitmap</var>.</li>
+ <ol><li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region list</a> associated with <var title="">bitmap</var>.</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
- control">control</a> is <var title="">control</var>, then
- return that <a href=#hit-region>hit region</a> and abort these
- steps.</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 control">control</a> is <var title="">control</var>, then return that <a href=#hit-region>hit
+ region</a> and abort these steps.</li>
<li><p>Otherwise, return nothing.</li>
- </ol><p><dfn id=the-control-represented-by-a-region>The control represented by a region</dfn> <var title="">region</var> for a <code><a href=#the-canvas-element>canvas</a></code> element <var title="">ancestor</var> is the value returned by the following
+ </ol><p><dfn id=the-control-represented-by-a-region>The control represented by a region</dfn> <var title="">region</var> for a
+ <code><a href=#the-canvas-element>canvas</a></code> element <var title="">ancestor</var> is the value returned by the following
algorithm (which can return an element or nothing):</p>
- <ol><li><p>If <var title="">region</var> has no <a href="#hit-region's-control" title="hit
- region's control">control</a>, return nothing and abort these
- steps.</li>
+ <ol><li><p>If <var title="">region</var> has no <a href="#hit-region's-control" title="hit region's control">control</a>,
+ return nothing and abort these steps.</li>
<li><p>Let <var title="">control</var> be <var title="">region</var>'s <a href="#hit-region's-control" title="hit region's
control">control</a>.</li>
- <li><p>If <var title="">control</var> is not a descendant of <var title="">ancestor</var>, then return nothing and abort these
- steps.</li>
+ <li><p>If <var title="">control</var> is not a descendant of <var title="">ancestor</var>, then
+ return nothing and abort these steps.</li>
<li><p>Otherwise, return <var title="">control</var>.</li>
- </ol><p><dfn id=the-cursor-for-a-hit-region>The cursor for a hit region</dfn> <var title="">region</var> of a <code><a href=#the-canvas-element>canvas</a></code> element <var title="">ancestor</var> is the value returned by the following
- algorithm:</p>
+ </ol><p><dfn id=the-cursor-for-a-hit-region>The cursor for a hit region</dfn> <var title="">region</var> of a <code><a href=#the-canvas-element>canvas</a></code>
+ element <var title="">ancestor</var> is the value returned by the following algorithm:</p>
- <ol><li><p><i>Loop</i>: If <var title="">region</var> has a <a href="#hit-region's-cursor-specification" title="hit region's cursor specification">cursor
- specification</a> other than "<code title="">inherit</code>",
- then return that <a href="#hit-region's-cursor-specification">hit region's cursor specification</a>
- and abort these steps.</li>
+ <ol><li><p><i>Loop</i>: If <var title="">region</var> has a <a href="#hit-region's-cursor-specification" title="hit region's cursor
+ specification">cursor specification</a> other than "<code title="">inherit</code>", then
+ return that <a href="#hit-region's-cursor-specification">hit region's cursor specification</a> and abort these steps.</li>
- <li><p>If <var title="">region</var> has a <a href="#hit-region's-parent" title="hit
- region's parent">parent</a>, then let <var title="">region</var> be that <a href="#hit-region's-parent">hit region's parent</a>,
- and return to the step labeled <i>loop</i>.</li>
+ <li><p>If <var title="">region</var> has a <a href="#hit-region's-parent" title="hit region's parent">parent</a>, then
+ let <var title="">region</var> be that <a href="#hit-region's-parent">hit region's parent</a>, and return to the step
+ labeled <i>loop</i>.</li>
<li><p>Otherwise, return the used value of the 'cursor' property for the <code><a href=#the-canvas-element>canvas</a></code>
element, if any; if there isn't one, return 'auto'. <a href=#refsCSSUI>[CSSUI]</a></li>
@@ -37282,10 +37216,9 @@
<ol><li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region list</a> associated with <var title="">bitmap</var>.</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
- pixels">set of pixels</a> contains <var title="">pixel</var>,
- then return that <a href=#hit-region>hit region</a> and abort these
- steps.</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 pixels">set of pixels</a> contains <var title="">pixel</var>, then return that
+ <a href=#hit-region>hit region</a> and abort these steps.</li>
<li><p>Otherwise, return nothing.</li>
@@ -37293,9 +37226,8 @@
<ol><li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region list</a> associated with <var title="">bitmap</var>.</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>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="">bitmap</var>.</li>
@@ -37304,16 +37236,12 @@
<ol><li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region list</a> associated with <var title="">bitmap</var>.</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
- pixels</a> and a zero <a href="#hit-region's-child-count" title="hit region's child
- count">child count</a>, if any. If there is no such <a href=#hit-region>hit
- region</a>, abort these steps.</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
+ pixels</a> and a zero <a href="#hit-region's-child-count" title="hit region's child count">child count</a>, if any. If
+ there is no such <a href=#hit-region>hit region</a>, abort these steps.</li>
- <li><p>If <var title="">victim</var> has a <a href="#hit-region's-parent" title="hit
- region's parent">parent</a>, then decrement that <a href="#hit-region's-child-count">hit
- region's child count</a> by one.</li>
+ <li><p>If <var title="">victim</var> has a <a href="#hit-region's-parent" title="hit region's parent">parent</a>, then
+ decrement that <a href="#hit-region's-child-count">hit region's child count</a> by one.</li>
<li><p>Remove <var title="">victim</var> from <var title="">list</var>.</li>
@@ -37324,16 +37252,17 @@
reset, e.g. when a <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object is bound to or unbound from a
<code><a href=#the-canvas-element>canvas</a></code>, or when the dimensions of the bitmap are changed.</p>
- <hr><p>When the <dfn id=dom-context-2d-addhitregion title=dom-context-2d-addHitRegion><code>addHitRegion()</code></dfn>
- method is invoked, the user agent must run the following steps:</p>
+ <hr><p>When the <dfn id=dom-context-2d-addhitregion title=dom-context-2d-addHitRegion><code>addHitRegion()</code></dfn> method is
+ invoked, the user agent must run the following steps:</p>
- <ol><li><p>Let <var title="">arguments</var> be the dictionary object
- provided as the method's argument.</li>
+ <ol><li><p>Let <var title="">arguments</var> be the dictionary object provided as the method's
+ argument.</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-path>path</code> member is not null,
- let <var title="">source path</var> be the <code title=dom-HitRegionOptions-path>path</code> member's value.
- Otherwise, let it be the <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code>
- object's <a href=#current-default-path>current default path</a>.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-path>path</code> member is not null, let <var title="">source
+ path</var> be the <code title=dom-HitRegionOptions-path>path</code> member's value. Otherwise,
+ let it be the <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object's <a href=#current-default-path>current default
+ path</a>.</li>
+
<!--
<li><p>If the <var title="">arguments</var> object's <code
title="dom-HitRegionOptions-path">path</code> member is null, but
@@ -37347,83 +37276,66 @@
title="dom-HitRegionOptions-transform">transform</code> member, if
it is not null.</p></li>
-->
- <li><p>Transform all the coordinates and lines in <var title="">source path</var> by the current transform matrix, if the
- <var title="">arguments</var> object's <code title=dom-HitRegionOptions-path>path</code> member is not
- null.</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-id>id</code> member is the
- empty string, let it be null instead.</li>
+ <li><p>Transform all the coordinates and lines in <var title="">source path</var> by the current
+ transform matrix, if the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-path>path</code> member is not null.</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-id>id</code> member is not null, then
- let <var title="">previous region for this ID</var> be <a href=#the-region-identified-by-the-id>the
- region identified by the ID</a> given by the <code title=dom-HitRegionOptions-id>id</code> member's value in this
- <a href=#scratch-bitmap>scratch bitmap</a>, if any. If the <code title=dom-HitRegionOptions-id>id</code> member is null or no such
- region currently exists, let <var title="">previous region for this
- ID</var> be null.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-id>id</code> member is the empty string, let it be null
+ instead.</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-parent>parent</code> member is the
- empty string, let it be null instead.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-id>id</code> member is not null, then let <var title="">previous
+ region for this ID</var> be <a href=#the-region-identified-by-the-id>the region identified by the ID</a> given by the <code title=dom-HitRegionOptions-id>id</code> member's value in this <a href=#scratch-bitmap>scratch bitmap</a>, if
+ any. If the <code title=dom-HitRegionOptions-id>id</code> member is null or no such region
+ currently exists, let <var title="">previous region for this ID</var> be null.</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-parent>parent</code> member is not
- null, then let <var title="">parent region</var> be <a href=#the-region-identified-by-the-id>the
- region identified by the ID</a> given by the <code title=dom-HitRegionOptions-parent>parent</code> member's value in
- the <a href=#scratch-bitmap>scratch bitmap</a>, if any. If the <code title=dom-HitRegionOptions-parent>parent</code> member is null or
- no such region currently exists, let <var title="">parent
- region</var> be null.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-parent>parent</code> member is the empty string, let it be null
+ instead.</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-label>label</code> member is the
- empty string, let it be null instead.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-parent>parent</code> member is not null, then let <var title="">parent region</var> be <a href=#the-region-identified-by-the-id>the region identified by the ID</a> given by the <code title=dom-HitRegionOptions-parent>parent</code> member's value in the <a href=#scratch-bitmap>scratch
+ bitmap</a>, if any. If the <code title=dom-HitRegionOptions-parent>parent</code> member is
+ null or no such region currently exists, let <var title="">parent region</var> be null.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-label>label</code> member is the empty string, let it be null
+ instead.</li>
+
<li>
- <p>If any of the following conditions are met, throw a
- <code><a href=#notsupportederror>NotSupportedError</a></code> exception and abort these
- steps.</p>
+ <p>If any of the following conditions are met, throw a <code><a href=#notsupportederror>NotSupportedError</a></code> exception
+ and abort these steps.</p>
<ul class=brief><!--
<li>The <var title="">arguments</var> object's <code
title="dom-HitRegionOptions-path">path</code> member is null, but
its <code title="dom-HitRegionOptions-transform">transform</code>
member is not.</li>
---><li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> and <code title=dom-HitRegionOptions-label>label</code> members are both
- non-null.</li>
+--><li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> and <code title=dom-HitRegionOptions-label>label</code> members are both non-null.</li>
- <li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> and <code title=dom-HitRegionOptions-role>role</code> members are both
- non-null.</li>
+ <li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> and <code title=dom-HitRegionOptions-role>role</code> members are both non-null.</li>
- <li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-role>role</code> member's value is
- the empty string, and the <code title=dom-HitRegionOptions-label>label</code> member's value is
- either null or the empty string.</li>
+ <li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-role>role</code> member's value is the empty string, and the <code title=dom-HitRegionOptions-label>label</code> member's value is either null or the empty
+ string.</li>
- <li>The <a href=#path>path</a> <var title="">source path</var>
- describes a shape with no pixels.</li>
+ <li>The <a href=#path>path</a> <var title="">source path</var> describes a shape with no
+ pixels.</li>
- <li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> member is not
- null but is neither an <code><a href=#the-a-element>a</a></code> element that
- <a href=#represents>represents</a> a <a href=#hyperlink>hyperlink</a>, a
- <code><a href=#the-button-element>button</a></code> element, an <code><a href=#the-input-element>input</a></code> element whose
- <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in one of
- the <a href="#checkbox-state-(type=checkbox)" title=attr-input-type-checkbox>Checkbox</a> or
- <a href="#radio-button-state-(type=radio)" title=attr-input-type-radio>Radio Button</a> states,
- nor an <code><a href=#the-input-element>input</a></code> element that is a <a href=#concept-button title=concept-button>button</a>.</li>
+ <li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> member is not null but is neither an
+ <code><a href=#the-a-element>a</a></code> element that <a href=#represents>represents</a> a <a href=#hyperlink>hyperlink</a>, a
+ <code><a href=#the-button-element>button</a></code> element, an <code><a href=#the-input-element>input</a></code> element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in one of the <a href="#checkbox-state-(type=checkbox)" title=attr-input-type-checkbox>Checkbox</a> or <a href="#radio-button-state-(type=radio)" title=attr-input-type-radio>Radio
+ Button</a> states, nor an <code><a href=#the-input-element>input</a></code> element that is a <a href=#concept-button title=concept-button>button</a>.</li>
- <li>The <var title="">parent region</var> is not null but has a
- <a href="#hit-region's-control" title="hit region's control">control</a>.</li>
+ <li>The <var title="">parent region</var> is not null but has a <a href="#hit-region's-control" title="hit region's
+ control">control</a>.</li>
- <li>The <var title="">previous region for this ID</var> is the
- same <a href=#hit-region>hit region</a> as the <var title="">parent
- region</var>.</li>
+ <li>The <var title="">previous region for this ID</var> is the same <a href=#hit-region>hit region</a> as
+ the <var title="">parent region</var>.</li>
- <li>The <var title="">previous region for this ID</var> is an
- <a href=#ancestor-region>ancestor region</a> of the <var title="">parent
- region</var>.</li>
+ <li>The <var title="">previous region for this ID</var> is an <a href=#ancestor-region>ancestor region</a> of
+ the <var title="">parent region</var>.</li>
</ul></li>
- <li><p>If the <code title=dom-HitRegionOptions-parent>parent</code> member is not
- null but <var title="">parent region</var> is null, then throw a
- <code><a href=#notfounderror>NotFoundError</a></code> exception and abort these
- steps.</li>
+ <li><p>If the <code title=dom-HitRegionOptions-parent>parent</code> member is not null but <var title="">parent region</var> is null, then throw a <code><a href=#notfounderror>NotFoundError</a></code> exception and abort
+ these steps.</li>
<li>
@@ -37442,8 +37354,8 @@
<li>
- <p>Let <var title="">region</var> be a newly created <a href=#hit-region>hit
- region</a>, with its information configured as follows:</p>
+ <p>Let <var title="">region</var> be a newly created <a href=#hit-region>hit region</a>, with its
+ information configured as follows:</p>
<dl><dt><a href="#hit-region's-set-of-pixels">Hit region's set of pixels</a>
@@ -37452,23 +37364,21 @@
<dt><a href="#hit-region's-bounding-circumference">Hit region's bounding circumference</a>
- <dd><p>A user-agent-defined shape that wraps the pixels contained
- in <var title="">source path</var>. (In the simplest case, this
- can just be the bounding rectangle; this specification allows it
- to be any shape in order to allow other interfaces.)
+ <dd><p>A user-agent-defined shape that wraps the pixels contained in <var title="">source
+ path</var>. (In the simplest case, this can just be the bounding rectangle; this specification
+ allows it to be any shape in order to allow other interfaces.)
<dt><a href="#hit-region's-id">Hit region's ID</a>
- <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-id>id</code> member is not null: the
- value of the <code title=dom-HitRegionOptions-id>id</code>
- member. Otherwise, <var title="">region</var> has no <a href="#hit-region's-id" title="hit region's id">id</a>.
+ <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-id>id</code> member is not null: the value of the <code title=dom-HitRegionOptions-id>id</code> member. Otherwise, <var title="">region</var> has no
+ <a href="#hit-region's-id" title="hit region's id">id</a>.
<dt><a href="#hit-region's-parent">Hit region's parent</a>
- <dd><p>If <var title="">parent region</var> is not null: <var title="">parent region</var>. Otherwise, <var title="">region</var> has no <a href="#hit-region's-parent" title="hit region's
- parent">parent</a>.
+ <dd><p>If <var title="">parent region</var> is not null: <var title="">parent region</var>.
+ Otherwise, <var title="">region</var> has no <a href="#hit-region's-parent" title="hit region's parent">parent</a>.
<dt><a href="#hit-region's-child-count">Hit region's child count</a>
@@ -37478,67 +37388,53 @@
<dt><a href="#hit-region's-cursor-specification">Hit region's cursor specification</a>
- <dd><p>If <var title="">parent region</var> is not null: <var title="">parent region</var>. Otherwise, <var title="">region</var> has no <a href="#hit-region's-parent" title="hit region's
- parent">parent</a>.
+ <dd><p>If <var title="">parent region</var> is not null: <var title="">parent region</var>.
+ Otherwise, <var title="">region</var> has no <a href="#hit-region's-parent" title="hit region's parent">parent</a>.
<dt><a href="#hit-region's-control">Hit region's control</a>
- <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> member is not
- null: the value of the <code title=dom-HitRegionOptions-control>control</code> member.
- Otherwise, <var title="">region</var> has no <a href="#hit-region's-control" title="hit
- region's control">control</a>.
+ <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> member is not null: the value of the <code title=dom-HitRegionOptions-control>control</code> member. Otherwise, <var title="">region</var> has no <a href="#hit-region's-control" title="hit region's control">control</a>.
<dt><a href="#hit-region's-label">Hit region's label</a>
- <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-label>label</code> member is not
- null: the value of the <code title=dom-HitRegionOptions-label>label</code> member.
- Otherwise, <var title="">region</var> has no <a href="#hit-region's-label" title="hit
- region's label">label</a>.
+ <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-label>label</code> member is not null: the value of the <code title=dom-HitRegionOptions-label>label</code> member. Otherwise, <var title="">region</var>
+ has no <a href="#hit-region's-label" title="hit region's label">label</a>.
<dt><a href="#hit-region's-aria-role">Hit region's ARIA role</a>
- <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-role>role</code> member is not null:
- the value of the <code title=dom-HitRegionOptions-role>role</code> member (which might
- be the empty string). Otherwise, if the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-label>label</code> member is not
- null: the empty string. Otherwise, <var title="">region</var> has
- no <a href="#hit-region's-aria-role" title="hit region's ARIA role">ARIA role</a>.
+ <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-role>role</code> member is not null: the value of the <code title=dom-HitRegionOptions-role>role</code> member (which might be the empty string).
+ Otherwise, if the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-label>label</code> member is not null: the empty string.
+ Otherwise, <var title="">region</var> has no <a href="#hit-region's-aria-role" title="hit region's ARIA role">ARIA
+ role</a>.
</dl></li>
<li>
- <p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-cursor>cursor</code> member is not
- null, then act as if a CSS rule for the <code><a href=#the-canvas-element>canvas</a></code>
- element setting its 'cursor' property had been seen, whose value
- was the <a href="#hit-region's-cursor-specification">hit region's cursor specification</a>.</p>
+ <p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-cursor>cursor</code> member is not null, then act as if a CSS rule
+ for the <code><a href=#the-canvas-element>canvas</a></code> element setting its 'cursor' property had been seen, whose value was
+ the <a href="#hit-region's-cursor-specification">hit region's cursor specification</a>.</p>
- <p class=note>For example, if the user agent prefetches cursor
- values, this would cause that to happen in response to an
- appropriately-formed <code title=dom-context-2d-addHitRegion><a href=#dom-context-2d-addhitregion>addHitRegion()</a></code>
- call.</p>
+ <p class=note>For example, if the user agent prefetches cursor values, this would cause that
+ to happen in response to an appropriately-formed <code title=dom-context-2d-addHitRegion><a href=#dom-context-2d-addhitregion>addHitRegion()</a></code> call.</p>
</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> member is not
- null, then let <var title="">previous region for the control</var>
- be <a href=#the-region-representing-the-control>the region representing the control</a> given by the
- <code title=dom-HitRegionOptions-control>control</code> member's
- value for this <a href=#scratch-bitmap>scratch bitmap</a>, if any. If the <code title=dom-HitRegionOptions-control>control</code> member is null
- or no such region currently exists, let <var title="">previous
- region for the control</var> be null.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> member is not null, then let <var title="">previous region for the control</var> be <a href=#the-region-representing-the-control>the region representing the
+ control</a> given by the <code title=dom-HitRegionOptions-control>control</code> member's
+ value for this <a href=#scratch-bitmap>scratch bitmap</a>, if any. If the <code title=dom-HitRegionOptions-control>control</code> member is null or no such region currently
+ exists, let <var title="">previous region for the control</var> be null.</li>
- <!-- the parent region can't have a control, because no region with
- a control can be a parent - we check for that above. Thus, it is
- safe to remove the previous region for the control without worrying
- that our parent is going to be affected.
+ <!-- the parent region can't have a control, because no region with a control can be a parent -
+ we check for that above. Thus, it is safe to remove the previous region for the control without
+ worrying that our parent is going to be affected.
- It's also safe to remove the previous region with this ID and all
- its descendants, as we know that our parent isn't part of that
- subtree. -->
+ It's also safe to remove the previous region with this ID and all its descendants, as we know
+ that our parent isn't part of that subtree. -->
<li><p>If there is a <var title="">previous region with this control</var>, remove it from the
<a href=#scratch-bitmap>scratch bitmap</a>'s <a href=#hit-region-list>hit region list</a>; then, if it had a <a href="#hit-region's-parent" title="hit
@@ -37550,8 +37446,8 @@
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>If there is a <var title="">parent region</var>, increment
- its <a href="#hit-region's-child-count">hit region's child count</a> by one.</li>
+ <li><p>If there is a <var title="">parent region</var>, increment its <a href="#hit-region's-child-count">hit region's child
+ count</a> by one.</li>
<li><p><a href=#clear-regions-that-cover-the-pixels>Clear regions that cover the pixels</a> in <var title="">region</var>'s <a href="#hit-region's-set-of-pixels" title="hit region's set of pixels">set of pixels</a> on this <a href=#scratch-bitmap>scratch
bitmap</a>.</li> <!-- this is what garbage collects the earlier regions -->
Modified: index
===================================================================
--- index 2013-04-12 21:31:10 UTC (rev 7820)
+++ index 2013-04-12 21:58:09 UTC (rev 7821)
@@ -1836,7 +1836,10 @@
<p class=impl>This is an implementation requirement.</p>
+ <p>In an algorithm, steps in <a href=#synchronous-section title="synchronous section">synchronous sections</a> are
+ marked with ⌛.</p>
+
<h3 id=fingerprint><span class=secno>1.10 </span>Privacy concerns</h3>
<p><i>This section is non-normative.</i></p>
@@ -35260,240 +35263,197 @@
<li><p>Return the <code><a href=#path>Path</a></code> object as the constructed
object.</li>
- </ol><hr><p>The <dfn id=dom-path-addpath title=dom-path-addPath><code>addPath(<var title="">b</var>, <var title="">transform</var>)</code></dfn>
- method, when invoked on a <code><a href=#path>Path</a></code> object <var title="">a</var>, must run the following steps:</p>
+ </ol><hr><p>The <dfn id=dom-path-addpath title=dom-path-addPath><code>addPath(<var title="">b</var>, <var title="">transform</var>)</code></dfn> method, when invoked on a <code><a href=#path>Path</a></code> object <var title="">a</var>, must run the following steps:</p>
- <ol><li><p>If the <code><a href=#path>Path</a></code> object <var title="">b</var> has
- no subpaths, abort these steps.</li>
+ <ol><li><p>If the <code><a href=#path>Path</a></code> object <var title="">b</var> has no subpaths, abort these
+ steps.</li>
- <li><p>Create a copy of all the subpaths in <var title="">b</var>.
- Let this copy be known as <var title="">c</var>.</li>
+ <li><p>Create a copy of all the subpaths in <var title="">b</var>. Let this copy be known as <var title="">c</var>.</li>
- <li><p>Transform all the coordinates and lines in <var title="">c</var> by the transform matrix <var title="">transform</var>, if it is not null.</li>
+ <li><p>Transform all the coordinates and lines in <var title="">c</var> by the transform matrix
+ <var title="">transform</var>, if it is not null.</li>
- <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
- last point in the last subpath of <var title="">c</var>.</li>
+ <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the last point in the last subpath
+ of <var title="">c</var>.</li>
<li><p>Add all the subpaths in <var title="">c</var> to <var title="">a</var>.</li>
- <li><p>Create a new subpath in <var title="">a</var> with (<var title="">x</var>, <var title="">y</var>) as the only point in the
- subpath.</li>
+ <li><p>Create a new subpath in <var title="">a</var> with (<var title="">x</var>, <var title="">y</var>) as the only point in the subpath.</li>
- </ol><hr><p>The <dfn id=dom-path-addpathbystrokingpath title=dom-path-addPathByStrokingPath><code>addPathByStrokingPath(<var title="">b</var>, <var title="">styles</var>, <var title="">transform</var>)</code></dfn> method, when invoked on a
- <code><a href=#path>Path</a></code> object <var title="">a</var>, must run the
- following steps:</p>
+ </ol><hr><p>The <dfn id=dom-path-addpathbystrokingpath title=dom-path-addPathByStrokingPath><code>addPathByStrokingPath(<var title="">b</var>, <var title="">styles</var>, <var title="">transform</var>)</code></dfn> method,
+ when invoked on a <code><a href=#path>Path</a></code> object <var title="">a</var>, must run the following
+ steps:</p>
- <ol><li><p>If the <code><a href=#path>Path</a></code> object <var title="">b</var> has
- no subpaths, abort these steps.</li>
+ <ol><li><p>If the <code><a href=#path>Path</a></code> object <var title="">b</var> has no subpaths, abort these
+ steps.</li>
- <li><p>Create a copy of all the subpaths in <var title="">b</var>.
- Let this copy be known as <var title="">c</var>.</li>
+ <li><p>Create a copy of all the subpaths in <var title="">b</var>. Let this copy be known as <var title="">c</var>.</li>
- <li><p>Transform all the coordinates and lines in <var title="">c</var> by transformation matrix <var title="">transform</var>, if it is not null.</li>
+ <li><p>Transform all the coordinates and lines in <var title="">c</var> by transformation matrix
+ <var title="">transform</var>, if it is not null.</li>
- <li><p>Let a new list of subpaths <var title="">d</var> be the
- result of <a href=#trace-a-path title="trace a path">tracing</a> <var title="">c</var>, using the <var title="">styles</var> argument for
- the line styles.</p>
+ <li><p>Let a new list of subpaths <var title="">d</var> be the result of <a href=#trace-a-path title="trace a
+ path">tracing</a> <var title="">c</var>, using the <var title="">styles</var> argument for the
+ line styles.</p>
- <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
- last point in the last subpath of <var title="">d</var>.</li>
+ <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the last point in the last subpath
+ of <var title="">d</var>.</li>
<li><p>Add all the subpaths in <var title="">d</var> to <var title="">a</var>.</li>
- <li><p>Create a new subpath in <var title="">a</var> with (<var title="">x</var>, <var title="">y</var>) as the only point in the
- subpath.</li>
+ <li><p>Create a new subpath in <var title="">a</var> with (<var title="">x</var>, <var title="">y</var>) as the only point in the subpath.</li>
- </ol><hr><p>The <dfn id=dom-path-addtext title=dom-path-addText><code>addText()</code></dfn>
- and <dfn id=dom-path-addpathbystrokingtext title=dom-path-addPathByStrokingText><code>addPathByStrokingText()</code></dfn>
- methods each come in two variants: one rendering text at a given
- coordinate, and one rendering text along a given path. In both
- cases, the methods take a <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object
- argument for the text and (if appropriate) line styles to use, an
- <code><a href=#svgmatrix>SVGMatrix</a></code> object <var title="">transform</var> (which
- can be null), and a maximum width can optionally be provided.</p>
+ </ol><hr><p>The <dfn id=dom-path-addtext title=dom-path-addText><code>addText()</code></dfn> and <dfn id=dom-path-addpathbystrokingtext title=dom-path-addPathByStrokingText><code>addPathByStrokingText()</code></dfn> methods each
+ come in two variants: one rendering text at a given coordinate, and one rendering text along a
+ given path. In both cases, the methods take a <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object argument for
+ the text and (if appropriate) line styles to use, an <code><a href=#svgmatrix>SVGMatrix</a></code> object <var title="">transform</var> (which can be null), and a maximum width can optionally be provided.</p>
- <p>When one of the <code title=dom-path-addText><a href=#dom-path-addtext>addText()</a></code> and <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code> variants
- that take as argument an (<var title="">x</var>, <var title="">y</var>) coordinate is invoked, the method must run the
- following algorithm:</p>
+ <p>When one of the <code title=dom-path-addText><a href=#dom-path-addtext>addText()</a></code> and <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code> variants that take as
+ argument an (<var title="">x</var>, <var title="">y</var>) coordinate is invoked, the method must
+ run the following algorithm:</p>
- <ol><li><p>Run the <a href=#text-preparation-algorithm>text preparation algorithm</a>, passing it
- <var title="">text</var>, the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code>
- object argument, and, if the <var title="">maxWidth</var> argument
- was provided, that argument. Let <var title="">glyphs</var> be the
- result.</p>
+ <ol><li><p>Run the <a href=#text-preparation-algorithm>text preparation algorithm</a>, passing it <var title="">text</var>, the
+ <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object argument, and, if the <var title="">maxWidth</var>
+ argument was provided, that argument. Let <var title="">glyphs</var> be the result.</p>
- <li><p>Move all the shapes in <var title="">glyphs</var> to the
- right by <var title="">x</var> CSS pixels and down by <var title="">y</var> CSS pixels.</li>
+ <li><p>Move all the shapes in <var title="">glyphs</var> to the right by <var title="">x</var>
+ CSS pixels and down by <var title="">y</var> CSS pixels.</li>
- <li><p>Let <var title="">glyph subpaths</var> be a
- <a href=#path>path</a> describing the shapes given in <var title="">glyphs</var>, with each CSS pixel in the coordinate space
- of <var title="">glyphs</var> mapped to one coordinate space unit
- in <var title="">glyph subpaths</var>. Subpaths in <var title="">glyph subpaths</var> must wind clockwise, regardless of
- how the user agent's font subsystem renders fonts and regardless of
- how the fonts themselves are defined.</p>
+ <li><p>Let <var title="">glyph subpaths</var> be a <a href=#path>path</a> describing the shapes given
+ in <var title="">glyphs</var>, with each CSS pixel in the coordinate space of <var title="">glyphs</var> mapped to one coordinate space unit in <var title="">glyph subpaths</var>.
+ Subpaths in <var title="">glyph subpaths</var> must wind clockwise, regardless of how the user
+ agent's font subsystem renders fonts and regardless of how the fonts themselves are defined.</p>
- <li><p>If the method is <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code>,
- replace <var title="">glyph subpaths</var> by the result of <a href=#trace-a-path title="trace a path">tracing</a> <var title="">glyph
- subpaths</var>, using the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object
- argument for the line styles.</p>
+ <li><p>If the method is <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code>, replace <var title="">glyph subpaths</var> by the result of <a href=#trace-a-path title="trace a path">tracing</a> <var title="">glyph subpaths</var>, using the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object argument for the
+ line styles.</p>
- <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the transformation matrix <var title="">transform</var>, if it is not null.</li>
+ <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the
+ transformation matrix <var title="">transform</var>, if it is not null.</li>
- <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) be the last point in the
- last subpath of <var title="">glyph subpaths</var>.</li>
+ <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) be the last point in the last subpath of <var title="">glyph
+ subpaths</var>.</li>
- <li><p>Add all the subpaths in <var title="">glyph
- subpaths</var> to the <code><a href=#path>Path</a></code> object.</li>
+ <li><p>Add all the subpaths in <var title="">glyph subpaths</var> to the <code><a href=#path>Path</a></code>
+ object.</li>
- <li><p>Create a new subpath in the <code><a href=#path>Path</a></code> object with
- (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) as the only point in the
- subpath.</li>
+ <li><p>Create a new subpath in the <code><a href=#path>Path</a></code> object with (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) as the only point in
+ the subpath.</li>
- </ol><p>When one of the <code title=dom-path-addText><a href=#dom-path-addtext>addText()</a></code> and <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code>
- variants that take as argument a <code><a href=#path>Path</a></code> object is
- invoked, the method must run the following algorithm:</p>
+ </ol><p>When one of the <code title=dom-path-addText><a href=#dom-path-addtext>addText()</a></code> and <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code> variants that take as
+ argument a <code><a href=#path>Path</a></code> object is invoked, the method must run the following algorithm:</p>
- <ol><li><p>Let <var title="">target</var> be the <code><a href=#path>Path</a></code>
- object on which the method was invoked.</li>
+ <ol><li><p>Let <var title="">target</var> be the <code><a href=#path>Path</a></code> object on which the method was
+ invoked.</li>
- <li><p>Let <var title="">path</var> be the <code><a href=#path>Path</a></code> object
- that was provided in the method's arguments.</li>
+ <li><p>Let <var title="">path</var> be the <code><a href=#path>Path</a></code> object that was provided in the
+ method's arguments.</li>
- <li><p>Run the <a href=#text-preparation-algorithm>text preparation algorithm</a>, passing it
- <var title="">text</var>, the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code>
- object argument, and, if the <var title="">maxWidth</var> argument
- was provided, that argument. Let <var title="">glyphs</var> be the
- resulting array, and <var title="">physical alignment</var> be the
- resulting alignment value.</p>
+ <li><p>Run the <a href=#text-preparation-algorithm>text preparation algorithm</a>, passing it <var title="">text</var>, the
+ <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object argument, and, if the <var title="">maxWidth</var>
+ argument was provided, that argument. Let <var title="">glyphs</var> be the resulting array, and
+ <var title="">physical alignment</var> be the resulting alignment value.</p>
- <li><p>Let <var title="">width</var> be the aggregate length of all
- the subpaths in <var title="">path</var>, including the distances
- from the last point of each closed subpath to the first point of
- that subpath.</li>
+ <li><p>Let <var title="">width</var> be the aggregate length of all the subpaths in <var title="">path</var>, including the distances from the last point of each closed subpath to the
+ first point of that subpath.</li>
- <li><p>Define <var title="">L</var> to be a linear coordinate line
- for of all the subpaths in <var title="">path</var>, with
- additional lines drawn between the last point and the first point
- of each closed subpath, such that the first point of the first
- subpath is defined as point 0, and the last point of the last
- subpath, if the last subpath is not closed, or the second
- occurrence first point of that subpath, if it is closed, is defined
- as point <var title="">width</var>.</li>
+ <li><p>Define <var title="">L</var> to be a linear coordinate line for of all the subpaths in
+ <var title="">path</var>, with additional lines drawn between the last point and the first point
+ of each closed subpath, such that the first point of the first subpath is defined as point 0, and
+ the last point of the last subpath, if the last subpath is not closed, or the second occurrence
+ first point of that subpath, if it is closed, is defined as point <var title="">width</var>.</li>
<li>
- <p>Let <var title="">offset</var> be determined according to the
- appropriate step below:</p>
+ <p>Let <var title="">offset</var> be determined according to the appropriate step below:</p>
- <dl class=switch><dt>If <var title="">physical alignment</var> is <i>left</i></dt>
- <dd>Let <var title="">offset</var> be zero.</dd>
+ <dl class=switch><dt>If <var title="">physical alignment</var> is <i>left</i></dt> <dd>Let <var title="">offset</var> be zero.</dd>
- <dt>If <var title="">physical alignment</var> is <i>right</i></dt>
- <dd>Let <var title="">offset</var> be <var title="">width</var>.</dd>
+ <dt>If <var title="">physical alignment</var> is <i>right</i></dt> <dd>Let <var title="">offset</var> be <var title="">width</var>.</dd>
- <dt>If <var title="">physical alignment</var> is <i title="">center</i></dt>
- <dd>Let <var title="">offset</var> be half of <var title="">width</var>.</dd>
+ <dt>If <var title="">physical alignment</var> is <i title="">center</i></dt> <dd>Let <var title="">offset</var> be half of <var title="">width</var>.</dd>
</dl></li>
- <li><p>Move all the shapes in <var title="">glyphs</var> to the
- right by <var title="">offset</var> CSS pixels.</li>
+ <li><p>Move all the shapes in <var title="">glyphs</var> to the right by <var title="">offset</var> CSS pixels.</li>
<li>
- <p>For each glyph <var title="">glyph</var> in the <var title="">glyphs</var> array, run these substeps:</p>
+ <p>For each glyph <var title="">glyph</var> in the <var title="">glyphs</var> array, run these
+ substeps:</p>
- <ol><li><p>Let <var title="">dx</var> be the <var title="">x</var>-coordinate of the horizontal center of the
- bounding box of the shape described by <var title="">glyph</var>, in CSS pixels.</li>
+ <ol><li><p>Let <var title="">dx</var> be the <var title="">x</var>-coordinate of the horizontal
+ center of the bounding box of the shape described by <var title="">glyph</var>, in CSS
+ pixels.</li>
- <li><p>If <var title="">dx</var> is negative or greater than <var title="">width</var>, skip the remainder of these substeps for
- this glyph.</li>
+ <li><p>If <var title="">dx</var> is negative or greater than <var title="">width</var>, skip
+ the remainder of these substeps for this glyph.</li>
- <li><p>Recast <var title="">dx</var> to coordinate spaces units
- in <var title="">path</var>. (This just changes the
- dimensionality of <var title="">dx</var>, not its numeric
- value.)</p> <!-- hide this step if people get confused by the
- pedancy -->
+ <li><p>Recast <var title="">dx</var> to coordinate spaces units in <var title="">path</var>.
+ (This just changes the dimensionality of <var title="">dx</var>, not its numeric value.)</p>
+ <!-- hide this step if people get confused by the pedancy -->
- <li><p>Find the point <var title="">p</var> on <var title="">path</var> (or implied closing lines in <var title="">path</var>) that corresponds to the position <var title="">dx</var> on the coordinate line <var title="">L</var>.</p>
+ <li><p>Find the point <var title="">p</var> on <var title="">path</var> (or implied closing
+ lines in <var title="">path</var>) that corresponds to the position <var title="">dx</var> on
+ the coordinate line <var title="">L</var>.</p>
- <li><p>Let <var title="">θ</var> be the clockwise angle
- from the positive x-axis to the side of the line that is
- tangential to <var title="">path</var> at the point <var title="">p</var> that is going in the same direction as the line
- at point <var title="">p</var>.</li>
+ <li><p>Let <var title="">θ</var> be the clockwise angle from the positive x-axis to the
+ side of the line that is tangential to <var title="">path</var> at the point <var title="">p</var> that is going in the same direction as the line at point <var title="">p</var>.</li>
- <li><p>Rotate the shape described by <var title="">glyph</var>
- clockwise by <var title="">θ</var> about the point that is
- at the <var title="">dx</var> coordinate horizontally and the
- zero coordinate vertically.</li>
+ <li><p>Rotate the shape described by <var title="">glyph</var> clockwise by <var title="">θ</var> about the point that is at the <var title="">dx</var> coordinate
+ horizontally and the zero coordinate vertically.</li>
- <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
- coordinate of the point <var title="">p</var>.</li>
+ <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the coordinate of the point <var title="">p</var>.</li>
- <li><p>Move the shape described by <var title="">glyph</var> to
- the right by <var title="">x</var> and down by <var title="">y</var>.</li>
+ <li><p>Move the shape described by <var title="">glyph</var> to the right by <var title="">x</var> and down by <var title="">y</var>.</li>
- <li><p>Let <var title="">glyph subpaths</var> be a list of
- subpaths describing the shape given in <var title="">glyph</var>,
- with each CSS pixel in the coordinate space of <var title="">glyph</var> mapped to one coordinate space unit in <var title="">glyph subpaths</var>. Subpaths in <var title="">glyph
- subpaths</var> must wind clockwise, regardless of how the user
- agent's font subsystem renders fonts and regardless of how the
- fonts themselves are defined.</p>
+ <li><p>Let <var title="">glyph subpaths</var> be a list of subpaths describing the shape given
+ in <var title="">glyph</var>, with each CSS pixel in the coordinate space of <var title="">glyph</var> mapped to one coordinate space unit in <var title="">glyph subpaths</var>.
+ Subpaths in <var title="">glyph subpaths</var> must wind clockwise, regardless of how the user
+ agent's font subsystem renders fonts and regardless of how the fonts themselves are
+ defined.</p>
- <li><p>If the method is <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code>,
- replace <var title="">glyph subpaths</var> by the result of <a href=#trace-a-path title="trace a path">tracing</a> <var title="">glyph
- subpaths</var>, using the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object
- argument for the line styles.</p>
+ <li><p>If the method is <code title=dom-path-addPathByStrokingText><a href=#dom-path-addpathbystrokingtext>addPathByStrokingText()</a></code>, replace <var title="">glyph subpaths</var> by the result of <a href=#trace-a-path title="trace a path">tracing</a> <var title="">glyph subpaths</var>, using the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object argument for
+ the line styles.</p>
- <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the transformation matrix <var title="">transform</var>, if it is not null.</li>
+ <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the
+ transformation matrix <var title="">transform</var>, if it is not null.</li>
- <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) be the last point in
- the last subpath of <var title="">glyph subpaths</var>. (This
- coordinate is only used if this is the last glyph
- processed.)</li>
+ <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) be the last point in the last subpath of <var title="">glyph
+ subpaths</var>. (This coordinate is only used if this is the last glyph processed.)</li>
- <li><p>Add all the subpaths in <var title="">glyph subpaths</var>
- to <var title="">target</var>.</li>
+ <li><p>Add all the subpaths in <var title="">glyph subpaths</var> to <var title="">target</var>.</li>
</ol></li>
- <li><p>Create a new subpath in the <code><a href=#path>Path</a></code> object with
- (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) as the only point in the
- subpath.</li>
+ <li><p>Create a new subpath in the <code><a href=#path>Path</a></code> object with (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) as the only point in
+ the subpath.</li>
</ol></div>
<h6 id=transformations><span class=secno>4.8.11.2.8 </span><dfn title=dom-context-2d-transformation>Transformations</dfn></h6>
- <p>Each <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object has a
- <i>current transformation matrix</i>, as well as methods (described
- in this section) to manipulate it. When a
- <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object is created, its
- transformation matrix must be initialized to the identity
- transform.</p>
+ <p>Each <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object has a <i>current transformation matrix</i>,
+ as well as methods (described in this section) to manipulate it. When a
+ <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object is created, its transformation matrix must be
+ initialized to the identity transform.</p>
- <p>The transformation matrix is applied to coordinates when creating
- the <a href=#current-default-path>current default path</a>, and when painting text,
- shapes, and <code><a href=#path>Path</a></code> objects, on
- <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> objects.</p> <!-- conformance
- criteria for actual drawing are described in the various sections
- below -->
+ <p>The transformation matrix is applied to coordinates when creating the <a href=#current-default-path>current default
+ path</a>, and when painting text, shapes, and <code><a href=#path>Path</a></code> objects, on
+ <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> objects.</p> <!-- conformance criteria for actual drawing
+ are described in the various sections below -->
- <p class=note>Most of the API uses <code><a href=#svgmatrix>SVGMatrix</a></code> objects
- rather than this API. This API remains mostly for historical
- reasons.</p>
+ <p class=note>Most of the API uses <code><a href=#svgmatrix>SVGMatrix</a></code> objects rather than this API. This API
+ remains mostly for historical reasons.</p>
<div class=impl>
<p>The transformations must be performed in reverse order.</p>
- <p class=note>For instance, if a scale transformation that doubles
- the width is applied to the canvas, followed by a rotation
- transformation that rotates drawing operations by a quarter turn,
- and a rectangle twice as wide as it is tall is then drawn on the
- canvas, the actual result will be a square.</p> <!-- q.v.
- http://goo.gl/5RLrN -->
+ <p class=note>For instance, if a scale transformation that doubles the width is applied to the
+ canvas, followed by a rotation transformation that rotates drawing operations by a quarter turn,
+ and a rectangle twice as wide as it is tall is then drawn on the canvas, the actual result will be
+ a square.</p> <!-- q.v. http://goo.gl/5RLrN -->
</div>
@@ -35557,38 +35517,32 @@
</dl><div class=impl>
- <p>The <dfn id=dom-context-2d-currenttransform title=dom-context-2d-currentTransform><code>currentTransform</code></dfn>,
- on getting, must return the last object that it was set to. On
- setting, its value must be changed to the new value, and the
- transformation matrix must be updated to match the matrix described
- by the new value. When the <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code>
- object is created, the <code title=dom-context-2d-currentTransform><a href=#dom-context-2d-currenttransform>currentTransform</a></code>
- attribute must be set a newly created <code><a href=#svgmatrix>SVGMatrix</a></code> object.
- When the transformation matrix is mutated by the methods described
- in this section, the last <code><a href=#svgmatrix>SVGMatrix</a></code> object to which the
- attribute has been set must be mutated in a corresponding
- fashion.</p>
+ <p>The <dfn id=dom-context-2d-currenttransform title=dom-context-2d-currentTransform><code>currentTransform</code></dfn>, on
+ getting, must return the last object that it was set to. On setting, its value must be changed to
+ the new value, and the transformation matrix must be updated to match the matrix described by the
+ new value. When the <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object is created, the <code title=dom-context-2d-currentTransform><a href=#dom-context-2d-currenttransform>currentTransform</a></code> attribute must be set a newly
+ created <code><a href=#svgmatrix>SVGMatrix</a></code> object. When the transformation matrix is mutated by the methods
+ described in this section, the last <code><a href=#svgmatrix>SVGMatrix</a></code> object to which the attribute has been
+ set must be mutated in a corresponding fashion.</p>
- <p>The <dfn id=dom-context-2d-scale title=dom-context-2d-scale><code>scale(<var title="">x</var>, <var title="">y</var>)</code></dfn> method must
- add the scaling transformation described by the arguments to the
- transformation matrix. The <var title="">x</var> argument represents
- the scale factor in the horizontal direction and the <var title="">y</var> argument represents the scale factor in the
- vertical direction. The factors are multiples.</p>
+ <p>The <dfn id=dom-context-2d-scale title=dom-context-2d-scale><code>scale(<var title="">x</var>, <var title="">y</var>)</code></dfn> method must add the scaling transformation described by the
+ arguments to the transformation matrix. The <var title="">x</var> argument represents the scale
+ factor in the horizontal direction and the <var title="">y</var> argument represents the scale
+ factor in the vertical direction. The factors are multiples.</p>
- <p>The <dfn id=dom-context-2d-rotate title=dom-context-2d-rotate><code>rotate(<var title="">angle</var>)</code></dfn> method must add the rotation
- transformation described by the argument to the transformation
- matrix. The <var title="">angle</var> argument represents a
- clockwise rotation angle expressed in radians.</p>
+ <p>The <dfn id=dom-context-2d-rotate title=dom-context-2d-rotate><code>rotate(<var title="">angle</var>)</code></dfn>
+ method must add the rotation transformation described by the argument to the transformation
+ matrix. The <var title="">angle</var> argument represents a clockwise rotation angle expressed in
+ radians.</p>
- <p>The <dfn id=dom-context-2d-translate title=dom-context-2d-translate><code>translate(<var title="">x</var>, <var title="">y</var>)</code></dfn> method must
- add the translation transformation described by the arguments to the
- transformation matrix. The <var title="">x</var> argument represents
- the translation distance in the horizontal direction and the <var title="">y</var> argument represents the translation distance in the
- vertical direction. The arguments are in coordinate space units.</p>
+ <p>The <dfn id=dom-context-2d-translate title=dom-context-2d-translate><code>translate(<var title="">x</var>, <var title="">y</var>)</code></dfn> method must add the translation transformation described by the
+ arguments to the transformation matrix. The <var title="">x</var> argument represents the
+ translation distance in the horizontal direction and the <var title="">y</var> argument represents
+ the translation distance in the vertical direction. The arguments are in coordinate space
+ units.</p>
- <p>The <dfn id=dom-context-2d-transform title=dom-context-2d-transform><code>transform(<var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>, <var title="">f</var>)</code></dfn> method must replace the current
- transformation matrix with the result of multiplying the current
- transformation matrix with the matrix described by:</p>
+ <p>The <dfn id=dom-context-2d-transform title=dom-context-2d-transform><code>transform(<var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>, <var title="">f</var>)</code></dfn> method must replace the current transformation matrix with the
+ result of multiplying the current transformation matrix with the matrix described by:</p>
</div>
@@ -35601,21 +35555,21 @@
<tr><td>0</td>
<td>0</td>
<td>1</td>
- </table><p class=note>The arguments <var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>, and <var title="">f</var> are sometimes called
- <var title="">m11</var>, <var title="">m12</var>, <var title="">m21</var>, <var title="">m22</var>, <var title="">dx</var>,
- and <var title="">dy</var> or <var title="">m11</var>, <var title="">m21</var>, <var title="">m12</var>, <var title="">m22</var>, <var title="">dx</var>, and <var title="">dy</var>. Care should be taken in particular with the order
- of the second and third arguments (<var title="">b</var> and <var title="">c</var>) as their order varies from API to API and APIs
- sometimes use the notation <var title="">m12</var>/<var title="">m21</var> and sometimes <var title="">m21</var>/<var title="">m12</var> for those positions.</p>
+ </table><p class=note>The arguments <var title="">a</var>, <var title="">b</var>, <var title="">c</var>,
+ <var title="">d</var>, <var title="">e</var>, and <var title="">f</var> are sometimes called <var title="">m11</var>, <var title="">m12</var>, <var title="">m21</var>, <var title="">m22</var>,
+ <var title="">dx</var>, and <var title="">dy</var> or <var title="">m11</var>, <var title="">m21</var>, <var title="">m12</var>, <var title="">m22</var>, <var title="">dx</var>, and
+ <var title="">dy</var>. Care should be taken in particular with the order of the second and third
+ arguments (<var title="">b</var> and <var title="">c</var>) as their order varies from API to API
+ and APIs sometimes use the notation <var title="">m12</var>/<var title="">m21</var> and sometimes
+ <var title="">m21</var>/<var title="">m12</var> for those positions.</p>
<div class=impl>
- <p>The <dfn id=dom-context-2d-settransform title=dom-context-2d-setTransform><code>setTransform(<var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>,
- <var title="">f</var>)</code></dfn> method must reset the current
- transform to the identity matrix, and then invoke the <code><a href=#dom-context-2d-transform title=dom-context-2d-transform>transform</a>(<var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>,
- <var title="">f</var>)</code> method with the same arguments.</p>
+ <p>The <dfn id=dom-context-2d-settransform title=dom-context-2d-setTransform><code>setTransform(<var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>, <var title="">f</var>)</code></dfn> method must reset the current transform to the identity matrix, and
+ then invoke the <code><a href=#dom-context-2d-transform title=dom-context-2d-transform>transform</a>(<var title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>, <var title="">f</var>)</code> method with the same arguments.</p>
- <p>The <dfn id=dom-context-2d-resettransform title=dom-context-2d-resetTransform><code>resetTransform()</code></dfn>
- method must reset the current transform to the identity matrix.</p>
+ <p>The <dfn id=dom-context-2d-resettransform title=dom-context-2d-resetTransform><code>resetTransform()</code></dfn> method must
+ reset the current transform to the identity matrix.</p>
</div>
@@ -35652,9 +35606,11 @@
steps.</li>
<li><p>If the <var title="">image</var> argument is an <code><a href=#htmlcanvaselement>HTMLCanvasElement</a></code> object with
- either a horizontal dimension or a vertical dimension equal to zero, then the implementation
- throw an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception and return <i>aborted</i>.</p>
+ either a horizontal dimension or a vertical dimension equal to zero, then throw an
+ <code><a href=#invalidstateerror>InvalidStateError</a></code> exception and return <i>aborted</i>.</p>
+ <li><p>Return <i>good</i>.</li>
+
</ol><p>When a <code><a href=#canvasimagesource>CanvasImageSource</a></code> object represents an <code><a href=#htmlimageelement>HTMLImageElement</a></code>, the
element's image must be used as the source image.</p>
@@ -37076,29 +37032,23 @@
bitmap that surrounds the <a href="#hit-region's-set-of-pixels">hit region's set of pixels</a> as they stood when it was
created.</li>
-<!--CLEANUP-->
- <li><p>Optionally, a non-empty string representing an <dfn id="hit-region's-id" title="hit region's ID">ID</dfn> for distinguishing the region
- from others.</li>
+ <li><p>Optionally, a non-empty string representing an <dfn id="hit-region's-id" title="hit region's ID">ID</dfn> for
+ distinguishing the region from others.</li>
- <li><p>Optionally, a reference to another region that acts as the
- <dfn id="hit-region's-parent" title="hit region's parent">parent</dfn> for this
- one.</li>
+ <li><p>Optionally, a reference to another region that acts as the <dfn id="hit-region's-parent" title="hit region's
+ parent">parent</dfn> for this one.</li>
- <li><p>A count of regions that have this one as their <a href="#hit-region's-parent" title="hit region's parent">parent</a>, known as the <dfn id="hit-region's-child-count">hit
- region's child count</dfn>.</li>
+ <li><p>A count of regions that have this one as their <a href="#hit-region's-parent" title="hit region's
+ parent">parent</a>, known as the <dfn id="hit-region's-child-count">hit region's child count</dfn>.</li>
- <li><p>A <dfn id="hit-region's-cursor-specification" title="hit region's cursor specification">cursor
- specification</dfn>, in the form of either a CSS cursor value, or
- the string "<code title="">inherit</code>" meaning that the cursor
- of the <a href="#hit-region's-parent">hit region's parent</a>, if any, or of the
- <code><a href=#the-canvas-element>canvas</a></code> element, if not, is to be used
- instead.</li>
+ <li><p>A <dfn id="hit-region's-cursor-specification" title="hit region's cursor specification">cursor specification</dfn>, in the form
+ of either a CSS cursor value, or the string "<code title="">inherit</code>" meaning that the
+ cursor of the <a href="#hit-region's-parent">hit region's parent</a>, if any, or of the <code><a href=#the-canvas-element>canvas</a></code> element, if
+ not, is to be used instead.</li>
<li>
- <p>Optionally, either a <a href="#hit-region's-control" title="hit region's
- control">control</a>, or an <a href="#hit-region's-unbacked-region-description" title="hit region's unbacked
- region description">unbacked region description</a>.</p>
+ <p>Optionally, either a <a href="#hit-region's-control" title="hit region's control">control</a>, or an <a href="#hit-region's-unbacked-region-description" title="hit region's unbacked region description">unbacked region description</a>.</p>
<p>A <dfn id="hit-region's-control" title="hit region's control">control</dfn> is just a reference to an
<code><a href=#element>Element</a></code> node, to which, in certain conditions, the user agent will route events,
@@ -37106,16 +37056,13 @@
accessibility tools. (The control is ignored when it is not a descendant of the
<code><a href=#the-canvas-element>canvas</a></code> element.)</p>
- <p>An <dfn id="hit-region's-unbacked-region-description" title="hit region's unbacked region
- description">unbacked region description</dfn> consists of the
- following:</p>
+ <p>An <dfn id="hit-region's-unbacked-region-description" title="hit region's unbacked region description">unbacked region description</dfn>
+ consists of the following:</p>
- <ul class=brief><li><p>Optionally, a <dfn id="hit-region's-label" title="hit region's
- label">label</dfn>.</p>
+ <ul class=brief><li><p>Optionally, a <dfn id="hit-region's-label" title="hit region's label">label</dfn>.</p>
- <li><p>An <dfn id="hit-region's-aria-role" title="hit region's ARIA role">ARIA role</dfn>,
- which, if the <a href="#hit-region's-unbacked-region-description" title="hit region's unbacked region
- description">unbacked region description</a> also has a label,
+ <li><p>An <dfn id="hit-region's-aria-role" title="hit region's ARIA role">ARIA role</dfn>, which, if the <a href="#hit-region's-unbacked-region-description" title="hit
+ region's unbacked region description">unbacked region description</a> also has a label,
could be the empty string.</li>
</ul></li>
@@ -37128,10 +37075,10 @@
<dl><dt><code title=dom-HitRegionOptions-path>path</code> (default null)
- <dd>A <code><a href=#path>Path</a></code> object that describes the pixels that
- form part of the region. If this member is not provided or is set
- to null, the <a href=#current-default-path>current default path</a> is used
+ <dd>A <code><a href=#path>Path</a></code> object that describes the pixels that form part of the region. If this
+ member is not provided or is set to null, the <a href=#current-default-path>current default path</a> is used
instead.</dd>
+
<!--
<dt><code title="dom-HitRegionOptions-transform">transform</code> (default null)
@@ -37139,58 +37086,54 @@
transformation to apply to the path described by the <code
title="dom-HitRegionOptions-path">path</code> member.</dd>
-->
+
<dt><code title=dom-HitRegionOptions-id>id</code> (default empty string)
- <dd>The ID to use for this region. This is used in
- <code><a href=#mouseevent>MouseEvent</a></code> events on the <code><a href=#the-canvas-element>canvas</a></code> (<code title=dom-MouseEvent-region><a href=#dom-mouseevent-region>event.region</a></code>) and as a way
- to reference this region in later calls to <code title=dom-context-2d-addHitRegion><a href=#dom-context-2d-addhitregion>addHitRegion()</a></code>.</dd>
+ <dd>The ID to use for this region. This is used in <code><a href=#mouseevent>MouseEvent</a></code> events on the
+ <code><a href=#the-canvas-element>canvas</a></code> (<code title=dom-MouseEvent-region><a href=#dom-mouseevent-region>event.region</a></code>) and as a way to
+ reference this region in later calls to <code title=dom-context-2d-addHitRegion><a href=#dom-context-2d-addhitregion>addHitRegion()</a></code>.</dd>
<dt><code title=dom-HitRegionOptions-parentID>parentID</code> (default null)
- <dd>The ID of the parent region, for purposes of navigation by
- accessibility tools and for cursor fallback.</dd>
+ <dd>The ID of the parent region, for purposes of navigation by accessibility tools and for
+ cursor fallback.</dd>
<dt><code title=dom-HitRegionOptions-cursor>cursor</code> (default "<code title="">inherit</code>")
- <dd>The cursor to use when the mouse is over this region. The
- value "<code title="">inherit</code>" means to use the cursor for
- the parent region (as specified by the <code title=dom-HitRegionOptions-parentID>parentID</code> member), if
- any, or to use the <code><a href=#the-canvas-element>canvas</a></code> element's cursor if the
- region has no parent.</dd>
+ <dd>The cursor to use when the mouse is over this region. The value "<code title="">inherit</code>" means to use the cursor for the parent region (as specified by the
+ <code title=dom-HitRegionOptions-parentID>parentID</code> member), if any, or to use the
+ <code><a href=#the-canvas-element>canvas</a></code> element's cursor if the region has no parent.</dd>
<dt><code title=dom-HitRegionOptions-control>control</code> (default null)
- <dd>An element (that is a descendant of the <code><a href=#the-canvas-element>canvas</a></code>)
- to which events are to be routed, and which accessibility tools
- are to use as a surrogate for describing and interacting with
- this region.</dd>
+ <dd>An element (that is a descendant of the <code><a href=#the-canvas-element>canvas</a></code>) to which events are to be
+ routed, and which accessibility tools are to use as a surrogate for describing and interacting
+ with this region.</dd>
<dt><code title=dom-HitRegionOptions-label>label</code> (default null)
- <dd>A text label for accessibility tools to use as a description
- of this region, if there is no control.</dd>
+ <dd>A text label for accessibility tools to use as a description of this region, if there is no
+ control.</dd>
<dt><code title=dom-HitRegionOptions-role>role</code> (default null)
- <dd>An ARIA role for accessibility tools to use to determine how
- to represent this region, if there is no control.</dd>
+ <dd>An ARIA role for accessibility tools to use to determine how to represent this region, if
+ there is no control.</dd>
</dl><p>Hit regions can be used for a variety of purposes:</p>
- <ul><li>With an ID, they can make hit detection easier by having the
- user agent check which region the mouse is over and include the
- ID in the mouse events.</li>
+ <ul><li>With an ID, they can make hit detection easier by having the user agent check which region
+ the mouse is over and include the ID in the mouse events.</li>
- <li>With a control, they can make routing events to DOM elements
- automatic, allowing e.g. clicks on a <code><a href=#the-canvas-element>canvas</a></code> to automatically
- submit a form via a <code><a href=#the-button-element>button</a></code> element.</li>
+ <li>With a control, they can make routing events to DOM elements automatic, allowing e.g.
+ clicks on a <code><a href=#the-canvas-element>canvas</a></code> to automatically submit a form via a <code><a href=#the-button-element>button</a></code>
+ element.</li>
- <li>With a label, they can make it easier for users to explore a
- <code><a href=#the-canvas-element>canvas</a></code> without seeing it, e.g. by touch on a mobile device.</li>
+ <li>With a label, they can make it easier for users to explore a <code><a href=#the-canvas-element>canvas</a></code> without
+ seeing it, e.g. by touch on a mobile device.</li>
- <li>With a cursor, they can make it easier for different regions
- of the <code><a href=#the-canvas-element>canvas</a></code> to have different cursors, with the user agent
- automatically switching between them.</li>
+ <li>With a cursor, they can make it easier for different regions of the <code><a href=#the-canvas-element>canvas</a></code> to
+ have different cursors, with the user agent automatically switching between them.</li>
</ul></dd>
@@ -37198,81 +37141,72 @@
<dd>
- <p>Removes a hit region (and all its descendants) 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>Removes a hit region (and all its descendants) 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>
+ <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
- <dfn id=ancestor-region>ancestor region</dfn> of a <a href=#hit-region>hit region</a> <var title="">B</var> if <var title="">B</var> has a <a href="#hit-region's-parent" title="hit
- region's parent">parent</a> and its <a href="#hit-region's-parent" title="hit region's
- parent">parent</a> is either <var title="">A</var> or another
- <a href=#hit-region>hit region</a> for which <var title="">A</var> is an
+ <p>A <a href=#hit-region>hit region</a> <var title="">A</var> is an <dfn id=ancestor-region>ancestor region</dfn> of a <a href=#hit-region>hit
+ region</a> <var title="">B</var> if <var title="">B</var> has a <a href="#hit-region's-parent" title="hit region's
+ parent">parent</a> and its <a href="#hit-region's-parent" title="hit region's parent">parent</a> is either <var title="">A</var> or another <a href=#hit-region>hit region</a> for which <var title="">A</var> is an
<a href=#ancestor-region>ancestor region</a>.</p>
<p><dfn id=the-region-identified-by-the-id>The region identified by the ID</dfn> <var title="">ID</var> in a bitmap <var title="">bitmap</var> is the value returned by the following algorithm (which can return a
<a href=#hit-region>hit region</a> or nothing):</p>
- <ol><li><p>If <var title="">ID</var> is null, return nothing and abort
- these steps.</li>
+ <ol><li><p>If <var title="">ID</var> is null, return nothing and abort these steps.</li>
- <li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region
- list</a> associated with <var title="">bitmap</var>.</li>
+ <li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region list</a> associated with <var title="">bitmap</var>.</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-id" title="hit region's ID">ID</a>
- is a <a href=#case-sensitive>case-sensitive</a> match for <var title="">ID</var>,
- then return that <a href=#hit-region>hit region</a> and abort these
- steps.</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-id" title="hit
+ region's ID">ID</a> is a <a href=#case-sensitive>case-sensitive</a> match for <var title="">ID</var>, then
+ return that <a href=#hit-region>hit region</a> and abort these steps.</li>
<li><p>Otherwise, return nothing.</li>
</ol><p><dfn id=the-region-representing-the-control>The region representing the control</dfn> <var title="">control</var> for a bitmap <var title="">bitmap</var> is the value returned by the following algorithm (which can return a
<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> associated with <var title="">bitmap</var>.</li>
+ <ol><li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region list</a> associated with <var title="">bitmap</var>.</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
- control">control</a> is <var title="">control</var>, then
- return that <a href=#hit-region>hit region</a> and abort these
- steps.</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 control">control</a> is <var title="">control</var>, then return that <a href=#hit-region>hit
+ region</a> and abort these steps.</li>
<li><p>Otherwise, return nothing.</li>
- </ol><p><dfn id=the-control-represented-by-a-region>The control represented by a region</dfn> <var title="">region</var> for a <code><a href=#the-canvas-element>canvas</a></code> element <var title="">ancestor</var> is the value returned by the following
+ </ol><p><dfn id=the-control-represented-by-a-region>The control represented by a region</dfn> <var title="">region</var> for a
+ <code><a href=#the-canvas-element>canvas</a></code> element <var title="">ancestor</var> is the value returned by the following
algorithm (which can return an element or nothing):</p>
- <ol><li><p>If <var title="">region</var> has no <a href="#hit-region's-control" title="hit
- region's control">control</a>, return nothing and abort these
- steps.</li>
+ <ol><li><p>If <var title="">region</var> has no <a href="#hit-region's-control" title="hit region's control">control</a>,
+ return nothing and abort these steps.</li>
<li><p>Let <var title="">control</var> be <var title="">region</var>'s <a href="#hit-region's-control" title="hit region's
control">control</a>.</li>
- <li><p>If <var title="">control</var> is not a descendant of <var title="">ancestor</var>, then return nothing and abort these
- steps.</li>
+ <li><p>If <var title="">control</var> is not a descendant of <var title="">ancestor</var>, then
+ return nothing and abort these steps.</li>
<li><p>Otherwise, return <var title="">control</var>.</li>
- </ol><p><dfn id=the-cursor-for-a-hit-region>The cursor for a hit region</dfn> <var title="">region</var> of a <code><a href=#the-canvas-element>canvas</a></code> element <var title="">ancestor</var> is the value returned by the following
- algorithm:</p>
+ </ol><p><dfn id=the-cursor-for-a-hit-region>The cursor for a hit region</dfn> <var title="">region</var> of a <code><a href=#the-canvas-element>canvas</a></code>
+ element <var title="">ancestor</var> is the value returned by the following algorithm:</p>
- <ol><li><p><i>Loop</i>: If <var title="">region</var> has a <a href="#hit-region's-cursor-specification" title="hit region's cursor specification">cursor
- specification</a> other than "<code title="">inherit</code>",
- then return that <a href="#hit-region's-cursor-specification">hit region's cursor specification</a>
- and abort these steps.</li>
+ <ol><li><p><i>Loop</i>: If <var title="">region</var> has a <a href="#hit-region's-cursor-specification" title="hit region's cursor
+ specification">cursor specification</a> other than "<code title="">inherit</code>", then
+ return that <a href="#hit-region's-cursor-specification">hit region's cursor specification</a> and abort these steps.</li>
- <li><p>If <var title="">region</var> has a <a href="#hit-region's-parent" title="hit
- region's parent">parent</a>, then let <var title="">region</var> be that <a href="#hit-region's-parent">hit region's parent</a>,
- and return to the step labeled <i>loop</i>.</li>
+ <li><p>If <var title="">region</var> has a <a href="#hit-region's-parent" title="hit region's parent">parent</a>, then
+ let <var title="">region</var> be that <a href="#hit-region's-parent">hit region's parent</a>, and return to the step
+ labeled <i>loop</i>.</li>
<li><p>Otherwise, return the used value of the 'cursor' property for the <code><a href=#the-canvas-element>canvas</a></code>
element, if any; if there isn't one, return 'auto'. <a href=#refsCSSUI>[CSSUI]</a></li>
@@ -37282,10 +37216,9 @@
<ol><li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region list</a> associated with <var title="">bitmap</var>.</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
- pixels">set of pixels</a> contains <var title="">pixel</var>,
- then return that <a href=#hit-region>hit region</a> and abort these
- steps.</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 pixels">set of pixels</a> contains <var title="">pixel</var>, then return that
+ <a href=#hit-region>hit region</a> and abort these steps.</li>
<li><p>Otherwise, return nothing.</li>
@@ -37293,9 +37226,8 @@
<ol><li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region list</a> associated with <var title="">bitmap</var>.</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>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="">bitmap</var>.</li>
@@ -37304,16 +37236,12 @@
<ol><li><p>Let <var title="">list</var> be the <a href=#hit-region-list>hit region list</a> associated with <var title="">bitmap</var>.</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
- pixels</a> and a zero <a href="#hit-region's-child-count" title="hit region's child
- count">child count</a>, if any. If there is no such <a href=#hit-region>hit
- region</a>, abort these steps.</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
+ pixels</a> and a zero <a href="#hit-region's-child-count" title="hit region's child count">child count</a>, if any. If
+ there is no such <a href=#hit-region>hit region</a>, abort these steps.</li>
- <li><p>If <var title="">victim</var> has a <a href="#hit-region's-parent" title="hit
- region's parent">parent</a>, then decrement that <a href="#hit-region's-child-count">hit
- region's child count</a> by one.</li>
+ <li><p>If <var title="">victim</var> has a <a href="#hit-region's-parent" title="hit region's parent">parent</a>, then
+ decrement that <a href="#hit-region's-child-count">hit region's child count</a> by one.</li>
<li><p>Remove <var title="">victim</var> from <var title="">list</var>.</li>
@@ -37324,16 +37252,17 @@
reset, e.g. when a <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object is bound to or unbound from a
<code><a href=#the-canvas-element>canvas</a></code>, or when the dimensions of the bitmap are changed.</p>
- <hr><p>When the <dfn id=dom-context-2d-addhitregion title=dom-context-2d-addHitRegion><code>addHitRegion()</code></dfn>
- method is invoked, the user agent must run the following steps:</p>
+ <hr><p>When the <dfn id=dom-context-2d-addhitregion title=dom-context-2d-addHitRegion><code>addHitRegion()</code></dfn> method is
+ invoked, the user agent must run the following steps:</p>
- <ol><li><p>Let <var title="">arguments</var> be the dictionary object
- provided as the method's argument.</li>
+ <ol><li><p>Let <var title="">arguments</var> be the dictionary object provided as the method's
+ argument.</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-path>path</code> member is not null,
- let <var title="">source path</var> be the <code title=dom-HitRegionOptions-path>path</code> member's value.
- Otherwise, let it be the <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code>
- object's <a href=#current-default-path>current default path</a>.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-path>path</code> member is not null, let <var title="">source
+ path</var> be the <code title=dom-HitRegionOptions-path>path</code> member's value. Otherwise,
+ let it be the <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object's <a href=#current-default-path>current default
+ path</a>.</li>
+
<!--
<li><p>If the <var title="">arguments</var> object's <code
title="dom-HitRegionOptions-path">path</code> member is null, but
@@ -37347,83 +37276,66 @@
title="dom-HitRegionOptions-transform">transform</code> member, if
it is not null.</p></li>
-->
- <li><p>Transform all the coordinates and lines in <var title="">source path</var> by the current transform matrix, if the
- <var title="">arguments</var> object's <code title=dom-HitRegionOptions-path>path</code> member is not
- null.</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-id>id</code> member is the
- empty string, let it be null instead.</li>
+ <li><p>Transform all the coordinates and lines in <var title="">source path</var> by the current
+ transform matrix, if the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-path>path</code> member is not null.</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-id>id</code> member is not null, then
- let <var title="">previous region for this ID</var> be <a href=#the-region-identified-by-the-id>the
- region identified by the ID</a> given by the <code title=dom-HitRegionOptions-id>id</code> member's value in this
- <a href=#scratch-bitmap>scratch bitmap</a>, if any. If the <code title=dom-HitRegionOptions-id>id</code> member is null or no such
- region currently exists, let <var title="">previous region for this
- ID</var> be null.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-id>id</code> member is the empty string, let it be null
+ instead.</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-parent>parent</code> member is the
- empty string, let it be null instead.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-id>id</code> member is not null, then let <var title="">previous
+ region for this ID</var> be <a href=#the-region-identified-by-the-id>the region identified by the ID</a> given by the <code title=dom-HitRegionOptions-id>id</code> member's value in this <a href=#scratch-bitmap>scratch bitmap</a>, if
+ any. If the <code title=dom-HitRegionOptions-id>id</code> member is null or no such region
+ currently exists, let <var title="">previous region for this ID</var> be null.</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-parent>parent</code> member is not
- null, then let <var title="">parent region</var> be <a href=#the-region-identified-by-the-id>the
- region identified by the ID</a> given by the <code title=dom-HitRegionOptions-parent>parent</code> member's value in
- the <a href=#scratch-bitmap>scratch bitmap</a>, if any. If the <code title=dom-HitRegionOptions-parent>parent</code> member is null or
- no such region currently exists, let <var title="">parent
- region</var> be null.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-parent>parent</code> member is the empty string, let it be null
+ instead.</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-label>label</code> member is the
- empty string, let it be null instead.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-parent>parent</code> member is not null, then let <var title="">parent region</var> be <a href=#the-region-identified-by-the-id>the region identified by the ID</a> given by the <code title=dom-HitRegionOptions-parent>parent</code> member's value in the <a href=#scratch-bitmap>scratch
+ bitmap</a>, if any. If the <code title=dom-HitRegionOptions-parent>parent</code> member is
+ null or no such region currently exists, let <var title="">parent region</var> be null.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-label>label</code> member is the empty string, let it be null
+ instead.</li>
+
<li>
- <p>If any of the following conditions are met, throw a
- <code><a href=#notsupportederror>NotSupportedError</a></code> exception and abort these
- steps.</p>
+ <p>If any of the following conditions are met, throw a <code><a href=#notsupportederror>NotSupportedError</a></code> exception
+ and abort these steps.</p>
<ul class=brief><!--
<li>The <var title="">arguments</var> object's <code
title="dom-HitRegionOptions-path">path</code> member is null, but
its <code title="dom-HitRegionOptions-transform">transform</code>
member is not.</li>
---><li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> and <code title=dom-HitRegionOptions-label>label</code> members are both
- non-null.</li>
+--><li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> and <code title=dom-HitRegionOptions-label>label</code> members are both non-null.</li>
- <li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> and <code title=dom-HitRegionOptions-role>role</code> members are both
- non-null.</li>
+ <li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> and <code title=dom-HitRegionOptions-role>role</code> members are both non-null.</li>
- <li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-role>role</code> member's value is
- the empty string, and the <code title=dom-HitRegionOptions-label>label</code> member's value is
- either null or the empty string.</li>
+ <li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-role>role</code> member's value is the empty string, and the <code title=dom-HitRegionOptions-label>label</code> member's value is either null or the empty
+ string.</li>
- <li>The <a href=#path>path</a> <var title="">source path</var>
- describes a shape with no pixels.</li>
+ <li>The <a href=#path>path</a> <var title="">source path</var> describes a shape with no
+ pixels.</li>
- <li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> member is not
- null but is neither an <code><a href=#the-a-element>a</a></code> element that
- <a href=#represents>represents</a> a <a href=#hyperlink>hyperlink</a>, a
- <code><a href=#the-button-element>button</a></code> element, an <code><a href=#the-input-element>input</a></code> element whose
- <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in one of
- the <a href="#checkbox-state-(type=checkbox)" title=attr-input-type-checkbox>Checkbox</a> or
- <a href="#radio-button-state-(type=radio)" title=attr-input-type-radio>Radio Button</a> states,
- nor an <code><a href=#the-input-element>input</a></code> element that is a <a href=#concept-button title=concept-button>button</a>.</li>
+ <li>The <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> member is not null but is neither an
+ <code><a href=#the-a-element>a</a></code> element that <a href=#represents>represents</a> a <a href=#hyperlink>hyperlink</a>, a
+ <code><a href=#the-button-element>button</a></code> element, an <code><a href=#the-input-element>input</a></code> element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in one of the <a href="#checkbox-state-(type=checkbox)" title=attr-input-type-checkbox>Checkbox</a> or <a href="#radio-button-state-(type=radio)" title=attr-input-type-radio>Radio
+ Button</a> states, nor an <code><a href=#the-input-element>input</a></code> element that is a <a href=#concept-button title=concept-button>button</a>.</li>
- <li>The <var title="">parent region</var> is not null but has a
- <a href="#hit-region's-control" title="hit region's control">control</a>.</li>
+ <li>The <var title="">parent region</var> is not null but has a <a href="#hit-region's-control" title="hit region's
+ control">control</a>.</li>
- <li>The <var title="">previous region for this ID</var> is the
- same <a href=#hit-region>hit region</a> as the <var title="">parent
- region</var>.</li>
+ <li>The <var title="">previous region for this ID</var> is the same <a href=#hit-region>hit region</a> as
+ the <var title="">parent region</var>.</li>
- <li>The <var title="">previous region for this ID</var> is an
- <a href=#ancestor-region>ancestor region</a> of the <var title="">parent
- region</var>.</li>
+ <li>The <var title="">previous region for this ID</var> is an <a href=#ancestor-region>ancestor region</a> of
+ the <var title="">parent region</var>.</li>
</ul></li>
- <li><p>If the <code title=dom-HitRegionOptions-parent>parent</code> member is not
- null but <var title="">parent region</var> is null, then throw a
- <code><a href=#notfounderror>NotFoundError</a></code> exception and abort these
- steps.</li>
+ <li><p>If the <code title=dom-HitRegionOptions-parent>parent</code> member is not null but <var title="">parent region</var> is null, then throw a <code><a href=#notfounderror>NotFoundError</a></code> exception and abort
+ these steps.</li>
<li>
@@ -37442,8 +37354,8 @@
<li>
- <p>Let <var title="">region</var> be a newly created <a href=#hit-region>hit
- region</a>, with its information configured as follows:</p>
+ <p>Let <var title="">region</var> be a newly created <a href=#hit-region>hit region</a>, with its
+ information configured as follows:</p>
<dl><dt><a href="#hit-region's-set-of-pixels">Hit region's set of pixels</a>
@@ -37452,23 +37364,21 @@
<dt><a href="#hit-region's-bounding-circumference">Hit region's bounding circumference</a>
- <dd><p>A user-agent-defined shape that wraps the pixels contained
- in <var title="">source path</var>. (In the simplest case, this
- can just be the bounding rectangle; this specification allows it
- to be any shape in order to allow other interfaces.)
+ <dd><p>A user-agent-defined shape that wraps the pixels contained in <var title="">source
+ path</var>. (In the simplest case, this can just be the bounding rectangle; this specification
+ allows it to be any shape in order to allow other interfaces.)
<dt><a href="#hit-region's-id">Hit region's ID</a>
- <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-id>id</code> member is not null: the
- value of the <code title=dom-HitRegionOptions-id>id</code>
- member. Otherwise, <var title="">region</var> has no <a href="#hit-region's-id" title="hit region's id">id</a>.
+ <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-id>id</code> member is not null: the value of the <code title=dom-HitRegionOptions-id>id</code> member. Otherwise, <var title="">region</var> has no
+ <a href="#hit-region's-id" title="hit region's id">id</a>.
<dt><a href="#hit-region's-parent">Hit region's parent</a>
- <dd><p>If <var title="">parent region</var> is not null: <var title="">parent region</var>. Otherwise, <var title="">region</var> has no <a href="#hit-region's-parent" title="hit region's
- parent">parent</a>.
+ <dd><p>If <var title="">parent region</var> is not null: <var title="">parent region</var>.
+ Otherwise, <var title="">region</var> has no <a href="#hit-region's-parent" title="hit region's parent">parent</a>.
<dt><a href="#hit-region's-child-count">Hit region's child count</a>
@@ -37478,67 +37388,53 @@
<dt><a href="#hit-region's-cursor-specification">Hit region's cursor specification</a>
- <dd><p>If <var title="">parent region</var> is not null: <var title="">parent region</var>. Otherwise, <var title="">region</var> has no <a href="#hit-region's-parent" title="hit region's
- parent">parent</a>.
+ <dd><p>If <var title="">parent region</var> is not null: <var title="">parent region</var>.
+ Otherwise, <var title="">region</var> has no <a href="#hit-region's-parent" title="hit region's parent">parent</a>.
<dt><a href="#hit-region's-control">Hit region's control</a>
- <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> member is not
- null: the value of the <code title=dom-HitRegionOptions-control>control</code> member.
- Otherwise, <var title="">region</var> has no <a href="#hit-region's-control" title="hit
- region's control">control</a>.
+ <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> member is not null: the value of the <code title=dom-HitRegionOptions-control>control</code> member. Otherwise, <var title="">region</var> has no <a href="#hit-region's-control" title="hit region's control">control</a>.
<dt><a href="#hit-region's-label">Hit region's label</a>
- <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-label>label</code> member is not
- null: the value of the <code title=dom-HitRegionOptions-label>label</code> member.
- Otherwise, <var title="">region</var> has no <a href="#hit-region's-label" title="hit
- region's label">label</a>.
+ <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-label>label</code> member is not null: the value of the <code title=dom-HitRegionOptions-label>label</code> member. Otherwise, <var title="">region</var>
+ has no <a href="#hit-region's-label" title="hit region's label">label</a>.
<dt><a href="#hit-region's-aria-role">Hit region's ARIA role</a>
- <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-role>role</code> member is not null:
- the value of the <code title=dom-HitRegionOptions-role>role</code> member (which might
- be the empty string). Otherwise, if the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-label>label</code> member is not
- null: the empty string. Otherwise, <var title="">region</var> has
- no <a href="#hit-region's-aria-role" title="hit region's ARIA role">ARIA role</a>.
+ <dd><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-role>role</code> member is not null: the value of the <code title=dom-HitRegionOptions-role>role</code> member (which might be the empty string).
+ Otherwise, if the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-label>label</code> member is not null: the empty string.
+ Otherwise, <var title="">region</var> has no <a href="#hit-region's-aria-role" title="hit region's ARIA role">ARIA
+ role</a>.
</dl></li>
<li>
- <p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-cursor>cursor</code> member is not
- null, then act as if a CSS rule for the <code><a href=#the-canvas-element>canvas</a></code>
- element setting its 'cursor' property had been seen, whose value
- was the <a href="#hit-region's-cursor-specification">hit region's cursor specification</a>.</p>
+ <p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-cursor>cursor</code> member is not null, then act as if a CSS rule
+ for the <code><a href=#the-canvas-element>canvas</a></code> element setting its 'cursor' property had been seen, whose value was
+ the <a href="#hit-region's-cursor-specification">hit region's cursor specification</a>.</p>
- <p class=note>For example, if the user agent prefetches cursor
- values, this would cause that to happen in response to an
- appropriately-formed <code title=dom-context-2d-addHitRegion><a href=#dom-context-2d-addhitregion>addHitRegion()</a></code>
- call.</p>
+ <p class=note>For example, if the user agent prefetches cursor values, this would cause that
+ to happen in response to an appropriately-formed <code title=dom-context-2d-addHitRegion><a href=#dom-context-2d-addhitregion>addHitRegion()</a></code> call.</p>
</li>
- <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> member is not
- null, then let <var title="">previous region for the control</var>
- be <a href=#the-region-representing-the-control>the region representing the control</a> given by the
- <code title=dom-HitRegionOptions-control>control</code> member's
- value for this <a href=#scratch-bitmap>scratch bitmap</a>, if any. If the <code title=dom-HitRegionOptions-control>control</code> member is null
- or no such region currently exists, let <var title="">previous
- region for the control</var> be null.</li>
+ <li><p>If the <var title="">arguments</var> object's <code title=dom-HitRegionOptions-control>control</code> member is not null, then let <var title="">previous region for the control</var> be <a href=#the-region-representing-the-control>the region representing the
+ control</a> given by the <code title=dom-HitRegionOptions-control>control</code> member's
+ value for this <a href=#scratch-bitmap>scratch bitmap</a>, if any. If the <code title=dom-HitRegionOptions-control>control</code> member is null or no such region currently
+ exists, let <var title="">previous region for the control</var> be null.</li>
- <!-- the parent region can't have a control, because no region with
- a control can be a parent - we check for that above. Thus, it is
- safe to remove the previous region for the control without worrying
- that our parent is going to be affected.
+ <!-- the parent region can't have a control, because no region with a control can be a parent -
+ we check for that above. Thus, it is safe to remove the previous region for the control without
+ worrying that our parent is going to be affected.
- It's also safe to remove the previous region with this ID and all
- its descendants, as we know that our parent isn't part of that
- subtree. -->
+ It's also safe to remove the previous region with this ID and all its descendants, as we know
+ that our parent isn't part of that subtree. -->
<li><p>If there is a <var title="">previous region with this control</var>, remove it from the
<a href=#scratch-bitmap>scratch bitmap</a>'s <a href=#hit-region-list>hit region list</a>; then, if it had a <a href="#hit-region's-parent" title="hit
@@ -37550,8 +37446,8 @@
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>If there is a <var title="">parent region</var>, increment
- its <a href="#hit-region's-child-count">hit region's child count</a> by one.</li>
+ <li><p>If there is a <var title="">parent region</var>, increment its <a href="#hit-region's-child-count">hit region's child
+ count</a> by one.</li>
<li><p><a href=#clear-regions-that-cover-the-pixels>Clear regions that cover the pixels</a> in <var title="">region</var>'s <a href="#hit-region's-set-of-pixels" title="hit region's set of pixels">set of pixels</a> on this <a href=#scratch-bitmap>scratch
bitmap</a>.</li> <!-- this is what garbage collects the earlier regions -->
Modified: source
===================================================================
--- source 2013-04-12 21:31:10 UTC (rev 7820)
+++ source 2013-04-12 21:58:09 UTC (rev 7821)
@@ -530,7 +530,10 @@
<p class="impl">This is an implementation requirement.</p>
+ <p>In an algorithm, steps in <span title="synchronous section">synchronous sections</span> are
+ marked with ⌛.</p>
+
<h3 id="fingerprint">Privacy concerns</h3>
<!--END dev-html--><p><i>This section is non-normative.</i></p><!--START dev-html-->
@@ -42575,279 +42578,231 @@
<hr>
- <p>The <dfn title="dom-path-addPath"><code>addPath(<var
- title="">b</var>, <var title="">transform</var>)</code></dfn>
- method, when invoked on a <code>Path</code> object <var
+ <p>The <dfn title="dom-path-addPath"><code>addPath(<var title="">b</var>, <var
+ title="">transform</var>)</code></dfn> method, when invoked on a <code>Path</code> object <var
title="">a</var>, must run the following steps:</p>
<ol>
- <li><p>If the <code>Path</code> object <var title="">b</var> has
- no subpaths, abort these steps.</p></li>
+ <li><p>If the <code>Path</code> object <var title="">b</var> has no subpaths, abort these
+ steps.</p></li>
- <li><p>Create a copy of all the subpaths in <var title="">b</var>.
- Let this copy be known as <var title="">c</var>.</p></li>
+ <li><p>Create a copy of all the subpaths in <var title="">b</var>. Let this copy be known as <var
+ title="">c</var>.</p></li>
- <li><p>Transform all the coordinates and lines in <var
- title="">c</var> by the transform matrix <var
- title="">transform</var>, if it is not null.</p></li>
+ <li><p>Transform all the coordinates and lines in <var title="">c</var> by the transform matrix
+ <var title="">transform</var>, if it is not null.</p></li>
- <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
- last point in the last subpath of <var title="">c</var>.</p></li>
+ <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the last point in the last subpath
+ of <var title="">c</var>.</p></li>
- <li><p>Add all the subpaths in <var title="">c</var> to <var
- title="">a</var>.</p></li>
+ <li><p>Add all the subpaths in <var title="">c</var> to <var title="">a</var>.</p></li>
- <li><p>Create a new subpath in <var title="">a</var> with (<var
- title="">x</var>, <var title="">y</var>) as the only point in the
- subpath.</p></li>
+ <li><p>Create a new subpath in <var title="">a</var> with (<var title="">x</var>, <var
+ title="">y</var>) as the only point in the subpath.</p></li>
</ol>
<hr>
- <p>The <dfn
- title="dom-path-addPathByStrokingPath"><code>addPathByStrokingPath(<var
- title="">b</var>, <var title="">styles</var>, <var
- title="">transform</var>)</code></dfn> method, when invoked on a
- <code>Path</code> object <var title="">a</var>, must run the
- following steps:</p>
+ <p>The <dfn title="dom-path-addPathByStrokingPath"><code>addPathByStrokingPath(<var
+ title="">b</var>, <var title="">styles</var>, <var title="">transform</var>)</code></dfn> method,
+ when invoked on a <code>Path</code> object <var title="">a</var>, must run the following
+ steps:</p>
<ol>
- <li><p>If the <code>Path</code> object <var title="">b</var> has
- no subpaths, abort these steps.</p></li>
+ <li><p>If the <code>Path</code> object <var title="">b</var> has no subpaths, abort these
+ steps.</p></li>
- <li><p>Create a copy of all the subpaths in <var title="">b</var>.
- Let this copy be known as <var title="">c</var>.</p></li>
+ <li><p>Create a copy of all the subpaths in <var title="">b</var>. Let this copy be known as <var
+ title="">c</var>.</p></li>
- <li><p>Transform all the coordinates and lines in <var
- title="">c</var> by transformation matrix <var
- title="">transform</var>, if it is not null.</p></li>
+ <li><p>Transform all the coordinates and lines in <var title="">c</var> by transformation matrix
+ <var title="">transform</var>, if it is not null.</p></li>
- <li><p>Let a new list of subpaths <var title="">d</var> be the
- result of <span title="trace a path">tracing</span> <var
- title="">c</var>, using the <var title="">styles</var> argument for
- the line styles.</p>
+ <li><p>Let a new list of subpaths <var title="">d</var> be the result of <span title="trace a
+ path">tracing</span> <var title="">c</var>, using the <var title="">styles</var> argument for the
+ line styles.</p>
- <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
- last point in the last subpath of <var title="">d</var>.</p></li>
+ <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the last point in the last subpath
+ of <var title="">d</var>.</p></li>
- <li><p>Add all the subpaths in <var title="">d</var> to <var
- title="">a</var>.</p></li>
+ <li><p>Add all the subpaths in <var title="">d</var> to <var title="">a</var>.</p></li>
- <li><p>Create a new subpath in <var title="">a</var> with (<var
- title="">x</var>, <var title="">y</var>) as the only point in the
- subpath.</p></li>
+ <li><p>Create a new subpath in <var title="">a</var> with (<var title="">x</var>, <var
+ title="">y</var>) as the only point in the subpath.</p></li>
</ol>
<hr>
- <p>The <dfn title="dom-path-addText"><code>addText()</code></dfn>
- and <dfn
- title="dom-path-addPathByStrokingText"><code>addPathByStrokingText()</code></dfn>
- methods each come in two variants: one rendering text at a given
- coordinate, and one rendering text along a given path. In both
- cases, the methods take a <code>CanvasDrawingStyles</code> object
- argument for the text and (if appropriate) line styles to use, an
- <code>SVGMatrix</code> object <var title="">transform</var> (which
- can be null), and a maximum width can optionally be provided.</p>
+ <p>The <dfn title="dom-path-addText"><code>addText()</code></dfn> and <dfn
+ title="dom-path-addPathByStrokingText"><code>addPathByStrokingText()</code></dfn> methods each
+ come in two variants: one rendering text at a given coordinate, and one rendering text along a
+ given path. In both cases, the methods take a <code>CanvasDrawingStyles</code> object argument for
+ the text and (if appropriate) line styles to use, an <code>SVGMatrix</code> object <var
+ title="">transform</var> (which can be null), and a maximum width can optionally be provided.</p>
- <p>When one of the <code
- title="dom-path-addText">addText()</code> and <code
- title="dom-path-addPathByStrokingText">addPathByStrokingText()</code> variants
- that take as argument an (<var title="">x</var>, <var
- title="">y</var>) coordinate is invoked, the method must run the
- following algorithm:</p>
+ <p>When one of the <code title="dom-path-addText">addText()</code> and <code
+ title="dom-path-addPathByStrokingText">addPathByStrokingText()</code> variants that take as
+ argument an (<var title="">x</var>, <var title="">y</var>) coordinate is invoked, the method must
+ run the following algorithm:</p>
<ol>
- <li><p>Run the <span>text preparation algorithm</span>, passing it
- <var title="">text</var>, the <code>CanvasDrawingStyles</code>
- object argument, and, if the <var title="">maxWidth</var> argument
- was provided, that argument. Let <var title="">glyphs</var> be the
- result.</p>
+ <li><p>Run the <span>text preparation algorithm</span>, passing it <var title="">text</var>, the
+ <code>CanvasDrawingStyles</code> object argument, and, if the <var title="">maxWidth</var>
+ argument was provided, that argument. Let <var title="">glyphs</var> be the result.</p>
- <li><p>Move all the shapes in <var title="">glyphs</var> to the
- right by <var title="">x</var> CSS pixels and down by <var
- title="">y</var> CSS pixels.</p></li>
+ <li><p>Move all the shapes in <var title="">glyphs</var> to the right by <var title="">x</var>
+ CSS pixels and down by <var title="">y</var> CSS pixels.</p></li>
- <li><p>Let <var title="">glyph subpaths</var> be a
- <span>path</span> describing the shapes given in <var
- title="">glyphs</var>, with each CSS pixel in the coordinate space
- of <var title="">glyphs</var> mapped to one coordinate space unit
- in <var title="">glyph subpaths</var>. Subpaths in <var
- title="">glyph subpaths</var> must wind clockwise, regardless of
- how the user agent's font subsystem renders fonts and regardless of
- how the fonts themselves are defined.</p>
+ <li><p>Let <var title="">glyph subpaths</var> be a <span>path</span> describing the shapes given
+ in <var title="">glyphs</var>, with each CSS pixel in the coordinate space of <var
+ title="">glyphs</var> mapped to one coordinate space unit in <var title="">glyph subpaths</var>.
+ Subpaths in <var title="">glyph subpaths</var> must wind clockwise, regardless of how the user
+ agent's font subsystem renders fonts and regardless of how the fonts themselves are defined.</p>
<li><p>If the method is <code
- title="dom-path-addPathByStrokingText">addPathByStrokingText()</code>,
- replace <var title="">glyph subpaths</var> by the result of <span
- title="trace a path">tracing</span> <var title="">glyph
- subpaths</var>, using the <code>CanvasDrawingStyles</code> object
- argument for the line styles.</p>
+ title="dom-path-addPathByStrokingText">addPathByStrokingText()</code>, replace <var
+ title="">glyph subpaths</var> by the result of <span title="trace a path">tracing</span> <var
+ title="">glyph subpaths</var>, using the <code>CanvasDrawingStyles</code> object argument for the
+ line styles.</p>
- <li><p>Transform all the coordinates and lines in <var
- title="">glyph subpaths</var> by the transformation matrix <var
- title="">transform</var>, if it is not null.</p></li>
+ <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the
+ transformation matrix <var title="">transform</var>, if it is not null.</p></li>
- <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var
- title="">y<sub title="">final</sub></var>) be the last point in the
- last subpath of <var title="">glyph subpaths</var>.</p></li>
+ <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub
+ title="">final</sub></var>) be the last point in the last subpath of <var title="">glyph
+ subpaths</var>.</p></li>
- <li><p>Add all the subpaths in <var title="">glyph
- subpaths</var> to the <code>Path</code> object.</p></li>
+ <li><p>Add all the subpaths in <var title="">glyph subpaths</var> to the <code>Path</code>
+ object.</p></li>
- <li><p>Create a new subpath in the <code>Path</code> object with
- (<var title="">x<sub title="">final</sub></var>, <var
- title="">y<sub title="">final</sub></var>) as the only point in the
- subpath.</p></li>
+ <li><p>Create a new subpath in the <code>Path</code> object with (<var title="">x<sub
+ title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) as the only point in
+ the subpath.</p></li>
</ol>
- <p>When one of the <code
- title="dom-path-addText">addText()</code> and <code
- title="dom-path-addPathByStrokingText">addPathByStrokingText()</code>
- variants that take as argument a <code>Path</code> object is
- invoked, the method must run the following algorithm:</p>
+ <p>When one of the <code title="dom-path-addText">addText()</code> and <code
+ title="dom-path-addPathByStrokingText">addPathByStrokingText()</code> variants that take as
+ argument a <code>Path</code> object is invoked, the method must run the following algorithm:</p>
<ol>
- <li><p>Let <var title="">target</var> be the <code>Path</code>
- object on which the method was invoked.</p></li>
+ <li><p>Let <var title="">target</var> be the <code>Path</code> object on which the method was
+ invoked.</p></li>
- <li><p>Let <var title="">path</var> be the <code>Path</code> object
- that was provided in the method's arguments.</p></li>
+ <li><p>Let <var title="">path</var> be the <code>Path</code> object that was provided in the
+ method's arguments.</p></li>
- <li><p>Run the <span>text preparation algorithm</span>, passing it
- <var title="">text</var>, the <code>CanvasDrawingStyles</code>
- object argument, and, if the <var title="">maxWidth</var> argument
- was provided, that argument. Let <var title="">glyphs</var> be the
- resulting array, and <var title="">physical alignment</var> be the
- resulting alignment value.</p>
+ <li><p>Run the <span>text preparation algorithm</span>, passing it <var title="">text</var>, the
+ <code>CanvasDrawingStyles</code> object argument, and, if the <var title="">maxWidth</var>
+ argument was provided, that argument. Let <var title="">glyphs</var> be the resulting array, and
+ <var title="">physical alignment</var> be the resulting alignment value.</p>
- <li><p>Let <var title="">width</var> be the aggregate length of all
- the subpaths in <var title="">path</var>, including the distances
- from the last point of each closed subpath to the first point of
- that subpath.</p></li>
+ <li><p>Let <var title="">width</var> be the aggregate length of all the subpaths in <var
+ title="">path</var>, including the distances from the last point of each closed subpath to the
+ first point of that subpath.</p></li>
- <li><p>Define <var title="">L</var> to be a linear coordinate line
- for of all the subpaths in <var title="">path</var>, with
- additional lines drawn between the last point and the first point
- of each closed subpath, such that the first point of the first
- subpath is defined as point 0, and the last point of the last
- subpath, if the last subpath is not closed, or the second
- occurrence first point of that subpath, if it is closed, is defined
- as point <var title="">width</var>.</p></li>
+ <li><p>Define <var title="">L</var> to be a linear coordinate line for of all the subpaths in
+ <var title="">path</var>, with additional lines drawn between the last point and the first point
+ of each closed subpath, such that the first point of the first subpath is defined as point 0, and
+ the last point of the last subpath, if the last subpath is not closed, or the second occurrence
+ first point of that subpath, if it is closed, is defined as point <var
+ title="">width</var>.</p></li>
<li>
- <p>Let <var title="">offset</var> be determined according to the
- appropriate step below:</p>
+ <p>Let <var title="">offset</var> be determined according to the appropriate step below:</p>
<dl class="switch">
- <dt>If <var title="">physical alignment</var> is <i>left</i></dt>
- <dd>Let <var title="">offset</var> be zero.</dd>
+ <dt>If <var title="">physical alignment</var> is <i>left</i></dt> <dd>Let <var
+ title="">offset</var> be zero.</dd>
- <dt>If <var title="">physical alignment</var> is <i>right</i></dt>
- <dd>Let <var title="">offset</var> be <var title="">width</var>.</dd>
+ <dt>If <var title="">physical alignment</var> is <i>right</i></dt> <dd>Let <var
+ title="">offset</var> be <var title="">width</var>.</dd>
- <dt>If <var title="">physical alignment</var> is <i title="">center</i></dt>
- <dd>Let <var title="">offset</var> be half of <var title="">width</var>.</dd>
+ <dt>If <var title="">physical alignment</var> is <i title="">center</i></dt> <dd>Let <var
+ title="">offset</var> be half of <var title="">width</var>.</dd>
</dl>
</li>
- <li><p>Move all the shapes in <var title="">glyphs</var> to the
- right by <var title="">offset</var> CSS pixels.</p></li>
+ <li><p>Move all the shapes in <var title="">glyphs</var> to the right by <var
+ title="">offset</var> CSS pixels.</p></li>
<li>
- <p>For each glyph <var title="">glyph</var> in the <var
- title="">glyphs</var> array, run these substeps:</p>
+ <p>For each glyph <var title="">glyph</var> in the <var title="">glyphs</var> array, run these
+ substeps:</p>
<ol>
- <li><p>Let <var title="">dx</var> be the <var
- title="">x</var>-coordinate of the horizontal center of the
- bounding box of the shape described by <var
- title="">glyph</var>, in CSS pixels.</p></li>
+ <li><p>Let <var title="">dx</var> be the <var title="">x</var>-coordinate of the horizontal
+ center of the bounding box of the shape described by <var title="">glyph</var>, in CSS
+ pixels.</p></li>
- <li><p>If <var title="">dx</var> is negative or greater than <var
- title="">width</var>, skip the remainder of these substeps for
- this glyph.</p></li>
+ <li><p>If <var title="">dx</var> is negative or greater than <var title="">width</var>, skip
+ the remainder of these substeps for this glyph.</p></li>
- <li><p>Recast <var title="">dx</var> to coordinate spaces units
- in <var title="">path</var>. (This just changes the
- dimensionality of <var title="">dx</var>, not its numeric
- value.)</p> <!-- hide this step if people get confused by the
- pedancy -->
+ <li><p>Recast <var title="">dx</var> to coordinate spaces units in <var title="">path</var>.
+ (This just changes the dimensionality of <var title="">dx</var>, not its numeric value.)</p>
+ <!-- hide this step if people get confused by the pedancy -->
- <li><p>Find the point <var title="">p</var> on <var
- title="">path</var> (or implied closing lines in <var
- title="">path</var>) that corresponds to the position <var
- title="">dx</var> on the coordinate line <var
- title="">L</var>.</p>
+ <li><p>Find the point <var title="">p</var> on <var title="">path</var> (or implied closing
+ lines in <var title="">path</var>) that corresponds to the position <var title="">dx</var> on
+ the coordinate line <var title="">L</var>.</p>
- <li><p>Let <var title="">θ</var> be the clockwise angle
- from the positive x-axis to the side of the line that is
- tangential to <var title="">path</var> at the point <var
- title="">p</var> that is going in the same direction as the line
- at point <var title="">p</var>.</p></li>
+ <li><p>Let <var title="">θ</var> be the clockwise angle from the positive x-axis to the
+ side of the line that is tangential to <var title="">path</var> at the point <var
+ title="">p</var> that is going in the same direction as the line at point <var
+ title="">p</var>.</p></li>
- <li><p>Rotate the shape described by <var title="">glyph</var>
- clockwise by <var title="">θ</var> about the point that is
- at the <var title="">dx</var> coordinate horizontally and the
- zero coordinate vertically.</p></li>
+ <li><p>Rotate the shape described by <var title="">glyph</var> clockwise by <var
+ title="">θ</var> about the point that is at the <var title="">dx</var> coordinate
+ horizontally and the zero coordinate vertically.</p></li>
- <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
- coordinate of the point <var title="">p</var>.</p></li>
+ <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the coordinate of the point <var
+ title="">p</var>.</p></li>
- <li><p>Move the shape described by <var title="">glyph</var> to
- the right by <var title="">x</var> and down by <var
- title="">y</var>.</p></li>
+ <li><p>Move the shape described by <var title="">glyph</var> to the right by <var
+ title="">x</var> and down by <var title="">y</var>.</p></li>
- <li><p>Let <var title="">glyph subpaths</var> be a list of
- subpaths describing the shape given in <var title="">glyph</var>,
- with each CSS pixel in the coordinate space of <var
- title="">glyph</var> mapped to one coordinate space unit in <var
- title="">glyph subpaths</var>. Subpaths in <var title="">glyph
- subpaths</var> must wind clockwise, regardless of how the user
- agent's font subsystem renders fonts and regardless of how the
- fonts themselves are defined.</p>
+ <li><p>Let <var title="">glyph subpaths</var> be a list of subpaths describing the shape given
+ in <var title="">glyph</var>, with each CSS pixel in the coordinate space of <var
+ title="">glyph</var> mapped to one coordinate space unit in <var title="">glyph subpaths</var>.
+ Subpaths in <var title="">glyph subpaths</var> must wind clockwise, regardless of how the user
+ agent's font subsystem renders fonts and regardless of how the fonts themselves are
+ defined.</p>
<li><p>If the method is <code
- title="dom-path-addPathByStrokingText">addPathByStrokingText()</code>,
- replace <var title="">glyph subpaths</var> by the result of <span
- title="trace a path">tracing</span> <var title="">glyph
- subpaths</var>, using the <code>CanvasDrawingStyles</code> object
- argument for the line styles.</p>
+ title="dom-path-addPathByStrokingText">addPathByStrokingText()</code>, replace <var
+ title="">glyph subpaths</var> by the result of <span title="trace a path">tracing</span> <var
+ title="">glyph subpaths</var>, using the <code>CanvasDrawingStyles</code> object argument for
+ the line styles.</p>
- <li><p>Transform all the coordinates and lines in <var
- title="">glyph subpaths</var> by the transformation matrix <var
- title="">transform</var>, if it is not null.</p></li>
+ <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the
+ transformation matrix <var title="">transform</var>, if it is not null.</p></li>
- <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var
- title="">y<sub title="">final</sub></var>) be the last point in
- the last subpath of <var title="">glyph subpaths</var>. (This
- coordinate is only used if this is the last glyph
- processed.)</p></li>
+ <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub
+ title="">final</sub></var>) be the last point in the last subpath of <var title="">glyph
+ subpaths</var>. (This coordinate is only used if this is the last glyph processed.)</p></li>
- <li><p>Add all the subpaths in <var title="">glyph subpaths</var>
- to <var title="">target</var>.</p></li>
+ <li><p>Add all the subpaths in <var title="">glyph subpaths</var> to <var
+ title="">target</var>.</p></li>
</ol>
</li>
- <li><p>Create a new subpath in the <code>Path</code> object with
- (<var title="">x<sub title="">final</sub></var>, <var
- title="">y<sub title="">final</sub></var>) as the only point in the
- subpath.</p></li>
+ <li><p>Create a new subpath in the <code>Path</code> object with (<var title="">x<sub
+ title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) as the only point in
+ the subpath.</p></li>
</ol>
@@ -42856,34 +42811,27 @@
<h6><dfn title="dom-context-2d-transformation">Transformations</dfn></h6>
- <p>Each <code>CanvasRenderingContext2D</code> object has a
- <i>current transformation matrix</i>, as well as methods (described
- in this section) to manipulate it. When a
- <code>CanvasRenderingContext2D</code> object is created, its
- transformation matrix must be initialized to the identity
- transform.</p>
+ <p>Each <code>CanvasRenderingContext2D</code> object has a <i>current transformation matrix</i>,
+ as well as methods (described in this section) to manipulate it. When a
+ <code>CanvasRenderingContext2D</code> object is created, its transformation matrix must be
+ initialized to the identity transform.</p>
- <p>The transformation matrix is applied to coordinates when creating
- the <span>current default path</span>, and when painting text,
- shapes, and <code>Path</code> objects, on
- <code>CanvasRenderingContext2D</code> objects.</p> <!-- conformance
- criteria for actual drawing are described in the various sections
- below -->
+ <p>The transformation matrix is applied to coordinates when creating the <span>current default
+ path</span>, and when painting text, shapes, and <code>Path</code> objects, on
+ <code>CanvasRenderingContext2D</code> objects.</p> <!-- conformance criteria for actual drawing
+ are described in the various sections below -->
- <p class="note">Most of the API uses <code>SVGMatrix</code> objects
- rather than this API. This API remains mostly for historical
- reasons.</p>
+ <p class="note">Most of the API uses <code>SVGMatrix</code> objects rather than this API. This API
+ remains mostly for historical reasons.</p>
<div class="impl">
<p>The transformations must be performed in reverse order.</p>
- <p class="note">For instance, if a scale transformation that doubles
- the width is applied to the canvas, followed by a rotation
- transformation that rotates drawing operations by a quarter turn,
- and a rectangle twice as wide as it is tall is then drawn on the
- canvas, the actual result will be a square.</p> <!-- q.v.
- http://goo.gl/5RLrN -->
+ <p class="note">For instance, if a scale transformation that doubles the width is applied to the
+ canvas, followed by a rotation transformation that rotates drawing operations by a quarter turn,
+ and a rectangle twice as wide as it is tall is then drawn on the canvas, the actual result will be
+ a square.</p> <!-- q.v. http://goo.gl/5RLrN -->
</div>
@@ -42951,48 +42899,37 @@
<div class="impl">
- <p>The <dfn
- title="dom-context-2d-currentTransform"><code>currentTransform</code></dfn>,
- on getting, must return the last object that it was set to. On
- setting, its value must be changed to the new value, and the
- transformation matrix must be updated to match the matrix described
- by the new value. When the <code>CanvasRenderingContext2D</code>
- object is created, the <code
- title="dom-context-2d-currentTransform">currentTransform</code>
- attribute must be set a newly created <code>SVGMatrix</code> object.
- When the transformation matrix is mutated by the methods described
- in this section, the last <code>SVGMatrix</code> object to which the
- attribute has been set must be mutated in a corresponding
- fashion.</p>
+ <p>The <dfn title="dom-context-2d-currentTransform"><code>currentTransform</code></dfn>, on
+ getting, must return the last object that it was set to. On setting, its value must be changed to
+ the new value, and the transformation matrix must be updated to match the matrix described by the
+ new value. When the <code>CanvasRenderingContext2D</code> object is created, the <code
+ title="dom-context-2d-currentTransform">currentTransform</code> attribute must be set a newly
+ created <code>SVGMatrix</code> object. When the transformation matrix is mutated by the methods
+ described in this section, the last <code>SVGMatrix</code> object to which the attribute has been
+ set must be mutated in a corresponding fashion.</p>
- <p>The <dfn title="dom-context-2d-scale"><code>scale(<var
- title="">x</var>, <var title="">y</var>)</code></dfn> method must
- add the scaling transformation described by the arguments to the
- transformation matrix. The <var title="">x</var> argument represents
- the scale factor in the horizontal direction and the <var
- title="">y</var> argument represents the scale factor in the
- vertical direction. The factors are multiples.</p>
+ <p>The <dfn title="dom-context-2d-scale"><code>scale(<var title="">x</var>, <var
+ title="">y</var>)</code></dfn> method must add the scaling transformation described by the
+ arguments to the transformation matrix. The <var title="">x</var> argument represents the scale
+ factor in the horizontal direction and the <var title="">y</var> argument represents the scale
+ factor in the vertical direction. The factors are multiples.</p>
- <p>The <dfn title="dom-context-2d-rotate"><code>rotate(<var
- title="">angle</var>)</code></dfn> method must add the rotation
- transformation described by the argument to the transformation
- matrix. The <var title="">angle</var> argument represents a
- clockwise rotation angle expressed in radians.</p>
+ <p>The <dfn title="dom-context-2d-rotate"><code>rotate(<var title="">angle</var>)</code></dfn>
+ method must add the rotation transformation described by the argument to the transformation
+ matrix. The <var title="">angle</var> argument represents a clockwise rotation angle expressed in
+ radians.</p>
- <p>The <dfn title="dom-context-2d-translate"><code>translate(<var
- title="">x</var>, <var title="">y</var>)</code></dfn> method must
- add the translation transformation described by the arguments to the
- transformation matrix. The <var title="">x</var> argument represents
- the translation distance in the horizontal direction and the <var
- title="">y</var> argument represents the translation distance in the
- vertical direction. The arguments are in coordinate space units.</p>
+ <p>The <dfn title="dom-context-2d-translate"><code>translate(<var title="">x</var>, <var
+ title="">y</var>)</code></dfn> method must add the translation transformation described by the
+ arguments to the transformation matrix. The <var title="">x</var> argument represents the
+ translation distance in the horizontal direction and the <var title="">y</var> argument represents
+ the translation distance in the vertical direction. The arguments are in coordinate space
+ units.</p>
- <p>The <dfn title="dom-context-2d-transform"><code>transform(<var
- title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var
- title="">d</var>, <var title="">e</var>, <var
- title="">f</var>)</code></dfn> method must replace the current
- transformation matrix with the result of multiplying the current
- transformation matrix with the matrix described by:</p>
+ <p>The <dfn title="dom-context-2d-transform"><code>transform(<var title="">a</var>, <var
+ title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>, <var
+ title="">f</var>)</code></dfn> method must replace the current transformation matrix with the
+ result of multiplying the current transformation matrix with the matrix described by:</p>
</div>
@@ -43014,37 +42951,27 @@
</tr>
</table>
- <p class="note">The arguments <var title="">a</var>, <var
- title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var
- title="">e</var>, and <var title="">f</var> are sometimes called
- <var title="">m11</var>, <var title="">m12</var>, <var
- title="">m21</var>, <var title="">m22</var>, <var title="">dx</var>,
- and <var title="">dy</var> or <var title="">m11</var>, <var
- title="">m21</var>, <var title="">m12</var>, <var
- title="">m22</var>, <var title="">dx</var>, and <var
- title="">dy</var>. Care should be taken in particular with the order
- of the second and third arguments (<var title="">b</var> and <var
- title="">c</var>) as their order varies from API to API and APIs
- sometimes use the notation <var title="">m12</var>/<var
- title="">m21</var> and sometimes <var title="">m21</var>/<var
- title="">m12</var> for those positions.</p>
+ <p class="note">The arguments <var title="">a</var>, <var title="">b</var>, <var title="">c</var>,
+ <var title="">d</var>, <var title="">e</var>, and <var title="">f</var> are sometimes called <var
+ title="">m11</var>, <var title="">m12</var>, <var title="">m21</var>, <var title="">m22</var>,
+ <var title="">dx</var>, and <var title="">dy</var> or <var title="">m11</var>, <var
+ title="">m21</var>, <var title="">m12</var>, <var title="">m22</var>, <var title="">dx</var>, and
+ <var title="">dy</var>. Care should be taken in particular with the order of the second and third
+ arguments (<var title="">b</var> and <var title="">c</var>) as their order varies from API to API
+ and APIs sometimes use the notation <var title="">m12</var>/<var title="">m21</var> and sometimes
+ <var title="">m21</var>/<var title="">m12</var> for those positions.</p>
<div class="impl">
- <p>The <dfn
- title="dom-context-2d-setTransform"><code>setTransform(<var
- title="">a</var>, <var title="">b</var>, <var
- title="">c</var>, <var title="">d</var>, <var title="">e</var>,
- <var title="">f</var>)</code></dfn> method must reset the current
- transform to the identity matrix, and then invoke the <code><span
- title="dom-context-2d-transform">transform</span>(<var
- title="">a</var>, <var title="">b</var>, <var
- title="">c</var>, <var title="">d</var>, <var title="">e</var>,
- <var title="">f</var>)</code> method with the same arguments.</p>
+ <p>The <dfn title="dom-context-2d-setTransform"><code>setTransform(<var title="">a</var>, <var
+ title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var title="">e</var>, <var
+ title="">f</var>)</code></dfn> method must reset the current transform to the identity matrix, and
+ then invoke the <code><span title="dom-context-2d-transform">transform</span>(<var
+ title="">a</var>, <var title="">b</var>, <var title="">c</var>, <var title="">d</var>, <var
+ title="">e</var>, <var title="">f</var>)</code> method with the same arguments.</p>
- <p>The <dfn
- title="dom-context-2d-resetTransform"><code>resetTransform()</code></dfn>
- method must reset the current transform to the identity matrix.</p>
+ <p>The <dfn title="dom-context-2d-resetTransform"><code>resetTransform()</code></dfn> method must
+ reset the current transform to the identity matrix.</p>
</div>
@@ -43090,9 +43017,11 @@
steps.</p></li>
<li><p>If the <var title="">image</var> argument is an <code>HTMLCanvasElement</code> object with
- either a horizontal dimension or a vertical dimension equal to zero, then the implementation
- throw an <code>InvalidStateError</code> exception and return <i>aborted</i>.</p>
+ either a horizontal dimension or a vertical dimension equal to zero, then throw an
+ <code>InvalidStateError</code> exception and return <i>aborted</i>.</p>
+ <li><p>Return <i>good</i>.</p></li>
+
</ol>
<p>When a <code>CanvasImageSource</code> object represents an <code>HTMLImageElement</code>, the
@@ -44771,31 +44700,24 @@
bitmap that surrounds the <span>hit region's set of pixels</span> as they stood when it was
created.</p></li>
-<!--CLEANUP-->
- <li><p>Optionally, a non-empty string representing an <dfn
- title="hit region's ID">ID</dfn> for distinguishing the region
- from others.</p></li>
+ <li><p>Optionally, a non-empty string representing an <dfn title="hit region's ID">ID</dfn> for
+ distinguishing the region from others.</p></li>
- <li><p>Optionally, a reference to another region that acts as the
- <dfn title="hit region's parent">parent</dfn> for this
- one.</p></li>
+ <li><p>Optionally, a reference to another region that acts as the <dfn title="hit region's
+ parent">parent</dfn> for this one.</p></li>
- <li><p>A count of regions that have this one as their <span
- title="hit region's parent">parent</span>, known as the <dfn>hit
- region's child count</dfn>.</p></li>
+ <li><p>A count of regions that have this one as their <span title="hit region's
+ parent">parent</span>, known as the <dfn>hit region's child count</dfn>.</p></li>
- <li><p>A <dfn title="hit region's cursor specification">cursor
- specification</dfn>, in the form of either a CSS cursor value, or
- the string "<code title="">inherit</code>" meaning that the cursor
- of the <span>hit region's parent</span>, if any, or of the
- <code>canvas</code> element, if not, is to be used
- instead.</p></li>
+ <li><p>A <dfn title="hit region's cursor specification">cursor specification</dfn>, in the form
+ of either a CSS cursor value, or the string "<code title="">inherit</code>" meaning that the
+ cursor of the <span>hit region's parent</span>, if any, or of the <code>canvas</code> element, if
+ not, is to be used instead.</p></li>
<li>
- <p>Optionally, either a <span title="hit region's
- control">control</span>, or an <span title="hit region's unbacked
- region description">unbacked region description</span>.</p>
+ <p>Optionally, either a <span title="hit region's control">control</span>, or an <span
+ title="hit region's unbacked region description">unbacked region description</span>.</p>
<p>A <dfn title="hit region's control">control</dfn> is just a reference to an
<code>Element</code> node, to which, in certain conditions, the user agent will route events,
@@ -44803,18 +44725,15 @@
accessibility tools. (The control is ignored when it is not a descendant of the
<code>canvas</code> element.)</p>
- <p>An <dfn title="hit region's unbacked region
- description">unbacked region description</dfn> consists of the
- following:</p>
+ <p>An <dfn title="hit region's unbacked region description">unbacked region description</dfn>
+ consists of the following:</p>
<ul class="brief">
- <li><p>Optionally, a <dfn title="hit region's
- label">label</dfn>.</p>
+ <li><p>Optionally, a <dfn title="hit region's label">label</dfn>.</p>
- <li><p>An <dfn title="hit region's ARIA role">ARIA role</dfn>,
- which, if the <span title="hit region's unbacked region
- description">unbacked region description</span> also has a label,
+ <li><p>An <dfn title="hit region's ARIA role">ARIA role</dfn>, which, if the <span title="hit
+ region's unbacked region description">unbacked region description</span> also has a label,
could be the empty string.</p></li>
</ul>
@@ -44835,10 +44754,10 @@
<dt><code title="dom-HitRegionOptions-path">path</code> (default null)
- <dd>A <code>Path</code> object that describes the pixels that
- form part of the region. If this member is not provided or is set
- to null, the <span>current default path</span> is used
+ <dd>A <code>Path</code> object that describes the pixels that form part of the region. If this
+ member is not provided or is set to null, the <span>current default path</span> is used
instead.</dd>
+
<!--
<dt><code title="dom-HitRegionOptions-transform">transform</code> (default null)
@@ -44846,44 +44765,41 @@
transformation to apply to the path described by the <code
title="dom-HitRegionOptions-path">path</code> member.</dd>
-->
+
<dt><code title="dom-HitRegionOptions-id">id</code> (default empty string)
- <dd>The ID to use for this region. This is used in
- <code>MouseEvent</code> events on the <code>canvas</code> (<code
- title="dom-MouseEvent-region">event.region</code>) and as a way
- to reference this region in later calls to <code
+ <dd>The ID to use for this region. This is used in <code>MouseEvent</code> events on the
+ <code>canvas</code> (<code title="dom-MouseEvent-region">event.region</code>) and as a way to
+ reference this region in later calls to <code
title="dom-context-2d-addHitRegion">addHitRegion()</code>.</dd>
<dt><code title="dom-HitRegionOptions-parentID">parentID</code> (default null)
- <dd>The ID of the parent region, for purposes of navigation by
- accessibility tools and for cursor fallback.</dd>
+ <dd>The ID of the parent region, for purposes of navigation by accessibility tools and for
+ cursor fallback.</dd>
<dt><code title="dom-HitRegionOptions-cursor">cursor</code> (default "<code title="">inherit</code>")
- <dd>The cursor to use when the mouse is over this region. The
- value "<code title="">inherit</code>" means to use the cursor for
- the parent region (as specified by the <code
- title="dom-HitRegionOptions-parentID">parentID</code> member), if
- any, or to use the <code>canvas</code> element's cursor if the
- region has no parent.</dd>
+ <dd>The cursor to use when the mouse is over this region. The value "<code
+ title="">inherit</code>" means to use the cursor for the parent region (as specified by the
+ <code title="dom-HitRegionOptions-parentID">parentID</code> member), if any, or to use the
+ <code>canvas</code> element's cursor if the region has no parent.</dd>
<dt><code title="dom-HitRegionOptions-control">control</code> (default null)
- <dd>An element (that is a descendant of the <code>canvas</code>)
- to which events are to be routed, and which accessibility tools
- are to use as a surrogate for describing and interacting with
- this region.</dd>
+ <dd>An element (that is a descendant of the <code>canvas</code>) to which events are to be
+ routed, and which accessibility tools are to use as a surrogate for describing and interacting
+ with this region.</dd>
<dt><code title="dom-HitRegionOptions-label">label</code> (default null)
- <dd>A text label for accessibility tools to use as a description
- of this region, if there is no control.</dd>
+ <dd>A text label for accessibility tools to use as a description of this region, if there is no
+ control.</dd>
<dt><code title="dom-HitRegionOptions-role">role</code> (default null)
- <dd>An ARIA role for accessibility tools to use to determine how
- to represent this region, if there is no control.</dd>
+ <dd>An ARIA role for accessibility tools to use to determine how to represent this region, if
+ there is no control.</dd>
</dl>
@@ -44891,20 +44807,18 @@
<ul>
- <li>With an ID, they can make hit detection easier by having the
- user agent check which region the mouse is over and include the
- ID in the mouse events.</li>
+ <li>With an ID, they can make hit detection easier by having the user agent check which region
+ the mouse is over and include the ID in the mouse events.</li>
- <li>With a control, they can make routing events to DOM elements
- automatic, allowing e.g. clicks on a <code>canvas</code> to automatically
- submit a form via a <code>button</code> element.</li>
+ <li>With a control, they can make routing events to DOM elements automatic, allowing e.g.
+ clicks on a <code>canvas</code> to automatically submit a form via a <code>button</code>
+ element.</li>
- <li>With a label, they can make it easier for users to explore a
- <code>canvas</code> without seeing it, e.g. by touch on a mobile device.</li>
+ <li>With a label, they can make it easier for users to explore a <code>canvas</code> without
+ seeing it, e.g. by touch on a mobile device.</li>
- <li>With a cursor, they can make it easier for different regions
- of the <code>canvas</code> to have different cursors, with the user agent
- automatically switching between them.</li>
+ <li>With a cursor, they can make it easier for different regions of the <code>canvas</code> to
+ have different cursors, with the user agent automatically switching between them.</li>
</ul>
@@ -44914,15 +44828,13 @@
<dd>
- <p>Removes a hit region (and all its descendants) from the canvas
- bitmap. The argument is the ID of a region added using <code
- title="dom-context-2d-addHitRegion">addHitRegion()</code>.</p>
+ <p>Removes a hit region (and all its descendants) 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>
+ <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>
@@ -44930,12 +44842,10 @@
<div class="impl">
- <p>A <span>hit region</span> <var title="">A</var> is an
- <dfn>ancestor region</dfn> of a <span>hit region</span> <var
- title="">B</var> if <var title="">B</var> has a <span title="hit
- region's parent">parent</span> and its <span title="hit region's
- parent">parent</span> is either <var title="">A</var> or another
- <span>hit region</span> for which <var title="">A</var> is an
+ <p>A <span>hit region</span> <var title="">A</var> is an <dfn>ancestor region</dfn> of a <span>hit
+ region</span> <var title="">B</var> if <var title="">B</var> has a <span title="hit region's
+ parent">parent</span> and its <span title="hit region's parent">parent</span> is either <var
+ title="">A</var> or another <span>hit region</span> for which <var title="">A</var> is an
<span>ancestor region</span>.</p>
<p><dfn>The region identified by the ID</dfn> <var title="">ID</var> in a bitmap <var
@@ -44944,17 +44854,14 @@
<ol>
- <li><p>If <var title="">ID</var> is null, return nothing and abort
- these steps.</p></li>
+ <li><p>If <var title="">ID</var> is null, return nothing and abort these steps.</p></li>
- <li><p>Let <var title="">list</var> be the <span>hit region
- list</span> associated with <var title="">bitmap</var>.</p></li>
+ <li><p>Let <var title="">list</var> be the <span>hit region list</span> associated with <var
+ title="">bitmap</var>.</p></li>
- <li><p>If there is a <span>hit region</span> in <var
- title="">list</var> whose <span title="hit region's ID">ID</span>
- is a <span>case-sensitive</span> match for <var title="">ID</var>,
- then return that <span>hit region</span> and abort these
- steps.</p></li>
+ <li><p>If there is a <span>hit region</span> in <var title="">list</var> whose <span title="hit
+ region's ID">ID</span> is a <span>case-sensitive</span> match for <var title="">ID</var>, then
+ return that <span>hit region</span> and abort these steps.</p></li>
<li><p>Otherwise, return nothing.</p></li>
@@ -44966,59 +44873,48 @@
<ol>
- <li><p>Let <var title="">list</var> be the <span>hit region
- list</span> associated with <var title="">bitmap</var>.</p></li>
+ <li><p>Let <var title="">list</var> be the <span>hit region list</span> associated with <var
+ title="">bitmap</var>.</p></li>
- <li><p>If there is a <span>hit region</span> in <var
- title="">list</var> whose <span title="hit region's
- control">control</span> is <var title="">control</var>, then
- return that <span>hit region</span> and abort these
- steps.</p></li>
+ <li><p>If there is a <span>hit region</span> in <var title="">list</var> whose <span title="hit
+ region's control">control</span> is <var title="">control</var>, then return that <span>hit
+ region</span> and abort these steps.</p></li>
<li><p>Otherwise, return nothing.</p></li>
</ol>
- <p><dfn>The control represented by a region</dfn> <var
- title="">region</var> for a <code>canvas</code> element <var
- title="">ancestor</var> is the value returned by the following
+ <p><dfn>The control represented by a region</dfn> <var title="">region</var> for a
+ <code>canvas</code> element <var title="">ancestor</var> is the value returned by the following
algorithm (which can return an element or nothing):</p>
<ol>
- <li><p>If <var title="">region</var> has no <span title="hit
- region's control">control</span>, return nothing and abort these
- steps.</p></li>
+ <li><p>If <var title="">region</var> has no <span title="hit region's control">control</span>,
+ return nothing and abort these steps.</p></li>
- <li><p>Let <var title="">control</var> be <var
- title="">region</var>'s <span title="hit region's
+ <li><p>Let <var title="">control</var> be <var title="">region</var>'s <span title="hit region's
control">control</span>.</p></li>
- <li><p>If <var title="">control</var> is not a descendant of <var
- title="">ancestor</var>, then return nothing and abort these
- steps.</p></li>
+ <li><p>If <var title="">control</var> is not a descendant of <var title="">ancestor</var>, then
+ return nothing and abort these steps.</p></li>
<li><p>Otherwise, return <var title="">control</var>.</p></li>
</ol>
- <p><dfn>The cursor for a hit region</dfn> <var
- title="">region</var> of a <code>canvas</code> element <var
- title="">ancestor</var> is the value returned by the following
- algorithm:</p>
+ <p><dfn>The cursor for a hit region</dfn> <var title="">region</var> of a <code>canvas</code>
+ element <var title="">ancestor</var> is the value returned by the following algorithm:</p>
<ol>
- <li><p><i>Loop</i>: If <var title="">region</var> has a <span
- title="hit region's cursor specification">cursor
- specification</span> other than "<code title="">inherit</code>",
- then return that <span>hit region's cursor specification</span>
- and abort these steps.</p></li>
+ <li><p><i>Loop</i>: If <var title="">region</var> has a <span title="hit region's cursor
+ specification">cursor specification</span> other than "<code title="">inherit</code>", then
+ return that <span>hit region's cursor specification</span> and abort these steps.</p></li>
- <li><p>If <var title="">region</var> has a <span title="hit
- region's parent">parent</span>, then let <var
- title="">region</var> be that <span>hit region's parent</span>,
- and return to the step labeled <i>loop</i>.</p></li>
+ <li><p>If <var title="">region</var> has a <span title="hit region's parent">parent</span>, then
+ let <var title="">region</var> be that <span>hit region's parent</span>, and return to the step
+ labeled <i>loop</i>.</p></li>
<li><p>Otherwise, return the used value of the 'cursor' property for the <code>canvas</code>
element, if any; if there isn't one, return 'auto'. <a href="#refsCSSUI">[CSSUI]</a></p></li>
@@ -45034,11 +44930,9 @@
<li><p>Let <var title="">list</var> be the <span>hit region list</span> associated with <var
title="">bitmap</var>.</p></li>
- <li><p>If there is a <span>hit region</span> in <var
- title="">list</var> whose <span title="hit region's set of
- pixels">set of pixels</span> contains <var title="">pixel</var>,
- then return that <span>hit region</span> and abort these
- steps.</p></li>
+ <li><p>If there is a <span>hit region</span> in <var title="">list</var> whose <span title="hit
+ region's set of pixels">set of pixels</span> contains <var title="">pixel</var>, then return that
+ <span>hit region</span> and abort these steps.</p></li>
<li><p>Otherwise, return nothing.</p></li>
@@ -45052,12 +44946,11 @@
<li><p>Let <var title="">list</var> be the <span>hit region list</span> associated with <var
title="">bitmap</var>.</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>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="">bitmap</var>.</p></li>
+ <li><p><span>Garbage-collect the regions</span> of <var title="">bitmap</var>.</p></li>
</ol>
@@ -45069,19 +44962,15 @@
<li><p>Let <var title="">list</var> be the <span>hit region list</span> associated with <var
title="">bitmap</var>.</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
- pixels</span> and a zero <span title="hit region's child
- count">child count</span>, if any. If there is no such <span>hit
- region</span>, abort these steps.</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
+ pixels</span> and a zero <span title="hit region's child count">child count</span>, if any. If
+ there is no such <span>hit region</span>, abort these steps.</p></li>
- <li><p>If <var title="">victim</var> has a <span title="hit
- region's parent">parent</span>, then decrement that <span>hit
- region's child count</span> by one.</p></li>
+ <li><p>If <var title="">victim</var> has a <span title="hit region's parent">parent</span>, then
+ decrement that <span>hit region's child count</span> by one.</p></li>
- <li><p>Remove <var title="">victim</var> from <var
- title="">list</var>.</p></li>
+ <li><p>Remove <var title="">victim</var> from <var title="">list</var>.</p></li>
<li><p>Jump back to the step labeled <i>loop</i>.</p></li>
@@ -45095,21 +44984,20 @@
<hr>
- <p>When the <dfn
- title="dom-context-2d-addHitRegion"><code>addHitRegion()</code></dfn>
- method is invoked, the user agent must run the following steps:</p>
+ <p>When the <dfn title="dom-context-2d-addHitRegion"><code>addHitRegion()</code></dfn> method is
+ invoked, the user agent must run the following steps:</p>
<ol>
- <li><p>Let <var title="">arguments</var> be the dictionary object
- provided as the method's argument.</p></li>
+ <li><p>Let <var title="">arguments</var> be the dictionary object provided as the method's
+ argument.</p></li>
<li><p>If the <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-path">path</code> member is not null,
- let <var title="">source path</var> be the <code
- title="dom-HitRegionOptions-path">path</code> member's value.
- Otherwise, let it be the <code>CanvasRenderingContext2D</code>
- object's <span>current default path</span>.</p></li>
+ title="dom-HitRegionOptions-path">path</code> member is not null, let <var title="">source
+ path</var> be the <code title="dom-HitRegionOptions-path">path</code> member's value. Otherwise,
+ let it be the <code>CanvasRenderingContext2D</code> object's <span>current default
+ path</span>.</p></li>
+
<!--
<li><p>If the <var title="">arguments</var> object's <code
title="dom-HitRegionOptions-path">path</code> member is null, but
@@ -45123,49 +45011,41 @@
title="dom-HitRegionOptions-transform">transform</code> member, if
it is not null.</p></li>
-->
- <li><p>Transform all the coordinates and lines in <var
- title="">source path</var> by the current transform matrix, if the
- <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-path">path</code> member is not
- null.</p></li>
+ <li><p>Transform all the coordinates and lines in <var title="">source path</var> by the current
+ transform matrix, if the <var title="">arguments</var> object's <code
+ title="dom-HitRegionOptions-path">path</code> member is not null.</p></li>
+
<li><p>If the <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-id">id</code> member is the
- empty string, let it be null instead.</p></li>
+ title="dom-HitRegionOptions-id">id</code> member is the empty string, let it be null
+ instead.</p></li>
<li><p>If the <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-id">id</code> member is not null, then
- let <var title="">previous region for this ID</var> be <span>the
- region identified by the ID</span> given by the <code
- title="dom-HitRegionOptions-id">id</code> member's value in this
- <span>scratch bitmap</span>, if any. If the <code
- title="dom-HitRegionOptions-id">id</code> member is null or no such
- region currently exists, let <var title="">previous region for this
- ID</var> be null.</p></li>
+ title="dom-HitRegionOptions-id">id</code> member is not null, then let <var title="">previous
+ region for this ID</var> be <span>the region identified by the ID</span> given by the <code
+ title="dom-HitRegionOptions-id">id</code> member's value in this <span>scratch bitmap</span>, if
+ any. If the <code title="dom-HitRegionOptions-id">id</code> member is null or no such region
+ currently exists, let <var title="">previous region for this ID</var> be null.</p></li>
<li><p>If the <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-parent">parent</code> member is the
- empty string, let it be null instead.</p></li>
+ title="dom-HitRegionOptions-parent">parent</code> member is the empty string, let it be null
+ instead.</p></li>
<li><p>If the <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-parent">parent</code> member is not
- null, then let <var title="">parent region</var> be <span>the
- region identified by the ID</span> given by the <code
- title="dom-HitRegionOptions-parent">parent</code> member's value in
- the <span>scratch bitmap</span>, if any. If the <code
- title="dom-HitRegionOptions-parent">parent</code> member is null or
- no such region currently exists, let <var title="">parent
- region</var> be null.</p></li>
+ title="dom-HitRegionOptions-parent">parent</code> member is not null, then let <var
+ title="">parent region</var> be <span>the region identified by the ID</span> given by the <code
+ title="dom-HitRegionOptions-parent">parent</code> member's value in the <span>scratch
+ bitmap</span>, if any. If the <code title="dom-HitRegionOptions-parent">parent</code> member is
+ null or no such region currently exists, let <var title="">parent region</var> be null.</p></li>
<li><p>If the <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-label">label</code> member is the
- empty string, let it be null instead.</p></li>
+ title="dom-HitRegionOptions-label">label</code> member is the empty string, let it be null
+ instead.</p></li>
<li>
- <p>If any of the following conditions are met, throw a
- <code>NotSupportedError</code> exception and abort these
- steps.</p>
+ <p>If any of the following conditions are met, throw a <code>NotSupportedError</code> exception
+ and abort these steps.</p>
<ul class="brief">
<!--
@@ -45174,56 +45054,48 @@
its <code title="dom-HitRegionOptions-transform">transform</code>
member is not.</li>
-->
+
<li>The <var title="">arguments</var> object's <code
title="dom-HitRegionOptions-control">control</code> and <code
- title="dom-HitRegionOptions-label">label</code> members are both
- non-null.</li>
+ title="dom-HitRegionOptions-label">label</code> members are both non-null.</li>
<li>The <var title="">arguments</var> object's <code
title="dom-HitRegionOptions-control">control</code> and <code
- title="dom-HitRegionOptions-role">role</code> members are both
- non-null.</li>
+ title="dom-HitRegionOptions-role">role</code> members are both non-null.</li>
<li>The <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-role">role</code> member's value is
- the empty string, and the <code
- title="dom-HitRegionOptions-label">label</code> member's value is
- either null or the empty string.</li>
+ title="dom-HitRegionOptions-role">role</code> member's value is the empty string, and the <code
+ title="dom-HitRegionOptions-label">label</code> member's value is either null or the empty
+ string.</li>
- <li>The <span>path</span> <var title="">source path</var>
- describes a shape with no pixels.</li>
+ <li>The <span>path</span> <var title="">source path</var> describes a shape with no
+ pixels.</li>
<li>The <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-control">control</code> member is not
- null but is neither an <code>a</code> element that
- <span>represents</span> a <span>hyperlink</span>, a
- <code>button</code> element, an <code>input</code> element whose
- <code title="attr-input-type">type</code> attribute is in one of
- the <span title="attr-input-type-checkbox">Checkbox</span> or
- <span title="attr-input-type-radio">Radio Button</span> states,
- nor an <code>input</code> element that is a <span
+ title="dom-HitRegionOptions-control">control</code> member is not null but is neither an
+ <code>a</code> element that <span>represents</span> a <span>hyperlink</span>, a
+ <code>button</code> element, an <code>input</code> element whose <code
+ title="attr-input-type">type</code> attribute is in one of the <span
+ title="attr-input-type-checkbox">Checkbox</span> or <span title="attr-input-type-radio">Radio
+ Button</span> states, nor an <code>input</code> element that is a <span
title="concept-button">button</span>.</li>
- <li>The <var title="">parent region</var> is not null but has a
- <span title="hit region's control">control</span>.</li>
+ <li>The <var title="">parent region</var> is not null but has a <span title="hit region's
+ control">control</span>.</li>
- <li>The <var title="">previous region for this ID</var> is the
- same <span>hit region</span> as the <var title="">parent
- region</var>.</li>
+ <li>The <var title="">previous region for this ID</var> is the same <span>hit region</span> as
+ the <var title="">parent region</var>.</li>
- <li>The <var title="">previous region for this ID</var> is an
- <span>ancestor region</span> of the <var title="">parent
- region</var>.</li>
+ <li>The <var title="">previous region for this ID</var> is an <span>ancestor region</span> of
+ the <var title="">parent region</var>.</li>
</ul>
</li>
- <li><p>If the <code
- title="dom-HitRegionOptions-parent">parent</code> member is not
- null but <var title="">parent region</var> is null, then throw a
- <code>NotFoundError</code> exception and abort these
- steps.</p></li>
+ <li><p>If the <code title="dom-HitRegionOptions-parent">parent</code> member is not null but <var
+ title="">parent region</var> is null, then throw a <code>NotFoundError</code> exception and abort
+ these steps.</p></li>
<li>
@@ -45249,8 +45121,8 @@
<li>
- <p>Let <var title="">region</var> be a newly created <span>hit
- region</span>, with its information configured as follows:</p>
+ <p>Let <var title="">region</var> be a newly created <span>hit region</span>, with its
+ information configured as follows:</p>
<dl>
@@ -45261,27 +45133,23 @@
<dt><span>Hit region's bounding circumference</span>
- <dd><p>A user-agent-defined shape that wraps the pixels contained
- in <var title="">source path</var>. (In the simplest case, this
- can just be the bounding rectangle; this specification allows it
- to be any shape in order to allow other interfaces.)
+ <dd><p>A user-agent-defined shape that wraps the pixels contained in <var title="">source
+ path</var>. (In the simplest case, this can just be the bounding rectangle; this specification
+ allows it to be any shape in order to allow other interfaces.)
<dt><span>Hit region's ID</span>
<dd><p>If the <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-id">id</code> member is not null: the
- value of the <code title="dom-HitRegionOptions-id">id</code>
- member. Otherwise, <var title="">region</var> has no <span
- title="hit region's id">id</span>.
+ title="dom-HitRegionOptions-id">id</code> member is not null: the value of the <code
+ title="dom-HitRegionOptions-id">id</code> member. Otherwise, <var title="">region</var> has no
+ <span title="hit region's id">id</span>.
<dt><span>Hit region's parent</span>
- <dd><p>If <var title="">parent region</var> is not null: <var
- title="">parent region</var>. Otherwise, <var
- title="">region</var> has no <span title="hit region's
- parent">parent</span>.
+ <dd><p>If <var title="">parent region</var> is not null: <var title="">parent region</var>.
+ Otherwise, <var title="">region</var> has no <span title="hit region's parent">parent</span>.
<dt><span>Hit region's child count</span>
@@ -45291,43 +45159,35 @@
<dt><span>Hit region's cursor specification</span>
- <dd><p>If <var title="">parent region</var> is not null: <var
- title="">parent region</var>. Otherwise, <var
- title="">region</var> has no <span title="hit region's
- parent">parent</span>.
+ <dd><p>If <var title="">parent region</var> is not null: <var title="">parent region</var>.
+ Otherwise, <var title="">region</var> has no <span title="hit region's parent">parent</span>.
<dt><span>Hit region's control</span>
<dd><p>If the <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-control">control</code> member is not
- null: the value of the <code
- title="dom-HitRegionOptions-control">control</code> member.
- Otherwise, <var title="">region</var> has no <span title="hit
- region's control">control</span>.
+ title="dom-HitRegionOptions-control">control</code> member is not null: the value of the <code
+ title="dom-HitRegionOptions-control">control</code> member. Otherwise, <var
+ title="">region</var> has no <span title="hit region's control">control</span>.
<dt><span>Hit region's label</span>
<dd><p>If the <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-label">label</code> member is not
- null: the value of the <code
- title="dom-HitRegionOptions-label">label</code> member.
- Otherwise, <var title="">region</var> has no <span title="hit
- region's label">label</span>.
+ title="dom-HitRegionOptions-label">label</code> member is not null: the value of the <code
+ title="dom-HitRegionOptions-label">label</code> member. Otherwise, <var title="">region</var>
+ has no <span title="hit region's label">label</span>.
<dt><span>Hit region's ARIA role</span>
<dd><p>If the <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-role">role</code> member is not null:
- the value of the <code
- title="dom-HitRegionOptions-role">role</code> member (which might
- be the empty string). Otherwise, if the <var
- title="">arguments</var> object's <code
- title="dom-HitRegionOptions-label">label</code> member is not
- null: the empty string. Otherwise, <var title="">region</var> has
- no <span title="hit region's ARIA role">ARIA role</span>.
+ title="dom-HitRegionOptions-role">role</code> member is not null: the value of the <code
+ title="dom-HitRegionOptions-role">role</code> member (which might be the empty string).
+ Otherwise, if the <var title="">arguments</var> object's <code
+ title="dom-HitRegionOptions-label">label</code> member is not null: the empty string.
+ Otherwise, <var title="">region</var> has no <span title="hit region's ARIA role">ARIA
+ role</span>.
</dl>
@@ -45337,37 +45197,30 @@
<li>
<p>If the <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-cursor">cursor</code> member is not
- null, then act as if a CSS rule for the <code>canvas</code>
- element setting its 'cursor' property had been seen, whose value
- was the <span>hit region's cursor specification</span>.</p>
+ title="dom-HitRegionOptions-cursor">cursor</code> member is not null, then act as if a CSS rule
+ for the <code>canvas</code> element setting its 'cursor' property had been seen, whose value was
+ the <span>hit region's cursor specification</span>.</p>
- <p class="note">For example, if the user agent prefetches cursor
- values, this would cause that to happen in response to an
- appropriately-formed <code
- title="dom-context-2d-addHitRegion">addHitRegion()</code>
- call.</p>
+ <p class="note">For example, if the user agent prefetches cursor values, this would cause that
+ to happen in response to an appropriately-formed <code
+ title="dom-context-2d-addHitRegion">addHitRegion()</code> call.</p>
</li>
<li><p>If the <var title="">arguments</var> object's <code
- title="dom-HitRegionOptions-control">control</code> member is not
- null, then let <var title="">previous region for the control</var>
- be <span>the region representing the control</span> given by the
- <code title="dom-HitRegionOptions-control">control</code> member's
+ title="dom-HitRegionOptions-control">control</code> member is not null, then let <var
+ title="">previous region for the control</var> be <span>the region representing the
+ control</span> given by the <code title="dom-HitRegionOptions-control">control</code> member's
value for this <span>scratch bitmap</span>, if any. If the <code
- title="dom-HitRegionOptions-control">control</code> member is null
- or no such region currently exists, let <var title="">previous
- region for the control</var> be null.</p></li>
+ title="dom-HitRegionOptions-control">control</code> member is null or no such region currently
+ exists, let <var title="">previous region for the control</var> be null.</p></li>
- <!-- the parent region can't have a control, because no region with
- a control can be a parent - we check for that above. Thus, it is
- safe to remove the previous region for the control without worrying
- that our parent is going to be affected.
+ <!-- the parent region can't have a control, because no region with a control can be a parent -
+ we check for that above. Thus, it is safe to remove the previous region for the control without
+ worrying that our parent is going to be affected.
- It's also safe to remove the previous region with this ID and all
- its descendants, as we know that our parent isn't part of that
- subtree. -->
+ It's also safe to remove the previous region with this ID and all its descendants, as we know
+ that our parent isn't part of that subtree. -->
<li><p>If there is a <var title="">previous region with this control</var>, remove it from the
<span>scratch bitmap</span>'s <span>hit region list</span>; then, if it had a <span title="hit
@@ -45380,8 +45233,8 @@
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>If there is a <var title="">parent region</var>, increment
- its <span>hit region's child count</span> by one.</p></li>
+ <li><p>If there is a <var title="">parent region</var>, increment its <span>hit region's child
+ count</span> by one.</p></li>
<li><p><span>Clear regions that cover the pixels</span> in <var title="">region</var>'s <span
title="hit region's set of pixels">set of pixels</span> on this <span>scratch
@@ -45392,8 +45245,7 @@
</ol>
- <p>When the <dfn
- title="dom-context-2d-removeHitRegion"><code>removeHitRegion()</code></dfn>
+ <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>
More information about the Commit-Watchers
mailing list