mo-form-dynamic-002.html (2208B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <head> 4 <meta charset="utf-8"> 5 <title><mo> dynamic form</title> 6 <link rel="help" href="https://w3c.github.io/mathml-core/#operator-fence-separator-or-accent-mo"> 7 <meta name="assert" content="Verifies that the form (and thus spacing) can be changed dynamically"> 8 <link rel="match" href="mo-form-dynamic-002-ref.html"> 9 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 10 <style> 11 math, math * { 12 font: 60px/1 Ahem; 13 } 14 mo { 15 color: blue; 16 } 17 </style> 18 <script> 19 window.addEventListener("load", () => { 20 document.getElementById("infix_attach_prefix").setAttribute("form", "prefix"); 21 document.getElementById("prefix_attach_infix").setAttribute("form", "infix"); 22 document.getElementById("infix_remove").removeAttribute("form"); 23 document.getElementById("prefix_remove").removeAttribute("form"); 24 document.getElementById("infix_set_to_prefix").setAttribute("form", "prefix"); 25 document.getElementById("prefix_set_to_infix").setAttribute("form", "infix"); 26 document.documentElement.classList.remove("reftest-wait"); 27 }); 28 </script> 29 </head> 30 <body> 31 <!-- Prefix and infix forms of "+" have different default spacing in 32 the operator dictionary. --> 33 <p> 34 <math> 35 <mn>1</mn><mo id="infix_attach_prefix">+</mo><mn>2</mn> 36 </math> 37 </p> 38 <p> 39 <math> 40 <mo id="prefix_attach_infix">+</mo><mn>3</mn> 41 </math> 42 </p> 43 <p> 44 <math> 45 <mn>1</mn><mo id="infix_remove" form="prefix">+</mo><mn>2</mn> 46 </math> 47 </p> 48 <p> 49 <math> 50 <mo id="prefix_remove" form="infix">+</mo><mn>3</mn> 51 </math> 52 </p> 53 <p> 54 <math> 55 <mn>1</mn><mo id="infix_set_to_prefix" form="postfix">+</mo><mn>2</mn> 56 </math> 57 </p> 58 <p> 59 <math> 60 <mo id="prefix_set_to_infix" form="postfix">+</mo><mn>3</mn> 61 </math> 62 </p> 63 <script src="/mathml/support/feature-detection.js"></script> 64 <script>MathMLFeatureDetection.ensure_for_match_reftest("has_operator_spacing");</script> 65 </body> 66 </html>