inline-editing-host-has-placeholder-with-after-pseudo-element.html (927B)
1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Basic test for inline editing host which has placeholder text with pseudo-element</title> 6 <style> 7 [contenteditable]:empty::after { 8 content: "Type something"; 9 } 10 </style> 11 <script src=/resources/testharness.js></script> 12 <script src=/resources/testharnessreport.js></script> 13 <script> 14 "use strict"; 15 16 addEventListener("load", () => { 17 const editingHost = document.querySelector("span[contenteditable]"); 18 editingHost.focus(); 19 test(() => { 20 document.execCommand("insertText", false, "X"); 21 assert_equals(editingHost.innerHTML, "X"); 22 }, "The editing host should have inserted text"); 23 test(() => { 24 document.execCommand("delete"); 25 assert_equals(editingHost.innerHTML, ""); 26 }, "The editing host should have no text"); 27 }, {once: true}); 28 </script> 29 </head> 30 <body> 31 <span id="container"> 32 <span contenteditable="true"></span> 33 </span> 34 </body> 35 </html>