Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/events/test/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  test_bug1327798.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/events/test/test_bug1327798.html


<!DOCTYPE html>
<html>
<head>
<title>Test for bug 1327798</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?=id=1327798">Mozilla Bug 1327798</a>
<p id="display"></p>
<div id="content" style="display: none;"></div>

<div contenteditable="true" id="editable1"><b>Formatted Text</b><br></div>
<pre>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(() => {
  var editable = document.getElementById("editable1");
  editable.focus();

  window.getSelection().selectAllChildren(editable1);

  SpecialPowers.doCommand(window, "cmd_copy");

  //--------- now check the content of the clipboard
  var clipboard = SpecialPowers.Cc["@mozilla.org/widget/clipboard;1"]
                               .getService(SpecialPowers.Ci.nsIClipboard);
  // does the clipboard contain text/plain data ?
  ok(clipboard.hasDataMatchingFlavors(["text/plain"], clipboard.kGlobalClipboard),
     "clipboard contains unicode text");
  // does the clipboard contain text/html data ?
  ok(clipboard.hasDataMatchingFlavors(["text/html"], clipboard.kGlobalClipboard),
     "clipboard contains html text");

  window.addEventListener("paste", (e) => {
    is(e.clipboardData.types.indexOf('text/html'), -1, "clipboardData shouldn't have text/html");
    is(e.clipboardData.getData('text/plain'), "Formatted Text",  "getData(text/plain) should return plain text");
    SimpleTest.finish();
  });

  SpecialPowers.doCommand(window, "cmd_pasteNoFormatting");
});
</script>
</pre>
</body>
</html>

Messung V0.5
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.