summaryrefslogtreecommitdiffstats
path: root/dom/xbl/nsXBLService.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-04-17 16:02:56 +0200
committerGitHub <noreply@github.com>2020-04-17 16:02:56 +0200
commitd5102d6beafc2a2a0cec3cc3ee5f7ebde31ae7bf (patch)
tree2bfef192cbb748b675ce8308c242a376798e265d /dom/xbl/nsXBLService.cpp
parent5caf99795aa81e1fc145b8e937b1ee8197ed2486 (diff)
parentf35aa3e15fedf3cd4ad163d60ab74a9537ca5c82 (diff)
downloadUXP-d5102d6beafc2a2a0cec3cc3ee5f7ebde31ae7bf.tar
UXP-d5102d6beafc2a2a0cec3cc3ee5f7ebde31ae7bf.tar.gz
UXP-d5102d6beafc2a2a0cec3cc3ee5f7ebde31ae7bf.tar.lz
UXP-d5102d6beafc2a2a0cec3cc3ee5f7ebde31ae7bf.tar.xz
UXP-d5102d6beafc2a2a0cec3cc3ee5f7ebde31ae7bf.zip
Merge pull request #1518 from MoonchildProductions/shadowdom-merge
Incremental shadowdom-merge
Diffstat (limited to 'dom/xbl/nsXBLService.cpp')
-rw-r--r--dom/xbl/nsXBLService.cpp38
1 files changed, 6 insertions, 32 deletions
diff --git a/dom/xbl/nsXBLService.cpp b/dom/xbl/nsXBLService.cpp
index 1475b1368..b50b2c6fe 100644
--- a/dom/xbl/nsXBLService.cpp
+++ b/dom/xbl/nsXBLService.cpp
@@ -115,45 +115,19 @@ public:
if (!doc)
return;
- // Destroy the frames for mBoundElement.
- nsIContent* destroyedFramesFor = nullptr;
- nsIPresShell* shell = doc->GetShell();
- if (shell) {
- shell->DestroyFramesFor(mBoundElement, &destroyedFramesFor);
- }
- MOZ_ASSERT(!mBoundElement->GetPrimaryFrame());
-
// Get the binding.
bool ready = false;
nsXBLService::GetInstance()->BindingReady(mBoundElement, mBindingURI, &ready);
if (!ready)
return;
- // If |mBoundElement| is (in addition to having binding |mBinding|)
- // also a descendant of another element with binding |mBinding|,
- // then we might have just constructed it due to the
- // notification of its parent. (We can know about both if the
- // binding loads were triggered from the DOM rather than frame
- // construction.) So we have to check both whether the element
- // has a primary frame and whether it's in the frame manager maps
- // before sending a ContentInserted notification, or bad things
- // will happen.
- MOZ_ASSERT(shell == doc->GetShell());
- if (shell) {
- nsIFrame* childFrame = mBoundElement->GetPrimaryFrame();
- if (!childFrame) {
- // Check to see if it's in the undisplayed content map...
- nsFrameManager* fm = shell->FrameManager();
- nsStyleContext* sc = fm->GetUndisplayedContent(mBoundElement);
- if (!sc) {
- // or in the display:contents map.
- sc = fm->GetDisplayContentsStyleFor(mBoundElement);
- }
- if (!sc) {
- shell->CreateFramesFor(destroyedFramesFor);
- }
- }
+ // Destroy the frames for mBoundElement. Do this after getting the binding,
+ // since if the binding fetch fails then we don't want to destroy the
+ // frames.
+ if (nsIPresShell* shell = doc->GetShell()) {
+ shell->DestroyFramesForAndRestyle(mBoundElement->AsElement());
}
+ MOZ_ASSERT(!mBoundElement->GetPrimaryFrame());
}
nsXBLBindingRequest(nsIURI* aURI, nsIContent* aBoundElement)