Bug 1288626 Part 4 - Rename nsStyleClipPath to StyleClipPath. r=heycam
MozReview-Commit-ID: 2iT4elvtTGd
--- 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