Bug 1953720 - In SetHTML create the inert document by inherting from the current document. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D241363
This commit is contained in:
@@ -5378,7 +5378,7 @@ void Element::SetHTML(const nsAString& aInnerHTML,
|
||||
ElementCreationOptionsOrString options;
|
||||
RefPtr<DocumentFragment> fragment;
|
||||
if (doc->IsHTMLDocument()) {
|
||||
inertDoc = nsContentUtils::CreateInertHTMLDocument(nullptr);
|
||||
inertDoc = nsContentUtils::CreateInertHTMLDocument(doc);
|
||||
if (!inertDoc) {
|
||||
aError = NS_ERROR_FAILURE;
|
||||
return;
|
||||
@@ -5392,7 +5392,7 @@ void Element::SetHTML(const nsAString& aInnerHTML,
|
||||
|
||||
} else {
|
||||
MOZ_ASSERT(doc->IsXMLDocument());
|
||||
inertDoc = nsContentUtils::CreateInertXMLDocument(nullptr);
|
||||
inertDoc = nsContentUtils::CreateInertXMLDocument(doc);
|
||||
if (!inertDoc) {
|
||||
aError = NS_ERROR_FAILURE;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user