function getImageDataURI() {
return document.getElementsByTagName("img")[0].getAttribute("src");
}
/** Test for Bug 1250010 **/
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(function() {
// First test: Empty paragraph is split correctly. vardiv = document.getElementById("test1"); div.focus();
synthesizeMouseAtCenter(div, {});
var sel = window.getSelection(); var selRange = sel.getRangeAt(0);
is(selRange.endContainer.nodeName, "#text", "selection should be at the end of text node");
is(selRange.endOffset, 10, "offset should be 10");
// Second test: Since we modified the code path that splits non-text nodes,
// test that this works, if the split node is not empty. div = document.getElementById("test2"); div.focus();
synthesizeMouseAtCenter(div, {});
selRange = sel.getRangeAt(0);
is(selRange.endContainer.nodeName, "#text", "selection should be at the end of text node");
is(selRange.endOffset, 3, "offset should be 3");
// Move behind the image and press enter, insert an "A".
// That should insert a new empty paragraph with the "A" after what we have.
synthesizeKey("KEY_ArrowRight");
synthesizeKey("KEY_ArrowRight");
synthesizeKey("KEY_Enter");
sendString("A");
// TODO: The <br> in the new paragraph and the paragraph containing the <img>
// should be removed at typing "A" because they are not necessary
// anymore to make the paragraphs visible (bug 503838).
const expectedHTML = "<p><tt>xyz</tt></p><p><tt><img src=\"" + getImageDataURI() + "\"><br></tt></p>" + "<p><tt>A</tt></p>";
is( div.innerHTML,
expectedHTML, "Pressing Enter after the <img> should create new paragraph and which contain <tt> and new text should be inserted in it"
);
SimpleTest.finish();
});
</script>
</body>
</html>
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.20 Sekunden
(vorverarbeitet am 2026-04-26)
¤
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.