tor-browser

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

custom-highlight-painting-007.html (787B)


      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="match" href="custom-highlight-painting-001-ref.html">
      6 <meta name="assert" value="Highlight is repainted after adding a Range to it after registering it in the HighlightRegistry">
      7 <style>
      8  ::highlight(example-highlight) {
      9    background-color: yellow;
     10    color: blue;
     11  }
     12 </style>
     13 <body><span>One </span><span>two </span><span>three…</span>
     14 <script>
     15  let r1 = new Range();
     16  r1.setStart(document.body, 0);
     17  r1.setEnd(document.body, 1);
     18  let h = new Highlight(r1);
     19  let r2 = new Range();
     20  r2.setStart(document.body, 1);
     21  r2.setEnd(document.body, 2);
     22  CSS.highlights.set("example-highlight", h);
     23  h.add(r2);
     24 </script>