diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /parser/html/nsHtml5TreeOperation.cpp | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'parser/html/nsHtml5TreeOperation.cpp')
-rw-r--r-- | parser/html/nsHtml5TreeOperation.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/parser/html/nsHtml5TreeOperation.cpp b/parser/html/nsHtml5TreeOperation.cpp index eb99869121..9adfad34bd 100644 --- a/parser/html/nsHtml5TreeOperation.cpp +++ b/parser/html/nsHtml5TreeOperation.cpp @@ -257,9 +257,10 @@ nsresult nsHtml5TreeOperation::Append(nsIContent* aNode, nsIContent* aParent, MOZ_ASSERT(aBuilder); MOZ_ASSERT(aBuilder->IsInDocUpdate()); ErrorResult rv; - nsHtml5OtherDocUpdate update(aParent->OwnerDoc(), aBuilder->GetDocument()); + Document* ownerDoc = aParent->OwnerDoc(); + nsHtml5OtherDocUpdate update(ownerDoc, aBuilder->GetDocument()); aParent->AppendChildTo(aNode, false, rv); - if (!rv.Failed()) { + if (!rv.Failed() && !ownerDoc->DOMNotificationsSuspended()) { aNode->SetParserHasNotified(); MutationObservers::NotifyContentAppended(aParent, aNode); } @@ -303,8 +304,10 @@ nsresult nsHtml5TreeOperation::AppendToDocument( return rv.StealNSResult(); } - aNode->SetParserHasNotified(); - MutationObservers::NotifyContentInserted(doc, aNode); + if (!doc->DOMNotificationsSuspended()) { + aNode->SetParserHasNotified(); + MutationObservers::NotifyContentInserted(doc, aNode); + } NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(), "Someone forgot to block scripts"); @@ -930,6 +933,7 @@ nsresult nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder, nsresult operator()(const opGetShadowRootFromHost& aOperation) { nsIContent* root = nsContentUtils::AttachDeclarativeShadowRoot( *aOperation.mHost, aOperation.mShadowRootMode, + aOperation.mShadowRootIsClonable, aOperation.mShadowRootDelegatesFocus); if (root) { *aOperation.mFragHandle = root; |