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:
wolfbeast 2019-12-20 23:08:47 +01:00 committed by Roy Tam
commit 72b9aaa248
6 changed files with 47 additions and 74 deletions

View file

@ -569,11 +569,8 @@ CSSEditUtils::GetComputedStyle(Element* aElement)
nsIDocument* doc = aElement->GetUncomposedDoc();
NS_ENSURE_TRUE(doc, nullptr);
nsIPresShell* presShell = doc->GetShell();
NS_ENSURE_TRUE(presShell, nullptr);
RefPtr<nsComputedDOMStyle> style =
NS_NewComputedDOMStyle(aElement, EmptyString(), presShell);
NS_NewComputedDOMStyle(aElement, EmptyString(), doc);
return style.forget();
}