tor-browser

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

custom-highlight-font-metrics-001.html (1169B)


      1 <!DOCTYPE html>
      2 <meta charset="UTF-8">
      3 <title>CSS Highlight API Test: </title>
      4 <link rel="help" href="https://drafts.csswg.org/css-highlight-api-1/">
      5 <link rel="help" href="https://drafts.csswg.org/css-pseudo/#highlight-styling">
      6 <link rel="match" href="custom-highlight-font-metrics-001-ref.html">
      7 <meta name="assert" value="lengths depending on fonts take the correct values in a universal highlight">
      8 <meta name="fuzzy" content="0-80;0-4">
      9 <head>
     10  <style>
     11    :root {
     12      font-size: 16px;
     13    }
     14    div {
     15      margin: 50px;
     16      font-size: 40px;
     17    }
     18    #h2 {
     19      font-size: 20px;
     20    }
     21    ::highlight(highlight1) {
     22      text-underline-offset: 0.5em;
     23      text-decoration-line: underline;
     24      text-decoration-color: green;
     25      text-decoration-thickness: 0.25rem;
     26    }
     27  </style>
     28 </head>
     29 <body>
     30  <div id="h1">Font relative units with 40px font</div>
     31  <div id="h2">Font relative units with 20px font</div>
     32  <script>
     33    let r1 = new Range();
     34    r1.setStart(h1, 0);
     35    r1.setEnd(h1, 1);
     36    let r2 = new Range();
     37    r2.setStart(h2, 0);
     38    r2.setEnd(h2, 1);
     39    CSS.highlights.set("highlight1", new Highlight(r1, r2));
     40  </script>
     41 </body>
     42 </html>