replace-html.html (450B)
1 <!DOCTYPE html> 2 <html class="test-wait"> 3 <script> 4 5 onload = async () => { 6 const doc = document, 7 old_html = doc.documentElement, 8 new_html = doc.createElement("html"); 9 new_html.className = "test-wait"; 10 const transition = doc.startViewTransition(() => {}); 11 doc.replaceChild(new_html, old_html); 12 await transition.finished; 13 new_html.classList.remove('test-wait'); 14 old_html.classList.remove('test-wait'); 15 } 16 17 </script> 18 </html>