tor-browser

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

inserttext-after-bold-in-font-face-monospace.html (1004B)


      1 <!doctype html>
      2 <html>
      3 <head>
      4 <meta charset="utf-8">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 </head>
      8 <body>
      9 <div contenteditable><div><br></div></div>
     10 <script>
     11 "use strict";
     12 
     13 const editingHost = document.querySelector("div[contenteditable]");
     14 test(() => {
     15  editingHost.focus();
     16  document.execCommand("fontName", false, "monospace");
     17  document.execCommand("insertText", false, "abc");
     18  document.execCommand("insertParagraph");
     19  document.execCommand("insertText", false, "def ");
     20  document.execCommand("bold");
     21  document.execCommand("insertText", false, "g");
     22  assert_in_array(
     23    editingHost.querySelector("div + div").innerHTML,
     24    // It's fine to convert the white-space at end of the `Text` in the <font>
     25    // for optimizing the deletion handler of following <b>.
     26    [
     27      '<font face="monospace">def <b>g</b></font>',
     28      '<font face="monospace">def&nbsp;<b>g</b></font>',
     29    ]
     30  );
     31 }, "");
     32 </script>
     33 </body>
     34 </html>