Bug 1295662 - Document layout of nsStyleCorners and inset StyleBasicShape; r?heycam draft
authorManish Goregaokar <manishsmail@gmail.com>
Wed, 17 Aug 2016 15:39:34 +0530
changeset 402421 20e98f27bc2145d64b97c6c1724637f99099e8b8
parent 400825 054d4856cea6150a6638e5daf7913713281af97d
child 402422 38cf5b6806f5b1c8283d9dcd5820ae72e6f8e670
push id26641
push userbmo:manishearth@gmail.com
push dateThu, 18 Aug 2016 05:54:41 +0000
reviewersheycam
bugs1295662
milestone51.0a1
Bug 1295662 - Document layout of nsStyleCorners and inset StyleBasicShape; r?heycam MozReview-Commit-ID: DYwaSnLvWJK
layout/style/nsStyleCoord.h
layout/style/nsStyleStruct.h
--- a/layout/style/nsStyleCoord.h
+++ b/layout/style/nsStyleCoord.h
@@ -333,17 +333,17 @@ public:
   }
 
 protected:
   nsStyleUnit   mUnits[4];
   nsStyleUnion  mValues[4];
 };
 
 /**
- * Class that represents a set of top-left/top-right/bottom-left/bottom-right
+ * Class that represents a set of top-left/top-right/bottom-right/bottom-left
  * nsStyleCoord pairs.  This is used to hold the dimensions of the
  * corners of a box (for, e.g., border-radius and outline-radius).
  */
  /** <div rustbindgen private accessor="unsafe"></div> */
 class nsStyleCorners {
 public:
   nsStyleCorners();
   nsStyleCorners(const nsStyleCorners&);
@@ -362,16 +362,21 @@ public:
   // Sets each corner to null and releases any refcounted objects.  Only use
   // this if the object is initialized (i.e. don't use it in nsStyleCorners
   // constructors).
   void Reset();
 
   inline void Set(uint8_t aHalfCorner, const nsStyleCoord& aCoord);
 
 protected:
+  // Stored as:
+  // top-left.x, top-left.y,
+  // top-right.x, top-right.y,
+  // bottom-right.x, bottom-right.y,
+  // bottom-left.x, bottom-left.y
   nsStyleUnit   mUnits[8];
   nsStyleUnion  mValues[8];
 };
 
 
 // -------------------------
 // nsStyleCoord inlines
 //
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -2606,18 +2606,21 @@ public:
 private:
   ~StyleBasicShape() {}
 
   StyleBasicShapeType mType;
   int32_t mFillRule;
 
   // mCoordinates has coordinates for polygon or radii for
   // ellipse and circle.
+  // (top, right, bottom, left) for inset
   nsTArray<nsStyleCoord> mCoordinates;
+  // position of center for ellipse or circle
   Position mPosition;
+  // corner radii for inset (0 if not set)
   nsStyleCorners mRadius;
 };
 
 template<typename ReferenceBox>
 struct StyleShapeSource
 {
   StyleShapeSource()
     : mURL(nullptr)