diff options
Diffstat (limited to 'dom/base/nsGlobalWindow.cpp')
-rw-r--r-- | dom/base/nsGlobalWindow.cpp | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 1288b3435..47b46dda0 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -10950,35 +10950,12 @@ nsGlobalWindow::GetComputedStyleHelperOuter(Element& aElt, { MOZ_RELEASE_ASSERT(IsOuterWindow()); - if (!mDocShell) { + if (!mDoc) { return nullptr; } - nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell(); - - if (!presShell) { - // Try flushing frames on our parent in case there's a pending - // style change that will create the presshell. - auto* parent = nsGlobalWindow::Cast(GetPrivateParent()); - if (!parent) { - return nullptr; - } - - parent->FlushPendingNotifications(Flush_Frames); - - // Might have killed mDocShell - if (!mDocShell) { - return nullptr; - } - - presShell = mDocShell->GetPresShell(); - if (!presShell) { - return nullptr; - } - } - RefPtr<nsComputedDOMStyle> compStyle = - NS_NewComputedDOMStyle(&aElt, aPseudoElt, presShell, + NS_NewComputedDOMStyle(&aElt, aPseudoElt, mDoc, aDefaultStylesOnly ? nsComputedDOMStyle::eDefaultOnly : nsComputedDOMStyle::eAll); |