editing-host-has-only-invisible-br.html (888B)
1 <!doctype html> 2 <html class="reftest-wait"> 3 <head> 4 <meta charset="utf-8"> 5 <title>Caret should be rendered in the editing host which has no visible non-anonymous content</title> 6 <meta name="viewport" content="width=device-width,initial-scale=1"> 7 <link rel="match" href="editing-host-has-only-invisible-br-ref.html"> 8 <style> 9 div[contenteditable]::after { 10 content: "placeholder text"; 11 } 12 </style> 13 <script> 14 "use strict"; 15 16 addEventListener("load", async () => { 17 const editingHost = document.querySelector("div[contenteditable]"); 18 document.activeElement?.blur(); 19 const waitForFocus = new Promise(resolve => 20 editingHost.addEventListener("focus", resolve, {once: true}) 21 ); 22 editingHost.focus(); 23 await waitForFocus; 24 document.documentElement.removeAttribute("class"); 25 }, {once: true}); 26 </script> 27 </head> 28 <body> 29 <div contenteditable><br style="display:none"></div> 30 </body> 31 </html>