tor-browser

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

custom-highlight-painting-002.html (713B)


      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-002-ref.html">
      6 <meta name="assert" value="Latest Highlight added to CSS.highlights has higher priority than the previous ones if there were no priorities explicitly set">
      7 <style>
      8  div::highlight(bar) {
      9    color: red;
     10  }
     11  div::highlight(foo) {
     12    color: green;
     13  }
     14 </style>
     15 <body><div>abc</div>
     16 <script>
     17  let div = document.body.firstChild;
     18  let r = new Range();
     19  r.setStart(div, 0);
     20  r.setEnd(div, 1);
     21  let h = new Highlight(r);
     22  CSS.highlights.set('foo', h);
     23  CSS.highlights.set('bar', h);
     24 </script>