mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 18:07:31 +09:00
Merge remote-tracking branch 'origin/master' into custom
This commit is contained in:
commit
bd793d6099
7 changed files with 47 additions and 79 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,14 +38,8 @@ GetCSSComputedValue(Element* aElem,
|
|||
return false;
|
||||
}
|
||||
|
||||
nsIPresShell* shell = doc->GetShell();
|
||||
if (!shell) {
|
||||
NS_WARNING("Unable to look up computed style -- no pres shell");
|
||||
return false;
|
||||
}
|
||||
|
||||
RefPtr<nsComputedDOMStyle> computedStyle =
|
||||
NS_NewComputedDOMStyle(aElem, EmptyString(), shell);
|
||||
NS_NewComputedDOMStyle(aElem, EmptyString(), doc);
|
||||
|
||||
computedStyle->GetPropertyValue(aPropID, aResult);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue