| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <title>Test the mphantom element</title> |
| <link rel="help" href="https://w3c.github.io/mathml-core/#making-sub-expressions-invisible-mphantom"> |
| <link rel="help" href="https://w3c.github.io/mathml-core/#user-agent-stylesheet"> |
| <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> |
| <meta name="assert" content="Verify default mphantom style and size."> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <style> |
| math { |
| font: 25px/1 Ahem; |
| } |
| </style> |
| </head> |
| <body> |
| <div id="log"></div> |
| <div> |
| <math> |
| <mrow id="reference"><mtext>AN ERROR</mtext></mrow> |
| <mphantom id="mphantom"><mtext>AN ERROR</mtext></mphantom> |
| </math> |
| </div> |
| <script> |
| setup({ explicit_done: true }); |
| document.fonts.ready.then(() => { |
| test(function () { |
| var style = window.getComputedStyle(document.getElementById("mphantom")); |
| assert_equals(style.visibility, "hidden"); |
| }, "Default CSS properties on mphantom"); |
| |
| test(function () { |
| var mphantomBox = document.getElementById("mphantom").getBoundingClientRect(); |
| var referenceBox = document.getElementById("reference").getBoundingClientRect(); |
| assert_equals(mphantomBox.width, referenceBox.width); |
| assert_equals(mphantomBox.height, referenceBox.height); |
| }, "Bounding box is the same as mrow"); |
| |
| done(); |
| }); |
| </script> |
| </body> |
| </html> |