diff --git a/accessible/base/StyleInfo.cpp b/accessible/base/StyleInfo.cpp index 41d1c5b78a..b6b41820ed 100644 --- a/accessible/base/StyleInfo.cpp +++ b/accessible/base/StyleInfo.cpp @@ -80,7 +80,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(); diff --git a/gfx/2d/Types.h b/gfx/2d/Types.h index 6dfd2b4054..4d0d9427b1 100644 --- a/gfx/2d/Types.h +++ b/gfx/2d/Types.h @@ -394,25 +394,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; } diff --git a/gfx/src/nsRect.cpp b/gfx/src/nsRect.cpp index c17c249b2e..79ccb1e6f1 100644 --- a/gfx/src/nsRect.cpp +++ b/gfx/src/nsRect.cpp @@ -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); diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index 2e2b0d0c84..48b140d156 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -436,7 +436,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); @@ -460,7 +460,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) { @@ -1738,7 +1738,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; @@ -4425,7 +4425,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, diff --git a/layout/base/nsCSSRenderingBorders.cpp b/layout/base/nsCSSRenderingBorders.cpp index 9720bb2dbf..903b39e550 100644 --- a/layout/base/nsCSSRenderingBorders.cpp +++ b/layout/base/nsCSSRenderingBorders.cpp @@ -63,8 +63,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) @@ -113,26 +113,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); } @@ -145,7 +145,7 @@ IsSingleSide(int aSides) } static bool -IsHorizontalSide(mozilla::css::Side aSide) +IsHorizontalSide(mozilla::Side aSide) { return aSide == NS_SIDE_TOP || aSide == NS_SIDE_BOTTOM; } @@ -385,8 +385,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) { @@ -449,7 +449,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); @@ -583,7 +583,7 @@ MaybeMoveToMidPoint(Point& aP0, Point& aP1, const Point& aMidPoint) } already_AddRefed -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. @@ -673,7 +673,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, Float aDotOffset) @@ -726,7 +726,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]; @@ -1091,8 +1091,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)); @@ -1627,7 +1627,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]; @@ -1803,7 +1803,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) { @@ -1819,7 +1819,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. // @@ -1888,7 +1888,7 @@ nsCSSBorderRenderer::DrawDashedOrDottedSide(mozilla::css::Side aSide) // For dotted sides that can merge with their prior dotted sides, advance the // dash offset to measure the distance around the combined path. This prevents // two dots from bunching together at a corner. - mozilla::css::Side mergeSide = aSide; + mozilla::Side mergeSide = aSide; while (IsCornerMergeable(GetCCWCorner(mergeSide))) { mergeSide = PREV_SIDE(mergeSide); // If we looped all the way around, measure starting at the top side, since @@ -1927,7 +1927,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. @@ -2307,7 +2307,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. @@ -2345,8 +2345,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) { @@ -2416,14 +2416,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) { @@ -2493,14 +2493,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) { @@ -2609,7 +2609,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 @@ -3386,7 +3386,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; @@ -3447,7 +3447,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); diff --git a/layout/base/nsCSSRenderingBorders.h b/layout/base/nsCSSRenderingBorders.h index 042f186754..5ff8300389 100644 --- a/layout/base/nsCSSRenderingBorders.h +++ b/layout/base/nsCSSRenderingBorders.h @@ -157,7 +157,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 @@ -167,10 +167,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 GetSideClipSubPath(mozilla::css::Side aSide); + already_AddRefed 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, Float aDotOffset = 0.0f); @@ -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. diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index fb7390753d..dcb543acd7 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -6787,7 +6787,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"); @@ -6803,7 +6803,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"); diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index 7d2b6f6f7f..6091fb45e4 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -1911,7 +1911,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. diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp index ce66f5d0f1..5936589c94 100644 --- a/layout/forms/nsFieldSetFrame.cpp +++ b/layout/forms/nsFieldSetFrame.cpp @@ -48,7 +48,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); @@ -234,7 +234,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); diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp index 3ab62ac11a..2045609e99 100644 --- a/layout/generic/ReflowInput.cpp +++ b/layout/generic/ReflowInput.cpp @@ -900,10 +900,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(); @@ -1139,9 +1139,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(); diff --git a/layout/generic/WritingModes.h b/layout/generic/WritingModes.h index 4c4717337e..b6227168d9 100644 --- a/layout/generic/WritingModes.h +++ b/layout/generic/WritingModes.h @@ -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 diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index a13586b8d4..be750a4c7a 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -847,9 +847,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(); diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index 1a46ef7592..d5fa1c51e3 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -4381,7 +4381,7 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty, const nsStyleCoord &coord = StyleDataAtOffset(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: diff --git a/layout/style/nsCSSDataBlock.cpp b/layout/style/nsCSSDataBlock.cpp index c32f436106..8f17cc71ca 100644 --- a/layout/style/nsCSSDataBlock.cpp +++ b/layout/style/nsCSSDataBlock.cpp @@ -238,7 +238,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); diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 7794d6af8e..e6be7dc0bd 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -5085,7 +5085,7 @@ nsComputedDOMStyle::DoGetTop() } already_AddRefed -nsComputedDOMStyle::GetOffsetWidthFor(mozilla::css::Side aSide) +nsComputedDOMStyle::GetOffsetWidthFor(mozilla::Side aSide) { const nsStyleDisplay* display = StyleDisplay(); @@ -5116,7 +5116,7 @@ nsComputedDOMStyle::GetOffsetWidthFor(mozilla::css::Side aSide) } already_AddRefed -nsComputedDOMStyle::GetAbsoluteOffset(mozilla::css::Side aSide) +nsComputedDOMStyle::GetAbsoluteOffset(mozilla::Side aSide) { MOZ_ASSERT(mOuterFrame, "need a frame, so we can call GetContainingBlock()"); @@ -5174,10 +5174,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 -nsComputedDOMStyle::GetRelativeOffset(mozilla::css::Side aSide) +nsComputedDOMStyle::GetRelativeOffset(mozilla::Side aSide) { RefPtr val = new nsROCSSPrimitiveValue; @@ -5207,7 +5207,7 @@ nsComputedDOMStyle::GetRelativeOffset(mozilla::css::Side aSide) } already_AddRefed -nsComputedDOMStyle::GetStickyOffset(mozilla::css::Side aSide) +nsComputedDOMStyle::GetStickyOffset(mozilla::Side aSide) { RefPtr val = new nsROCSSPrimitiveValue; @@ -5237,7 +5237,7 @@ nsComputedDOMStyle::GetStickyOffset(mozilla::css::Side aSide) already_AddRefed -nsComputedDOMStyle::GetStaticOffset(mozilla::css::Side aSide) +nsComputedDOMStyle::GetStaticOffset(mozilla::Side aSide) { RefPtr val = new nsROCSSPrimitiveValue; @@ -5246,7 +5246,7 @@ nsComputedDOMStyle::GetStaticOffset(mozilla::css::Side aSide) } already_AddRefed -nsComputedDOMStyle::GetPaddingWidthFor(mozilla::css::Side aSide) +nsComputedDOMStyle::GetPaddingWidthFor(mozilla::Side aSide) { RefPtr val = new nsROCSSPrimitiveValue; @@ -5302,7 +5302,7 @@ nsComputedDOMStyle::GetLineHeightCoord(nscoord& aCoord) } already_AddRefed -nsComputedDOMStyle::GetBorderColorsFor(mozilla::css::Side aSide) +nsComputedDOMStyle::GetBorderColorsFor(mozilla::Side aSide) { const nsStyleBorder *border = StyleBorder(); @@ -5330,7 +5330,7 @@ nsComputedDOMStyle::GetBorderColorsFor(mozilla::css::Side aSide) } already_AddRefed -nsComputedDOMStyle::GetBorderWidthFor(mozilla::css::Side aSide) +nsComputedDOMStyle::GetBorderWidthFor(mozilla::Side aSide) { RefPtr val = new nsROCSSPrimitiveValue; @@ -5347,7 +5347,7 @@ nsComputedDOMStyle::GetBorderWidthFor(mozilla::css::Side aSide) } already_AddRefed -nsComputedDOMStyle::GetBorderColorFor(mozilla::css::Side aSide) +nsComputedDOMStyle::GetBorderColorFor(mozilla::Side aSide) { RefPtr val = new nsROCSSPrimitiveValue; SetValueFromComplexColor(val, StyleBorder()->mBorderColor[aSide]); @@ -5355,7 +5355,7 @@ nsComputedDOMStyle::GetBorderColorFor(mozilla::css::Side aSide) } already_AddRefed -nsComputedDOMStyle::GetMarginWidthFor(mozilla::css::Side aSide) +nsComputedDOMStyle::GetMarginWidthFor(mozilla::Side aSide) { RefPtr val = new nsROCSSPrimitiveValue; @@ -5376,7 +5376,7 @@ nsComputedDOMStyle::GetMarginWidthFor(mozilla::css::Side aSide) } already_AddRefed -nsComputedDOMStyle::GetBorderStyleFor(mozilla::css::Side aSide) +nsComputedDOMStyle::GetBorderStyleFor(mozilla::Side aSide) { RefPtr val = new nsROCSSPrimitiveValue; val->SetIdent( diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h index 996f8ffc42..ce19ca51c1 100644 --- a/layout/style/nsComputedDOMStyle.h +++ b/layout/style/nsComputedDOMStyle.h @@ -160,27 +160,27 @@ private: already_AddRefed GetEllipseRadii(const nsStyleCorners& aRadius, uint8_t aFullCorner); - already_AddRefed GetOffsetWidthFor(mozilla::css::Side aSide); + already_AddRefed GetOffsetWidthFor(mozilla::Side aSide); - already_AddRefed GetAbsoluteOffset(mozilla::css::Side aSide); + already_AddRefed GetAbsoluteOffset(mozilla::Side aSide); - already_AddRefed GetRelativeOffset(mozilla::css::Side aSide); + already_AddRefed GetRelativeOffset(mozilla::Side aSide); - already_AddRefed GetStickyOffset(mozilla::css::Side aSide); + already_AddRefed GetStickyOffset(mozilla::Side aSide); - already_AddRefed GetStaticOffset(mozilla::css::Side aSide); + already_AddRefed GetStaticOffset(mozilla::Side aSide); - already_AddRefed GetPaddingWidthFor(mozilla::css::Side aSide); + already_AddRefed GetPaddingWidthFor(mozilla::Side aSide); - already_AddRefed GetBorderColorsFor(mozilla::css::Side aSide); + already_AddRefed GetBorderColorsFor(mozilla::Side aSide); - already_AddRefed GetBorderStyleFor(mozilla::css::Side aSide); + already_AddRefed GetBorderStyleFor(mozilla::Side aSide); - already_AddRefed GetBorderWidthFor(mozilla::css::Side aSide); + already_AddRefed GetBorderWidthFor(mozilla::Side aSide); - already_AddRefed GetBorderColorFor(mozilla::css::Side aSide); + already_AddRefed GetBorderColorFor(mozilla::Side aSide); - already_AddRefed GetMarginWidthFor(mozilla::css::Side aSide); + already_AddRefed GetMarginWidthFor(mozilla::Side aSide); already_AddRefed GetSVGPaintFor(bool aFill); diff --git a/layout/style/nsStyleCoord.h b/layout/style/nsStyleCoord.h index bda17bbf50..ef37f85423 100644 --- a/layout/style/nsStyleCoord.h +++ b/layout/style/nsStyleCoord.h @@ -272,13 +272,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; @@ -311,13 +311,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]); } @@ -545,7 +545,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]; } @@ -570,7 +570,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])); } @@ -595,7 +595,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); } diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index c28f2bca9e..b6d5874239 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -1207,7 +1207,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; @@ -1219,13 +1219,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); @@ -1252,18 +1252,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; @@ -1826,7 +1826,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(); }