author | Bobby Holley <bobbyholley@gmail.com> |
Wed, 19 Jul 2017 17:27:51 -0700 | |
changeset 369829 | 5a43e98b2000fa178b0454cb005dff11762340f4 |
parent 369828 | 06e2da701e49f5a474bac8a1e819b82ccac86dc6 |
child 369830 | 747035414236731b91080e801f393be22017a5b8 |
push id | 32208 |
push user | archaeopteryx@coole-files.de |
push date | Fri, 21 Jul 2017 09:12:51 +0000 |
treeherder | mozilla-central@0faada5c2f30 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | heycam |
bugs | 1382357 |
milestone | 56.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/xbl/nsXBLService.cpp +++ b/dom/xbl/nsXBLService.cpp @@ -111,30 +111,32 @@ public: void DocumentLoaded(nsIDocument* aBindingDoc) { // We only need the document here to cause frame construction, so // we need the current doc, not the owner doc. nsIDocument* doc = mBoundElement->GetUncomposedDoc(); 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) { 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