summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-17 06:11:43 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-17 06:11:43 -0400
commit675dce947209afa61950777a7e13016604b3fdb1 (patch)
tree6be7d6ec2c5e799e330f238b643b3e79e0b2aa91
parent70c8ff8e5af7d2661b64fb92a158f2860af7766c (diff)
downloadUXP-675dce947209afa61950777a7e13016604b3fdb1.tar
UXP-675dce947209afa61950777a7e13016604b3fdb1.tar.gz
UXP-675dce947209afa61950777a7e13016604b3fdb1.tar.lz
UXP-675dce947209afa61950777a7e13016604b3fdb1.tar.xz
UXP-675dce947209afa61950777a7e13016604b3fdb1.zip
Bug 1382357 - Wait to destroy frames until after we've successfully fetched the binding
Tag #1375
-rw-r--r--dom/xbl/nsXBLService.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/dom/xbl/nsXBLService.cpp b/dom/xbl/nsXBLService.cpp
index 1475b1368..3f98eefe0 100644
--- a/dom/xbl/nsXBLService.cpp
+++ b/dom/xbl/nsXBLService.cpp
@@ -115,7 +115,15 @@ public:
if (!doc)
return;
- // Destroy the frames for mBoundElement.
+ // Get the binding.
+ bool ready = false;
+ nsXBLService::GetInstance()->BindingReady(mBoundElement, mBindingURI, &ready);
+ if (!ready)
+ return;
+
+ // 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.
nsIContent* destroyedFramesFor = nullptr;
nsIPresShell* shell = doc->GetShell();
if (shell) {
@@ -123,12 +131,6 @@ public:
}
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