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

@@ -394,8 +394,8 @@ nsTextControlFrame::CreateEmptyAnonymousDivWithTextNode(
RefPtr<Element> divElement = CreateEmptyAnonymousDiv(aAnonymousDivType);
// Create the text node for the anonymous <div> element.
RefPtr<nsTextNode> textNode =
new nsTextNode(divElement->OwnerDoc()->NodeInfoManager());
RefPtr<nsTextNode> textNode = new (divElement->OwnerDoc()->NodeInfoManager())
nsTextNode(divElement->OwnerDoc()->NodeInfoManager());
// If the anonymous div element is not for the placeholder, we should
// mark the text node as "maybe modified frequently" for avoiding ASCII
// range checks at every input.
@@ -1257,8 +1257,8 @@ nsresult nsTextControlFrame::UpdateValueDisplay(bool aNotify,
Text* textContent;
if (!childContent) {
// Set up a textnode with our value
RefPtr<nsTextNode> textNode =
new nsTextNode(mContent->NodeInfo()->NodeInfoManager());
RefPtr<nsTextNode> textNode = new (mContent->NodeInfo()->NodeInfoManager())
nsTextNode(mContent->NodeInfo()->NodeInfoManager());
textNode->MarkAsMaybeModifiedFrequently();
if (IsPasswordTextControl()) {
textNode->MarkAsMaybeMasked();