function doTest() {
let t1 = SpecialPowers.wrap($("t1"));
// Test 1: Undo on an empty editor - the editor should not forget about
// the padding <br> element for empty editor.
let t1Editor = t1.editor;
// Did the editor recognize the new padding <br> element?
t1Editor.undo();
ok(!t1.value, " still recognized as padding on undo");
// Test 2: Redo on an empty editor - the editor should not forget about
// the padding <br> element for empty editor.
let t2 = SpecialPowers.wrap($("t2"));
let t2Editor = t2.editor;
// Did the editor recognize the new padding <br> element?
t2Editor.redo();
ok(!t2.value, " still recognized as padding on redo");
// Test 3: Undoing a batched transaction where both end points of the
// transaction are the padding <br> element for empty editor - the
// <br> element should still be recognized as padding.
t1Editor.beginTransaction();
t1.value = "mozilla";
t1.value = "";
t1Editor.endTransaction();
t1Editor.undo();
ok(!t1.value, "recreated from undo transaction recognized as padding");
// Test 4: Redoing a batched transaction where both end points of the
// transaction are the padding <br> element for empty editor - the
// <br> element should still be recognized padding.
t1Editor.redo();
ok(!t1.value, "recreated from redo transaction recognized as padding");
SimpleTest.finish();
}
</script>
</pre>
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.