Bug 1402246 - Remove "friend struct" declarations in nsStyleStruct.h. draft
authorTing-Yu Lin <tlin@mozilla.com>
Fri, 22 Sep 2017 15:30:36 +0800
changeset 668963 ca0035f296fe759a1c048036353c710d2bee85fc
parent 668887 97282b0c985aa1778ced171514d1ae61945c634c
child 668964 a39056b2df7ce20617310ca315994a279a4ebdc2
push id81167
push userbmo:tlin@mozilla.com
push dateFri, 22 Sep 2017 08:16:03 +0000
bugs1402246
milestone58.0a1
Bug 1402246 - Remove "friend struct" declarations in nsStyleStruct.h. Those structs do not have any private section, so those "friend struct" declarations are not needed. MozReview-Commit-ID: BYPPPLAdiEQ
layout/style/nsStyleStruct.h
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -635,18 +635,16 @@ struct nsStyleImageLayers {
   explicit nsStyleImageLayers(LayerType aType);
   nsStyleImageLayers(const nsStyleImageLayers &aSource);
   ~nsStyleImageLayers() {
     MOZ_COUNT_DTOR(nsStyleImageLayers);
   }
 
   static bool IsInitialPositionForLayerType(mozilla::Position aPosition, LayerType aType);
 
-  struct Size;
-  friend struct Size;
   struct Size {
     struct Dimension : public nsStyleCoord::CalcValue {
       nscoord ResolveLengthPercentage(nscoord aAvailable) const {
         double d = double(mPercent) * double(aAvailable) + double(mLength);
         if (d < 0.0) {
           return 0;
         }
         return NSToCoordRoundWithClamp(float(d));
@@ -698,18 +696,16 @@ struct nsStyleImageLayers {
     void SetInitialValues();
 
     bool operator==(const Size& aOther) const;
     bool operator!=(const Size& aOther) const {
       return !(*this == aOther);
     }
   };
 
-  struct Repeat;
-  friend struct Repeat;
   struct Repeat {
     mozilla::StyleImageLayerRepeat mXRepeat, mYRepeat;
 
     // Initialize nothing
     Repeat() {}
 
     bool IsInitialValue() const {
       return mXRepeat == mozilla::StyleImageLayerRepeat::Repeat &&
@@ -731,18 +727,16 @@ struct nsStyleImageLayers {
       return mXRepeat == aOther.mXRepeat &&
              mYRepeat == aOther.mYRepeat;
     }
     bool operator!=(const Repeat& aOther) const {
       return !(*this == aOther);
     }
   };
 
-  struct Layer;
-  friend struct Layer;
   struct Layer {
     typedef mozilla::StyleGeometryBox StyleGeometryBox;
 
     nsStyleImage  mImage;         // [reset]
     mozilla::Position mPosition;  // [reset]
     Size          mSize;          // [reset]
     StyleGeometryBox  mClip;      // [reset] See nsStyleConsts.h
     MOZ_INIT_OUTSIDE_CTOR