tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

displaystyle-3.html (2804B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <meta charset="utf-8">
      5 <title>displaystyle</title>
      6 <link rel="help" href="https://w3c.github.io/mathml-core/#css-styling">
      7 <link rel="help" href="https://w3c.github.io/mathml-core/#the-displaystyle-and-scriptlevel-attributes">
      8 <link rel="help" href="https://w3c.github.io/mathml-core/#the-math-style-property">
      9 <meta name="assert" content="Verify the displaystyle of the underover element is considered (not the one of its base) to determine whether to move limits.">
     10 <link rel="stylesheet" href="/fonts/ahem.css">
     11 <style>
     12  math, math *  {
     13    font-family: Ahem;
     14    font-size: 20px;
     15  }
     16 </style>
     17 <script src="/resources/testharness.js"></script>
     18 <script src="/resources/testharnessreport.js"></script>
     19 <script src="/mathml/support/feature-detection.js"></script>
     20 <script src="/mathml/support/fonts.js"></script>
     21 <script>
     22  setup({ explicit_done: true });
     23  window.addEventListener("load", () => { loadAllFonts().then(runTests); });
     24  function runTests() {
     25      ["munder", "mover", "munderover"].forEach((tag) => {
     26          Array.from(document.getElementsByTagName(tag)).forEach(e => {
     27              var displaystyle = e.getAttribute('displaystyle') === "true";
     28              test(function() {
     29                  assert_true(MathMLFeatureDetection.has_movablelimits());
     30                  var elementRight = e.getBoundingClientRect().right;
     31                  var baseRight = e.firstElementChild.getBoundingClientRect().right;
     32                  if (displaystyle)
     33                      assert_approx_equals(elementRight, baseRight, 1);
     34                  else
     35                      assert_greater_than(elementRight, baseRight + 10);
     36              }, `movablelimits for ${tag} element (displaystyle=${displaystyle})`);
     37          });
     38      });
     39      done();
     40  }
     41 </script>
     42 </head>
     43 <body>
     44  <div id="log"></div>
     45  <math>
     46    <munder displaystyle="false">
     47      <mo displaystyle="true" movablelimits="true">XX</mo>
     48      <mtext>X</mtext>
     49    </munder>
     50  </math>
     51  <math>
     52    <mover displaystyle="false">
     53      <mo displaystyle="true" movablelimits="true">XX</mo>
     54      <mtext>X</mtext>
     55    </mover>
     56  </math>
     57  <math>
     58    <munderover displaystyle="false">
     59      <mo displaystyle="true" movablelimits="true">XX</mo>
     60      <mtext>X</mtext>
     61      <mtext>X</mtext>
     62    </munderover>
     63  </math>
     64  <math>
     65    <munder displaystyle="true">
     66      <mo displaystyle="false" movablelimits="true">XX</mo>
     67      <mtext>X</mtext>
     68    </munder>
     69  </math>
     70  <math>
     71    <mover displaystyle="true">
     72      <mo displaystyle="false" movablelimits="true">XX</mo>
     73      <mtext>X</mtext>
     74    </mover>
     75  </math>
     76  <math>
     77    <munderover displaystyle="true">
     78      <mo displaystyle="false" movablelimits="true">XX</mo>
     79      <mtext>X</mtext>
     80      <mtext>X</mtext>
     81    </munderover>
     82  </math>
     83 </body>
     84 </html>