tor-browser

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

selection-attention-in-user-select-none-ref.html (785B)


      1 <!doctype html>
      2 <html>
      3 <head>
      4 <meta charset="utf-8">
      5 <title>Normal selection for the "Find in Page" result should be painted even if `user-select:none`</title>
      6 <script src="/tests/SimpleTest/SimpleTest.js"></script>
      7 <style></style>
      8 <script>
      9 "use strict";
     10 
     11 document.querySelector("style").textContent = `
     12  ::selection {
     13    color: ${SpecialPowers.getStringPref("ui.textSelectAttentionForeground")};
     14    background-color: ${SpecialPowers.getStringPref("ui.textSelectAttentionBackground")};
     15  }
     16 `;
     17 
     18 addEventListener("DOMContentLoaded", () => {
     19  // Select "THIS".
     20  getSelection().setBaseAndExtent(
     21    document.body.firstChild,
     22    "Look for ".length,
     23    document.body.firstChild,
     24    "Look for THIS".length
     25  );
     26 }, {once: true});
     27 </script>
     28 </head>
     29 <body>Look for THIS.</body>
     30 </html>