Bug 1356873 - Insert inline text nodes between open and close tags; r=gl

MozReview-Commit-ID: 9bWm0EP7Wrp

--HG--
extra : rebase_source : ca64ab2e20a77a828dd8da126ff2bfeb13032d88
This commit is contained in:
Patrick Brosset 2017-04-16 18:11:14 +02:00
parent ae977fa1ff
commit 475fa7b551
2 changed files with 5 additions and 2 deletions

View File

@ -75,6 +75,10 @@ function* checkNode(inspector, testActor, {desc, selector, inline, value}) {
if (inline) {
textContainer = container.elt.querySelector("pre");
ok(!!textContainer, "Text container is already rendered for inline text elements");
ok(textContainer.parentNode.previousSibling.classList.contains("open"),
"Text container is after the open tag");
ok(textContainer.parentNode.nextSibling.classList.contains("close"),
"Text container is before the close tag");
} else {
textContainer = container.elt.querySelector("pre");
ok(!textContainer, "Text container is not rendered for collapsed text nodes");

View File

@ -271,8 +271,7 @@ ElementEditor.prototype = {
// This editor won't receive an update automatically, so we rely on
// child text editors to let us know that we need updating.
this.textEditor = new TextEditor(this.container, node, "text");
this.elt.insertBefore(this.textEditor.elt,
this.elt.firstChild.nextSibling.nextSibling);
this.elt.insertBefore(this.textEditor.elt, this.elt.querySelector(".close"));
}
if (this.textEditor) {