Give MathML-converted formula an HTML fallback for ATs.
authorCameron McCormack <cam@mcc.id.au>
Sat, 19 May 2012 11:53:23 +1000
changeset 108 b2b7c8420e88
parent 107 42787b381607
child 109 5b8404a7e25f
Give MathML-converted formula an HTML fallback for ATs.
master/painting.html
master/style/default_svg.css
--- a/master/painting.html	Fri May 18 16:18:56 2012 +1000
+++ b/master/painting.html	Sat May 19 11:53:23 2012 +1000
@@ -697,26 +697,29 @@
 related to the angle <var>θ</var> between the segments in user space by the
 formula:</p>
 
-<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
-  <mrow>
-    <mfrac>
-      <mi>miterLength</mi>
-      <mi>stroke-width</mi>
-    </mfrac>
-    <mo>=</mo>
-    <mfrac>
-      <mn>1</mn>
-      <mrow>
-        <mi>sin</mi>
-        <mo>&#x2061;</mo>
-        <mfrac>
-          <mi>θ</mi>
-          <mn>2</mn>
-        </mfrac>
-      </mrow>
-    </mfrac>
-  </mrow>
-</math>
+<div role="math" aria-describedby="math-miterlength">
+  <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+    <mrow>
+      <mfrac>
+        <mi>miterLength</mi>
+        <mi>stroke-width</mi>
+      </mfrac>
+      <mo>=</mo>
+      <mfrac>
+        <mn>1</mn>
+        <mrow>
+          <mi>sin</mi>
+          <mo>&#x2061;</mo>
+          <mfrac>
+            <mi>θ</mi>
+            <mn>2</mn>
+          </mfrac>
+        </mrow>
+      </mfrac>
+    </mrow>
+  </math>
+  <pre id="math-miterlength">miterLength / stroke-width = 1 / sin(theta / 2)</pre>
+</div>
 
 <p>For example, a miter limit of 1.414 converts miters to bevels for
 theta less than 90 degrees, a limit of 4.0 converts them for theta less
--- a/master/style/default_svg.css	Fri May 18 16:18:56 2012 +1000
+++ b/master/style/default_svg.css	Sat May 19 11:53:23 2012 +1000
@@ -233,6 +233,14 @@
    headings. */
 .chapter-divider { margin: 4em 0 }
 
+/* HTML-equivalent math for ATs. */
+div[role="math"] > :first-child ~ * {
+  position: absolute;
+  width: 400px;
+  left: -10000px;
+  overflow: hidden;
+}
+
 /*
  * Temporary styles for use only while the spec is in development:
  */