Skip to content

Commit

Permalink
[e] (0) More minor improvements to non-normative canvas text to make …
Browse files Browse the repository at this point in the history
…things clearer for authors.

Affected topics: Canvas

git-svn-id: http://svn.whatwg.org/webapps@8415 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 21, 2014
1 parent 975376a commit 0931c58
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
15 changes: 9 additions & 6 deletions complete.html
Expand Up @@ -57720,6 +57720,7 @@ <h6 id=drawing-paths-to-the-canvas><span class=secno>4.12.4.2.13 </span>Drawing
}
<strong> context.beginPath();
context.rect(x-7, y-7, 12 + metrics.width+2, 14);
context.addHitRegion({ control: element });
if (paint &amp;&amp; context.drawCustomFocusRing(element)) {
context.strokeStyle = 'silver';
context.stroke();
Expand Down Expand Up @@ -59054,14 +59055,16 @@ <h6 id=best-practices><span class=secno>4.12.4.2.21 </span>Best practices</h6>
<p>When a canvas is interactive, authors should include focusable elements in the element's
fallback content corresponding to each focusable part of the canvas, as in the <a href=#drawCustomFocusRingExample>example above</a>.</p>

<p>To indicate which focusable part of the canvas is currently focused, authors should use the
<code title=dom-context-2d-drawSystemFocusRing><a href=#dom-context-2d-drawsystemfocusring>drawSystemFocusRing()</a></code> method, passing it
the element for which a ring is being drawn. This method only draws the focus ring if the element
is focused, so that it can simply be called whenever drawing the element, without checking whether
<p>To expose text and interactive content on a <code><a href=#the-canvas-element>canvas</a></code> to users of accessibility
tools, authors should use the <code title=dom-context-2d-addHitRegion><a href=#dom-context-2d-addhitregion>addHitRegion()</a></code>
API. When rendering focus rings, to ensure that focus rings have the appearance of native focus
rings, authors should use the <code title=dom-context-2d-drawSystemFocusRing><a href=#dom-context-2d-drawsystemfocusring>drawSystemFocusRing()</a></code> method, passing it the
element for which a ring is being drawn. This method only draws the focus ring if the element is
focused, so that it can simply be called whenever drawing the element, without checking whether
the element is focused or not first.</p>

<p>Authors should avoid implementing text editing controls using the <code><a href=#the-canvas-element>canvas</a></code> element.
Doing so has a large number of disadvantages:</p>
<p id=no-text-editing-in-canvas-please>Authors should avoid implementing text editing controls
using the <code><a href=#the-canvas-element>canvas</a></code> element. Doing so has a large number of disadvantages:</p>

<ul><li>Mouse placement of the caret has to be reimplemented.</li>

Expand Down
15 changes: 9 additions & 6 deletions index
Expand Up @@ -57720,6 +57720,7 @@ v6DVT (also check for '- -' bits in the part above) --><p>The <dfn id=dom-contex
}
<strong> context.beginPath();
context.rect(x-7, y-7, 12 + metrics.width+2, 14);
context.addHitRegion({ control: element });
if (paint &amp;&amp; context.drawCustomFocusRing(element)) {
context.strokeStyle = 'silver';
context.stroke();
Expand Down Expand Up @@ -59054,14 +59055,16 @@ function AddCloud(data, x, y) { ... }</pre>
<p>When a canvas is interactive, authors should include focusable elements in the element's
fallback content corresponding to each focusable part of the canvas, as in the <a href=#drawCustomFocusRingExample>example above</a>.</p>

<p>To indicate which focusable part of the canvas is currently focused, authors should use the
<code title=dom-context-2d-drawSystemFocusRing><a href=#dom-context-2d-drawsystemfocusring>drawSystemFocusRing()</a></code> method, passing it
the element for which a ring is being drawn. This method only draws the focus ring if the element
is focused, so that it can simply be called whenever drawing the element, without checking whether
<p>To expose text and interactive content on a <code><a href=#the-canvas-element>canvas</a></code> to users of accessibility
tools, authors should use the <code title=dom-context-2d-addHitRegion><a href=#dom-context-2d-addhitregion>addHitRegion()</a></code>
API. When rendering focus rings, to ensure that focus rings have the appearance of native focus
rings, authors should use the <code title=dom-context-2d-drawSystemFocusRing><a href=#dom-context-2d-drawsystemfocusring>drawSystemFocusRing()</a></code> method, passing it the
element for which a ring is being drawn. This method only draws the focus ring if the element is
focused, so that it can simply be called whenever drawing the element, without checking whether
the element is focused or not first.</p>

<p>Authors should avoid implementing text editing controls using the <code><a href=#the-canvas-element>canvas</a></code> element.
Doing so has a large number of disadvantages:</p>
<p id=no-text-editing-in-canvas-please>Authors should avoid implementing text editing controls
using the <code><a href=#the-canvas-element>canvas</a></code> element. Doing so has a large number of disadvantages:</p>

<ul><li>Mouse placement of the caret has to be reimplemented.</li>

Expand Down
16 changes: 10 additions & 6 deletions source
Expand Up @@ -64179,6 +64179,7 @@ v6DVT (also check for '- -' bits in the part above) -->
}
<strong> context.beginPath();
context.rect(x-7, y-7, 12 + metrics.width+2, 14);
context.addHitRegion({ control: element });
if (paint && context.drawCustomFocusRing(element)) {
context.strokeStyle = 'silver';
context.stroke();
Expand Down Expand Up @@ -65782,14 +65783,17 @@ function AddCloud(data, x, y) { ... }</pre>
fallback content corresponding to each focusable part of the canvas, as in the <a
href="#drawCustomFocusRingExample">example above</a>.</p>

<p>To indicate which focusable part of the canvas is currently focused, authors should use the
<code data-x="dom-context-2d-drawSystemFocusRing">drawSystemFocusRing()</code> method, passing it
the element for which a ring is being drawn. This method only draws the focus ring if the element
is focused, so that it can simply be called whenever drawing the element, without checking whether
<p>To expose text and interactive content on a <code>canvas</code> to users of accessibility
tools, authors should use the <code data-x="dom-context-2d-addHitRegion">addHitRegion()</code>
API. When rendering focus rings, to ensure that focus rings have the appearance of native focus
rings, authors should use the <code
data-x="dom-context-2d-drawSystemFocusRing">drawSystemFocusRing()</code> method, passing it the
element for which a ring is being drawn. This method only draws the focus ring if the element is
focused, so that it can simply be called whenever drawing the element, without checking whether
the element is focused or not first.</p>

<p>Authors should avoid implementing text editing controls using the <code>canvas</code> element.
Doing so has a large number of disadvantages:</p>
<p id="no-text-editing-in-canvas-please">Authors should avoid implementing text editing controls
using the <code>canvas</code> element. Doing so has a large number of disadvantages:</p>

<ul>

Expand Down

0 comments on commit 0931c58

Please sign in to comment.