Bug 1288626 Part 4 - Rename nsStyleClipPath to StyleClipPath. r=heycam draft
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 28 Jul 2016 10:29:33 +0800
changeset 398403 4084ff063b2201b5bbfdc3395b26a9e521d32aa9
parent 398402 327bc257e6eb716fcf8ebaebb231cfb46e85ce79
child 398404 3be2e33ba423e175f4e784ef4f716477ccbc2403
push id25517
push userbmo:tlin@mozilla.com
push dateTue, 09 Aug 2016 03:27:51 +0000
reviewersheycam
bugs1288626
milestone51.0a1
Bug 1288626 Part 4 - Rename nsStyleClipPath to StyleClipPath. r=heycam MozReview-Commit-ID: 2iT4elvtTGd
layout/style/StyleAnimationValue.cpp
layout/style/nsRuleNode.cpp
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
layout/svg/nsCSSClipPathInstance.h
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -3488,17 +3488,17 @@ ExtractImageLayerSizePairList(const nsSt
         break;
     }
   }
 
   aComputedValue.SetAndAdoptCSSValuePairListValue(result.forget());
 }
 
 static bool
-StyleClipBasicShapeToCSSArray(const nsStyleClipPath& aClipPath,
+StyleClipBasicShapeToCSSArray(const StyleClipPath& aClipPath,
                               nsCSSValue::Array* aResult)
 {
   MOZ_ASSERT(aResult->Count() == 2,
              "Expected array to be presized for a function and the sizing-box");
 
   const StyleBasicShape* shape = aClipPath.GetBasicShape();
   nsCSSKeyword functionName = shape->GetShapeTypeName();
   RefPtr<nsCSSValue::Array> functionArray;
@@ -3948,17 +3948,17 @@ StyleAnimationValue::ExtractComputedValu
           ExtractImageLayerSizePairList(layers, aComputedValue);
           break;
         }
 #endif
 
         case eCSSProperty_clip_path: {
           const nsStyleSVGReset* svgReset =
             static_cast<const nsStyleSVGReset*>(styleStruct);
-          const nsStyleClipPath& clipPath = svgReset->mClipPath;
+          const StyleClipPath& clipPath = svgReset->mClipPath;
           const StyleClipPathType type = clipPath.GetType();
 
           if (type == StyleClipPathType::URL) {
             nsIDocument* doc = aStyleContext->PresContext()->Document();
             RefPtr<mozilla::css::URLValue> url =
               FragmentOrURLToURLValue(clipPath.GetURL(), doc);
 
             auto result = MakeUnique<nsCSSValue>();
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -9726,17 +9726,17 @@ GetStyleBasicShapeFromCSSValue(const nsC
   } else {
     NS_NOTREACHED("unexpected basic shape function");
   }
 
   return basicShape.forget();
 }
 
 static void
-SetStyleClipPathToCSSValue(nsStyleClipPath* aStyleClipPath,
+SetStyleClipPathToCSSValue(StyleClipPath* aStyleClipPath,
                            const nsCSSValue* aValue,
                            nsStyleContext* aStyleContext,
                            nsPresContext* aPresContext,
                            RuleNodeCacheConditions& aConditions)
 {
   MOZ_ASSERT(aValue->GetUnit() == eCSSUnit_Array,
              "expected a basic shape or reference box");
 
@@ -9874,29 +9874,29 @@ nsRuleNode::ComputeSVGResetData(void* aS
   // clip-path: url, <basic-shape> || <geometry-box>, none, inherit
   const nsCSSValue* clipPathValue = aRuleData->ValueForClipPath();
   switch (clipPathValue->GetUnit()) {
     case eCSSUnit_Null:
       break;
     case eCSSUnit_None:
     case eCSSUnit_Initial:
     case eCSSUnit_Unset:
-      svgReset->mClipPath = nsStyleClipPath();
+      svgReset->mClipPath = StyleClipPath();
       break;
     case eCSSUnit_Inherit:
       conditions.SetUncacheable();
       svgReset->mClipPath = parentSVGReset->mClipPath;
       break;
     case eCSSUnit_URL: {
-      svgReset->mClipPath = nsStyleClipPath();
+      svgReset->mClipPath = StyleClipPath();
       svgReset->mClipPath.SetURL(clipPathValue);
       break;
     }
     case eCSSUnit_Array: {
-      svgReset->mClipPath = nsStyleClipPath();
+      svgReset->mClipPath = StyleClipPath();
       SetStyleClipPathToCSSValue(&svgReset->mClipPath, clipPathValue, aContext,
                                  mPresContext, conditions);
       break;
     }
     default:
       NS_NOTREACHED("unexpected unit");
   }
 
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -1101,46 +1101,46 @@ StyleBasicShape::GetShapeTypeName() cons
     case StyleBasicShapeType::Inset:
       return eCSSKeyword_inset;
   }
   NS_NOTREACHED("unexpected type");
   return eCSSKeyword_UNKNOWN;
 }
 
 // --------------------
-// nsStyleClipPath
+// StyleClipPath
 //
-nsStyleClipPath::nsStyleClipPath()
+StyleClipPath::StyleClipPath()
   : mURL(nullptr)
   , mType(StyleClipPathType::None_)
   , mSizingBox(StyleClipShapeSizing::NoBox)
 {
 }
 
-nsStyleClipPath::nsStyleClipPath(const nsStyleClipPath& aSource)
+StyleClipPath::StyleClipPath(const StyleClipPath& aSource)
   : mURL(nullptr)
   , mType(StyleClipPathType::None_)
   , mSizingBox(StyleClipShapeSizing::NoBox)
 {
   if (aSource.mType == StyleClipPathType::URL) {
     CopyURL(aSource);
   } else if (aSource.mType == StyleClipPathType::Shape) {
     SetBasicShape(aSource.mBasicShape, aSource.mSizingBox);
   } else if (aSource.mType == StyleClipPathType::Box) {
     SetSizingBox(aSource.mSizingBox);
   }
 }
 
-nsStyleClipPath::~nsStyleClipPath()
+StyleClipPath::~StyleClipPath()
 {
   ReleaseRef();
 }
 
-nsStyleClipPath&
-nsStyleClipPath::operator=(const nsStyleClipPath& aOther)
+StyleClipPath&
+StyleClipPath::operator=(const StyleClipPath& aOther)
 {
   if (this == &aOther) {
     return *this;
   }
 
   if (aOther.mType == StyleClipPathType::URL) {
     CopyURL(aOther);
   } else if (aOther.mType == StyleClipPathType::Shape) {
@@ -1151,17 +1151,17 @@ nsStyleClipPath::operator=(const nsStyle
     ReleaseRef();
     mSizingBox = StyleClipShapeSizing::NoBox;
     mType = StyleClipPathType::None_;
   }
   return *this;
 }
 
 bool
-nsStyleClipPath::operator==(const nsStyleClipPath& aOther) const
+StyleClipPath::operator==(const StyleClipPath& aOther) const
 {
   if (mType != aOther.mType) {
     return false;
   }
 
   if (mType == StyleClipPathType::URL) {
     return EqualURIs(mURL, aOther.mURL);
   } else if (mType == StyleClipPathType::Shape) {
@@ -1170,68 +1170,68 @@ nsStyleClipPath::operator==(const nsStyl
   } else if (mType == StyleClipPathType::Box) {
     return mSizingBox == aOther.mSizingBox;
   }
 
   return true;
 }
 
 void
-nsStyleClipPath::ReleaseRef()
+StyleClipPath::ReleaseRef()
 {
   if (mType == StyleClipPathType::Shape) {
     NS_ASSERTION(mBasicShape, "expected pointer");
     mBasicShape->Release();
   } else if (mType == StyleClipPathType::URL) {
     NS_ASSERTION(mURL, "expected pointer");
     delete mURL;
   }
   // mBasicShap, mURL, etc. are all pointers in a union of pointers. Nulling
   // one of them nulls all of them:
   mURL = nullptr;
 }
 
 void
-nsStyleClipPath::CopyURL(const nsStyleClipPath& aOther)
+StyleClipPath::CopyURL(const StyleClipPath& aOther)
 {
   ReleaseRef();
 
   mURL = new FragmentOrURL(*aOther.mURL);
   mType = StyleClipPathType::URL;
 }
 
 bool
-nsStyleClipPath::SetURL(const nsCSSValue* aValue)
+StyleClipPath::SetURL(const nsCSSValue* aValue)
 {
   if (!aValue->GetURLValue()) {
     return false;
   }
 
   ReleaseRef();
 
   mURL = new FragmentOrURL();
   mURL->SetValue(aValue);
   mType = StyleClipPathType::URL;
   return true;
 }
 
 void
-nsStyleClipPath::SetBasicShape(StyleBasicShape* aBasicShape,
-                               StyleClipShapeSizing aSizingBox)
+StyleClipPath::SetBasicShape(StyleBasicShape* aBasicShape,
+                             StyleClipShapeSizing aSizingBox)
 {
   NS_ASSERTION(aBasicShape, "expected pointer");
   ReleaseRef();
   mBasicShape = aBasicShape;
   mBasicShape->AddRef();
   mSizingBox = aSizingBox;
   mType = StyleClipPathType::Shape;
 }
 
 void
-nsStyleClipPath::SetSizingBox(StyleClipShapeSizing aSizingBox)
+StyleClipPath::SetSizingBox(StyleClipShapeSizing aSizingBox)
 {
   ReleaseRef();
   mSizingBox = aSizingBox;
   mType = StyleClipPathType::Box;
 }
 
 // --------------------
 // nsStyleFilter
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -3526,26 +3526,26 @@ private:
 
   // mCoordinates has coordinates for polygon or radii for
   // ellipse and circle.
   nsTArray<nsStyleCoord> mCoordinates;
   Position mPosition;
   nsStyleCorners mRadius;
 };
 
-struct nsStyleClipPath
+struct StyleClipPath
 {
-  nsStyleClipPath();
-  nsStyleClipPath(const nsStyleClipPath& aSource);
-  ~nsStyleClipPath();
-
-  nsStyleClipPath& operator=(const nsStyleClipPath& aOther);
-
-  bool operator==(const nsStyleClipPath& aOther) const;
-  bool operator!=(const nsStyleClipPath& aOther) const {
+  StyleClipPath();
+  StyleClipPath(const StyleClipPath& aSource);
+  ~StyleClipPath();
+
+  StyleClipPath& operator=(const StyleClipPath& aOther);
+
+  bool operator==(const StyleClipPath& aOther) const;
+  bool operator!=(const StyleClipPath& aOther) const {
     return !(*this == aOther);
   }
 
   StyleClipPathType GetType() const {
     return mType;
   }
 
   FragmentOrURL* GetURL() const {
@@ -3563,17 +3563,17 @@ struct nsStyleClipPath
                      StyleClipShapeSizing aSizingBox =
                      StyleClipShapeSizing::NoBox);
 
   StyleClipShapeSizing GetSizingBox() const { return mSizingBox; }
   void SetSizingBox(StyleClipShapeSizing aSizingBox);
 
 private:
   void ReleaseRef();
-  void CopyURL(const nsStyleClipPath& aOther);
+  void CopyURL(const StyleClipPath& aOther);
 
   void* operator new(size_t) = delete;
 
   union {
     StyleBasicShape* mBasicShape;
     FragmentOrURL* mURL;
   };
   StyleClipPathType    mType;
@@ -3672,17 +3672,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;
-  mozilla::nsStyleClipPath mClipPath; // [reset]
+  mozilla::StyleClipPath mClipPath;   // [reset]
   nscolor          mStopColor;        // [reset]
   nscolor          mFloodColor;       // [reset]
   nscolor          mLightingColor;    // [reset]
 
   float            mStopOpacity;      // [reset]
   float            mFloodOpacity;     // [reset]
 
   uint8_t          mDominantBaseline; // [reset] see nsStyleConsts.h
--- a/layout/svg/nsCSSClipPathInstance.h
+++ b/layout/svg/nsCSSClipPathInstance.h
@@ -23,17 +23,17 @@ class nsCSSClipPathInstance
 public:
   static void ApplyBasicShapeClip(gfxContext& aContext,
                                   nsIFrame* aFrame);
   // aPoint is in CSS pixels.
   static bool HitTestBasicShapeClip(nsIFrame* aFrame,
                                     const gfxPoint& aPoint);
 private:
   explicit nsCSSClipPathInstance(nsIFrame* aFrame,
-                                 const nsStyleClipPath aClipPathStyle)
+                                 const StyleClipPath aClipPathStyle)
     : mTargetFrame(aFrame)
     , mClipPathStyle(aClipPathStyle)
   {
   }
 
   already_AddRefed<Path> CreateClipPath(DrawTarget* aDrawTarget);
 
   already_AddRefed<Path> CreateClipPathCircle(DrawTarget* aDrawTarget,
@@ -44,14 +44,14 @@ private:
 
   already_AddRefed<Path> CreateClipPathPolygon(DrawTarget* aDrawTarget,
                                                const nsRect& aRefBox);
 
   /**
    * The frame for the element that is currently being clipped.
    */
   nsIFrame* mTargetFrame;
-  nsStyleClipPath mClipPathStyle;
+  StyleClipPath mClipPathStyle;
 };
 
 } // namespace mozilla
 
 #endif