mo-no-vertical-adjustment-for-basic-binary-operators.html (1509B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>No vertical adjustment for basic binary operators</title> 4 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 5 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1890531" /> 6 <meta name="assert" content="Verify vertical alignement of basic binary operators is not adjusted to align their centers with the math axis."> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <script src="/mathml/support/fonts.js"></script> 10 <style> 11 @font-face { 12 font-family: operators; 13 /* AxisHeight == 0, so the math axis matches the baseline */ 14 src: url("/fonts/math/operators.woff"); 15 } 16 math { 17 font: 25px operators; 18 } 19 </style> 20 <math> 21 <mn id="ref">↯</mn> 22 <mo>+</mo><mo>=</mo><mo>*</mo><mo>−</mo><mo>≤</mo><mo>≥</mo><mo>×</mo> 23 </math> 24 <script> 25 promise_test(async () => { 26 await new Promise(r => { window.addEventListener("DOMContentLoaded", r) }); 27 await loadAllFonts(); 28 function centerOf(element) { 29 const box = element.getBoundingClientRect(); 30 return (box.top + box.bottom) / 2; 31 } 32 const ref = centerOf(document.getElementById("ref")); 33 const epsilon = 1; 34 Array.from(document.getElementsByTagName("mo")).forEach(mo => { 35 assert_approx_equals(centerOf(mo), ref, epsilon, 36 `Position of "${mo.textContent}"`); 37 }); 38 }, "Vertical alignment of basic binary operators is not adjusted."); 39 </script>