Bug 1440141 part 1 - Move GeckoStyleContext::TakeRef to nsStyleContextInlines.h so that header doesn't depend on the Inlines.h. r?emilio draft
authorXidorn Quan <me@upsuper.org>
Thu, 22 Feb 2018 11:51:38 +1100
changeset 758200 f5bdc52e96ae063288465a3323cc94dfe6aaf158
parent 758199 0b470680bdd0df714fa835d34088e5e04a4d8f39
child 758201 ee33fbc44cc8961e30b9a2f7885fea205c8fa918
child 758233 bfd51f71389b203830cf08c6271d1ab3dfc3cf32
push id99981
push userxquan@mozilla.com
push dateThu, 22 Feb 2018 00:53:44 +0000
reviewersemilio
bugs1440141
milestone60.0a1
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
layout/base/nsCSSFrameConstructor.cpp
layout/style/GeckoStyleContext.h
layout/style/nsStyleContextInlines.h
--- 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