tor-browser

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

text-transform-math-auto-003.html (1380B)


      1 <!DOCTYPE html>
      2 <html>
      3  <head>
      4    <meta charset="utf-8"/>
      5    <title>text-transform math-auto</title>
      6    <link rel="help" href="https://w3c.github.io/mathml-core/#math-auto-transform">
      7    <link rel="help" href="https://w3c.github.io/mathml-core/#italic-mappings">
      8    <script src="/resources/testharness.js"></script>
      9    <script src="/resources/testharnessreport.js"></script>
     10    <script src="italic-mapping.js"></script>
     11    <meta name="assert" content="Verify Selection.toString() on a character with 'text-transform: math-auto' returns the transformed unicode character.">
     12    <style>
     13      #container {
     14        text-transform: math-auto;
     15      }
     16    </style>
     17  </head>
     18  <body>
     19    <span id="container"></span>
     20    <script>
     21      add_completion_callback(() => {
     22        container.remove();
     23      });
     24      for (let code_point in italic_mapping) {
     25        test(() => {
     26          container.textContent = String.fromCodePoint(code_point);
     27          window
     28            .getSelection()
     29            .setBaseAndExtent(container.firstChild, 0, container.firstChild, 1);
     30          assert_equals(
     31            window.getSelection().toString(),
     32            String.fromCodePoint(italic_mapping[code_point])
     33          );
     34        }, `Selection.toString() for math-auto '${String.fromCodePoint(code_point)}' returns the transformed character.`);
     35      }
     36    </script>
     37  </body>
     38 </html>