[html5] r8415 - [e] (0) More minor improvements to non-normative canvas text to make things clea [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Jan 21 15:41:08 PST 2014


Author: ianh
Date: 2014-01-21 15:41:07 -0800 (Tue, 21 Jan 2014)
New Revision: 8415

Modified:
   complete.html
   index
   source
Log:
[e] (0) More minor improvements to non-normative canvas text to make things clearer for authors.
Affected topics: Canvas

Modified: complete.html
===================================================================
--- complete.html	2014-01-21 23:34:02 UTC (rev 8414)
+++ complete.html	2014-01-21 23:41:07 UTC (rev 8415)
@@ -57720,6 +57720,7 @@
    }
 <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();
@@ -59054,14 +59055,16 @@
   <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>
 

Modified: index
===================================================================
--- index	2014-01-21 23:34:02 UTC (rev 8414)
+++ index	2014-01-21 23:41:07 UTC (rev 8415)
@@ -57720,6 +57720,7 @@
    }
 <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();
@@ -59054,14 +59055,16 @@
   <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>
 

Modified: source
===================================================================
--- source	2014-01-21 23:34:02 UTC (rev 8414)
+++ source	2014-01-21 23:41:07 UTC (rev 8415)
@@ -64179,6 +64179,7 @@
    }
 <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();
@@ -65782,14 +65783,17 @@
   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>
 




More information about the Commit-Watchers mailing list