tor-browser

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

designMode-caret-change.html (868B)


      1 <!doctype html>
      2 <html class="test-wait">
      3 <style>
      4 button {
      5  background-repeat: no-repeat;
      6 }
      7 *:last-child {
      8  opacity: 0;
      9  animation: kf ease-in, steps(65, start) 0.92 paused;
     10  border-radius: inherit
     11 }
     12 @keyframes kf {}
     13 </style>
     14 <script>
     15 let animationEnded = false;
     16 let selectionChanged = false;
     17 function maybeFinishTest() {
     18  if (animationEnded && selectionChanged) {
     19    requestAnimationFrame(() => requestAnimationFrame(() => {
     20      document.documentElement.className = "";
     21    }));
     22  }
     23 }
     24 document.addEventListener("DOMContentLoaded", () => {
     25  document.designMode = "on"
     26  window.onanimationend = () => {
     27    document.execCommand("insertHTML", false, "A")
     28    animationEnded = true;
     29    maybeFinishTest();
     30  }
     31  document.onselectionchange = () => {
     32    document.execCommand("selectAll", false)
     33    selectionChanged = true;
     34    maybeFinishTest();
     35  }
     36 })
     37 </script>