Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/editor/libeditor/tests/     Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Impressum test_paste_clipboard_change.html  Sprache: HTML


 products/Sources/formale Sprachen/C/Firefox/editor/libeditor/tests/test_paste_clipboard_change.html


<!doctype html>
<html>
<head>
  <title>Test for clipboard content changes during the paste event handler</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<input type="text">
<div contenteditable="true"></div>
<script>
document.querySelectorAll("input, div[contenteditable]").forEach((element) => {
  add_task(async () => {
    info("test for " + element);
    info("Waiting for initializing clipboard...");
    await SimpleTest.promiseClipboardChange(
      "Original text",
      () => SpecialPowers.clipboardCopyString("Original text")
    );

    element.focus();
    element.addEventListener("paste", () => {
      // Overwrite the clipboard content.
      SpecialPowers.clipboardCopyString("New text");
    }, { once: true });
    SpecialPowers.doCommand(window, "cmd_paste");

    // Check content.
    is(element.isContentEditable ? element.textContent : element.value, "New text", "Check paste content");
  });
})
</script>
</body>
</html>

Messung
CHZG
899910096

¤ Dauer der Verarbeitung: 0.196 Sekunden  ¤

*Bot Zugriff