mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09:00
Issue #1925 - Remove mozilla::css::Side typedef.
This commit is contained in:
parent
5b0921df6e
commit
e6e2796541
18 changed files with 108 additions and 112 deletions
|
|
@ -80,7 +80,7 @@ StyleInfo::TextIndent(nsAString& aValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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");
|
MOZ_ASSERT(mElement->GetPrimaryFrame(), " mElement->GetPrimaryFrame() needs to be valid pointer");
|
||||||
aValue.Truncate();
|
aValue.Truncate();
|
||||||
|
|
|
||||||
|
|
@ -394,25 +394,21 @@ enum SideBits {
|
||||||
#define NS_SIDE_BOTTOM mozilla::eSideBottom
|
#define NS_SIDE_BOTTOM mozilla::eSideBottom
|
||||||
#define NS_SIDE_LEFT mozilla::eSideLeft
|
#define NS_SIDE_LEFT mozilla::eSideLeft
|
||||||
|
|
||||||
namespace css {
|
// Creates a for loop that walks over the four mozilla::Side values.
|
||||||
typedef mozilla::Side Side;
|
|
||||||
} // namespace css
|
|
||||||
|
|
||||||
// Creates a for loop that walks over the four mozilla::css::Side values.
|
|
||||||
// We use an int32_t helper variable (instead of a Side) for our loop counter,
|
// 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
|
// to avoid triggering undefined behavior just before we exit the loop (at
|
||||||
// which point the counter is incremented beyond the largest valid Side value).
|
// which point the counter is incremented beyond the largest valid Side value).
|
||||||
#define NS_FOR_CSS_SIDES(var_) \
|
#define NS_FOR_CSS_SIDES(var_) \
|
||||||
int32_t MOZ_CONCAT(var_,__LINE__) = NS_SIDE_TOP; \
|
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 && \
|
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__)++)
|
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 &&
|
NS_PRECONDITION(side >= NS_SIDE_TOP &&
|
||||||
side <= NS_SIDE_LEFT, "Out of range side");
|
side <= NS_SIDE_LEFT, "Out of range side");
|
||||||
side = css::Side(side + 1);
|
side = Side(side + 1);
|
||||||
return side;
|
return side;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ static_assert((int(NS_SIDE_TOP) == 0) &&
|
||||||
(int(NS_SIDE_RIGHT) == 1) &&
|
(int(NS_SIDE_RIGHT) == 1) &&
|
||||||
(int(NS_SIDE_BOTTOM) == 2) &&
|
(int(NS_SIDE_BOTTOM) == 2) &&
|
||||||
(int(NS_SIDE_LEFT) == 3),
|
(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() {
|
const mozilla::gfx::IntRect& GetMaxSizedIntRect() {
|
||||||
static const mozilla::gfx::IntRect r(0, 0, INT32_MAX, INT32_MAX);
|
static const mozilla::gfx::IntRect r(0, 0, INT32_MAX, INT32_MAX);
|
||||||
|
|
|
||||||
|
|
@ -436,7 +436,7 @@ static DrawResult DrawBorderImage(nsPresContext* aPresContext,
|
||||||
Sides aSkipSides,
|
Sides aSkipSides,
|
||||||
PaintBorderFlags aFlags);
|
PaintBorderFlags aFlags);
|
||||||
|
|
||||||
static nscolor MakeBevelColor(mozilla::css::Side whichSide, uint8_t style,
|
static nscolor MakeBevelColor(mozilla::Side whichSide, uint8_t style,
|
||||||
nscolor aBackgroundColor,
|
nscolor aBackgroundColor,
|
||||||
nscolor aBorderColor);
|
nscolor aBorderColor);
|
||||||
|
|
||||||
|
|
@ -460,7 +460,7 @@ void nsCSSRendering::Shutdown()
|
||||||
* Make a bevel color
|
* Make a bevel color
|
||||||
*/
|
*/
|
||||||
static nscolor
|
static nscolor
|
||||||
MakeBevelColor(mozilla::css::Side whichSide, uint8_t style,
|
MakeBevelColor(mozilla::Side whichSide, uint8_t style,
|
||||||
nscolor aBackgroundColor, nscolor aBorderColor)
|
nscolor aBackgroundColor, nscolor aBorderColor)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -1738,7 +1738,7 @@ nsCSSRendering::PaintBackground(const PaintBGParams& aParams)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
IsOpaqueBorderEdge(const nsStyleBorder& aBorder, mozilla::css::Side aSide)
|
IsOpaqueBorderEdge(const nsStyleBorder& aBorder, mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
if (aBorder.GetComputedBorder().Side(aSide) == 0)
|
if (aBorder.GetComputedBorder().Side(aSide) == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -4425,7 +4425,7 @@ nsCSSRendering::DrawTableBorderSegment(DrawTarget& aDrawTarget,
|
||||||
? RoundFloatToPixel(0.5f * (float)aStartBevelOffset, twipsPerPixel, true) : 0;
|
? RoundFloatToPixel(0.5f * (float)aStartBevelOffset, twipsPerPixel, true) : 0;
|
||||||
nscoord endBevel = (aEndBevelOffset > 0)
|
nscoord endBevel = (aEndBevelOffset > 0)
|
||||||
? RoundFloatToPixel(0.5f * (float)aEndBevelOffset, twipsPerPixel, true) : 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
|
// FIXME: In theory, this should use the visited-dependent
|
||||||
// background color, but I don't care.
|
// background color, but I don't care.
|
||||||
nscolor bevelColor = MakeBevelColor(ridgeGrooveSide, ridgeGroove,
|
nscolor bevelColor = MakeBevelColor(ridgeGrooveSide, ridgeGroove,
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,8 @@ static void ComputeBorderCornerDimensions(const Float* aBorderWidths,
|
||||||
RectCornerRadii *aDimsResult);
|
RectCornerRadii *aDimsResult);
|
||||||
|
|
||||||
// given a side index, get the previous and next side index
|
// given a side index, get the previous and next side index
|
||||||
#define NEXT_SIDE(_s) mozilla::css::Side(((_s) + 1) & 3)
|
#define NEXT_SIDE(_s) mozilla::Side(((_s) + 1) & 3)
|
||||||
#define PREV_SIDE(_s) mozilla::css::Side(((_s) + 3) & 3)
|
#define PREV_SIDE(_s) mozilla::Side(((_s) + 3) & 3)
|
||||||
|
|
||||||
// given a corner index, get the previous and next corner index
|
// given a corner index, get the previous and next corner index
|
||||||
#define NEXT_CORNER(_s) mozilla::css::Corner(((_s) + 1) & 3)
|
#define NEXT_CORNER(_s) mozilla::css::Corner(((_s) + 1) & 3)
|
||||||
|
|
@ -113,26 +113,26 @@ AllCornersZeroSize(const RectCornerRadii& corners) {
|
||||||
IsZeroSize(corners[NS_CORNER_BOTTOM_LEFT]);
|
IsZeroSize(corners[NS_CORNER_BOTTOM_LEFT]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static mozilla::css::Side
|
static mozilla::Side
|
||||||
GetHorizontalSide(mozilla::css::Corner aCorner)
|
GetHorizontalSide(mozilla::css::Corner aCorner)
|
||||||
{
|
{
|
||||||
return (aCorner == C_TL || aCorner == C_TR) ? NS_SIDE_TOP : NS_SIDE_BOTTOM;
|
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)
|
GetVerticalSide(mozilla::css::Corner aCorner)
|
||||||
{
|
{
|
||||||
return (aCorner == C_TL || aCorner == C_BL) ? NS_SIDE_LEFT : NS_SIDE_RIGHT;
|
return (aCorner == C_TL || aCorner == C_BL) ? NS_SIDE_LEFT : NS_SIDE_RIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static mozilla::css::Corner
|
static mozilla::css::Corner
|
||||||
GetCWCorner(mozilla::css::Side aSide)
|
GetCWCorner(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
return mozilla::css::Corner(NEXT_SIDE(aSide));
|
return mozilla::css::Corner(NEXT_SIDE(aSide));
|
||||||
}
|
}
|
||||||
|
|
||||||
static mozilla::css::Corner
|
static mozilla::css::Corner
|
||||||
GetCCWCorner(mozilla::css::Side aSide)
|
GetCCWCorner(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
return mozilla::css::Corner(aSide);
|
return mozilla::css::Corner(aSide);
|
||||||
}
|
}
|
||||||
|
|
@ -145,7 +145,7 @@ IsSingleSide(int aSides)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
IsHorizontalSide(mozilla::css::Side aSide)
|
IsHorizontalSide(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
return aSide == NS_SIDE_TOP || aSide == NS_SIDE_BOTTOM;
|
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::Side sideH(GetHorizontalSide(aCorner));
|
||||||
mozilla::css::Side sideV(GetVerticalSide(aCorner));
|
mozilla::Side sideV(GetVerticalSide(aCorner));
|
||||||
uint8_t styleH = mBorderStyles[sideH];
|
uint8_t styleH = mBorderStyles[sideH];
|
||||||
uint8_t styleV = mBorderStyles[sideV];
|
uint8_t styleV = mBorderStyles[sideV];
|
||||||
if (styleH != styleV || styleH != NS_STYLE_BORDER_STYLE_DOTTED) {
|
if (styleH != styleV || styleH != NS_STYLE_BORDER_STYLE_DOTTED) {
|
||||||
|
|
@ -449,7 +449,7 @@ nsCSSBorderRenderer::GetCornerRect(mozilla::css::Corner aCorner)
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect
|
Rect
|
||||||
nsCSSBorderRenderer::GetSideClipWithoutCornersRect(mozilla::css::Side aSide)
|
nsCSSBorderRenderer::GetSideClipWithoutCornersRect(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
Point offset(0.f, 0.f);
|
Point offset(0.f, 0.f);
|
||||||
|
|
||||||
|
|
@ -583,7 +583,7 @@ MaybeMoveToMidPoint(Point& aP0, Point& aP1, const Point& aMidPoint)
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<Path>
|
already_AddRefed<Path>
|
||||||
nsCSSBorderRenderer::GetSideClipSubPath(mozilla::css::Side aSide)
|
nsCSSBorderRenderer::GetSideClipSubPath(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
// the clip proceeds clockwise from the top left corner;
|
// the clip proceeds clockwise from the top left corner;
|
||||||
// so "start" in each case is the start of the region from that side.
|
// 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
|
Point
|
||||||
nsCSSBorderRenderer::GetStraightBorderPoint(mozilla::css::Side aSide,
|
nsCSSBorderRenderer::GetStraightBorderPoint(mozilla::Side aSide,
|
||||||
mozilla::css::Corner aCorner,
|
mozilla::css::Corner aCorner,
|
||||||
bool* aIsUnfilled,
|
bool* aIsUnfilled,
|
||||||
Float aDotOffset)
|
Float aDotOffset)
|
||||||
|
|
@ -726,7 +726,7 @@ nsCSSBorderRenderer::GetStraightBorderPoint(mozilla::css::Side aSide,
|
||||||
// | |
|
// | |
|
||||||
// otherSide | |
|
// otherSide | |
|
||||||
// | |
|
// | |
|
||||||
mozilla::css::Side otherSide = ((uint8_t)aSide == (uint8_t)aCorner)
|
mozilla::Side otherSide = ((uint8_t)aSide == (uint8_t)aCorner)
|
||||||
? PREV_SIDE(aSide)
|
? PREV_SIDE(aSide)
|
||||||
: NEXT_SIDE(aSide);
|
: NEXT_SIDE(aSide);
|
||||||
uint8_t otherStyle = mBorderStyles[otherSide];
|
uint8_t otherStyle = mBorderStyles[otherSide];
|
||||||
|
|
@ -1091,8 +1091,8 @@ nsCSSBorderRenderer::GetOuterAndInnerBezier(Bezier* aOuterBezier,
|
||||||
// | |
|
// | |
|
||||||
// +---------+
|
// +---------+
|
||||||
|
|
||||||
mozilla::css::Side sideH(GetHorizontalSide(aCorner));
|
mozilla::Side sideH(GetHorizontalSide(aCorner));
|
||||||
mozilla::css::Side sideV(GetVerticalSide(aCorner));
|
mozilla::Side sideV(GetVerticalSide(aCorner));
|
||||||
|
|
||||||
Size outerCornerSize(ceil(mBorderRadii[aCorner].width),
|
Size outerCornerSize(ceil(mBorderRadii[aCorner].width),
|
||||||
ceil(mBorderRadii[aCorner].height));
|
ceil(mBorderRadii[aCorner].height));
|
||||||
|
|
@ -1627,7 +1627,7 @@ nsCSSBorderRenderer::DrawBorderSides(int aSides)
|
||||||
void
|
void
|
||||||
nsCSSBorderRenderer::SetupDashedOptions(StrokeOptions* aStrokeOptions,
|
nsCSSBorderRenderer::SetupDashedOptions(StrokeOptions* aStrokeOptions,
|
||||||
Float aDash[2],
|
Float aDash[2],
|
||||||
mozilla::css::Side aSide,
|
mozilla::Side aSide,
|
||||||
Float aBorderLength, bool isCorner)
|
Float aBorderLength, bool isCorner)
|
||||||
{
|
{
|
||||||
uint8_t style = mBorderStyles[aSide];
|
uint8_t style = mBorderStyles[aSide];
|
||||||
|
|
@ -1803,7 +1803,7 @@ nsCSSBorderRenderer::SetupDashedOptions(StrokeOptions* aStrokeOptions,
|
||||||
}
|
}
|
||||||
|
|
||||||
static Float
|
static Float
|
||||||
GetBorderLength(mozilla::css::Side aSide,
|
GetBorderLength(mozilla::Side aSide,
|
||||||
const Point& aStart, const Point& aEnd)
|
const Point& aStart, const Point& aEnd)
|
||||||
{
|
{
|
||||||
if (aSide == NS_SIDE_TOP) {
|
if (aSide == NS_SIDE_TOP) {
|
||||||
|
|
@ -1819,7 +1819,7 @@ GetBorderLength(mozilla::css::Side aSide,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsCSSBorderRenderer::DrawDashedOrDottedSide(mozilla::css::Side aSide)
|
nsCSSBorderRenderer::DrawDashedOrDottedSide(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
// Draw dashed/dotted side with following approach.
|
// 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
|
// 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
|
// dash offset to measure the distance around the combined path. This prevents
|
||||||
// two dots from bunching together at a corner.
|
// two dots from bunching together at a corner.
|
||||||
mozilla::css::Side mergeSide = aSide;
|
mozilla::Side mergeSide = aSide;
|
||||||
while (IsCornerMergeable(GetCCWCorner(mergeSide))) {
|
while (IsCornerMergeable(GetCCWCorner(mergeSide))) {
|
||||||
mergeSide = PREV_SIDE(mergeSide);
|
mergeSide = PREV_SIDE(mergeSide);
|
||||||
// If we looped all the way around, measure starting at the top side, since
|
// 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
|
void
|
||||||
nsCSSBorderRenderer::DrawDottedSideSlow(mozilla::css::Side aSide)
|
nsCSSBorderRenderer::DrawDottedSideSlow(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
// Draw each circles separately for dotted with borderWidth > 2.0.
|
// Draw each circles separately for dotted with borderWidth > 2.0.
|
||||||
// Dashed line with CapStyle::ROUND doesn't render perfect circles.
|
// Dashed line with CapStyle::ROUND doesn't render perfect circles.
|
||||||
|
|
@ -2307,7 +2307,7 @@ nsCSSBorderRenderer::DrawDottedSideSlow(mozilla::css::Side aSide)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsCSSBorderRenderer::DrawDashedOrDottedCorner(mozilla::css::Side aSide,
|
nsCSSBorderRenderer::DrawDashedOrDottedCorner(mozilla::Side aSide,
|
||||||
mozilla::css::Corner aCorner)
|
mozilla::css::Corner aCorner)
|
||||||
{
|
{
|
||||||
// Draw dashed/dotted corner with following approach.
|
// Draw dashed/dotted corner with following approach.
|
||||||
|
|
@ -2345,8 +2345,8 @@ nsCSSBorderRenderer::DrawDashedOrDottedCorner(mozilla::css::Side aSide,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mozilla::css::Side sideH(GetHorizontalSide(aCorner));
|
mozilla::Side sideH(GetHorizontalSide(aCorner));
|
||||||
mozilla::css::Side sideV(GetVerticalSide(aCorner));
|
mozilla::Side sideV(GetVerticalSide(aCorner));
|
||||||
Float borderWidthH = mBorderWidths[sideH];
|
Float borderWidthH = mBorderWidths[sideH];
|
||||||
Float borderWidthV = mBorderWidths[sideV];
|
Float borderWidthV = mBorderWidths[sideV];
|
||||||
if (borderWidthH == 0.0f && borderWidthV == 0.0f) {
|
if (borderWidthH == 0.0f && borderWidthV == 0.0f) {
|
||||||
|
|
@ -2416,14 +2416,14 @@ nsCSSBorderRenderer::DrawDashedOrDottedCorner(mozilla::css::Side aSide,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsCSSBorderRenderer::DrawDottedCornerSlow(mozilla::css::Side aSide,
|
nsCSSBorderRenderer::DrawDottedCornerSlow(mozilla::Side aSide,
|
||||||
mozilla::css::Corner aCorner)
|
mozilla::css::Corner aCorner)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(mBorderStyles[aSide] == NS_STYLE_BORDER_STYLE_DOTTED,
|
NS_ASSERTION(mBorderStyles[aSide] == NS_STYLE_BORDER_STYLE_DOTTED,
|
||||||
"Style should be dotted.");
|
"Style should be dotted.");
|
||||||
|
|
||||||
mozilla::css::Side sideH(GetHorizontalSide(aCorner));
|
mozilla::Side sideH(GetHorizontalSide(aCorner));
|
||||||
mozilla::css::Side sideV(GetVerticalSide(aCorner));
|
mozilla::Side sideV(GetVerticalSide(aCorner));
|
||||||
Float R0 = mBorderWidths[sideH] / 2.0f;
|
Float R0 = mBorderWidths[sideH] / 2.0f;
|
||||||
Float Rn = mBorderWidths[sideV] / 2.0f;
|
Float Rn = mBorderWidths[sideV] / 2.0f;
|
||||||
if (R0 == 0.0f && Rn == 0.0f) {
|
if (R0 == 0.0f && Rn == 0.0f) {
|
||||||
|
|
@ -2493,14 +2493,14 @@ DashedPathOverlapsRect(Rect& pathRect,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsCSSBorderRenderer::DrawDashedCornerSlow(mozilla::css::Side aSide,
|
nsCSSBorderRenderer::DrawDashedCornerSlow(mozilla::Side aSide,
|
||||||
mozilla::css::Corner aCorner)
|
mozilla::css::Corner aCorner)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(mBorderStyles[aSide] == NS_STYLE_BORDER_STYLE_DASHED,
|
NS_ASSERTION(mBorderStyles[aSide] == NS_STYLE_BORDER_STYLE_DASHED,
|
||||||
"Style should be dashed.");
|
"Style should be dashed.");
|
||||||
|
|
||||||
mozilla::css::Side sideH(GetHorizontalSide(aCorner));
|
mozilla::Side sideH(GetHorizontalSide(aCorner));
|
||||||
mozilla::css::Side sideV(GetVerticalSide(aCorner));
|
mozilla::Side sideV(GetVerticalSide(aCorner));
|
||||||
Float borderWidthH = mBorderWidths[sideH];
|
Float borderWidthH = mBorderWidths[sideH];
|
||||||
Float borderWidthV = mBorderWidths[sideV];
|
Float borderWidthV = mBorderWidths[sideV];
|
||||||
if (borderWidthH == 0.0f && borderWidthV == 0.0f) {
|
if (borderWidthH == 0.0f && borderWidthV == 0.0f) {
|
||||||
|
|
@ -2609,7 +2609,7 @@ nsCSSBorderRenderer::DrawDashedCornerSlow(mozilla::css::Side aSide,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsCSSBorderRenderer::DrawFallbackSolidCorner(mozilla::css::Side aSide,
|
nsCSSBorderRenderer::DrawFallbackSolidCorner(mozilla::Side aSide,
|
||||||
mozilla::css::Corner aCorner)
|
mozilla::css::Corner aCorner)
|
||||||
{
|
{
|
||||||
// Render too large dashed or dotted corner with solid style, to avoid hangup
|
// Render too large dashed or dotted corner with solid style, to avoid hangup
|
||||||
|
|
@ -3386,7 +3386,7 @@ nsCSSBorderRenderer::DrawBorders()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
NS_FOR_CSS_CORNERS(corner) {
|
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]))
|
if (!IsZeroSize(mBorderRadii[corner]))
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -3447,7 +3447,7 @@ nsCSSBorderRenderer::DrawBorders()
|
||||||
// advantages outway the modest easthetic improvement.
|
// advantages outway the modest easthetic improvement.
|
||||||
|
|
||||||
for (int cornerSide = 0; cornerSide < 2; cornerSide++) {
|
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];
|
uint8_t style = mBorderStyles[side];
|
||||||
|
|
||||||
PrintAsFormatString("corner: %d cornerSide: %d side: %d style: %d\n", corner, cornerSide, side, style);
|
PrintAsFormatString("corner: %d cornerSide: %d side: %d style: %d\n", corner, cornerSide, side, style);
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ private:
|
||||||
// Get the Rect for drawing the given corner
|
// Get the Rect for drawing the given corner
|
||||||
Rect GetCornerRect(mozilla::css::Corner aCorner);
|
Rect GetCornerRect(mozilla::css::Corner aCorner);
|
||||||
// add the path for drawing the given side without any adjacent corners to the context
|
// 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
|
// Create a clip path for the wedge that this side of
|
||||||
// the border should take up. This is only called
|
// the border should take up. This is only called
|
||||||
|
|
@ -167,10 +167,10 @@ private:
|
||||||
// This code needs to make sure that the individual pieces
|
// This code needs to make sure that the individual pieces
|
||||||
// don't ever (mathematically) overlap; the pixel overlap
|
// don't ever (mathematically) overlap; the pixel overlap
|
||||||
// is taken care of by the ADD compositing.
|
// 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
|
// Return start or end point for dashed/dotted side
|
||||||
Point GetStraightBorderPoint(mozilla::css::Side aSide,
|
Point GetStraightBorderPoint(mozilla::Side aSide,
|
||||||
mozilla::css::Corner aCorner,
|
mozilla::css::Corner aCorner,
|
||||||
bool* aIsUnfilled,
|
bool* aIsUnfilled,
|
||||||
Float aDotOffset = 0.0f);
|
Float aDotOffset = 0.0f);
|
||||||
|
|
@ -213,29 +213,29 @@ private:
|
||||||
|
|
||||||
// Setup the stroke options for the given dashed/dotted side
|
// Setup the stroke options for the given dashed/dotted side
|
||||||
void SetupDashedOptions(StrokeOptions* aStrokeOptions,
|
void SetupDashedOptions(StrokeOptions* aStrokeOptions,
|
||||||
Float aDash[2], mozilla::css::Side aSide,
|
Float aDash[2], mozilla::Side aSide,
|
||||||
Float aBorderLength, bool isCorner);
|
Float aBorderLength, bool isCorner);
|
||||||
|
|
||||||
// Draw the given dashed/dotte side
|
// 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
|
// 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
|
// Draw the given dashed/dotted corner
|
||||||
void DrawDashedOrDottedCorner(mozilla::css::Side aSide,
|
void DrawDashedOrDottedCorner(mozilla::Side aSide,
|
||||||
mozilla::css::Corner aCorner);
|
mozilla::css::Corner aCorner);
|
||||||
|
|
||||||
// Draw the given dotted corner, each segment separately
|
// Draw the given dotted corner, each segment separately
|
||||||
void DrawDottedCornerSlow(mozilla::css::Side aSide,
|
void DrawDottedCornerSlow(mozilla::Side aSide,
|
||||||
mozilla::css::Corner aCorner);
|
mozilla::css::Corner aCorner);
|
||||||
|
|
||||||
// Draw the given dashed corner, each dot separately
|
// Draw the given dashed corner, each dot separately
|
||||||
void DrawDashedCornerSlow(mozilla::css::Side aSide,
|
void DrawDashedCornerSlow(mozilla::Side aSide,
|
||||||
mozilla::css::Corner aCorner);
|
mozilla::css::Corner aCorner);
|
||||||
|
|
||||||
// Draw the given dashed/dotted corner with solid style
|
// Draw the given dashed/dotted corner with solid style
|
||||||
void DrawFallbackSolidCorner(mozilla::css::Side aSide,
|
void DrawFallbackSolidCorner(mozilla::Side aSide,
|
||||||
mozilla::css::Corner aCorner);
|
mozilla::css::Corner aCorner);
|
||||||
|
|
||||||
// Analyze if all border sides have the same width.
|
// Analyze if all border sides have the same width.
|
||||||
|
|
|
||||||
|
|
@ -6787,7 +6787,7 @@ nsLayoutUtils::HasNonZeroCorner(const nsStyleCorners& aCorners)
|
||||||
}
|
}
|
||||||
|
|
||||||
// aCorner is a "full corner" value, i.e. NS_CORNER_TOP_LEFT etc
|
// 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_TOP == NS_CORNER_TOP_LEFT, "Check for Full Corner");
|
||||||
static_assert((int)NS_SIDE_RIGHT == NS_CORNER_TOP_RIGHT, "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
|
/* static */ bool
|
||||||
nsLayoutUtils::HasNonZeroCornerOnSide(const nsStyleCorners& aCorners,
|
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_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");
|
static_assert(NS_CORNER_TOP_LEFT_Y/2 == NS_CORNER_TOP_LEFT, "Check for Non Zero on side");
|
||||||
|
|
|
||||||
|
|
@ -1911,7 +1911,7 @@ public:
|
||||||
* given side.
|
* given side.
|
||||||
*/
|
*/
|
||||||
static bool HasNonZeroCornerOnSide(const nsStyleCorners& aCorners,
|
static bool HasNonZeroCornerOnSide(const nsStyleCorners& aCorners,
|
||||||
mozilla::css::Side aSide);
|
mozilla::Side aSide);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if a widget is likely to require transparency or translucency.
|
* Determine if a widget is likely to require transparency or translucency.
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ nsRect
|
||||||
nsFieldSetFrame::VisualBorderRectRelativeToSelf() const
|
nsFieldSetFrame::VisualBorderRectRelativeToSelf() const
|
||||||
{
|
{
|
||||||
WritingMode wm = GetWritingMode();
|
WritingMode wm = GetWritingMode();
|
||||||
css::Side legendSide = wm.PhysicalSide(eLogicalSideBStart);
|
Side legendSide = wm.PhysicalSide(eLogicalSideBStart);
|
||||||
nscoord legendBorder = StyleBorder()->GetComputedBorderWidth(legendSide);
|
nscoord legendBorder = StyleBorder()->GetComputedBorderWidth(legendSide);
|
||||||
LogicalRect r(wm, LogicalPoint(wm, 0, 0), GetLogicalSize(wm));
|
LogicalRect r(wm, LogicalPoint(wm, 0, 0), GetLogicalSize(wm));
|
||||||
nsSize containerSize = r.Size(wm).GetPhysicalSize(wm);
|
nsSize containerSize = r.Size(wm).GetPhysicalSize(wm);
|
||||||
|
|
@ -234,7 +234,7 @@ nsFieldSetFrame::PaintBorder(
|
||||||
this, rect);
|
this, rect);
|
||||||
|
|
||||||
if (nsIFrame* legend = GetLegend()) {
|
if (nsIFrame* legend = GetLegend()) {
|
||||||
css::Side legendSide = wm.PhysicalSide(eLogicalSideBStart);
|
Side legendSide = wm.PhysicalSide(eLogicalSideBStart);
|
||||||
nscoord legendBorderWidth =
|
nscoord legendBorderWidth =
|
||||||
StyleBorder()->GetComputedBorderWidth(legendSide);
|
StyleBorder()->GetComputedBorderWidth(legendSide);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -900,10 +900,10 @@ ReflowInput::ComputeRelativeOffsets(WritingMode aWM,
|
||||||
nsMargin& aComputedOffsets)
|
nsMargin& aComputedOffsets)
|
||||||
{
|
{
|
||||||
LogicalMargin offsets(aWM);
|
LogicalMargin offsets(aWM);
|
||||||
mozilla::css::Side inlineStart = aWM.PhysicalSide(eLogicalSideIStart);
|
mozilla::Side inlineStart = aWM.PhysicalSide(eLogicalSideIStart);
|
||||||
mozilla::css::Side inlineEnd = aWM.PhysicalSide(eLogicalSideIEnd);
|
mozilla::Side inlineEnd = aWM.PhysicalSide(eLogicalSideIEnd);
|
||||||
mozilla::css::Side blockStart = aWM.PhysicalSide(eLogicalSideBStart);
|
mozilla::Side blockStart = aWM.PhysicalSide(eLogicalSideBStart);
|
||||||
mozilla::css::Side blockEnd = aWM.PhysicalSide(eLogicalSideBEnd);
|
mozilla::Side blockEnd = aWM.PhysicalSide(eLogicalSideBEnd);
|
||||||
|
|
||||||
const nsStylePosition* position = aFrame->StylePosition();
|
const nsStylePosition* position = aFrame->StylePosition();
|
||||||
|
|
||||||
|
|
@ -1139,9 +1139,9 @@ ReflowInput::CalculateBorderPaddingMargin(
|
||||||
nscoord* aOutsideBoxSizing) const
|
nscoord* aOutsideBoxSizing) const
|
||||||
{
|
{
|
||||||
WritingMode wm = GetWritingMode();
|
WritingMode wm = GetWritingMode();
|
||||||
mozilla::css::Side startSide =
|
mozilla::Side startSide =
|
||||||
wm.PhysicalSide(MakeLogicalSide(aAxis, eLogicalEdgeStart));
|
wm.PhysicalSide(MakeLogicalSide(aAxis, eLogicalEdgeStart));
|
||||||
mozilla::css::Side endSide =
|
mozilla::Side endSide =
|
||||||
wm.PhysicalSide(MakeLogicalSide(aAxis, eLogicalEdgeEnd));
|
wm.PhysicalSide(MakeLogicalSide(aAxis, eLogicalEdgeEnd));
|
||||||
|
|
||||||
nsMargin styleBorder = mStyleBorder->GetComputedBorder();
|
nsMargin styleBorder = mStyleBorder->GetComputedBorder();
|
||||||
|
|
|
||||||
|
|
@ -324,7 +324,7 @@ public:
|
||||||
// two-bit values:
|
// two-bit values:
|
||||||
// bit 0 = the eOrientationMask value
|
// bit 0 = the eOrientationMask value
|
||||||
// bit 1 = the eBlockFlowMask 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_TOP, NS_SIDE_BOTTOM }, // horizontal-tb
|
||||||
{ NS_SIDE_RIGHT, NS_SIDE_LEFT }, // vertical-rl
|
{ NS_SIDE_RIGHT, NS_SIDE_LEFT }, // vertical-rl
|
||||||
{ NS_SIDE_BOTTOM, NS_SIDE_TOP }, // (horizontal-bt)
|
{ 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
|
// is no horizontal-bt writing-mode, and no text-orientation value that
|
||||||
// produces "inverted" text. (The former 'sideways-left' value, no longer
|
// produces "inverted" text. (The former 'sideways-left' value, no longer
|
||||||
// in the spec, would have produced this in vertical-rl mode.)
|
// 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_LEFT, NS_SIDE_RIGHT }, // horizontal-tb ltr
|
||||||
{ NS_SIDE_TOP, NS_SIDE_BOTTOM }, // vertical-rl ltr
|
{ NS_SIDE_TOP, NS_SIDE_BOTTOM }, // vertical-rl ltr
|
||||||
{ NS_SIDE_RIGHT, NS_SIDE_LEFT }, // horizontal-tb rtl
|
{ NS_SIDE_RIGHT, NS_SIDE_LEFT }, // horizontal-tb rtl
|
||||||
|
|
@ -404,7 +404,7 @@ public:
|
||||||
* given the current writing mode.
|
* given the current writing mode.
|
||||||
* (This is the inverse of the PhysicalSide() method above.)
|
* (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:
|
// indexes are four-bit values:
|
||||||
// bit 0 = the eOrientationMask value
|
// bit 0 = the eOrientationMask value
|
||||||
|
|
|
||||||
|
|
@ -847,9 +847,9 @@ nsContainerFrame::DoInlineIntrinsicISize(nsRenderingContext *aRenderingContext,
|
||||||
aType == nsLayoutUtils::PREF_ISIZE, "bad type");
|
aType == nsLayoutUtils::PREF_ISIZE, "bad type");
|
||||||
|
|
||||||
WritingMode wm = GetWritingMode();
|
WritingMode wm = GetWritingMode();
|
||||||
mozilla::css::Side startSide =
|
mozilla::Side startSide =
|
||||||
wm.PhysicalSideForInlineAxis(eLogicalEdgeStart);
|
wm.PhysicalSideForInlineAxis(eLogicalEdgeStart);
|
||||||
mozilla::css::Side endSide =
|
mozilla::Side endSide =
|
||||||
wm.PhysicalSideForInlineAxis(eLogicalEdgeEnd);
|
wm.PhysicalSideForInlineAxis(eLogicalEdgeEnd);
|
||||||
|
|
||||||
const nsStylePadding *stylePadding = StylePadding();
|
const nsStylePadding *stylePadding = StylePadding();
|
||||||
|
|
|
||||||
|
|
@ -4381,7 +4381,7 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty,
|
||||||
|
|
||||||
const nsStyleCoord &coord =
|
const nsStyleCoord &coord =
|
||||||
StyleDataAtOffset<nsStyleSides>(styleStruct, ssOffset).
|
StyleDataAtOffset<nsStyleSides>(styleStruct, ssOffset).
|
||||||
Get(mozilla::css::Side(animType - eStyleAnimType_Sides_Top));
|
Get(mozilla::Side(animType - eStyleAnimType_Sides_Top));
|
||||||
return StyleCoordToValue(coord, aComputedValue);
|
return StyleCoordToValue(coord, aComputedValue);
|
||||||
}
|
}
|
||||||
case eStyleAnimType_Corner_TopLeft:
|
case eStyleAnimType_Corner_TopLeft:
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ EnsurePhysicalProperty(nsCSSPropertyID& aProperty, nsRuleData* aRuleData)
|
||||||
// We handle block axis logical properties separately to save a bit of
|
// We handle block axis logical properties separately to save a bit of
|
||||||
// work that the WritingMode constructor does that is unnecessary
|
// work that the WritingMode constructor does that is unnecessary
|
||||||
// unless we have an inline axis property.
|
// unless we have an inline axis property.
|
||||||
mozilla::css::Side side;
|
mozilla::Side side;
|
||||||
if (isBlock) {
|
if (isBlock) {
|
||||||
uint8_t wm = aRuleData->mStyleContext->StyleVisibility()->mWritingMode;
|
uint8_t wm = aRuleData->mStyleContext->StyleVisibility()->mWritingMode;
|
||||||
side = WritingMode::PhysicalSideForBlockAxis(wm, edge);
|
side = WritingMode::PhysicalSideForBlockAxis(wm, edge);
|
||||||
|
|
|
||||||
|
|
@ -5085,7 +5085,7 @@ nsComputedDOMStyle::DoGetTop()
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CSSValue>
|
already_AddRefed<CSSValue>
|
||||||
nsComputedDOMStyle::GetOffsetWidthFor(mozilla::css::Side aSide)
|
nsComputedDOMStyle::GetOffsetWidthFor(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
const nsStyleDisplay* display = StyleDisplay();
|
const nsStyleDisplay* display = StyleDisplay();
|
||||||
|
|
||||||
|
|
@ -5116,7 +5116,7 @@ nsComputedDOMStyle::GetOffsetWidthFor(mozilla::css::Side aSide)
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CSSValue>
|
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()");
|
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 &&
|
static_assert(NS_SIDE_TOP == 0 && NS_SIDE_RIGHT == 1 &&
|
||||||
NS_SIDE_BOTTOM == 2 && NS_SIDE_LEFT == 3,
|
NS_SIDE_BOTTOM == 2 && NS_SIDE_LEFT == 3,
|
||||||
"box side constants not as expected for NS_OPPOSITE_SIDE");
|
"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>
|
already_AddRefed<CSSValue>
|
||||||
nsComputedDOMStyle::GetRelativeOffset(mozilla::css::Side aSide)
|
nsComputedDOMStyle::GetRelativeOffset(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
|
|
||||||
|
|
@ -5207,7 +5207,7 @@ nsComputedDOMStyle::GetRelativeOffset(mozilla::css::Side aSide)
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CSSValue>
|
already_AddRefed<CSSValue>
|
||||||
nsComputedDOMStyle::GetStickyOffset(mozilla::css::Side aSide)
|
nsComputedDOMStyle::GetStickyOffset(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
|
|
||||||
|
|
@ -5237,7 +5237,7 @@ nsComputedDOMStyle::GetStickyOffset(mozilla::css::Side aSide)
|
||||||
|
|
||||||
|
|
||||||
already_AddRefed<CSSValue>
|
already_AddRefed<CSSValue>
|
||||||
nsComputedDOMStyle::GetStaticOffset(mozilla::css::Side aSide)
|
nsComputedDOMStyle::GetStaticOffset(mozilla::Side aSide)
|
||||||
|
|
||||||
{
|
{
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
|
|
@ -5246,7 +5246,7 @@ nsComputedDOMStyle::GetStaticOffset(mozilla::css::Side aSide)
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CSSValue>
|
already_AddRefed<CSSValue>
|
||||||
nsComputedDOMStyle::GetPaddingWidthFor(mozilla::css::Side aSide)
|
nsComputedDOMStyle::GetPaddingWidthFor(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
|
|
||||||
|
|
@ -5302,7 +5302,7 @@ nsComputedDOMStyle::GetLineHeightCoord(nscoord& aCoord)
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CSSValue>
|
already_AddRefed<CSSValue>
|
||||||
nsComputedDOMStyle::GetBorderColorsFor(mozilla::css::Side aSide)
|
nsComputedDOMStyle::GetBorderColorsFor(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
const nsStyleBorder *border = StyleBorder();
|
const nsStyleBorder *border = StyleBorder();
|
||||||
|
|
||||||
|
|
@ -5330,7 +5330,7 @@ nsComputedDOMStyle::GetBorderColorsFor(mozilla::css::Side aSide)
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CSSValue>
|
already_AddRefed<CSSValue>
|
||||||
nsComputedDOMStyle::GetBorderWidthFor(mozilla::css::Side aSide)
|
nsComputedDOMStyle::GetBorderWidthFor(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
|
|
||||||
|
|
@ -5347,7 +5347,7 @@ nsComputedDOMStyle::GetBorderWidthFor(mozilla::css::Side aSide)
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CSSValue>
|
already_AddRefed<CSSValue>
|
||||||
nsComputedDOMStyle::GetBorderColorFor(mozilla::css::Side aSide)
|
nsComputedDOMStyle::GetBorderColorFor(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
SetValueFromComplexColor(val, StyleBorder()->mBorderColor[aSide]);
|
SetValueFromComplexColor(val, StyleBorder()->mBorderColor[aSide]);
|
||||||
|
|
@ -5355,7 +5355,7 @@ nsComputedDOMStyle::GetBorderColorFor(mozilla::css::Side aSide)
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CSSValue>
|
already_AddRefed<CSSValue>
|
||||||
nsComputedDOMStyle::GetMarginWidthFor(mozilla::css::Side aSide)
|
nsComputedDOMStyle::GetMarginWidthFor(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
|
|
||||||
|
|
@ -5376,7 +5376,7 @@ nsComputedDOMStyle::GetMarginWidthFor(mozilla::css::Side aSide)
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CSSValue>
|
already_AddRefed<CSSValue>
|
||||||
nsComputedDOMStyle::GetBorderStyleFor(mozilla::css::Side aSide)
|
nsComputedDOMStyle::GetBorderStyleFor(mozilla::Side aSide)
|
||||||
{
|
{
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
val->SetIdent(
|
val->SetIdent(
|
||||||
|
|
|
||||||
|
|
@ -160,27 +160,27 @@ private:
|
||||||
already_AddRefed<CSSValue> GetEllipseRadii(const nsStyleCorners& aRadius,
|
already_AddRefed<CSSValue> GetEllipseRadii(const nsStyleCorners& aRadius,
|
||||||
uint8_t aFullCorner);
|
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);
|
already_AddRefed<CSSValue> GetSVGPaintFor(bool aFill);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -272,13 +272,13 @@ public:
|
||||||
bool operator==(const nsStyleSides& aOther) const;
|
bool operator==(const nsStyleSides& aOther) const;
|
||||||
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 GetLeftUnit() const;
|
||||||
inline nsStyleUnit GetTopUnit() const;
|
inline nsStyleUnit GetTopUnit() const;
|
||||||
inline nsStyleUnit GetRightUnit() const;
|
inline nsStyleUnit GetRightUnit() const;
|
||||||
inline nsStyleUnit GetBottomUnit() 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 GetLeft() const;
|
||||||
inline nsStyleCoord GetTop() const;
|
inline nsStyleCoord GetTop() const;
|
||||||
inline nsStyleCoord GetRight() const;
|
inline nsStyleCoord GetRight() const;
|
||||||
|
|
@ -311,13 +311,13 @@ public:
|
||||||
// constructors).
|
// constructors).
|
||||||
void Reset();
|
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 SetLeft(const nsStyleCoord& aCoord);
|
||||||
inline void SetTop(const nsStyleCoord& aCoord);
|
inline void SetTop(const nsStyleCoord& aCoord);
|
||||||
inline void SetRight(const nsStyleCoord& aCoord);
|
inline void SetRight(const nsStyleCoord& aCoord);
|
||||||
inline void SetBottom(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]);
|
return nsStyleCoord::ToLength(mUnits[aSide], mValues[aSide]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -545,7 +545,7 @@ inline bool nsStyleSides::operator!=(const nsStyleSides& aOther) const
|
||||||
return !((*this) == aOther);
|
return !((*this) == aOther);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline nsStyleUnit nsStyleSides::GetUnit(mozilla::css::Side aSide) const
|
inline nsStyleUnit nsStyleSides::GetUnit(mozilla::Side aSide) const
|
||||||
{
|
{
|
||||||
return (nsStyleUnit)mUnits[aSide];
|
return (nsStyleUnit)mUnits[aSide];
|
||||||
}
|
}
|
||||||
|
|
@ -570,7 +570,7 @@ inline nsStyleUnit nsStyleSides::GetBottomUnit() const
|
||||||
return GetUnit(NS_SIDE_BOTTOM);
|
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]));
|
return nsStyleCoord(mValues[aSide], nsStyleUnit(mUnits[aSide]));
|
||||||
}
|
}
|
||||||
|
|
@ -595,7 +595,7 @@ inline nsStyleCoord nsStyleSides::GetBottom() const
|
||||||
return Get(NS_SIDE_BOTTOM);
|
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);
|
nsStyleCoord::SetValue(mUnits[aSide], mValues[aSide], aCoord);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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]) {
|
if (mBorderColors && mBorderColors[aSide]) {
|
||||||
delete mBorderColors[aSide];
|
delete mBorderColors[aSide];
|
||||||
mBorderColors[aSide] = nullptr;
|
mBorderColors[aSide] = nullptr;
|
||||||
|
|
@ -1219,13 +1219,13 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBorder
|
||||||
// Note that this does *not* consider the effects of 'border-image':
|
// Note that this does *not* consider the effects of 'border-image':
|
||||||
// if border-style is none, but there is a loaded border image,
|
// if border-style is none, but there is a loaded border image,
|
||||||
// HasVisibleStyle will be false even though there *is* a border.
|
// 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]);
|
return IsVisibleBorderStyle(mBorderStyle[aSide]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// aBorderWidth is in twips
|
// aBorderWidth is in twips
|
||||||
void SetBorderWidth(mozilla::css::Side aSide, nscoord aBorderWidth)
|
void SetBorderWidth(mozilla::Side aSide, nscoord aBorderWidth)
|
||||||
{
|
{
|
||||||
nscoord roundedWidth =
|
nscoord roundedWidth =
|
||||||
NS_ROUND_BORDER_TO_PIXELS(aBorderWidth, mTwipsPerPixel);
|
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
|
// 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
|
// 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.
|
// 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);
|
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");
|
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
|
||||||
return mBorderStyle[aSide];
|
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");
|
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
|
||||||
mBorderStyle[aSide] = aStyle;
|
mBorderStyle[aSide] = aStyle;
|
||||||
|
|
@ -1826,7 +1826,7 @@ public:
|
||||||
bool MaxHeightDependsOnContainer() const
|
bool MaxHeightDependsOnContainer() const
|
||||||
{ return HeightCoordDependsOnContainer(mMaxHeight); }
|
{ return HeightCoordDependsOnContainer(mMaxHeight); }
|
||||||
|
|
||||||
bool OffsetHasPercent(mozilla::css::Side aSide) const
|
bool OffsetHasPercent(mozilla::Side aSide) const
|
||||||
{
|
{
|
||||||
return mOffset.Get(aSide).HasPercent();
|
return mOffset.Get(aSide).HasPercent();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue