--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -361,20 +361,22 @@ nsBorderColors::~nsBorderColors()
{
NS_CSS_DELETE_LIST_MEMBER(nsBorderColors, this, mNext);
}
nsBorderColors*
nsBorderColors::Clone(bool aDeep) const
{
nsBorderColors* result = new nsBorderColors(mColor);
- if (MOZ_UNLIKELY(!result))
+ if (MOZ_UNLIKELY(!result)) {
return result;
- if (aDeep)
+ }
+ if (aDeep) {
NS_CSS_CLONE_LIST_MEMBER(nsBorderColors, this, mNext, result, (false));
+ }
return result;
}
nsStyleBorder::nsStyleBorder(const nsStyleBorder& aSrc)
: mBorderColors(nullptr)
, mBorderRadius(aSrc.mBorderRadius)
, mBorderImageSource(aSrc.mBorderImageSource)
, mBorderImageSlice(aSrc.mBorderImageSlice)
@@ -387,35 +389,38 @@ nsStyleBorder::nsStyleBorder(const nsSty
, mBoxDecorationBreak(aSrc.mBoxDecorationBreak)
, mComputedBorder(aSrc.mComputedBorder)
, mBorder(aSrc.mBorder)
, mTwipsPerPixel(aSrc.mTwipsPerPixel)
{
MOZ_COUNT_CTOR(nsStyleBorder);
if (aSrc.mBorderColors) {
EnsureBorderColors();
- for (int32_t i = 0; i < 4; i++)
- if (aSrc.mBorderColors[i])
+ for (int32_t i = 0; i < 4; i++) {
+ if (aSrc.mBorderColors[i]) {
mBorderColors[i] = aSrc.mBorderColors[i]->Clone();
- else
+ } else {
mBorderColors[i] = nullptr;
+ }
+ }
}
NS_FOR_CSS_SIDES(side) {
mBorderStyle[side] = aSrc.mBorderStyle[side];
mBorderColor[side] = aSrc.mBorderColor[side];
}
}
nsStyleBorder::~nsStyleBorder()
{
MOZ_COUNT_DTOR(nsStyleBorder);
if (mBorderColors) {
- for (int32_t i = 0; i < 4; i++)
+ for (int32_t i = 0; i < 4; i++) {
delete mBorderColors[i];
+ }
delete [] mBorderColors;
}
}
nsMargin
nsStyleBorder::GetImageOutset() const
{
// We don't check whether there is a border-image (which is OK since
@@ -454,18 +459,19 @@ nsChangeHint
nsStyleBorder::CalcDifference(const nsStyleBorder& aNewData) const
{
// XXXbz we should be able to return a more specific change hint for
// at least GetComputedBorder() differences...
if (mTwipsPerPixel != aNewData.mTwipsPerPixel ||
GetComputedBorder() != aNewData.GetComputedBorder() ||
mFloatEdge != aNewData.mFloatEdge ||
mBorderImageOutset != aNewData.mBorderImageOutset ||
- mBoxDecorationBreak != aNewData.mBoxDecorationBreak)
+ mBoxDecorationBreak != aNewData.mBoxDecorationBreak) {
return NS_STYLE_HINT_REFLOW;
+ }
NS_FOR_CSS_SIDES(ix) {
// See the explanation in nsChangeHint.h of
// nsChangeHint_BorderStyleNoneChange .
// Furthermore, even though we know *this* side is 0 width, just
// assume a repaint hint for some other change rather than bother
// tracking this result through the rest of the function.
if (HasVisibleStyle(ix) != aNewData.HasVisibleStyle(ix)) {
@@ -476,42 +482,46 @@ nsStyleBorder::CalcDifference(const nsSt
// Note that mBorderStyle stores not only the border style but also
// color-related flags. Given that we've already done an mComputedBorder
// comparison, border-style differences can only lead to a repaint hint. So
// it's OK to just compare the values directly -- if either the actual
// style or the color flags differ we want to repaint.
NS_FOR_CSS_SIDES(ix) {
if (mBorderStyle[ix] != aNewData.mBorderStyle[ix] ||
- mBorderColor[ix] != aNewData.mBorderColor[ix])
+ mBorderColor[ix] != aNewData.mBorderColor[ix]) {
return nsChangeHint_RepaintFrame;
+ }
}
if (mBorderRadius != aNewData.mBorderRadius ||
- !mBorderColors != !aNewData.mBorderColors)
+ !mBorderColors != !aNewData.mBorderColors) {
return nsChangeHint_RepaintFrame;
+ }
if (IsBorderImageLoaded() || aNewData.IsBorderImageLoaded()) {
if (mBorderImageSource != aNewData.mBorderImageSource ||
mBorderImageRepeatH != aNewData.mBorderImageRepeatH ||
mBorderImageRepeatV != aNewData.mBorderImageRepeatV ||
mBorderImageSlice != aNewData.mBorderImageSlice ||
mBorderImageFill != aNewData.mBorderImageFill ||
mBorderImageWidth != aNewData.mBorderImageWidth ||
- mBorderImageOutset != aNewData.mBorderImageOutset)
+ mBorderImageOutset != aNewData.mBorderImageOutset) {
return nsChangeHint_RepaintFrame;
+ }
}
// Note that at this point if mBorderColors is non-null so is
// aNewData.mBorderColors
if (mBorderColors) {
NS_FOR_CSS_SIDES(ix) {
if (!nsBorderColors::Equal(mBorderColors[ix],
- aNewData.mBorderColors[ix]))
+ aNewData.mBorderColors[ix])) {
return nsChangeHint_RepaintFrame;
+ }
}
}
// mBorder is the specified border value. Changes to this don't
// need any change processing, since we operate on the computed
// border values instead.
if (mBorder != aNewData.mBorder) {
return nsChangeHint_NeutralChange;
@@ -677,26 +687,28 @@ nsStyleList::CalcDifference(const nsStyl
{
// If the quotes implementation is ever going to change we might not need
// a framechange here and a reflow should be sufficient. See bug 35768.
if (mQuotes != aNewData.mQuotes &&
(mQuotes || aNewData.mQuotes) &&
GetQuotePairs() != aNewData.GetQuotePairs()) {
return NS_STYLE_HINT_FRAMECHANGE;
}
- if (mListStylePosition != aNewData.mListStylePosition)
+ if (mListStylePosition != aNewData.mListStylePosition) {
return NS_STYLE_HINT_FRAMECHANGE;
+ }
if (EqualImages(mListStyleImage, aNewData.mListStyleImage) &&
mCounterStyle == aNewData.mCounterStyle) {
if (mImageRegion.IsEqualInterior(aNewData.mImageRegion)) {
return NS_STYLE_HINT_NONE;
}
if (mImageRegion.width == aNewData.mImageRegion.width &&
- mImageRegion.height == aNewData.mImageRegion.height)
+ mImageRegion.height == aNewData.mImageRegion.height) {
return NS_STYLE_HINT_VISUAL;
+ }
}
return NS_STYLE_HINT_REFLOW;
}
StaticRefPtr<nsStyleQuoteValues>
nsStyleList::sInitialQuotes;
StaticRefPtr<nsStyleQuoteValues>
@@ -739,20 +751,22 @@ nsChangeHint
nsStyleXUL::CalcDifference(const nsStyleXUL& aNewData) const
{
if (mBoxAlign == aNewData.mBoxAlign &&
mBoxDirection == aNewData.mBoxDirection &&
mBoxFlex == aNewData.mBoxFlex &&
mBoxOrient == aNewData.mBoxOrient &&
mBoxPack == aNewData.mBoxPack &&
mBoxOrdinal == aNewData.mBoxOrdinal &&
- mStretchStack == aNewData.mStretchStack)
+ mStretchStack == aNewData.mStretchStack) {
return NS_STYLE_HINT_NONE;
- if (mBoxOrdinal != aNewData.mBoxOrdinal)
+ }
+ if (mBoxOrdinal != aNewData.mBoxOrdinal) {
return NS_STYLE_HINT_FRAMECHANGE;
+ }
return NS_STYLE_HINT_REFLOW;
}
// --------------------
// nsStyleColumn
//
/* static */ const uint32_t nsStyleColumn::kMaxColumnCount = 1000;
@@ -790,32 +804,35 @@ nsStyleColumn::nsStyleColumn(const nsSty
MOZ_COUNT_CTOR(nsStyleColumn);
}
nsChangeHint
nsStyleColumn::CalcDifference(const nsStyleColumn& aNewData) const
{
if ((mColumnWidth.GetUnit() == eStyleUnit_Auto)
!= (aNewData.mColumnWidth.GetUnit() == eStyleUnit_Auto) ||
- mColumnCount != aNewData.mColumnCount)
+ mColumnCount != aNewData.mColumnCount) {
// We force column count changes to do a reframe, because it's tricky to handle
// some edge cases where the column count gets smaller and content overflows.
// XXX not ideal
return NS_STYLE_HINT_FRAMECHANGE;
+ }
if (mColumnWidth != aNewData.mColumnWidth ||
mColumnGap != aNewData.mColumnGap ||
- mColumnFill != aNewData.mColumnFill)
+ mColumnFill != aNewData.mColumnFill) {
return NS_STYLE_HINT_REFLOW;
+ }
if (GetComputedColumnRuleWidth() != aNewData.GetComputedColumnRuleWidth() ||
mColumnRuleStyle != aNewData.mColumnRuleStyle ||
mColumnRuleColor != aNewData.mColumnRuleColor ||
- mColumnRuleColorIsForeground != aNewData.mColumnRuleColorIsForeground)
+ mColumnRuleColorIsForeground != aNewData.mColumnRuleColorIsForeground) {
return NS_STYLE_HINT_VISUAL;
+ }
// XXX Is it right that we never check mTwipsPerPixel to return a
// non-nsChangeHint_NeutralChange hint?
if (mColumnRuleWidth != aNewData.mColumnRuleWidth ||
mTwipsPerPixel != aNewData.mTwipsPerPixel) {
return nsChangeHint_NeutralChange;
}
@@ -1125,18 +1142,19 @@ nsStyleFilter::~nsStyleFilter()
{
ReleaseRef();
MOZ_COUNT_DTOR(nsStyleFilter);
}
nsStyleFilter&
nsStyleFilter::operator=(const nsStyleFilter& aOther)
{
- if (this == &aOther)
+ if (this == &aOther) {
return *this;
+ }
if (aOther.mType == NS_STYLE_FILTER_URL) {
SetURL(aOther.mURL);
} else if (aOther.mType == NS_STYLE_FILTER_DROP_SHADOW) {
SetDropShadow(aOther.mDropShadow);
} else if (aOther.mType != NS_STYLE_FILTER_NONE) {
SetFilterParameter(aOther.mFilterParameter, aOther.mType);
} else {
@@ -1337,40 +1355,44 @@ nsStyleSVGPaint::SetType(nsStyleSVGPaint
mPaint.mColor = NS_RGB(0, 0, 0);
}
mType = aType;
}
nsStyleSVGPaint&
nsStyleSVGPaint::operator=(const nsStyleSVGPaint& aOther)
{
- if (this == &aOther)
+ if (this == &aOther) {
return *this;
+ }
SetType(aOther.mType);
mFallbackColor = aOther.mFallbackColor;
if (mType == eStyleSVGPaintType_Server) {
mPaint.mPaintServer = aOther.mPaint.mPaintServer;
NS_IF_ADDREF(mPaint.mPaintServer);
} else {
mPaint.mColor = aOther.mPaint.mColor;
}
return *this;
}
bool nsStyleSVGPaint::operator==(const nsStyleSVGPaint& aOther) const
{
- if (mType != aOther.mType)
+ if (mType != aOther.mType) {
return false;
- if (mType == eStyleSVGPaintType_Server)
+ }
+ if (mType == eStyleSVGPaintType_Server) {
return EqualURIs(mPaint.mPaintServer, aOther.mPaint.mPaintServer) &&
mFallbackColor == aOther.mFallbackColor;
- if (mType == eStyleSVGPaintType_Color)
+ }
+ if (mType == eStyleSVGPaintType_Color) {
return mPaint.mColor == aOther.mPaint.mColor;
+ }
return true;
}
// --------------------
// nsStylePosition
//
nsStylePosition::nsStylePosition(StyleStructContext aContext)
: mWidth(eStyleUnit_Auto)
@@ -1726,18 +1748,19 @@ nsStyleTable::nsStyleTable(const nsStyle
{
MOZ_COUNT_CTOR(nsStyleTable);
}
nsChangeHint
nsStyleTable::CalcDifference(const nsStyleTable& aNewData) const
{
if (mSpan != aNewData.mSpan ||
- mLayoutStrategy != aNewData.mLayoutStrategy)
+ mLayoutStrategy != aNewData.mLayoutStrategy) {
return NS_STYLE_HINT_FRAMECHANGE;
+ }
return NS_STYLE_HINT_NONE;
}
// -----------------------
// nsStyleTableBorder
nsStyleTableBorder::nsStyleTableBorder(StyleStructContext aContext)
: mBorderSpacingCol(0)
@@ -1773,22 +1796,23 @@ nsStyleTableBorder::CalcDifference(const
// require extra state to be stored).
if (mBorderCollapse != aNewData.mBorderCollapse) {
return NS_STYLE_HINT_FRAMECHANGE;
}
if ((mCaptionSide == aNewData.mCaptionSide) &&
(mBorderSpacingCol == aNewData.mBorderSpacingCol) &&
(mBorderSpacingRow == aNewData.mBorderSpacingRow)) {
- if (mEmptyCells == aNewData.mEmptyCells)
+ if (mEmptyCells == aNewData.mEmptyCells) {
return NS_STYLE_HINT_NONE;
+ }
return NS_STYLE_HINT_VISUAL;
+ } else {
+ return NS_STYLE_HINT_REFLOW;
}
- else
- return NS_STYLE_HINT_REFLOW;
}
// --------------------
// nsStyleColor
//
nsStyleColor::nsStyleColor(StyleStructContext aContext)
: mColor(aContext.DefaultColor())
@@ -1800,18 +1824,19 @@ nsStyleColor::nsStyleColor(const nsStyle
: mColor(aSource.mColor)
{
MOZ_COUNT_CTOR(nsStyleColor);
}
nsChangeHint
nsStyleColor::CalcDifference(const nsStyleColor& aNewData) const
{
- if (mColor == aNewData.mColor)
+ if (mColor == aNewData.mColor) {
return NS_STYLE_HINT_NONE;
+ }
return nsChangeHint_RepaintFrame;
}
// --------------------
// nsStyleGradient
//
bool
nsStyleGradient::operator==(const nsStyleGradient& aOther) const
@@ -1826,29 +1851,32 @@ nsStyleGradient::operator==(const nsStyl
if (mShape != aOther.mShape ||
mSize != aOther.mSize ||
mRepeating != aOther.mRepeating ||
mLegacySyntax != aOther.mLegacySyntax ||
mBgPosX != aOther.mBgPosX ||
mBgPosY != aOther.mBgPosY ||
mAngle != aOther.mAngle ||
mRadiusX != aOther.mRadiusX ||
- mRadiusY != aOther.mRadiusY)
+ mRadiusY != aOther.mRadiusY) {
return false;
-
- if (mStops.Length() != aOther.mStops.Length())
+ }
+
+ if (mStops.Length() != aOther.mStops.Length()) {
return false;
+ }
for (uint32_t i = 0; i < mStops.Length(); i++) {
const auto& stop1 = mStops[i];
const auto& stop2 = aOther.mStops[i];
if (stop1.mLocation != stop2.mLocation ||
stop1.mIsInterpolationHint != stop2.mIsInterpolationHint ||
- (!stop1.mIsInterpolationHint && stop1.mColor != stop2.mColor))
+ (!stop1.mIsInterpolationHint && stop1.mColor != stop2.mColor)) {
return false;
+ }
}
return true;
}
nsStyleGradient::nsStyleGradient()
: mShape(NS_STYLE_GRADIENT_SHAPE_LINEAR)
, mSize(NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER)
@@ -1856,28 +1884,30 @@ nsStyleGradient::nsStyleGradient()
, mLegacySyntax(false)
{
}
bool
nsStyleGradient::IsOpaque()
{
for (uint32_t i = 0; i < mStops.Length(); i++) {
- if (NS_GET_A(mStops[i].mColor) < 255)
+ if (NS_GET_A(mStops[i].mColor) < 255) {
return false;
+ }
}
return true;
}
bool
nsStyleGradient::HasCalc()
{
for (uint32_t i = 0; i < mStops.Length(); i++) {
- if (mStops[i].mLocation.IsCalcUnit())
+ if (mStops[i].mLocation.IsCalcUnit()) {
return true;
+ }
}
return mBgPosX.IsCalcUnit() || mBgPosY.IsCalcUnit() || mAngle.IsCalcUnit() ||
mRadiusX.IsCalcUnit() || mRadiusY.IsCalcUnit();
}
// --------------------
// nsStyleImage
//
@@ -1890,18 +1920,19 @@ nsStyleImage::nsStyleImage()
#endif
{
MOZ_COUNT_CTOR(nsStyleImage);
}
nsStyleImage::~nsStyleImage()
{
MOZ_COUNT_DTOR(nsStyleImage);
- if (mType != eStyleImageType_Null)
+ if (mType != eStyleImageType_Null) {
SetNull();
+ }
}
nsStyleImage::nsStyleImage(const nsStyleImage& aOther)
: mType(eStyleImageType_Null)
, mCropRect(nullptr)
#ifdef DEBUG
, mImageTracked(false)
#endif
@@ -1910,64 +1941,68 @@ nsStyleImage::nsStyleImage(const nsStyle
// to copy the reference count
MOZ_COUNT_CTOR(nsStyleImage);
DoCopy(aOther);
}
nsStyleImage&
nsStyleImage::operator=(const nsStyleImage& aOther)
{
- if (this != &aOther)
+ if (this != &aOther) {
DoCopy(aOther);
+ }
return *this;
}
void
nsStyleImage::DoCopy(const nsStyleImage& aOther)
{
SetNull();
- if (aOther.mType == eStyleImageType_Image)
+ if (aOther.mType == eStyleImageType_Image) {
SetImageData(aOther.mImage);
- else if (aOther.mType == eStyleImageType_Gradient)
+ } else if (aOther.mType == eStyleImageType_Gradient) {
SetGradientData(aOther.mGradient);
- else if (aOther.mType == eStyleImageType_Element)
+ } else if (aOther.mType == eStyleImageType_Element) {
SetElementId(aOther.mElementId);
+ }
SetCropRect(aOther.mCropRect);
}
void
nsStyleImage::SetNull()
{
MOZ_ASSERT(!mImageTracked,
"Calling SetNull() with image tracked!");
- if (mType == eStyleImageType_Gradient)
+ if (mType == eStyleImageType_Gradient) {
mGradient->Release();
- else if (mType == eStyleImageType_Image)
+ } else if (mType == eStyleImageType_Image) {
NS_RELEASE(mImage);
- else if (mType == eStyleImageType_Element)
+ } else if (mType == eStyleImageType_Element) {
free(mElementId);
+ }
mType = eStyleImageType_Null;
mCropRect = nullptr;
}
void
nsStyleImage::SetImageData(imgRequestProxy* aImage)
{
MOZ_ASSERT(!mImageTracked,
"Setting a new image without untracking the old one!");
NS_IF_ADDREF(aImage);
- if (mType != eStyleImageType_Null)
+ if (mType != eStyleImageType_Null) {
SetNull();
+ }
if (aImage) {
mImage = aImage;
mType = eStyleImageType_Image;
}
mSubImages.Clear();
}
@@ -1976,18 +2011,19 @@ nsStyleImage::TrackImage(nsPresContext*
{
// Sanity
MOZ_ASSERT(!mImageTracked, "Already tracking image!");
MOZ_ASSERT(mType == eStyleImageType_Image,
"Can't track image when there isn't one!");
// Register the image with the document
nsIDocument* doc = aContext->Document();
- if (doc)
+ if (doc) {
doc->AddImage(mImage);
+ }
// Mark state
#ifdef DEBUG
mImageTracked = true;
#endif
}
void
@@ -1995,45 +2031,49 @@ nsStyleImage::UntrackImage(nsPresContext
{
// Sanity
MOZ_ASSERT(mImageTracked, "Image not tracked!");
MOZ_ASSERT(mType == eStyleImageType_Image,
"Can't untrack image when there isn't one!");
// Unregister the image with the document
nsIDocument* doc = aContext->Document();
- if (doc)
+ if (doc) {
doc->RemoveImage(mImage, nsIDocument::REQUEST_DISCARD);
+ }
// Mark state
#ifdef DEBUG
mImageTracked = false;
#endif
}
void
nsStyleImage::SetGradientData(nsStyleGradient* aGradient)
{
- if (aGradient)
+ if (aGradient) {
aGradient->AddRef();
-
- if (mType != eStyleImageType_Null)
+ }
+
+ if (mType != eStyleImageType_Null) {
SetNull();
+ }
if (aGradient) {
mGradient = aGradient;
mType = eStyleImageType_Gradient;
}
}
void
nsStyleImage::SetElementId(const char16_t* aElementId)
{
- if (mType != eStyleImageType_Null)
+ if (mType != eStyleImageType_Null) {
SetNull();
+ }
if (aElementId) {
mElementId = NS_strdup(aElementId);
mType = eStyleImageType_Element;
}
}
void
@@ -2066,75 +2106,84 @@ ConvertToPixelCoord(const nsStyleCoord&
pixelValue = std::min(pixelValue, double(INT32_MAX)); // avoid overflow
return NS_lround(pixelValue);
}
bool
nsStyleImage::ComputeActualCropRect(nsIntRect& aActualCropRect,
bool* aIsEntireImage) const
{
- if (mType != eStyleImageType_Image)
+ if (mType != eStyleImageType_Image) {
return false;
+ }
nsCOMPtr<imgIContainer> imageContainer;
mImage->GetImage(getter_AddRefs(imageContainer));
- if (!imageContainer)
+ if (!imageContainer) {
return false;
+ }
nsIntSize imageSize;
imageContainer->GetWidth(&imageSize.width);
imageContainer->GetHeight(&imageSize.height);
- if (imageSize.width <= 0 || imageSize.height <= 0)
+ if (imageSize.width <= 0 || imageSize.height <= 0) {
return false;
+ }
int32_t left = ConvertToPixelCoord(mCropRect->GetLeft(), imageSize.width);
int32_t top = ConvertToPixelCoord(mCropRect->GetTop(), imageSize.height);
int32_t right = ConvertToPixelCoord(mCropRect->GetRight(), imageSize.width);
int32_t bottom = ConvertToPixelCoord(mCropRect->GetBottom(), imageSize.height);
// IntersectRect() returns an empty rect if we get negative width or height
nsIntRect cropRect(left, top, right - left, bottom - top);
nsIntRect imageRect(nsIntPoint(0, 0), imageSize);
aActualCropRect.IntersectRect(imageRect, cropRect);
- if (aIsEntireImage)
+ if (aIsEntireImage) {
*aIsEntireImage = aActualCropRect.IsEqualInterior(imageRect);
+ }
return true;
}
nsresult
nsStyleImage::StartDecoding() const
{
- if ((mType == eStyleImageType_Image) && mImage)
+ if ((mType == eStyleImageType_Image) && mImage) {
return mImage->StartDecoding();
+ }
return NS_OK;
}
bool
nsStyleImage::IsOpaque() const
{
- if (!IsComplete())
+ if (!IsComplete()) {
return false;
-
- if (mType == eStyleImageType_Gradient)
+ }
+
+ if (mType == eStyleImageType_Gradient) {
return mGradient->IsOpaque();
-
- if (mType == eStyleImageType_Element)
+ }
+
+ if (mType == eStyleImageType_Element) {
return false;
+ }
MOZ_ASSERT(mType == eStyleImageType_Image, "unexpected image type");
nsCOMPtr<imgIContainer> imageContainer;
mImage->GetImage(getter_AddRefs(imageContainer));
MOZ_ASSERT(imageContainer, "IsComplete() said image container is ready");
// Check if the crop region of the image is opaque.
if (imageContainer->IsOpaque()) {
- if (!mCropRect)
+ if (!mCropRect) {
return true;
+ }
// Must make sure if mCropRect contains at least a pixel.
// XXX Is this optimization worth it? Maybe I should just return false.
nsIntRect actualCropRect;
bool rv = ComputeActualCropRect(actualCropRect);
NS_ASSERTION(rv, "ComputeActualCropRect() can not fail here");
return rv && !actualCropRect.IsEmpty();
}
@@ -2191,30 +2240,35 @@ EqualRects(const nsStyleSides* aRect1, c
{
return aRect1 == aRect2 || /* handles null== null, and optimize */
(aRect1 && aRect2 && *aRect1 == *aRect2);
}
bool
nsStyleImage::operator==(const nsStyleImage& aOther) const
{
- if (mType != aOther.mType)
+ if (mType != aOther.mType) {
return false;
-
- if (!EqualRects(mCropRect, aOther.mCropRect))
+ }
+
+ if (!EqualRects(mCropRect, aOther.mCropRect)) {
return false;
-
- if (mType == eStyleImageType_Image)
+ }
+
+ if (mType == eStyleImageType_Image) {
return EqualImages(mImage, aOther.mImage);
-
- if (mType == eStyleImageType_Gradient)
+ }
+
+ if (mType == eStyleImageType_Gradient) {
return *mGradient == *aOther.mGradient;
-
- if (mType == eStyleImageType_Element)
+ }
+
+ if (mType == eStyleImageType_Element) {
return NS_strcmp(mElementId, aOther.mElementId) == 0;
+ }
return true;
}
// --------------------
// nsStyleImageLayers
//
@@ -2963,18 +3017,19 @@ nsStyleDisplay::CalcDifference(const nsS
|| mOverflowY != aNewData.mOverflowY
|| mScrollBehavior != aNewData.mScrollBehavior
|| mScrollSnapTypeX != aNewData.mScrollSnapTypeX
|| mScrollSnapTypeY != aNewData.mScrollSnapTypeY
|| mScrollSnapPointsX != aNewData.mScrollSnapPointsX
|| mScrollSnapPointsY != aNewData.mScrollSnapPointsY
|| mScrollSnapDestination != aNewData.mScrollSnapDestination
|| mTopLayer != aNewData.mTopLayer
- || mResize != aNewData.mResize)
+ || mResize != aNewData.mResize) {
hint |= nsChangeHint_ReconstructFrame;
+ }
/* Note: When mScrollBehavior, mScrollSnapTypeX, mScrollSnapTypeY,
* mScrollSnapPointsX, mScrollSnapPointsY, or mScrollSnapDestination are
* changed, nsChangeHint_NeutralChange is not sufficient to enter
* nsCSSFrameConstructor::PropagateScrollToViewport. By using the same hint
* as used when the overflow css property changes,
* nsChangeHint_ReconstructFrame, PropagateScrollToViewport will be called.
*
@@ -3012,19 +3067,20 @@ nsStyleDisplay::CalcDifference(const nsS
// XXX the following is conservative, for now: changing float breaking shouldn't
// necessarily require a repaint, reflow should suffice.
if (mBreakType != aNewData.mBreakType
|| mBreakInside != aNewData.mBreakInside
|| mBreakBefore != aNewData.mBreakBefore
|| mBreakAfter != aNewData.mBreakAfter
|| mAppearance != aNewData.mAppearance
|| mOrient != aNewData.mOrient
- || mOverflowClipBox != aNewData.mOverflowClipBox)
+ || mOverflowClipBox != aNewData.mOverflowClipBox) {
hint |= nsChangeHint_AllReflowHints |
nsChangeHint_RepaintFrame;
+ }
if (mIsolation != aNewData.mIsolation) {
hint |= nsChangeHint_RepaintFrame;
}
/* If we've added or removed the transform property, we need to reconstruct the frame to add
* or remove the view object, and also to handle abs-pos and fixed-pos containers.
*/
@@ -3058,41 +3114,45 @@ nsStyleDisplay::CalcDifference(const nsS
transformHint |= nsChangeHint_UpdatePostTransformOverflow;
} else {
transformHint |= nsChangeHint_UpdateOverflow;
}
}
const nsChangeHint kUpdateOverflowAndRepaintHint =
nsChangeHint_UpdateOverflow | nsChangeHint_RepaintFrame;
- for (uint8_t index = 0; index < 3; ++index)
+ for (uint8_t index = 0; index < 3; ++index) {
if (mTransformOrigin[index] != aNewData.mTransformOrigin[index]) {
transformHint |= nsChangeHint_UpdateTransformLayer |
nsChangeHint_UpdatePostTransformOverflow;
break;
}
-
- for (uint8_t index = 0; index < 2; ++index)
+ }
+
+ for (uint8_t index = 0; index < 2; ++index) {
if (mPerspectiveOrigin[index] != aNewData.mPerspectiveOrigin[index]) {
transformHint |= kUpdateOverflowAndRepaintHint;
break;
}
+ }
if (HasPerspectiveStyle() != aNewData.HasPerspectiveStyle()) {
// A change from/to being a containing block for position:fixed.
hint |= nsChangeHint_UpdateContainingBlock;
}
if (mChildPerspective != aNewData.mChildPerspective ||
mTransformStyle != aNewData.mTransformStyle ||
- mTransformBox != aNewData.mTransformBox)
+ mTransformBox != aNewData.mTransformBox) {
transformHint |= kUpdateOverflowAndRepaintHint;
-
- if (mBackfaceVisibility != aNewData.mBackfaceVisibility)
+ }
+
+ if (mBackfaceVisibility != aNewData.mBackfaceVisibility) {
transformHint |= nsChangeHint_RepaintFrame;
+ }
if (transformHint) {
if (HasTransformStyle()) {
hint |= transformHint;
} else {
hint |= nsChangeHint_NeutralChange;
}
}
@@ -3241,18 +3301,19 @@ nsStyleContentData::~nsStyleContentData(
} else if (mContent.mString) {
free(mContent.mString);
}
}
nsStyleContentData&
nsStyleContentData::operator=(const nsStyleContentData& aOther)
{
- if (this == &aOther)
+ if (this == &aOther) {
return *this;
+ }
this->~nsStyleContentData();
new (this) nsStyleContentData();
mType = aOther.mType;
if (mType == eStyleContentType_Image) {
mContent.mImage = aOther.mContent.mImage;
NS_IF_ADDREF(mContent.mImage);
} else if (mType == eStyleContentType_Counter ||
@@ -3265,50 +3326,54 @@ nsStyleContentData::operator=(const nsSt
mContent.mString = nullptr;
}
return *this;
}
bool
nsStyleContentData::operator==(const nsStyleContentData& aOther) const
{
- if (mType != aOther.mType)
+ if (mType != aOther.mType) {
return false;
+ }
if (mType == eStyleContentType_Image) {
- if (!mContent.mImage || !aOther.mContent.mImage)
+ if (!mContent.mImage || !aOther.mContent.mImage) {
return mContent.mImage == aOther.mContent.mImage;
+ }
bool eq;
nsCOMPtr<nsIURI> thisURI, otherURI;
mContent.mImage->GetURI(getter_AddRefs(thisURI));
aOther.mContent.mImage->GetURI(getter_AddRefs(otherURI));
return thisURI == otherURI || // handles null==null
(thisURI && otherURI &&
NS_SUCCEEDED(thisURI->Equals(otherURI, &eq)) &&
eq);
}
if (mType == eStyleContentType_Counter ||
- mType == eStyleContentType_Counters)
+ mType == eStyleContentType_Counters) {
return *mContent.mCounters == *aOther.mContent.mCounters;
+ }
return safe_strcmp(mContent.mString, aOther.mContent.mString) == 0;
}
void
nsStyleContentData::TrackImage(nsPresContext* aContext)
{
// Sanity
MOZ_ASSERT(!mImageTracked, "Already tracking image!");
MOZ_ASSERT(mType == eStyleContentType_Image,
"Trying to do image tracking on non-image!");
MOZ_ASSERT(mContent.mImage,
"Can't track image when there isn't one!");
// Register the image with the document
nsIDocument* doc = aContext->Document();
- if (doc)
+ if (doc) {
doc->AddImage(mContent.mImage);
+ }
// Mark state
#ifdef DEBUG
mImageTracked = true;
#endif
}
void
@@ -3318,18 +3383,19 @@ nsStyleContentData::UntrackImage(nsPresC
MOZ_ASSERT(mImageTracked, "Image not tracked!");
MOZ_ASSERT(mType == eStyleContentType_Image,
"Trying to do image tracking on non-image!");
MOZ_ASSERT(mContent.mImage,
"Can't untrack image when there isn't one!");
// Unregister the image with the document
nsIDocument* doc = aContext->Document();
- if (doc)
+ if (doc) {
doc->RemoveImage(mContent.mImage, nsIDocument::REQUEST_DISCARD);
+ }
// Mark state
#ifdef DEBUG
mImageTracked = false;
#endif
}
@@ -3539,25 +3605,28 @@ nsStyleTextReset::CalcDifference(const n
return NS_STYLE_HINT_NONE;
}
// Returns true if the given shadow-arrays are equal.
static bool
AreShadowArraysEqual(nsCSSShadowArray* lhs,
nsCSSShadowArray* rhs)
{
- if (lhs == rhs)
+ if (lhs == rhs) {
return true;
-
- if (!lhs || !rhs || lhs->Length() != rhs->Length())
+ }
+
+ if (!lhs || !rhs || lhs->Length() != rhs->Length()) {
return false;
+ }
for (uint32_t i = 0; i < lhs->Length(); ++i) {
- if (*lhs->ShadowAt(i) != *rhs->ShadowAt(i))
+ if (*lhs->ShadowAt(i) != *rhs->ShadowAt(i)) {
return false;
+ }
}
return true;
}
// --------------------
// nsStyleText
//
@@ -3666,18 +3735,19 @@ nsStyleText::CalcDifference(const nsStyl
(mHyphens != aNewData.mHyphens) ||
(mRubyAlign != aNewData.mRubyAlign) ||
(mRubyPosition != aNewData.mRubyPosition) ||
(mTextSizeAdjust != aNewData.mTextSizeAdjust) ||
(mLetterSpacing != aNewData.mLetterSpacing) ||
(mLineHeight != aNewData.mLineHeight) ||
(mTextIndent != aNewData.mTextIndent) ||
(mWordSpacing != aNewData.mWordSpacing) ||
- (mTabSize != aNewData.mTabSize))
+ (mTabSize != aNewData.mTabSize)) {
return NS_STYLE_HINT_REFLOW;
+ }
if (HasTextEmphasis() != aNewData.HasTextEmphasis() ||
(HasTextEmphasis() &&
mTextEmphasisPosition != aNewData.mTextEmphasisPosition)) {
// Text emphasis position change could affect line height calculation.
return nsChangeHint_AllReflowHints |
nsChangeHint_RepaintFrame;
}
@@ -3813,35 +3883,38 @@ nsStyleUserInterface::~nsStyleUserInterf
MOZ_COUNT_DTOR(nsStyleUserInterface);
delete [] mCursorArray;
}
nsChangeHint
nsStyleUserInterface::CalcDifference(const nsStyleUserInterface& aNewData) const
{
nsChangeHint hint = nsChangeHint(0);
- if (mCursor != aNewData.mCursor)
+ if (mCursor != aNewData.mCursor) {
hint |= nsChangeHint_UpdateCursor;
+ }
// We could do better. But it wouldn't be worth it, URL-specified cursors are
// rare.
- if (mCursorArrayLength > 0 || aNewData.mCursorArrayLength > 0)
+ if (mCursorArrayLength > 0 || aNewData.mCursorArrayLength > 0) {
hint |= nsChangeHint_UpdateCursor;
+ }
if (mPointerEvents != aNewData.mPointerEvents) {
// nsSVGPathGeometryFrame's mRect depends on stroke _and_ on the value
// of pointer-events. See nsSVGPathGeometryFrame::ReflowSVG's use of
// GetHitTestFlags. (Only a reflow, no visual change.)
hint |= nsChangeHint_NeedReflow |
nsChangeHint_NeedDirtyReflow; // XXX remove me: bug 876085
}
- if (mUserModify != aNewData.mUserModify)
+ if (mUserModify != aNewData.mUserModify) {
hint |= NS_STYLE_HINT_VISUAL;
-
+ }
+
if (mUserInput != aNewData.mUserInput) {
if (NS_STYLE_USER_INPUT_NONE == mUserInput ||
NS_STYLE_USER_INPUT_NONE == aNewData.mUserInput) {
hint |= NS_STYLE_HINT_FRAMECHANGE;
} else {
hint |= nsChangeHint_NeutralChange;
}
}
@@ -3857,18 +3930,19 @@ void
nsStyleUserInterface::CopyCursorArrayFrom(const nsStyleUserInterface& aSource)
{
mCursorArray = nullptr;
mCursorArrayLength = 0;
if (aSource.mCursorArrayLength) {
mCursorArray = new nsCursorImage[aSource.mCursorArrayLength];
if (mCursorArray) {
mCursorArrayLength = aSource.mCursorArrayLength;
- for (uint32_t i = 0; i < mCursorArrayLength; ++i)
+ for (uint32_t i = 0; i < mCursorArrayLength; ++i) {
mCursorArray[i] = aSource.mCursorArray[i];
+ }
}
}
}
//-----------------------
// nsStyleUIReset
//
@@ -3896,26 +3970,28 @@ nsStyleUIReset::~nsStyleUIReset()
{
MOZ_COUNT_DTOR(nsStyleUIReset);
}
nsChangeHint
nsStyleUIReset::CalcDifference(const nsStyleUIReset& aNewData) const
{
// ignore mIMEMode
- if (mForceBrokenImageIcon != aNewData.mForceBrokenImageIcon)
+ if (mForceBrokenImageIcon != aNewData.mForceBrokenImageIcon) {
return NS_STYLE_HINT_FRAMECHANGE;
+ }
if (mWindowShadow != aNewData.mWindowShadow) {
// We really need just an nsChangeHint_SyncFrameView, except
// on an ancestor of the frame, so we get that by doing a
// reflow.
return NS_STYLE_HINT_REFLOW;
}
- if (mUserSelect != aNewData.mUserSelect)
+ if (mUserSelect != aNewData.mUserSelect) {
return NS_STYLE_HINT_VISUAL;
+ }
if (mWindowDragging != aNewData.mWindowDragging) {
return nsChangeHint_SchedulePaint;
}
return NS_STYLE_HINT_NONE;
}
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -535,18 +535,19 @@ struct nsStyleImageLayers {
};
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)
+ if (d < 0.0) {
return 0;
+ }
return NSToCoordRoundWithClamp(float(d));
}
};
Dimension mWidth, mHeight;
bool IsInitialValue() const {
return mWidthType == eAuto && mHeightType == eAuto;
}
@@ -671,22 +672,24 @@ struct nsStyleImageLayers {
~Layer();
// Initialize mRepeat and mOrigin by specified layer type
void Initialize(LayerType aType);
// Register/unregister images with the document. We do this only
// after the dust has settled in ComputeBackgroundData.
void TrackImages(nsPresContext* aContext) {
- if (mImage.GetType() == eStyleImageType_Image)
+ if (mImage.GetType() == eStyleImageType_Image) {
mImage.TrackImage(aContext);
+ }
}
void UntrackImages(nsPresContext* aContext) {
- if (mImage.GetType() == eStyleImageType_Image)
+ if (mImage.GetType() == eStyleImageType_Image) {
mImage.UntrackImage(aContext);
+ }
}
// True if the rendering of this layer might change when the size
// of the background positioning area changes. This is true for any
// non-solid-color background whose position or size depends on
// the size of the positioning area. It's also true for SVG images
// whose root <svg> node has a viewBox.
bool RenderingMightDependOnPositioningAreaSizeChange() const;
@@ -917,21 +920,23 @@ struct nsBorderColors
nsBorderColors() : mNext(nullptr), mColor(NS_RGB(0,0,0)) {}
explicit nsBorderColors(const nscolor& aColor) : mNext(nullptr), mColor(aColor) {}
~nsBorderColors();
nsBorderColors* Clone() const { return Clone(true); }
static bool Equal(const nsBorderColors* c1,
const nsBorderColors* c2) {
- if (c1 == c2)
+ if (c1 == c2) {
return true;
+ }
while (c1 && c2) {
- if (c1->mColor != c2->mColor)
+ if (c1->mColor != c2->mColor) {
return false;
+ }
c1 = c1->mNext;
c2 = c2->mNext;
}
// both should be nullptr if these are equal, otherwise one
// has more colors than another
return !c1 && !c2;
}
@@ -1012,29 +1017,32 @@ public:
}
const nsCSSShadowItem* ShadowAt(uint32_t i) const {
MOZ_ASSERT(i < mLength, "Accessing too high an index in the text shadow array!");
return &mArray[i];
}
bool HasShadowWithInset(bool aInset) {
for (uint32_t i = 0; i < mLength; ++i) {
- if (mArray[i].mInset == aInset)
+ if (mArray[i].mInset == aInset) {
return true;
+ }
}
return false;
}
bool operator==(const nsCSSShadowArray& aOther) const {
- if (mLength != aOther.Length())
+ if (mLength != aOther.Length()) {
return false;
+ }
for (uint32_t i = 0; i < mLength; ++i) {
- if (ShadowAt(i) != aOther.ShadowAt(i))
+ if (ShadowAt(i) != aOther.ShadowAt(i)) {
return false;
+ }
}
return true;
}
NS_INLINE_DECL_REFCOUNTING(nsCSSShadowArray)
private:
@@ -1088,19 +1096,21 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
return nsChangeHint_NeedReflow |
nsChangeHint_ReflowChangesSizeOrPosition |
nsChangeHint_ClearAncestorIntrinsics;
}
void EnsureBorderColors() {
if (!mBorderColors) {
mBorderColors = new nsBorderColors*[4];
- if (mBorderColors)
- for (int32_t i = 0; i < 4; i++)
+ if (mBorderColors) {
+ for (int32_t i = 0; i < 4; i++) {
mBorderColors[i] = nullptr;
+ }
+ }
}
}
void ClearBorderColors(mozilla::css::Side aSide) {
if (mBorderColors && mBorderColors[aSide]) {
delete mBorderColors[aSide];
mBorderColors[aSide] = nullptr;
}
@@ -1117,18 +1127,19 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
}
// aBorderWidth is in twips
void SetBorderWidth(mozilla::css::Side aSide, nscoord aBorderWidth)
{
nscoord roundedWidth =
NS_ROUND_BORDER_TO_PIXELS(aBorderWidth, mTwipsPerPixel);
mBorder.Side(aSide) = roundedWidth;
- if (HasVisibleStyle(aSide))
+ if (HasVisibleStyle(aSide)) {
mComputedBorder.Side(aSide) = roundedWidth;
+ }
}
// Get the computed border (plus rounding). This does consider the
// effects of 'border-style: none', but does not consider
// 'border-image'.
const nsMargin& GetComputedBorder() const
{
return mComputedBorder;
@@ -1168,22 +1179,23 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
return mBorderImageSource.IsLoaded();
}
void GetBorderColor(mozilla::css::Side aSide, nscolor& aColor,
bool& aForeground) const
{
aForeground = false;
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
- if ((mBorderStyle[aSide] & BORDER_COLOR_SPECIAL) == 0)
+ if ((mBorderStyle[aSide] & BORDER_COLOR_SPECIAL) == 0) {
aColor = mBorderColor[aSide];
- else if (mBorderStyle[aSide] & BORDER_COLOR_FOREGROUND)
+ } else if (mBorderStyle[aSide] & BORDER_COLOR_FOREGROUND) {
aForeground = true;
- else
+ } else {
NS_NOTREACHED("OUTLINE_COLOR_INITIAL should not be set here");
+ }
}
void SetBorderColor(mozilla::css::Side aSide, nscolor aColor)
{
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
mBorderColor[aSide] = aColor;
mBorderStyle[aSide] &= ~BORDER_COLOR_SPECIAL;
}
@@ -1200,32 +1212,34 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
mBorderImageSource.UntrackImage(aContext);
}
}
nsMargin GetImageOutset() const;
void GetCompositeColors(int32_t aIndex, nsBorderColors** aColors) const
{
- if (!mBorderColors)
+ if (!mBorderColors) {
*aColors = nullptr;
- else
+ } else {
*aColors = mBorderColors[aIndex];
+ }
}
void AppendBorderColor(int32_t aIndex, nscolor aColor)
{
NS_ASSERTION(aIndex >= 0 && aIndex <= 3, "bad side for composite border color");
nsBorderColors* colorEntry = new nsBorderColors(aColor);
- if (!mBorderColors[aIndex])
+ if (!mBorderColors[aIndex]) {
mBorderColors[aIndex] = colorEntry;
- else {
+ } else {
nsBorderColors* last = mBorderColors[aIndex];
- while (last->mNext)
+ while (last->mNext) {
last = last->mNext;
+ }
last->mNext = colorEntry;
}
mBorderStyle[aIndex] &= ~BORDER_COLOR_SPECIAL;
}
void SetBorderToForeground(mozilla::css::Side aSide)
{
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
@@ -1435,21 +1449,23 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
static void Shutdown() {
sInitialQuotes = nullptr;
sNoneQuotes = nullptr;
}
imgRequestProxy* GetListStyleImage() const { return mListStyleImage; }
void SetListStyleImage(imgRequestProxy* aReq)
{
- if (mListStyleImage)
+ if (mListStyleImage) {
mListStyleImage->UnlockImage();
+ }
mListStyleImage = aReq;
- if (mListStyleImage)
+ if (mListStyleImage) {
mListStyleImage->LockImage();
+ }
}
void GetListStyleType(nsSubstring& aType) const { mCounterStyle->GetStyleName(aType); }
mozilla::CounterStyle* GetCounterStyle() const
{
return mCounterStyle.get();
}
void SetCounterStyle(mozilla::CounterStyle* aStyle)
@@ -2090,25 +2106,26 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
struct nsStyleImageOrientation
{
static nsStyleImageOrientation CreateAsAngleAndFlip(double aRadians,
bool aFlip) {
uint8_t orientation(0);
// Compute the final angle value, rounding to the closest quarter turn.
double roundedAngle = fmod(aRadians, 2 * M_PI);
- if (roundedAngle < 0.25 * M_PI) orientation = ANGLE_0;
- else if (roundedAngle < 0.75 * M_PI) orientation = ANGLE_90;
- else if (roundedAngle < 1.25 * M_PI) orientation = ANGLE_180;
- else if (roundedAngle < 1.75 * M_PI) orientation = ANGLE_270;
- else orientation = ANGLE_0;
+ if (roundedAngle < 0.25 * M_PI) { orientation = ANGLE_0; }
+ else if (roundedAngle < 0.75 * M_PI) { orientation = ANGLE_90; }
+ else if (roundedAngle < 1.25 * M_PI) { orientation = ANGLE_180;}
+ else if (roundedAngle < 1.75 * M_PI) { orientation = ANGLE_270;}
+ else { orientation = ANGLE_0; }
// Add a bit for 'flip' if needed.
- if (aFlip)
+ if (aFlip) {
orientation |= FLIP_MASK;
+ }
return nsStyleImageOrientation(orientation);
}
static nsStyleImageOrientation CreateAsFlip() {
return nsStyleImageOrientation(FLIP_MASK);
}
@@ -2309,18 +2326,19 @@ struct nsTimingFunction
StepSyntax mStepSyntax;
uint32_t mSteps;
};
};
nsTimingFunction&
operator=(const nsTimingFunction& aOther)
{
- if (&aOther == this)
+ if (&aOther == this) {
return *this;
+ }
mType = aOther.mType;
if (HasSpline()) {
mFunc.mX1 = aOther.mFunc.mX1;
mFunc.mY1 = aOther.mFunc.mY1;
mFunc.mX2 = aOther.mFunc.mX2;
mFunc.mY2 = aOther.mFunc.mY2;
@@ -3026,21 +3044,23 @@ struct nsCursorImage
nsCursorImage& operator=(const nsCursorImage& aOther);
/*
* We hide mImage and force access through the getter and setter so that we
* can lock the images we use. Cursor images are likely to be small, so we
* don't care about discarding them. See bug 512260.
* */
void SetImage(imgIRequest *aImage) {
- if (mImage)
+ if (mImage) {
mImage->UnlockImage();
+ }
mImage = aImage;
- if (mImage)
+ if (mImage) {
mImage->LockImage();
+ }
}
imgIRequest* GetImage() const {
return mImage;
}
private:
nsCOMPtr<imgIRequest> mImage;
};