Bug 1344398 part 1: Move presContext variable a little earlier in a nsCSSFrameConstructor method. r=tnikkel

Also, assert that this presContext is non-null (which we already implicitly
assume, when we dereference it without null-checking it).

MozReview-Commit-ID: IIYUqGQTOnb

--HG--
extra : rebase_source : 67cbf91fb2fdeb46352559fb519693d6d13d3224
This commit is contained in:
Daniel Holbert 2017-05-10 13:53:25 -07:00
parent cc1d0f7c6c
commit 7cb2ea776a

View File

@ -8488,11 +8488,14 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
ServoRestyleManager::ClearServoDataFromSubtree(aChild->AsElement());
}
nsPresContext* presContext = mPresShell->GetPresContext();
MOZ_ASSERT(presContext, "Our presShell should have a valid presContext");
if (aChild->IsHTMLElement(nsGkAtoms::body) ||
(!aContainer && aChild->IsElement())) {
// This might be the element we propagated viewport scrollbar
// styles from. Recompute those.
mPresShell->GetPresContext()->UpdateViewportScrollbarStylesOverride();
presContext->UpdateViewportScrollbarStylesOverride();
}
// XXXldb Do we need to re-resolve style to handle the CSS2 + combinator and
@ -8554,7 +8557,6 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
ClearDisplayContentsIn(aChild, aContainer);
}
nsPresContext* presContext = mPresShell->GetPresContext();
#ifdef MOZ_XUL
if (NotifyListBoxBody(presContext, aContainer, aChild, aOldNextSibling,
childFrame, CONTENT_REMOVED)) {