test_html_in_mathml.html (1411B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>HTML in MathML Tests</title> 5 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 6 7 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 8 9 <script type="application/javascript" 10 src="../common.js"></script> 11 <script type="application/javascript" 12 src="../role.js"></script> 13 14 <script type="application/javascript"> 15 function doTest() { 16 // <label> is generally not valid in MathML and shouldn't create an HTMl 17 // label. 18 testAccessibleTree("invalidLabel", { 19 MATHML_MATH: [ { 20 TEXT_CONTAINER: [ { 21 TEXT_LEAF: [] 22 } ], 23 } ], 24 }); 25 26 // HTML is valid inside <mtext>, so <label> should create an HTMl label. 27 testAccessibleTree("validLabel", { 28 MATHML_MATH: [ { 29 MATHML_TEXT: [ { 30 LABEL: [ { 31 TEXT_LEAF: [] 32 } ], 33 } ], 34 } ], 35 }); 36 37 SimpleTest.finish(); 38 } 39 40 SimpleTest.waitForExplicitFinish(); 41 addA11yLoadEvent(doTest); 42 </script> 43 </head> 44 <body> 45 <p id="display"></p> 46 <div id="content" style="display: none"></div> 47 <pre id="test"> 48 </pre> 49 50 <math id="invalidLabel"> 51 <label>Text</label> 52 </math> 53 54 <math id="validLabel"> 55 <mtext> 56 <label>Text</label> 57 </mtext> 58 </math> 59 60 </body> 61 </html>