Bug 1290061 - stylo: Mark nsStyleUnion/Unit fields as unsafe and private for bindgen; r?bholley
MozReview-Commit-ID: 6K38Gvbn4vn
--- a/layout/style/nsStyleCoord.h
+++ b/layout/style/nsStyleCoord.h
@@ -67,16 +67,17 @@ typedef union {
/**
* Class that hold a single size specification used by the style
* system. The size specification consists of two parts -- a number
* and a unit. The number is an integer, a floating point value, an
* nscoord, or undefined, and the unit is an nsStyleUnit. Checking
* the unit is a must before asking for the value in any particular
* form.
*/
+ /** <div rustbindgen private accessor="unsafe"></div> */
class nsStyleCoord {
public:
// Non-reference counted calc() value. See nsStyleStruct.h for some uses
// of this.
struct CalcValue {
// Every calc() expression evaluates to a length plus a percentage.
nscoord mLength;
float mPercent;
@@ -257,16 +258,17 @@ private:
nsStyleUnion mValue;
};
/**
* Class that represents a set of top/right/bottom/left nsStyleCoords.
* This is commonly used to hold the widths of the borders, margins,
* or paddings of a box.
*/
+ /** <div rustbindgen private accessor="unsafe"></div> */
class nsStyleSides {
public:
nsStyleSides();
nsStyleSides(const nsStyleSides&);
~nsStyleSides();
nsStyleSides& operator=(const nsStyleSides& aCopy);
bool operator==(const nsStyleSides& aOther) const;
@@ -335,16 +337,17 @@ protected:
nsStyleUnion mValues[4];
};
/**
* Class that represents a set of top-left/top-right/bottom-left/bottom-right
* 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&);
~nsStyleCorners();
// use compiler's version
nsStyleCorners& operator=(const nsStyleCorners& aCopy);