Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug

It would be convenient to get nsPresContext from nsIDocument.

MozReview-Commit-ID: Ei6V3UE8XGr
This commit is contained in:
Hiroyuki Ikezoe
2018-02-21 07:00:10 +09:00
parent ce3e2391a3
commit b1da8534e8
52 changed files with 198 additions and 416 deletions

View File

@@ -1951,15 +1951,12 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
// we're not leaving behind a pointer to ourselves as the PresContext's
// cached provider of the viewport's scrollbar styles.
if (document) {
nsIPresShell* presShell = document->GetShell();
if (presShell) {
nsPresContext* presContext = presShell->GetPresContext();
if (presContext) {
MOZ_ASSERT(this !=
presContext->GetViewportScrollbarStylesOverrideElement(),
"Leaving behind a raw pointer to this element (as having "
"propagated scrollbar styles) - that's dangerous...");
}
nsPresContext* presContext = document->GetPresContext();
if (presContext) {
MOZ_ASSERT(this !=
presContext->GetViewportScrollbarStylesOverrideElement(),
"Leaving behind a raw pointer to this element (as having "
"propagated scrollbar styles) - that's dangerous...");
}
}
#endif