Bug 1443950: Go back to using getComposedDoc for the computed style by default. r?bz
Now that NODE_FORCE_XBL_BINDINGS is gone, the only reason OwnerDoc() was added
in
bug 1432490 is also gone.
Let's go back to using the composed doc, at least until the CSSWG decides on
what's the computed style of something that's not in[1].
[1]: https://github.com/w3c/csswg-drafts/issues/1548
MozReview-Commit-ID: EV1c46kkUva
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -10,25 +10,25 @@
#define nsComputedDOMStyle_h__
#include "mozilla/ArenaRefPtr.h"
#include "mozilla/ArenaRefPtrInlines.h"
#include "mozilla/Attributes.h"
#include "mozilla/StyleComplexColor.h"
#include "mozilla/UniquePtr.h"
#include "nsCOMPtr.h"
+#include "nsContentUtils.h"
#include "nscore.h"
#include "nsCSSProps.h"
#include "nsDOMCSSDeclaration.h"
#include "mozilla/ComputedStyle.h"
#include "nsIWeakReferenceUtils.h"
#include "mozilla/gfx/Types.h"
#include "nsCoord.h"
#include "nsColor.h"
-#include "nsIContent.h"
#include "nsStyleStruct.h"
#include "mozilla/WritingModes.h"
namespace mozilla {
namespace dom {
class DocGroup;
class Element;
} // namespace dom
@@ -102,17 +102,17 @@ public:
static already_AddRefed<mozilla::ComputedStyle>
GetComputedStyleNoFlush(mozilla::dom::Element* aElement,
nsAtom* aPseudo,
StyleType aStyleType = eAll)
{
return DoGetComputedStyleNoFlush(aElement,
aPseudo,
- aElement->OwnerDoc()->GetShell(),
+ nsContentUtils::GetPresShellForContent(aElement),
aStyleType);
}
static already_AddRefed<mozilla::ComputedStyle>
GetUnanimatedComputedStyleNoFlush(mozilla::dom::Element* aElement,
nsAtom* aPseudo);
// Helper for nsDOMWindowUtils::GetVisitedDependentComputedStyle