diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-12-20 23:08:47 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-12-20 23:08:47 +0100 |
commit | d6baead6c8bcd90f04d62908bfaf73b369df4e6f (patch) | |
tree | 9d042110d977eea7839bc992d736fdfeb0462f44 /layout/style/nsComputedDOMStyle.h | |
parent | ce250e9ccfddff9cae496ed7ad01404fd7135291 (diff) | |
download | UXP-d6baead6c8bcd90f04d62908bfaf73b369df4e6f.tar UXP-d6baead6c8bcd90f04d62908bfaf73b369df4e6f.tar.gz UXP-d6baead6c8bcd90f04d62908bfaf73b369df4e6f.tar.lz UXP-d6baead6c8bcd90f04d62908bfaf73b369df4e6f.tar.xz UXP-d6baead6c8bcd90f04d62908bfaf73b369df4e6f.zip |
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
Diffstat (limited to 'layout/style/nsComputedDOMStyle.h')
-rw-r--r-- | layout/style/nsComputedDOMStyle.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h index 77df71ec8..7fbf49afe 100644 --- a/layout/style/nsComputedDOMStyle.h +++ b/layout/style/nsComputedDOMStyle.h @@ -76,12 +76,12 @@ public: nsComputedDOMStyle(mozilla::dom::Element* aElement, const nsAString& aPseudoElt, - nsIPresShell* aPresShell, + nsIDocument* aDocument, StyleType aStyleType); - virtual nsINode *GetParentObject() override + nsINode *GetParentObject() override { - return mContent; + return mElement; } static already_AddRefed<nsStyleContext> @@ -667,9 +667,9 @@ private: // We don't really have a good immutable representation of "presentation". // Given the way GetComputedStyle is currently used, we should just grab the - // 0th presshell, if any, from the document. + // presshell, if any, from the document. nsWeakPtr mDocumentWeak; - nsCOMPtr<nsIContent> mContent; + RefPtr<mozilla::dom::Element> mElement; /** * Strong reference to the style context we access data from. This can be @@ -735,7 +735,7 @@ private: already_AddRefed<nsComputedDOMStyle> NS_NewComputedDOMStyle(mozilla::dom::Element* aElement, const nsAString& aPseudoElt, - nsIPresShell* aPresShell, + nsIDocument* aDocument, nsComputedDOMStyle::StyleType aStyleType = nsComputedDOMStyle::eAll); |