frac-created-dynamically-3.html (1236B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <head> 4 <meta charset="utf-8"> 5 <title>mfrac created dynamically</title> 6 <link rel="help" href="https://w3c.github.io/mathml-core/#fractions-mfrac"> 7 <link rel="help" href="https://w3c.github.io/mathml-core/#dom-and-javascript"> 8 <meta name="assert" content="A dynamically added mfrac should render like the equivalent markup."> 9 <link rel="match" href="frac-created-dynamically-3-ref.html"> 10 <script> 11 window.addEventListener("load", function() { 12 13 // force initial layout so we're sure what we're testing against 14 document.documentElement.getBoundingClientRect(); 15 16 var mn3 = document.createElementNS("http://www.w3.org/1998/Math/MathML","mn"); 17 mn3.appendChild(document.createTextNode("3")); 18 document.getElementsByTagName("mfrac")[0].appendChild(mn3); 19 document.getElementById("mn2").remove(); 20 21 document.documentElement.classList.remove('reftest-wait'); 22 }); 23 </script> 24 </head> 25 <body> 26 <p>This test passes if you see a fraction 1/3.</p> 27 <math> 28 <mfrac> 29 <mn>1</mn> 30 <mn id="mn2">2</mn> 31 </mfrac> 32 </math> 33 <script src="/mathml/support/feature-detection.js"></script> 34 <script>MathMLFeatureDetection.ensure_for_match_reftest("has_mfrac");</script> 35 </body> 36 </html>