Bug 1498755 - Part 4: Clean up includes and forward declarations in Servo bindings headers r=emilio
authorCameron McCormack <cam@mcc.id.au>
Sun, 14 Oct 2018 00:05:52 +0000
changeset 496939 fb4ec4a85293a3f83fb5b8c37bf85da3d1b0b60d
parent 496938 ab1c2c7f02391a2fffd5202e7f4d5131b50d20d1
child 496940 7c22eed0a6de3dfaf527eda236dda01e064c1010
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1498755
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1498755 - Part 4: Clean up includes and forward declarations in Servo bindings headers r=emilio Depends on D8645 Differential Revision: https://phabricator.services.mozilla.com/D8646
dom/smil/nsSMILCSSValueType.cpp
layout/style/GeckoBindings.h
layout/style/ServoBindings.h
layout/style/ServoComputedData.h
layout/style/ServoTypes.h
--- a/dom/smil/nsSMILCSSValueType.cpp
+++ b/dom/smil/nsSMILCSSValueType.cpp
@@ -24,17 +24,16 @@
 #include "mozilla/dom/BaseKeyframeTypesBinding.h" // For CompositeOperation
 #include "mozilla/dom/Element.h"
 #include "nsDebug.h"
 #include "nsStyleUtil.h"
 #include "nsIDocument.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
-using mozilla::StyleAnimationValue;
 
 typedef AutoTArray<RefPtr<RawServoAnimationValue>, 1> ServoAnimationValues;
 
 /*static*/ nsSMILCSSValueType nsSMILCSSValueType::sSingleton;
 
 struct ValueWrapper {
   ValueWrapper(nsCSSPropertyID aPropID, const AnimationValue& aValue)
     : mPropID(aPropID)
--- a/layout/style/GeckoBindings.h
+++ b/layout/style/GeckoBindings.h
@@ -6,71 +6,48 @@
 
 /* FFI functions for Servo to call into Gecko */
 
 #ifndef mozilla_GeckoBindings_h
 #define mozilla_GeckoBindings_h
 
 #include <stdint.h>
 
-#include "mozilla/AtomArray.h"
 #include "mozilla/ServoTypes.h"
 #include "mozilla/ServoBindingTypes.h"
-#include "mozilla/ServoComputedDataInlines.h"
-#include "mozilla/ServoElementSnapshot.h"
 #include "mozilla/css/DocumentMatchingFunction.h"
 #include "mozilla/css/SheetLoadData.h"
-#include "mozilla/css/SheetParsingMode.h"
 #include "mozilla/EffectCompositor.h"
 #include "mozilla/ComputedTimingFunction.h"
-#include "nsChangeHint.h"
-#include "nsIDocument.h"
+#include "nsCSSValue.h"
+#include "nsStyleStruct.h"
 
 class nsAtom;
-class nsIPrincipal;
 class nsIURI;
+class nsSimpleContentList;
 struct nsFont;
+
 namespace mozilla {
-  class FontFamilyList;
+  class ComputedStyle;
+  class SeenPtrs;
+  class ServoElementSnapshot;
+  class ServoElementSnapshotTable;
+  class SharedFontList;
+  class StyleSheet;
+  enum class CSSPseudoElementType : uint8_t;
+  enum class PointerCapabilities : uint8_t;
+  enum class UpdateAnimationsTasks : uint8_t;
   struct FontFamilyName;
-  enum FontFamilyType : uint8_t;
-  class SharedFontList;
-  enum class CSSPseudoElementType : uint8_t;
   struct Keyframe;
-  struct StyleTransition;
-  namespace css {
-    class ErrorReporter;
-    struct URLValue;
-    class LoaderReusableStyleSheets;
-  };
-  namespace dom {
-    enum class IterationCompositeOperation : uint8_t;
-  };
-  enum class UpdateAnimationsTasks : uint8_t;
   struct LangGroupFontPrefs;
-  class SeenPtrs;
-  class ComputedStyle;
-  class StyleSheet;
-  class ServoElementSnapshotTable;
-  enum class PointerCapabilities : uint8_t;
+
+  namespace css {
+    class LoaderReusableStyleSheets;
+  }
 }
-using mozilla::FontFamilyList;
-using mozilla::FontFamilyName;
-using mozilla::FontFamilyType;
-using mozilla::ServoElementSnapshot;
-using mozilla::SharedFontList;
-struct nsMediaFeature;
-class nsSimpleContentList;
-struct nsStyleList;
-struct nsStyleImage;
-struct nsStyleGradientStop;
-class nsStyleGradient;
-class nsStyleCoord;
-struct nsStyleDisplay;
-class nsXBLBinding;
 
 #ifdef NIGHTLY_BUILD
 const bool GECKO_IS_NIGHTLY = true;
 #else
 const bool GECKO_IS_NIGHTLY = false;
 #endif
 
 #define NS_DECL_THREADSAFE_FFI_REFCOUNTING(class_, name_)                     \
@@ -115,17 +92,17 @@ struct FontSizePrefs
   nscoord mDefaultSansSerifSize;
   nscoord mDefaultMonospaceSize;
   nscoord mDefaultCursiveSize;
   nscoord mDefaultFantasySize;
 };
 
 // Debugging stuff.
 void Gecko_Element_DebugListAttributes(RawGeckoElementBorrowed, nsCString*);
-void Gecko_Snapshot_DebugListAttributes(const ServoElementSnapshot*, nsCString*);
+void Gecko_Snapshot_DebugListAttributes(const mozilla::ServoElementSnapshot*, nsCString*);
 
 bool Gecko_IsSignificantChild(RawGeckoNodeBorrowed node, bool whitespace_is_significant);
 RawGeckoNodeBorrowedOrNull Gecko_GetLastChild(RawGeckoNodeBorrowed node);
 RawGeckoNodeBorrowedOrNull Gecko_GetPreviousSibling(RawGeckoNodeBorrowed node);
 RawGeckoNodeBorrowedOrNull Gecko_GetFlattenedTreeParentNode(RawGeckoNodeBorrowed node);
 RawGeckoElementBorrowedOrNull Gecko_GetBeforeOrAfterPseudo(RawGeckoElementBorrowed element, bool is_before);
 nsTArray<nsIContent*>* Gecko_GetAnonymousContentForElement(RawGeckoElementBorrowed element);
 const nsTArray<RefPtr<nsINode>>* Gecko_GetAssignedNodes(RawGeckoElementBorrowed element);
@@ -197,17 +174,17 @@ bool Gecko_IsBrowserFrame(RawGeckoElemen
                               nsAtom* name, nsAtom* str, bool ignore_case);
 
 bool Gecko_AssertClassAttrValueIsSane(const nsAttrValue*);
 const nsAttrValue* Gecko_GetSVGAnimatedClass(RawGeckoElementBorrowed);
 
 
 SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS(Gecko_, RawGeckoElementBorrowed)
 SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS(Gecko_Snapshot,
-                                              const ServoElementSnapshot*)
+                                              const mozilla::ServoElementSnapshot*)
 
 #undef SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS
 
 // Style attributes.
 RawServoDeclarationBlockStrongBorrowedOrNull
 Gecko_GetStyleAttrDeclarationBlock(RawGeckoElementBorrowed element);
 void Gecko_UnsetDirtyStyleAttr(RawGeckoElementBorrowed element);
 RawServoDeclarationBlockStrongBorrowedOrNull
@@ -272,22 +249,22 @@ void Gecko_StyleTransition_SetUnsupporte
 // Atoms.
 nsAtom* Gecko_Atomize(const char* aString, uint32_t aLength);
 nsAtom* Gecko_Atomize16(const nsAString* aString);
 void Gecko_AddRefAtom(nsAtom* aAtom);
 void Gecko_ReleaseAtom(nsAtom* aAtom);
 
 // Font style
 void Gecko_CopyFontFamilyFrom(nsFont* dst, const nsFont* src);
-void Gecko_nsTArray_FontFamilyName_AppendNamed(nsTArray<FontFamilyName>* aNames, nsAtom* aName, bool aQuoted);
-void Gecko_nsTArray_FontFamilyName_AppendGeneric(nsTArray<FontFamilyName>* aNames, FontFamilyType aType);
+void Gecko_nsTArray_FontFamilyName_AppendNamed(nsTArray<mozilla::FontFamilyName>* aNames, nsAtom* aName, bool aQuoted);
+void Gecko_nsTArray_FontFamilyName_AppendGeneric(nsTArray<mozilla::FontFamilyName>* aNames, mozilla::FontFamilyType aType);
 // Returns an already-AddRefed SharedFontList with an empty mNames array.
-SharedFontList* Gecko_SharedFontList_Create();
-size_t Gecko_SharedFontList_SizeOfIncludingThis(SharedFontList* fontlist);
-size_t Gecko_SharedFontList_SizeOfIncludingThisIfUnshared(SharedFontList* fontlist);
+mozilla::SharedFontList* Gecko_SharedFontList_Create();
+size_t Gecko_SharedFontList_SizeOfIncludingThis(mozilla::SharedFontList* fontlist);
+size_t Gecko_SharedFontList_SizeOfIncludingThisIfUnshared(mozilla::SharedFontList* fontlist);
 NS_DECL_THREADSAFE_FFI_REFCOUNTING(mozilla::SharedFontList, SharedFontList);
 // will not run destructors on dst, give it uninitialized memory
 // font_id is LookAndFeel::FontID
 void Gecko_nsFont_InitSystem(nsFont* dst, int32_t font_id,
                              const nsStyleFont* font, RawGeckoPresContextBorrowed pres_context);
 void Gecko_nsFont_Destroy(nsFont* dst);
 
 // The gfxFontFeatureValueSet returned from this function has zero reference.
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -7,70 +7,48 @@
 /* FFI functions for Gecko to call into Servo */
 
 #ifndef mozilla_ServoBindings_h
 #define mozilla_ServoBindings_h
 
 #include <stdint.h>
 
 #include "mozilla/AtomArray.h"
-#include "mozilla/ServoTypes.h"
-#include "mozilla/ServoBindingTypes.h"
-#include "mozilla/ServoComputedDataInlines.h"
-#include "mozilla/ServoElementSnapshot.h"
-#include "mozilla/css/DocumentMatchingFunction.h"
 #include "mozilla/css/SheetLoadData.h"
 #include "mozilla/css/SheetParsingMode.h"
-#include "mozilla/EffectCompositor.h"
-#include "mozilla/ComputedTimingFunction.h"
+#include "mozilla/ServoBindingTypes.h"
 #include "nsChangeHint.h"
-#include "nsIDocument.h"
+#include "nsColor.h"
+#include "nsCSSValue.h"
 
+class gfxFontFeatureValueSet;
 class nsAtom;
-class nsIPrincipal;
-class nsIURI;
-struct nsFont;
+class nsSimpleContentList;
+struct gfxFontFeature;
+
 namespace mozilla {
-  class FontFamilyList;
-  struct FontFamilyName;
-  enum FontFamilyType : uint8_t;
+  class SeenPtrs;
+  class ServoElementSnapshotTable;
   class SharedFontList;
+  class StyleSheet;
   enum class CSSPseudoElementType : uint8_t;
   struct Keyframe;
-  struct StyleTransition;
+
   namespace css {
-    class ErrorReporter;
-    struct URLValue;
     class LoaderReusableStyleSheets;
-  };
+  }
+
+  namespace gfx {
+    struct FontVariation;
+  }
+
   namespace dom {
     enum class IterationCompositeOperation : uint8_t;
-  };
-  enum class UpdateAnimationsTasks : uint8_t;
-  struct LangGroupFontPrefs;
-  class SeenPtrs;
-  class ComputedStyle;
-  class StyleSheet;
-  class ServoElementSnapshotTable;
-  enum class PointerCapabilities : uint8_t;
+  }
 }
-using mozilla::FontFamilyList;
-using mozilla::FontFamilyName;
-using mozilla::FontFamilyType;
-using mozilla::ServoElementSnapshot;
-using mozilla::SharedFontList;
-struct nsMediaFeature;
-class nsSimpleContentList;
-struct nsStyleList;
-struct nsStyleImage;
-struct nsStyleGradientStop;
-class nsStyleGradient;
-class nsStyleCoord;
-struct nsStyleDisplay;
-class nsXBLBinding;
 
 extern "C" {
 
 // Element data
 void Servo_Element_ClearData(RawGeckoElementBorrowed node);
 
 size_t Servo_Element_SizeOfExcludingThisAndCVs(
   mozilla::MallocSizeOf malloc_size_of,
@@ -1141,17 +1119,17 @@ void Servo_IntersectionObserverRootMargi
 bool Servo_ParseTransformIntoMatrix(
   const nsAString* value,
   bool* contains_3d_transform,
   RawGeckoGfxMatrix4x4* result);
 
 bool Servo_ParseFontShorthandForMatching(
   const nsAString* value,
   RawGeckoURLExtraData* data,
-  RefPtr<SharedFontList>* family,
+  RefPtr<mozilla::SharedFontList>* family,
   // We use ComputedFontStyleDescriptor just for convenience,
   // but the two values of Oblique are the same.
   mozilla::StyleComputedFontStyleDescriptor* style,
   float* stretch,
   float* weight);
 
 nsCSSPropertyID Servo_ResolveLogicalProperty(
   nsCSSPropertyID,
--- a/layout/style/ServoComputedData.h
+++ b/layout/style/ServoComputedData.h
@@ -4,16 +4,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_ServoComputedData_h
 #define mozilla_ServoComputedData_h
 
 #include "mozilla/ServoTypes.h"
 
+class nsWindowSizes;
+
 /*
  * ServoComputedData and its related types.
  */
 
 #define STYLE_STRUCT(name_) struct nsStyle##name_;
 #include "nsStyleStructList.h"
 #undef STYLE_STRUCT
 
--- a/layout/style/ServoTypes.h
+++ b/layout/style/ServoTypes.h
@@ -9,22 +9,19 @@
 
 #include "mozilla/TypedEnumBits.h"
 
 /*
  * Type definitions used to interact with Servo. This gets included by nsINode,
  * so don't add significant include dependencies to this file.
  */
 
-class nsWindowSizes;
 struct ServoNodeData;
 namespace mozilla {
 
-class SizeOfState;
-
 /*
  * Replaced types. These get mapped to associated Servo types in bindgen.
  */
 
 template<typename T>
 struct ServoUnsafeCell {
   T value;