tor-browser

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

copy-paste-in-styled-inline-editing-host.https.html (1352B)


      1 <!doctype html>
      2 <html>
      3 <head>
      4 <meta charset="utf-8">
      5 <meta name="timeout" content="long">
      6 <title>Copying text in styled inline editing host should not duplicate the editing host</title>
      7 <script src="/resources/testharness.js"></script>
      8 <script src="/resources/testharnessreport.js"></script>
      9 <script src="/resources/testdriver.js"></script>
     10 <script src="/resources/testdriver-vendor.js"></script>
     11 <script src="/resources/testdriver-actions.js"></script>
     12 <script src="../include/editor-test-utils.js"></script>
     13 <script>
     14 "use strict";
     15 
     16 addEventListener("DOMContentLoaded", () => {
     17  promise_test(async () => {
     18    const editingHost = document.querySelector("span[contenteditable]");
     19    editingHost.focus();
     20    await test_driver.click(editingHost);
     21    const utils = new EditorTestUtils(editingHost);
     22    utils.setupEditingHost("ABC [DEF ]GHI");
     23    await utils.sendCopyShortcutKey();
     24    getSelection().collapse(editingHost.firstChild, editingHost.firstChild.length);
     25    await utils.sendPasteShortcutKey();
     26    assert_equals(
     27      editingHost.innerHTML.replace("&nbsp;", " "),
     28      "ABC DEF GHIDEF "
     29    );
     30  }, `Copying text in styled inline editing host should not duplicate the editing host`);
     31 }, {once: true});
     32 </script>
     33 </head>
     34 <body>
     35 <span contenteditable style="font-size:2em;font-weight:bold;border:1px solid">ABC</span><br>
     36 </body>
     37 </html>