Bug 1288626 Part 1 - Move nsBasicShape and nsStyleClipPath into mozilla namespace. r=heycam draft
authorTing-Yu Lin <tlin@mozilla.com>
Wed, 27 Jul 2016 17:38:26 +0800
changeset 398400 580b8d7657fdfc25bb1e8bd2455ab95e7f810d9d
parent 398399 0af0d04b9cf6e71668756db02bc59a6fab4314a8
child 398401 6debb710f079c5413fc07599c927c4cbb327bc5d
push id25517
push userbmo:tlin@mozilla.com
push dateTue, 09 Aug 2016 03:27:51 +0000
reviewersheycam
bugs1288626
milestone51.0a1
Bug 1288626 Part 1 - Move nsBasicShape and nsStyleClipPath into mozilla namespace. r=heycam MozReview-Commit-ID: D9wwa1rLUNa
layout/style/nsComputedDOMStyle.h
layout/style/nsStyleStruct.h
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -641,22 +641,22 @@ private:
   bool GetFrameBorderRectHeight(nscoord& aHeight);
 
   /* Helper functions for computing the filter property style. */
   void SetCssTextToCoord(nsAString& aCssText, const nsStyleCoord& aCoord);
   already_AddRefed<CSSValue> CreatePrimitiveValueForStyleFilter(
     const nsStyleFilter& aStyleFilter);
 
   already_AddRefed<CSSValue> CreatePrimitiveValueForClipPath(
-    const nsStyleBasicShape* aStyleBasicShape,
+    const mozilla::nsStyleBasicShape* aStyleBasicShape,
     mozilla::StyleClipShapeSizing aSizingBox);
 
   // Helper function for computing basic shape styles.
   already_AddRefed<CSSValue> CreatePrimitiveValueForBasicShape(
-    const nsStyleBasicShape* aStyleBasicShape);
+    const mozilla::nsStyleBasicShape* aStyleBasicShape);
   void BoxValuesToString(nsAString& aString,
                          const nsTArray<nsStyleCoord>& aBoxValues);
   void BasicShapeRadiiToString(nsAString& aCssText,
                                const nsStyleCorners& aCorners);
 
 
   static nsComputedStyleMap* GetComputedStyleMap();
 
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -3431,16 +3431,18 @@ private:
     STROKE_WIDTH_CONTEXT       = 0x40,  // stroke-width: context-value
     FILL_OPACITY_SOURCE_SHIFT   = 0,
     STROKE_OPACITY_SOURCE_SHIFT = 2,
   };
 
   uint8_t          mContextFlags;     // [inherited]
 };
 
+namespace mozilla {
+
 class nsStyleBasicShape final
 {
 public:
   enum Type {
     eInset,
     eCircle,
     eEllipse,
     ePolygon
@@ -3542,52 +3544,54 @@ struct nsStyleClipPath
 
   nsStyleClipPath& operator=(const nsStyleClipPath& aOther);
 
   bool operator==(const nsStyleClipPath& aOther) const;
   bool operator!=(const nsStyleClipPath& aOther) const {
     return !(*this == aOther);
   }
 
-  mozilla::StyleClipPathType GetType() const {
+  StyleClipPathType GetType() const {
     return mType;
   }
 
   FragmentOrURL* GetURL() const {
-    NS_ASSERTION(mType == mozilla::StyleClipPathType::URL, "wrong clip-path type");
+    NS_ASSERTION(mType == StyleClipPathType::URL, "wrong clip-path type");
     return mURL;
   }
   bool SetURL(const nsCSSValue* aValue);
 
   nsStyleBasicShape* GetBasicShape() const {
-    NS_ASSERTION(mType == mozilla::StyleClipPathType::Shape, "wrong clip-path type");
+    NS_ASSERTION(mType == StyleClipPathType::Shape, "wrong clip-path type");
     return mBasicShape;
   }
 
   void SetBasicShape(nsStyleBasicShape* mBasicShape,
-                     mozilla::StyleClipShapeSizing aSizingBox =
-                     mozilla::StyleClipShapeSizing::NoBox);
-
-  mozilla::StyleClipShapeSizing GetSizingBox() const { return mSizingBox; }
-  void SetSizingBox(mozilla::StyleClipShapeSizing aSizingBox);
+                     StyleClipShapeSizing aSizingBox =
+                     StyleClipShapeSizing::NoBox);
+
+  StyleClipShapeSizing GetSizingBox() const { return mSizingBox; }
+  void SetSizingBox(StyleClipShapeSizing aSizingBox);
 
 private:
   void ReleaseRef();
   void CopyURL(const nsStyleClipPath& aOther);
 
   void* operator new(size_t) = delete;
 
   union {
     nsStyleBasicShape* mBasicShape;
     FragmentOrURL* mURL;
   };
-  mozilla::StyleClipPathType    mType;
-  mozilla::StyleClipShapeSizing mSizingBox;
+  StyleClipPathType    mType;
+  StyleClipShapeSizing mSizingBox;
 };
 
+} // namespace mozilla
+
 struct nsStyleFilter
 {
   nsStyleFilter();
   nsStyleFilter(const nsStyleFilter& aSource);
   ~nsStyleFilter();
 
   nsStyleFilter& operator=(const nsStyleFilter& aOther);
 
@@ -3673,17 +3677,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
     return mClipPath.GetType() != mozilla::StyleClipPathType::None_;
   }
 
   bool HasNonScalingStroke() const {
     return mVectorEffect == NS_STYLE_VECTOR_EFFECT_NON_SCALING_STROKE;
   }
 
   nsStyleImageLayers    mMask;
-  nsStyleClipPath  mClipPath;         // [reset]
+  mozilla::nsStyleClipPath mClipPath; // [reset]
   nscolor          mStopColor;        // [reset]
   nscolor          mFloodColor;       // [reset]
   nscolor          mLightingColor;    // [reset]
 
   float            mStopOpacity;      // [reset]
   float            mFloodOpacity;     // [reset]
 
   uint8_t          mDominantBaseline; // [reset] see nsStyleConsts.h