Bug 1440141 part 1 - Move GeckoStyleContext::TakeRef to nsStyleContextInlines.h so that header doesn't depend on the Inlines.h. r?emilio
MozReview-Commit-ID: GdARP4HUAIY
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -80,21 +80,19 @@
#include "nsRubyTextContainerFrame.h"
#include "nsImageFrame.h"
#include "nsIObjectLoadingContent.h"
#include "nsTArray.h"
#include "nsGenericDOMDataNode.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/ElementInlines.h"
#include "nsAutoLayoutPhase.h"
+#include "nsStyleContextInlines.h"
#include "nsStyleStructInlines.h"
#include "nsPageContentFrame.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/GeckoStyleContext.h"
-#endif
#include "mozilla/RestyleManager.h"
#include "mozilla/RestyleManagerInlines.h"
#include "mozilla/StylePrefs.h"
#include "StickyScrollContainer.h"
#include "nsFieldSetFrame.h"
#include "nsInlineFrame.h"
#include "nsBlockFrame.h"
#include "nsCanvasFrame.h"
--- a/layout/style/GeckoStyleContext.h
+++ b/layout/style/GeckoStyleContext.h
@@ -8,24 +8,18 @@
#define mozilla_GeckoStyleContext_h
#include "nsStyleContext.h"
namespace mozilla {
class GeckoStyleContext final : public nsStyleContext {
public:
- static already_AddRefed<GeckoStyleContext>
- TakeRef(already_AddRefed<nsStyleContext> aStyleContext)
- {
- auto* context = aStyleContext.take();
- MOZ_ASSERT(context);
-
- return already_AddRefed<GeckoStyleContext>(context->AsGecko());
- }
+ static inline already_AddRefed<GeckoStyleContext>
+ TakeRef(already_AddRefed<nsStyleContext> aStyleContext);
GeckoStyleContext(GeckoStyleContext* aParent,
nsAtom* aPseudoTag,
CSSPseudoElementType aPseudoType,
already_AddRefed<nsRuleNode> aRuleNode,
bool aSkipParentDisplayBasedStyleFixup);
void* operator new(size_t sz, nsPresContext* aPresContext);
--- a/layout/style/nsStyleContextInlines.h
+++ b/layout/style/nsStyleContextInlines.h
@@ -188,9 +188,21 @@ nsStyleContext::GetStyleIfVisited() cons
void
nsStyleContext::StartBackgroundImageLoads()
{
// Just get our background struct; that should do the trick
StyleBackground();
}
+#ifdef MOZ_OLD_STYLE
+/* static */ already_AddRefed<mozilla::GeckoStyleContext>
+mozilla::GeckoStyleContext::TakeRef(
+ already_AddRefed<nsStyleContext> aStyleContext)
+{
+ auto* context = aStyleContext.take();
+ MOZ_ASSERT(context);
+
+ return already_AddRefed<mozilla::GeckoStyleContext>(context->AsGecko());
+}
+#endif
+
#endif // nsStyleContextInlines_h