Bug 1317588 Part 2 - Remove mozilla::css::Side typedef. r=mats

This patch is written with the help of the following script.

function rename() {
find .\
     -type f\
     ! -path "./obj*"\
     ! -path "./.git"\
     ! -path "./.hg"\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -e "s/$1/$2/g" "{}" \;
}

rename "css::Side" "Side"

MozReview-Commit-ID: DPV6vivpPUp

--HG--
extra : rebase_source : 9c4f66dc9d2b26c89a4517fba4ff9c5db413411b
This commit is contained in:
Ting-Yu Lin 2016-11-18 16:28:38 +08:00
parent 3a4c674931
commit c9cfd878cb
18 changed files with 107 additions and 111 deletions

View File

@ -81,7 +81,7 @@ StyleInfo::TextIndent(nsAString& aValue)
}
void
StyleInfo::Margin(css::Side aSide, nsAString& aValue)
StyleInfo::Margin(Side aSide, nsAString& aValue)
{
MOZ_ASSERT(mElement->GetPrimaryFrame(), " mElement->GetPrimaryFrame() needs to be valid pointer");
aValue.Truncate();

View File

@ -404,25 +404,21 @@ enum SideBits {
#define NS_SIDE_BOTTOM mozilla::eSideBottom
#define NS_SIDE_LEFT mozilla::eSideLeft
namespace css {
typedef mozilla::Side Side;
} // namespace css
// Creates a for loop that walks over the four mozilla::css::Side values.
// Creates a for loop that walks over the four mozilla::Side values.
// We use an int32_t helper variable (instead of a Side) for our loop counter,
// to avoid triggering undefined behavior just before we exit the loop (at
// which point the counter is incremented beyond the largest valid Side value).
#define NS_FOR_CSS_SIDES(var_) \
int32_t MOZ_CONCAT(var_,__LINE__) = NS_SIDE_TOP; \
for (mozilla::css::Side var_; \
for (mozilla::Side var_; \
MOZ_CONCAT(var_,__LINE__) <= NS_SIDE_LEFT && \
((var_ = mozilla::css::Side(MOZ_CONCAT(var_,__LINE__))), true); \
((var_ = mozilla::Side(MOZ_CONCAT(var_,__LINE__))), true); \
MOZ_CONCAT(var_,__LINE__)++)
static inline css::Side operator++(css::Side& side, int) {
static inline Side operator++(Side& side, int) {
NS_PRECONDITION(side >= NS_SIDE_TOP &&
side <= NS_SIDE_LEFT, "Out of range side");
side = css::Side(side + 1);
side = Side(side + 1);
return side;
}

View File

@ -14,7 +14,7 @@ static_assert((int(NS_SIDE_TOP) == 0) &&
(int(NS_SIDE_RIGHT) == 1) &&
(int(NS_SIDE_BOTTOM) == 2) &&
(int(NS_SIDE_LEFT) == 3),
"The mozilla::css::Side sequence must match the nsMargin nscoord sequence");
"The mozilla::Side sequence must match the nsMargin nscoord sequence");
const mozilla::gfx::IntRect& GetMaxSizedIntRect() {
static const mozilla::gfx::IntRect r(0, 0, INT32_MAX, INT32_MAX);

View File

@ -6711,7 +6711,7 @@ nsLayoutUtils::HasNonZeroCorner(const nsStyleCorners& aCorners)
}
// aCorner is a "full corner" value, i.e. NS_CORNER_TOP_LEFT etc
static bool IsCornerAdjacentToSide(uint8_t aCorner, css::Side aSide)
static bool IsCornerAdjacentToSide(uint8_t aCorner, Side aSide)
{
static_assert((int)NS_SIDE_TOP == NS_CORNER_TOP_LEFT, "Check for Full Corner");
static_assert((int)NS_SIDE_RIGHT == NS_CORNER_TOP_RIGHT, "Check for Full Corner");
@ -6727,7 +6727,7 @@ static bool IsCornerAdjacentToSide(uint8_t aCorner, css::Side aSide)
/* static */ bool
nsLayoutUtils::HasNonZeroCornerOnSide(const nsStyleCorners& aCorners,
css::Side aSide)
Side aSide)
{
static_assert(NS_CORNER_TOP_LEFT_X/2 == NS_CORNER_TOP_LEFT, "Check for Non Zero on side");
static_assert(NS_CORNER_TOP_LEFT_Y/2 == NS_CORNER_TOP_LEFT, "Check for Non Zero on side");

View File

@ -1938,7 +1938,7 @@ public:
* given side.
*/
static bool HasNonZeroCornerOnSide(const nsStyleCorners& aCorners,
mozilla::css::Side aSide);
mozilla::Side aSide);
/**
* Determine if a widget is likely to require transparency or translucency.

View File

@ -52,7 +52,7 @@ nsRect
nsFieldSetFrame::VisualBorderRectRelativeToSelf() const
{
WritingMode wm = GetWritingMode();
css::Side legendSide = wm.PhysicalSide(eLogicalSideBStart);
Side legendSide = wm.PhysicalSide(eLogicalSideBStart);
nscoord legendBorder = StyleBorder()->GetComputedBorderWidth(legendSide);
LogicalRect r(wm, LogicalPoint(wm, 0, 0), GetLogicalSize(wm));
nsSize containerSize = r.Size(wm).GetPhysicalSize(wm);
@ -237,7 +237,7 @@ nsFieldSetFrame::PaintBorder(
this, rect);
if (nsIFrame* legend = GetLegend()) {
css::Side legendSide = wm.PhysicalSide(eLogicalSideBStart);
Side legendSide = wm.PhysicalSide(eLogicalSideBStart);
nscoord legendBorderWidth =
StyleBorder()->GetComputedBorderWidth(legendSide);

View File

@ -906,10 +906,10 @@ ReflowInput::ComputeRelativeOffsets(WritingMode aWM,
nsMargin& aComputedOffsets)
{
LogicalMargin offsets(aWM);
mozilla::css::Side inlineStart = aWM.PhysicalSide(eLogicalSideIStart);
mozilla::css::Side inlineEnd = aWM.PhysicalSide(eLogicalSideIEnd);
mozilla::css::Side blockStart = aWM.PhysicalSide(eLogicalSideBStart);
mozilla::css::Side blockEnd = aWM.PhysicalSide(eLogicalSideBEnd);
mozilla::Side inlineStart = aWM.PhysicalSide(eLogicalSideIStart);
mozilla::Side inlineEnd = aWM.PhysicalSide(eLogicalSideIEnd);
mozilla::Side blockStart = aWM.PhysicalSide(eLogicalSideBStart);
mozilla::Side blockEnd = aWM.PhysicalSide(eLogicalSideBEnd);
const nsStylePosition* position = aFrame->StylePosition();
@ -1144,9 +1144,9 @@ ReflowInput::CalculateBorderPaddingMargin(
nscoord* aOutsideBoxSizing) const
{
WritingMode wm = GetWritingMode();
mozilla::css::Side startSide =
mozilla::Side startSide =
wm.PhysicalSide(MakeLogicalSide(aAxis, eLogicalEdgeStart));
mozilla::css::Side endSide =
mozilla::Side endSide =
wm.PhysicalSide(MakeLogicalSide(aAxis, eLogicalEdgeEnd));
nsMargin styleBorder = mStyleBorder->GetComputedBorder();

View File

@ -324,7 +324,7 @@ public:
// two-bit values:
// bit 0 = the eOrientationMask value
// bit 1 = the eBlockFlowMask value
static const mozilla::css::Side kLogicalBlockSides[][2] = {
static const mozilla::Side kLogicalBlockSides[][2] = {
{ NS_SIDE_TOP, NS_SIDE_BOTTOM }, // horizontal-tb
{ NS_SIDE_RIGHT, NS_SIDE_LEFT }, // vertical-rl
{ NS_SIDE_BOTTOM, NS_SIDE_TOP }, // (horizontal-bt)
@ -352,7 +352,7 @@ public:
// is no horizontal-bt writing-mode, and no text-orientation value that
// produces "inverted" text. (The former 'sideways-left' value, no longer
// in the spec, would have produced this in vertical-rl mode.)
static const mozilla::css::Side kLogicalInlineSides[][2] = {
static const mozilla::Side kLogicalInlineSides[][2] = {
{ NS_SIDE_LEFT, NS_SIDE_RIGHT }, // horizontal-tb ltr
{ NS_SIDE_TOP, NS_SIDE_BOTTOM }, // vertical-rl ltr
{ NS_SIDE_RIGHT, NS_SIDE_LEFT }, // horizontal-tb rtl
@ -404,7 +404,7 @@ public:
* given the current writing mode.
* (This is the inverse of the PhysicalSide() method above.)
*/
LogicalSide LogicalSideForPhysicalSide(mozilla::css::Side aSide) const
LogicalSide LogicalSideForPhysicalSide(mozilla::Side aSide) const
{
// indexes are four-bit values:
// bit 0 = the eOrientationMask value

View File

@ -834,9 +834,9 @@ nsContainerFrame::DoInlineIntrinsicISize(nsRenderingContext *aRenderingContext,
aType == nsLayoutUtils::PREF_ISIZE, "bad type");
WritingMode wm = GetWritingMode();
mozilla::css::Side startSide =
mozilla::Side startSide =
wm.PhysicalSideForInlineAxis(eLogicalEdgeStart);
mozilla::css::Side endSide =
mozilla::Side endSide =
wm.PhysicalSideForInlineAxis(eLogicalEdgeEnd);
const nsStylePadding *stylePadding = StylePadding();

View File

@ -437,7 +437,7 @@ static DrawResult DrawBorderImage(nsPresContext* aPresContext,
Sides aSkipSides,
PaintBorderFlags aFlags);
static nscolor MakeBevelColor(mozilla::css::Side whichSide, uint8_t style,
static nscolor MakeBevelColor(mozilla::Side whichSide, uint8_t style,
nscolor aBackgroundColor,
nscolor aBorderColor);
@ -461,7 +461,7 @@ void nsCSSRendering::Shutdown()
* Make a bevel color
*/
static nscolor
MakeBevelColor(mozilla::css::Side whichSide, uint8_t style,
MakeBevelColor(mozilla::Side whichSide, uint8_t style,
nscolor aBackgroundColor, nscolor aBorderColor)
{
@ -1739,7 +1739,7 @@ nsCSSRendering::PaintBackground(const PaintBGParams& aParams)
}
static bool
IsOpaqueBorderEdge(const nsStyleBorder& aBorder, mozilla::css::Side aSide)
IsOpaqueBorderEdge(const nsStyleBorder& aBorder, mozilla::Side aSide)
{
if (aBorder.GetComputedBorder().Side(aSide) == 0)
return true;
@ -4336,7 +4336,7 @@ nsCSSRendering::DrawTableBorderSegment(DrawTarget& aDrawTarget,
? RoundFloatToPixel(0.5f * (float)aStartBevelOffset, twipsPerPixel, true) : 0;
nscoord endBevel = (aEndBevelOffset > 0)
? RoundFloatToPixel(0.5f * (float)aEndBevelOffset, twipsPerPixel, true) : 0;
mozilla::css::Side ridgeGrooveSide = (horizontal) ? NS_SIDE_TOP : NS_SIDE_LEFT;
mozilla::Side ridgeGrooveSide = (horizontal) ? NS_SIDE_TOP : NS_SIDE_LEFT;
// FIXME: In theory, this should use the visited-dependent
// background color, but I don't care.
nscolor bevelColor = MakeBevelColor(ridgeGrooveSide, ridgeGroove,

View File

@ -64,8 +64,8 @@ static void ComputeBorderCornerDimensions(const Float* aBorderWidths,
RectCornerRadii *aDimsResult);
// given a side index, get the previous and next side index
#define NEXT_SIDE(_s) mozilla::css::Side(((_s) + 1) & 3)
#define PREV_SIDE(_s) mozilla::css::Side(((_s) + 3) & 3)
#define NEXT_SIDE(_s) mozilla::Side(((_s) + 1) & 3)
#define PREV_SIDE(_s) mozilla::Side(((_s) + 3) & 3)
// given a corner index, get the previous and next corner index
#define NEXT_CORNER(_s) mozilla::css::Corner(((_s) + 1) & 3)
@ -114,26 +114,26 @@ AllCornersZeroSize(const RectCornerRadii& corners) {
IsZeroSize(corners[NS_CORNER_BOTTOM_LEFT]);
}
static mozilla::css::Side
static mozilla::Side
GetHorizontalSide(mozilla::css::Corner aCorner)
{
return (aCorner == C_TL || aCorner == C_TR) ? NS_SIDE_TOP : NS_SIDE_BOTTOM;
}
static mozilla::css::Side
static mozilla::Side
GetVerticalSide(mozilla::css::Corner aCorner)
{
return (aCorner == C_TL || aCorner == C_BL) ? NS_SIDE_LEFT : NS_SIDE_RIGHT;
}
static mozilla::css::Corner
GetCWCorner(mozilla::css::Side aSide)
GetCWCorner(mozilla::Side aSide)
{
return mozilla::css::Corner(NEXT_SIDE(aSide));
}
static mozilla::css::Corner
GetCCWCorner(mozilla::css::Side aSide)
GetCCWCorner(mozilla::Side aSide)
{
return mozilla::css::Corner(aSide);
}
@ -146,7 +146,7 @@ IsSingleSide(int aSides)
}
static bool
IsHorizontalSide(mozilla::css::Side aSide)
IsHorizontalSide(mozilla::Side aSide)
{
return aSide == NS_SIDE_TOP || aSide == NS_SIDE_BOTTOM;
}
@ -386,8 +386,8 @@ nsCSSBorderRenderer::IsCornerMergeable(mozilla::css::Corner aCorner)
// +-------------------------+----
// | |
// | |
mozilla::css::Side sideH(GetHorizontalSide(aCorner));
mozilla::css::Side sideV(GetVerticalSide(aCorner));
mozilla::Side sideH(GetHorizontalSide(aCorner));
mozilla::Side sideV(GetVerticalSide(aCorner));
uint8_t styleH = mBorderStyles[sideH];
uint8_t styleV = mBorderStyles[sideV];
if (styleH != styleV || styleH != NS_STYLE_BORDER_STYLE_DOTTED) {
@ -450,7 +450,7 @@ nsCSSBorderRenderer::GetCornerRect(mozilla::css::Corner aCorner)
}
Rect
nsCSSBorderRenderer::GetSideClipWithoutCornersRect(mozilla::css::Side aSide)
nsCSSBorderRenderer::GetSideClipWithoutCornersRect(mozilla::Side aSide)
{
Point offset(0.f, 0.f);
@ -584,7 +584,7 @@ MaybeMoveToMidPoint(Point& aP0, Point& aP1, const Point& aMidPoint)
}
already_AddRefed<Path>
nsCSSBorderRenderer::GetSideClipSubPath(mozilla::css::Side aSide)
nsCSSBorderRenderer::GetSideClipSubPath(mozilla::Side aSide)
{
// the clip proceeds clockwise from the top left corner;
// so "start" in each case is the start of the region from that side.
@ -674,7 +674,7 @@ nsCSSBorderRenderer::GetSideClipSubPath(mozilla::css::Side aSide)
}
Point
nsCSSBorderRenderer::GetStraightBorderPoint(mozilla::css::Side aSide,
nsCSSBorderRenderer::GetStraightBorderPoint(mozilla::Side aSide,
mozilla::css::Corner aCorner,
bool* aIsUnfilled)
{
@ -725,7 +725,7 @@ nsCSSBorderRenderer::GetStraightBorderPoint(mozilla::css::Side aSide,
// | |
// otherSide | |
// | |
mozilla::css::Side otherSide = ((uint8_t)aSide == (uint8_t)aCorner)
mozilla::Side otherSide = ((uint8_t)aSide == (uint8_t)aCorner)
? PREV_SIDE(aSide)
: NEXT_SIDE(aSide);
uint8_t otherStyle = mBorderStyles[otherSide];
@ -1081,8 +1081,8 @@ nsCSSBorderRenderer::GetOuterAndInnerBezier(Bezier* aOuterBezier,
// | |
// +---------+
mozilla::css::Side sideH(GetHorizontalSide(aCorner));
mozilla::css::Side sideV(GetVerticalSide(aCorner));
mozilla::Side sideH(GetHorizontalSide(aCorner));
mozilla::Side sideV(GetVerticalSide(aCorner));
Size outerCornerSize(ceil(mBorderRadii[aCorner].width),
ceil(mBorderRadii[aCorner].height));
@ -1617,7 +1617,7 @@ nsCSSBorderRenderer::DrawBorderSides(int aSides)
void
nsCSSBorderRenderer::SetupDashedOptions(StrokeOptions* aStrokeOptions,
Float aDash[2],
mozilla::css::Side aSide,
mozilla::Side aSide,
Float aBorderLength, bool isCorner)
{
uint8_t style = mBorderStyles[aSide];
@ -1792,7 +1792,7 @@ nsCSSBorderRenderer::SetupDashedOptions(StrokeOptions* aStrokeOptions,
}
static Float
GetBorderLength(mozilla::css::Side aSide,
GetBorderLength(mozilla::Side aSide,
const Point& aStart, const Point& aEnd)
{
if (aSide == NS_SIDE_TOP) {
@ -1808,7 +1808,7 @@ GetBorderLength(mozilla::css::Side aSide,
}
void
nsCSSBorderRenderer::DrawDashedOrDottedSide(mozilla::css::Side aSide)
nsCSSBorderRenderer::DrawDashedOrDottedSide(mozilla::Side aSide)
{
// Draw dashed/dotted side with following approach.
//
@ -1878,7 +1878,7 @@ nsCSSBorderRenderer::DrawDashedOrDottedSide(mozilla::css::Side aSide)
}
void
nsCSSBorderRenderer::DrawDottedSideSlow(mozilla::css::Side aSide)
nsCSSBorderRenderer::DrawDottedSideSlow(mozilla::Side aSide)
{
// Draw each circles separately for dotted with borderWidth > 2.0.
// Dashed line with CapStyle::ROUND doesn't render perfect circles.
@ -2258,7 +2258,7 @@ nsCSSBorderRenderer::DrawDottedSideSlow(mozilla::css::Side aSide)
}
void
nsCSSBorderRenderer::DrawDashedOrDottedCorner(mozilla::css::Side aSide,
nsCSSBorderRenderer::DrawDashedOrDottedCorner(mozilla::Side aSide,
mozilla::css::Corner aCorner)
{
// Draw dashed/dotted corner with following approach.
@ -2296,8 +2296,8 @@ nsCSSBorderRenderer::DrawDashedOrDottedCorner(mozilla::css::Side aSide,
return;
}
mozilla::css::Side sideH(GetHorizontalSide(aCorner));
mozilla::css::Side sideV(GetVerticalSide(aCorner));
mozilla::Side sideH(GetHorizontalSide(aCorner));
mozilla::Side sideV(GetVerticalSide(aCorner));
Float borderWidthH = mBorderWidths[sideH];
Float borderWidthV = mBorderWidths[sideV];
if (borderWidthH == 0.0f && borderWidthV == 0.0f) {
@ -2364,14 +2364,14 @@ nsCSSBorderRenderer::DrawDashedOrDottedCorner(mozilla::css::Side aSide,
}
void
nsCSSBorderRenderer::DrawDottedCornerSlow(mozilla::css::Side aSide,
nsCSSBorderRenderer::DrawDottedCornerSlow(mozilla::Side aSide,
mozilla::css::Corner aCorner)
{
NS_ASSERTION(mBorderStyles[aSide] == NS_STYLE_BORDER_STYLE_DOTTED,
"Style should be dotted.");
mozilla::css::Side sideH(GetHorizontalSide(aCorner));
mozilla::css::Side sideV(GetVerticalSide(aCorner));
mozilla::Side sideH(GetHorizontalSide(aCorner));
mozilla::Side sideV(GetVerticalSide(aCorner));
Float R0 = mBorderWidths[sideH] / 2.0f;
Float Rn = mBorderWidths[sideV] / 2.0f;
if (R0 == 0.0f && Rn == 0.0f) {
@ -2441,14 +2441,14 @@ DashedPathOverlapsRect(Rect& pathRect,
}
void
nsCSSBorderRenderer::DrawDashedCornerSlow(mozilla::css::Side aSide,
nsCSSBorderRenderer::DrawDashedCornerSlow(mozilla::Side aSide,
mozilla::css::Corner aCorner)
{
NS_ASSERTION(mBorderStyles[aSide] == NS_STYLE_BORDER_STYLE_DASHED,
"Style should be dashed.");
mozilla::css::Side sideH(GetHorizontalSide(aCorner));
mozilla::css::Side sideV(GetVerticalSide(aCorner));
mozilla::Side sideH(GetHorizontalSide(aCorner));
mozilla::Side sideV(GetVerticalSide(aCorner));
Float borderWidthH = mBorderWidths[sideH];
Float borderWidthV = mBorderWidths[sideV];
if (borderWidthH == 0.0f && borderWidthV == 0.0f) {
@ -2557,7 +2557,7 @@ nsCSSBorderRenderer::DrawDashedCornerSlow(mozilla::css::Side aSide,
}
void
nsCSSBorderRenderer::DrawFallbackSolidCorner(mozilla::css::Side aSide,
nsCSSBorderRenderer::DrawFallbackSolidCorner(mozilla::Side aSide,
mozilla::css::Corner aCorner)
{
// Render too large dashed or dotted corner with solid style, to avoid hangup
@ -3357,7 +3357,7 @@ nsCSSBorderRenderer::DrawBorders()
*/
NS_FOR_CSS_CORNERS(corner) {
const mozilla::css::Side sides[2] = { mozilla::css::Side(corner), PREV_SIDE(corner) };
const mozilla::Side sides[2] = { mozilla::Side(corner), PREV_SIDE(corner) };
if (!IsZeroSize(mBorderRadii[corner]))
continue;
@ -3418,7 +3418,7 @@ nsCSSBorderRenderer::DrawBorders()
// advantages outway the modest easthetic improvement.
for (int cornerSide = 0; cornerSide < 2; cornerSide++) {
mozilla::css::Side side = mozilla::css::Side(sides[cornerSide]);
mozilla::Side side = mozilla::Side(sides[cornerSide]);
uint8_t style = mBorderStyles[side];
PrintAsFormatString("corner: %d cornerSide: %d side: %d style: %d\n", corner, cornerSide, side, style);

View File

@ -158,7 +158,7 @@ private:
// Get the Rect for drawing the given corner
Rect GetCornerRect(mozilla::css::Corner aCorner);
// add the path for drawing the given side without any adjacent corners to the context
Rect GetSideClipWithoutCornersRect(mozilla::css::Side aSide);
Rect GetSideClipWithoutCornersRect(mozilla::Side aSide);
// Create a clip path for the wedge that this side of
// the border should take up. This is only called
@ -168,10 +168,10 @@ private:
// This code needs to make sure that the individual pieces
// don't ever (mathematically) overlap; the pixel overlap
// is taken care of by the ADD compositing.
already_AddRefed<Path> GetSideClipSubPath(mozilla::css::Side aSide);
already_AddRefed<Path> GetSideClipSubPath(mozilla::Side aSide);
// Return start or end point for dashed/dotted side
Point GetStraightBorderPoint(mozilla::css::Side aSide,
Point GetStraightBorderPoint(mozilla::Side aSide,
mozilla::css::Corner aCorner,
bool* aIsUnfilled);
@ -213,29 +213,29 @@ private:
// Setup the stroke options for the given dashed/dotted side
void SetupDashedOptions(StrokeOptions* aStrokeOptions,
Float aDash[2], mozilla::css::Side aSide,
Float aDash[2], mozilla::Side aSide,
Float aBorderLength, bool isCorner);
// Draw the given dashed/dotte side
void DrawDashedOrDottedSide(mozilla::css::Side aSide);
void DrawDashedOrDottedSide(mozilla::Side aSide);
// Draw the given dotted side, each dot separately
void DrawDottedSideSlow(mozilla::css::Side aSide);
void DrawDottedSideSlow(mozilla::Side aSide);
// Draw the given dashed/dotted corner
void DrawDashedOrDottedCorner(mozilla::css::Side aSide,
void DrawDashedOrDottedCorner(mozilla::Side aSide,
mozilla::css::Corner aCorner);
// Draw the given dotted corner, each segment separately
void DrawDottedCornerSlow(mozilla::css::Side aSide,
void DrawDottedCornerSlow(mozilla::Side aSide,
mozilla::css::Corner aCorner);
// Draw the given dashed corner, each dot separately
void DrawDashedCornerSlow(mozilla::css::Side aSide,
void DrawDashedCornerSlow(mozilla::Side aSide,
mozilla::css::Corner aCorner);
// Draw the given dashed/dotted corner with solid style
void DrawFallbackSolidCorner(mozilla::css::Side aSide,
void DrawFallbackSolidCorner(mozilla::Side aSide,
mozilla::css::Corner aCorner);
// Analyze if all border sides have the same width.

View File

@ -4531,7 +4531,7 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty,
const nsStyleCoord &coord =
StyleDataAtOffset<nsStyleSides>(styleStruct, ssOffset).
Get(mozilla::css::Side(animType - eStyleAnimType_Sides_Top));
Get(mozilla::Side(animType - eStyleAnimType_Sides_Top));
return StyleCoordToValue(coord, aComputedValue);
}
case eStyleAnimType_Corner_TopLeft:

View File

@ -241,7 +241,7 @@ EnsurePhysicalProperty(nsCSSPropertyID& aProperty, nsRuleData* aRuleData)
// We handle block axis logical properties separately to save a bit of
// work that the WritingMode constructor does that is unnecessary
// unless we have an inline axis property.
mozilla::css::Side side;
mozilla::Side side;
if (isBlock) {
uint8_t wm = aRuleData->mStyleContext->StyleVisibility()->mWritingMode;
side = WritingMode::PhysicalSideForBlockAxis(wm, edge);

View File

@ -5010,7 +5010,7 @@ nsComputedDOMStyle::GetROCSSValueList(bool aCommaDelimited)
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetOffsetWidthFor(mozilla::css::Side aSide)
nsComputedDOMStyle::GetOffsetWidthFor(mozilla::Side aSide)
{
const nsStyleDisplay* display = StyleDisplay();
@ -5041,7 +5041,7 @@ nsComputedDOMStyle::GetOffsetWidthFor(mozilla::css::Side aSide)
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetAbsoluteOffset(mozilla::css::Side aSide)
nsComputedDOMStyle::GetAbsoluteOffset(mozilla::Side aSide)
{
MOZ_ASSERT(mOuterFrame, "need a frame, so we can call GetContainingBlock()");
@ -5099,10 +5099,10 @@ nsComputedDOMStyle::GetAbsoluteOffset(mozilla::css::Side aSide)
static_assert(NS_SIDE_TOP == 0 && NS_SIDE_RIGHT == 1 &&
NS_SIDE_BOTTOM == 2 && NS_SIDE_LEFT == 3,
"box side constants not as expected for NS_OPPOSITE_SIDE");
#define NS_OPPOSITE_SIDE(s_) mozilla::css::Side(((s_) + 2) & 3)
#define NS_OPPOSITE_SIDE(s_) mozilla::Side(((s_) + 2) & 3)
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetRelativeOffset(mozilla::css::Side aSide)
nsComputedDOMStyle::GetRelativeOffset(mozilla::Side aSide)
{
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
@ -5132,7 +5132,7 @@ nsComputedDOMStyle::GetRelativeOffset(mozilla::css::Side aSide)
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetStickyOffset(mozilla::css::Side aSide)
nsComputedDOMStyle::GetStickyOffset(mozilla::Side aSide)
{
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
@ -5162,7 +5162,7 @@ nsComputedDOMStyle::GetStickyOffset(mozilla::css::Side aSide)
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetStaticOffset(mozilla::css::Side aSide)
nsComputedDOMStyle::GetStaticOffset(mozilla::Side aSide)
{
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
@ -5171,7 +5171,7 @@ nsComputedDOMStyle::GetStaticOffset(mozilla::css::Side aSide)
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetPaddingWidthFor(mozilla::css::Side aSide)
nsComputedDOMStyle::GetPaddingWidthFor(mozilla::Side aSide)
{
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
@ -5225,7 +5225,7 @@ nsComputedDOMStyle::GetLineHeightCoord(nscoord& aCoord)
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetBorderColorsFor(mozilla::css::Side aSide)
nsComputedDOMStyle::GetBorderColorsFor(mozilla::Side aSide)
{
const nsStyleBorder *border = StyleBorder();
@ -5253,7 +5253,7 @@ nsComputedDOMStyle::GetBorderColorsFor(mozilla::css::Side aSide)
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetBorderWidthFor(mozilla::css::Side aSide)
nsComputedDOMStyle::GetBorderWidthFor(mozilla::Side aSide)
{
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
@ -5270,7 +5270,7 @@ nsComputedDOMStyle::GetBorderWidthFor(mozilla::css::Side aSide)
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetBorderColorFor(mozilla::css::Side aSide)
nsComputedDOMStyle::GetBorderColorFor(mozilla::Side aSide)
{
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
SetValueFromComplexColor(val, StyleBorder()->mBorderColor[aSide]);
@ -5278,7 +5278,7 @@ nsComputedDOMStyle::GetBorderColorFor(mozilla::css::Side aSide)
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetMarginWidthFor(mozilla::css::Side aSide)
nsComputedDOMStyle::GetMarginWidthFor(mozilla::Side aSide)
{
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
@ -5299,7 +5299,7 @@ nsComputedDOMStyle::GetMarginWidthFor(mozilla::css::Side aSide)
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetBorderStyleFor(mozilla::css::Side aSide)
nsComputedDOMStyle::GetBorderStyleFor(mozilla::Side aSide)
{
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
val->SetIdent(

View File

@ -153,27 +153,27 @@ private:
already_AddRefed<CSSValue> GetEllipseRadii(const nsStyleCorners& aRadius,
uint8_t aFullCorner);
already_AddRefed<CSSValue> GetOffsetWidthFor(mozilla::css::Side aSide);
already_AddRefed<CSSValue> GetOffsetWidthFor(mozilla::Side aSide);
already_AddRefed<CSSValue> GetAbsoluteOffset(mozilla::css::Side aSide);
already_AddRefed<CSSValue> GetAbsoluteOffset(mozilla::Side aSide);
already_AddRefed<CSSValue> GetRelativeOffset(mozilla::css::Side aSide);
already_AddRefed<CSSValue> GetRelativeOffset(mozilla::Side aSide);
already_AddRefed<CSSValue> GetStickyOffset(mozilla::css::Side aSide);
already_AddRefed<CSSValue> GetStickyOffset(mozilla::Side aSide);
already_AddRefed<CSSValue> GetStaticOffset(mozilla::css::Side aSide);
already_AddRefed<CSSValue> GetStaticOffset(mozilla::Side aSide);
already_AddRefed<CSSValue> GetPaddingWidthFor(mozilla::css::Side aSide);
already_AddRefed<CSSValue> GetPaddingWidthFor(mozilla::Side aSide);
already_AddRefed<CSSValue> GetBorderColorsFor(mozilla::css::Side aSide);
already_AddRefed<CSSValue> GetBorderColorsFor(mozilla::Side aSide);
already_AddRefed<CSSValue> GetBorderStyleFor(mozilla::css::Side aSide);
already_AddRefed<CSSValue> GetBorderStyleFor(mozilla::Side aSide);
already_AddRefed<CSSValue> GetBorderWidthFor(mozilla::css::Side aSide);
already_AddRefed<CSSValue> GetBorderWidthFor(mozilla::Side aSide);
already_AddRefed<CSSValue> GetBorderColorFor(mozilla::css::Side aSide);
already_AddRefed<CSSValue> GetBorderColorFor(mozilla::Side aSide);
already_AddRefed<CSSValue> GetMarginWidthFor(mozilla::css::Side aSide);
already_AddRefed<CSSValue> GetMarginWidthFor(mozilla::Side aSide);
already_AddRefed<CSSValue> GetSVGPaintFor(bool aFill);

View File

@ -274,13 +274,13 @@ public:
bool operator==(const nsStyleSides& aOther) const;
bool operator!=(const nsStyleSides& aOther) const;
inline nsStyleUnit GetUnit(mozilla::css::Side aSide) const;
inline nsStyleUnit GetUnit(mozilla::Side aSide) const;
inline nsStyleUnit GetLeftUnit() const;
inline nsStyleUnit GetTopUnit() const;
inline nsStyleUnit GetRightUnit() const;
inline nsStyleUnit GetBottomUnit() const;
inline nsStyleCoord Get(mozilla::css::Side aSide) const;
inline nsStyleCoord Get(mozilla::Side aSide) const;
inline nsStyleCoord GetLeft() const;
inline nsStyleCoord GetTop() const;
inline nsStyleCoord GetRight() const;
@ -313,13 +313,13 @@ public:
// constructors).
void Reset();
inline void Set(mozilla::css::Side aSide, const nsStyleCoord& aCoord);
inline void Set(mozilla::Side aSide, const nsStyleCoord& aCoord);
inline void SetLeft(const nsStyleCoord& aCoord);
inline void SetTop(const nsStyleCoord& aCoord);
inline void SetRight(const nsStyleCoord& aCoord);
inline void SetBottom(const nsStyleCoord& aCoord);
nscoord ToLength(mozilla::css::Side aSide) const {
nscoord ToLength(mozilla::Side aSide) const {
return nsStyleCoord::ToLength(mUnits[aSide], mValues[aSide]);
}
@ -548,7 +548,7 @@ inline bool nsStyleSides::operator!=(const nsStyleSides& aOther) const
return !((*this) == aOther);
}
inline nsStyleUnit nsStyleSides::GetUnit(mozilla::css::Side aSide) const
inline nsStyleUnit nsStyleSides::GetUnit(mozilla::Side aSide) const
{
return (nsStyleUnit)mUnits[aSide];
}
@ -573,7 +573,7 @@ inline nsStyleUnit nsStyleSides::GetBottomUnit() const
return GetUnit(NS_SIDE_BOTTOM);
}
inline nsStyleCoord nsStyleSides::Get(mozilla::css::Side aSide) const
inline nsStyleCoord nsStyleSides::Get(mozilla::Side aSide) const
{
return nsStyleCoord(mValues[aSide], nsStyleUnit(mUnits[aSide]));
}
@ -598,7 +598,7 @@ inline nsStyleCoord nsStyleSides::GetBottom() const
return Get(NS_SIDE_BOTTOM);
}
inline void nsStyleSides::Set(mozilla::css::Side aSide, const nsStyleCoord& aCoord)
inline void nsStyleSides::Set(mozilla::Side aSide, const nsStyleCoord& aCoord)
{
nsStyleCoord::SetValue(mUnits[aSide], mValues[aSide], aCoord);
}

View File

@ -1263,7 +1263,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBorder
}
}
void ClearBorderColors(mozilla::css::Side aSide) {
void ClearBorderColors(mozilla::Side aSide) {
if (mBorderColors && mBorderColors[aSide]) {
delete mBorderColors[aSide];
mBorderColors[aSide] = nullptr;
@ -1275,13 +1275,13 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBorder
// Note that this does *not* consider the effects of 'border-image':
// if border-style is none, but there is a loaded border image,
// HasVisibleStyle will be false even though there *is* a border.
bool HasVisibleStyle(mozilla::css::Side aSide) const
bool HasVisibleStyle(mozilla::Side aSide) const
{
return IsVisibleBorderStyle(mBorderStyle[aSide]);
}
// aBorderWidth is in twips
void SetBorderWidth(mozilla::css::Side aSide, nscoord aBorderWidth)
void SetBorderWidth(mozilla::Side aSide, nscoord aBorderWidth)
{
nscoord roundedWidth =
NS_ROUND_BORDER_TO_PIXELS(aBorderWidth, mTwipsPerPixel);
@ -1308,18 +1308,18 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBorder
// this is zero if and only if there is no border to be painted for this
// side. That is, this value takes into account the border style and the
// value is rounded to the nearest device pixel by NS_ROUND_BORDER_TO_PIXELS.
nscoord GetComputedBorderWidth(mozilla::css::Side aSide) const
nscoord GetComputedBorderWidth(mozilla::Side aSide) const
{
return GetComputedBorder().Side(aSide);
}
uint8_t GetBorderStyle(mozilla::css::Side aSide) const
uint8_t GetBorderStyle(mozilla::Side aSide) const
{
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
return mBorderStyle[aSide];
}
void SetBorderStyle(mozilla::css::Side aSide, uint8_t aStyle)
void SetBorderStyle(mozilla::Side aSide, uint8_t aStyle)
{
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
mBorderStyle[aSide] = aStyle;
@ -1892,7 +1892,7 @@ public:
bool MaxHeightDependsOnContainer() const
{ return HeightCoordDependsOnContainer(mMaxHeight); }
bool OffsetHasPercent(mozilla::css::Side aSide) const
bool OffsetHasPercent(mozilla::Side aSide) const
{
return mOffset.Get(aSide).HasPercent();
}