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

Quelle  test_bug1385905.html   Sprache: HTML

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


<!DOCTYPE html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi=id=1385905
-->

<html>
<head>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script src="/tests/SimpleTest/EventUtils.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1385905">Mozilla Bug 1385905</a>
<div id="display"></div>
<div id="editor" contenteditable style="padding: 5px;"><div>contents</div></div>
<pre id="test">
</pre>

<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(() => {
  function ensureNoPaddingBR() {
    for (let br of document.querySelectorAll("#editor > div > br")) {
      ok(!SpecialPowers.wrap(br).isPaddingForEmptyLastLine,
         "padding
element shouldn't be used with this test"
);
    }
  }
  document.execCommand("defaultparagraphseparator", false, "div");
  var editor = document.getElementById("editor");
  // Click the left blank area of the first line to set cursor to the start of "contents".
  synthesizeMouse(editor, 3, 10, {});
  synthesizeKey("KEY_Enter");
  is(editor.innerHTML, "

contents
"
,
     "Typing Enter at start of the
element should split the
element");
  synthesizeKey("KEY_ArrowUp");
  sendString("x");
  is(editor.innerHTML, "
x
contents
"
,
     "Typing 'x' at the empty
element should just insert 'x' into the
element");
  ensureNoPaddingBR();
  synthesizeKey("KEY_Enter");
  is(editor.innerHTML, "
x

contents
"
,
     "Typing Enter next to 'x' in the first
element should split the
element and inserts
element to a new
element");
  ensureNoPaddingBR();
  synthesizeKey("KEY_Enter");
  is(editor.innerHTML, "
x


contents
"
,
     "Typing Enter in the empty
should split the
element and inserts
element to a new
element");
  ensureNoPaddingBR();
  SimpleTest.finish();
});
</script>
</body>
</html>

100%


¤ Dauer der Verarbeitung: 0.16 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 ist noch experimentell.