tor-browser

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

custom-highlight-container-metrics-002.html (1256B)


      1 <!DOCTYPE html>
      2 <meta charset="UTF-8">
      3 <title>CSS Highlight API Test: Highlights using container sizes</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="help" href="https://drafts.csswg.org/css-conditional-5/#container-lengths">
      7 <link rel="match" href="custom-highlight-container-metrics-002-ref.html">
      8 <meta name="assert" value="lengths depending on containers take the correct values inside and outside a container">
      9 <meta name="fuzzy" content="0-60;0-25">
     10 <head>
     11  <style>
     12    .wrapper {
     13      container: wrapper / size;
     14      width: 200px;
     15      height: 100px;
     16    }
     17    ::highlight(highlight1) {
     18      text-underline-offset: 2cqw;
     19      text-decoration-line: underline;
     20      text-decoration-color: green;
     21      text-decoration-thickness: 4cqh;
     22    }
     23 </style>
     24 </head>
     25 <body>
     26  <div class="wrapper">
     27    <div id="h1">With container size</div>
     28  </div>
     29  <div id="h2">Without container size</div>
     30  <script>
     31    let r1 = new Range();
     32    r1.setStart(h1, 0);
     33    r1.setEnd(h1, 1);
     34    let r2 = new Range();
     35    r2.setStart(h2, 0);
     36    r2.setEnd(h2, 1);
     37    CSS.highlights.set("highlight1", new Highlight(r1, r2));
     38  </script>
     39 </body>