mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
Issue #1219 - Align computed DOM styles with mainstream behvior.
This updates our behavior for computed DOM styling to no longer return null on elements that have no display, but return a 0-length (empty) style instead and don't throw. For this we stop looking at having a presentation for the style and just look at the document instead. This resolves #1219
This commit is contained in:
parent
f24dcfdaa4
commit
72b9aaa248
6 changed files with 47 additions and 74 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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue