frac-created-dynamically-2.html (1883B)
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-2-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 mfrac = document.createElementNS("http://www.w3.org/1998/Math/MathML","mfrac"); 17 var mspace1 = document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace"); 18 mspace1.setAttribute("width", "50px"); 19 mspace1.setAttribute("height", "50px"); 20 mspace1.setAttribute("style", "background: black"); 21 var mspace2 = document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace"); 22 mspace2.setAttribute("width", "50px"); 23 mspace2.setAttribute("height", "50px"); 24 mspace2.setAttribute("style", "background: black"); 25 var mspace3 = document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace"); 26 mspace3.setAttribute("width", "50px"); 27 mspace3.setAttribute("height", "50px"); 28 mspace3.setAttribute("style", "background: black"); 29 document.getElementsByTagName("math")[0].appendChild(mfrac); 30 mfrac.appendChild(mspace1); 31 mfrac.appendChild(mspace2); 32 mfrac.appendChild(mspace3); 33 34 document.documentElement.classList.remove('reftest-wait'); 35 }); 36 </script> 37 </head> 38 <body> 39 <p>This test passes if it renders the same as an invalid fraction with 3 children.</p> 40 <math></math> 41 <script src="/mathml/support/feature-detection.js"></script> 42 <script>MathMLFeatureDetection.ensure_for_match_reftest("has_mfrac");</script> 43 </body> 44 </html>