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

@ -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;