Bug 1377999 - Make TextNode to adapt the DOMArena changes r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D62353
This commit is contained in:
Sean Feng
2020-03-17 14:53:54 +00:00
parent 26a255b849
commit fbd3ec536a
18 changed files with 45 additions and 33 deletions

View File

@@ -220,8 +220,8 @@ static already_AddRefed<Element> MakeAnonButton(Document* aDoc,
// Set the browse button text. It's a bit of a pain to do because we want to
// make sure we are not notifying.
RefPtr<nsTextNode> textContent =
new nsTextNode(button->NodeInfo()->NodeInfoManager());
RefPtr<nsTextNode> textContent = new (button->NodeInfo()->NodeInfoManager())
nsTextNode(button->NodeInfo()->NodeInfoManager());
textContent->SetText(buttonTxt, false);
@@ -267,7 +267,8 @@ nsresult nsFileControlFrame::CreateAnonymousContent(
// NOTE: SetIsNativeAnonymousRoot() has to be called before setting any
// attribute.
mTextContent->SetIsNativeAnonymousRoot();
RefPtr<nsTextNode> text = new nsTextNode(doc->NodeInfoManager());
RefPtr<nsTextNode> text =
new (doc->NodeInfoManager()) nsTextNode(doc->NodeInfoManager());
mTextContent->AppendChildTo(text, false);
// Update the displayed text to reflect the current element's value.