diff --git a/dom/base/DocumentType.cpp b/dom/base/DocumentType.cpp index c0133bb1d8fc..e79475601fb5 100644 --- a/dom/base/DocumentType.cpp +++ b/dom/base/DocumentType.cpp @@ -27,8 +27,9 @@ already_AddRefed NS_NewDOMDocumentType( nsGkAtoms::documentTypeNodeName, nullptr, kNameSpaceID_None, nsINode::DOCUMENT_TYPE_NODE, aName); - RefPtr docType = new mozilla::dom::DocumentType( - ni.forget(), aPublicId, aSystemId, aInternalSubset); + RefPtr docType = + new (aNodeInfoManager) mozilla::dom::DocumentType( + ni.forget(), aPublicId, aSystemId, aInternalSubset); return docType.forget(); } @@ -75,8 +76,8 @@ void DocumentType::GetInternalSubset(nsAString& aInternalSubset) const { already_AddRefed DocumentType::CloneDataNode( mozilla::dom::NodeInfo* aNodeInfo, bool aCloneText) const { - return do_AddRef(new DocumentType(do_AddRef(aNodeInfo), mPublicId, mSystemId, - mInternalSubset)); + return do_AddRef(new (aNodeInfo->NodeInfoManager()) DocumentType( + do_AddRef(aNodeInfo), mPublicId, mSystemId, mInternalSubset)); } } // namespace dom