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

Differential Revision: https://phabricator.services.mozilla.com/D62354

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Sean Feng 2020-03-17 14:53:58 +00:00
parent 908efe692e
commit 1d4b093969
3 changed files with 6 additions and 3 deletions

View File

@ -7798,7 +7798,8 @@ already_AddRefed<CDATASection> Document::CreateCDATASection(
return nullptr;
}
RefPtr<CDATASection> cdata = new CDATASection(mNodeInfoManager);
RefPtr<CDATASection> cdata =
new (mNodeInfoManager) CDATASection(mNodeInfoManager);
// Don't notify; this node is still being created.
cdata->SetText(aData, false);

View File

@ -23,7 +23,8 @@ bool CDATASection::IsNodeOfType(uint32_t aFlags) const { return false; }
already_AddRefed<CharacterData> CDATASection::CloneDataNode(
mozilla::dom::NodeInfo* aNodeInfo, bool aCloneText) const {
RefPtr<mozilla::dom::NodeInfo> ni = aNodeInfo;
RefPtr<CDATASection> it = new CDATASection(ni.forget());
auto* nim = ni->NodeInfoManager();
RefPtr<CDATASection> it = new (nim) CDATASection(ni.forget());
if (aCloneText) {
it->mText = mText;
}

View File

@ -1103,7 +1103,8 @@ nsXMLContentSink::HandleCDataSection(const char16_t* aData, uint32_t aLength) {
FlushText();
RefPtr<CDATASection> cdata = new CDATASection(mNodeInfoManager);
RefPtr<CDATASection> cdata =
new (mNodeInfoManager) CDATASection(mNodeInfoManager);
cdata->SetText(aData, aLength, false);
nsresult rv = AddContentAsLeaf(cdata);
DidAddContent();