selectall-and-find-svg-text-on-selectstart.html (500B)
1 <!doctype html> 2 <html class="test-wait"> 3 <head> 4 <meta charset="utf-8"> 5 <script> 6 addEventListener("DOMContentLoaded", () => { 7 let i = 5; 8 document.addEventListener("selectstart", () => { 9 window.find("AAA"); 10 document.querySelector("li").before(document.querySelector("text")); 11 if (!(--i)) { 12 document.documentElement.removeAttribute("class"); 13 } 14 }); 15 document.execCommand("selectAll"); 16 }, {once: true}); 17 </script> 18 <body> 19 <svg> 20 <text>AAA</text> 21 <li> 22 </li></svg></body> 23 </html>