test_mathml.html (1530B)
1 <html> 2 3 <head> 4 <title>MathML Text attributes tests</title> 5 <meta charset="utf-8"> 6 <link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 7 8 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 9 10 <script src="../common.js"></script> 11 <script src="../attributes.js"></script> 12 <script src="../events.js"></script> 13 14 <script> 15 function doTest() { 16 const math = getNode("math"); 17 const defAttrs = buildDefaultTextAttrs(math, "10pt"); 18 testDefaultTextAttrs(math, defAttrs); 19 20 for (const id of ["mn", "mi", "annotation", "annotationXml"]) { 21 testTextAttrs(id, 0, {}, defAttrs, 0, 1); 22 } 23 24 // These elements contain a surrogate pair, so the end offset is 2. 25 for (const id of ["mn_double_struck", "mi_italic"]) { 26 testTextAttrs(id, 0, {}, defAttrs, 0, 2); 27 } 28 29 SimpleTest.finish(); 30 } 31 32 SimpleTest.waitForExplicitFinish(); 33 addA11yLoadEvent(doTest); 34 </script> 35 </head> 36 <body style="font-size: 12pt"> 37 38 <p id="display"></p> 39 <div id="content" style="display: none"></div> 40 <pre id="test"> 41 </pre> 42 43 <math id="math" style="font-size: smaller"> 44 <mn id="mn">1</mn> 45 <mi id="mi" mathvariant="normal">x</mi> 46 <mn id="mn_double_struck">𝟙</mn> 47 <mi id="mi_italic">x</mi> 48 <!-- tabindex forces creation of an Accessible --> 49 <annotation id="annotation" tabindex="0">a</annotation> 50 <annotation-xml id="annotationXml" tabindex="0">a</annotation-xml> 51 </math> 52 53 </body> 54 </html>