--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -559,48 +559,50 @@ JoinBoxesForSlice(nsIFrame* aFrame, cons
return (aOrder == eForBorder
? gInlineBGData->GetBorderContinuousRect(aFrame, aBorderArea)
: gInlineBGData->GetContinuousRect(aFrame)) +
aBorderArea.TopLeft();
}
return JoinBoxesForBlockAxisSlice(aFrame, aBorderArea);
}
-static bool
-IsBoxDecorationSlice(const nsStyleBorder& aStyleBorder)
+/* static */ bool
+nsCSSRendering::IsBoxDecorationSlice(const nsStyleBorder& aStyleBorder)
{
return aStyleBorder.mBoxDecorationBreak == StyleBoxDecorationBreak::Slice;
}
-static nsRect
-BoxDecorationRectForBorder(nsIFrame* aFrame, const nsRect& aBorderArea,
- Sides aSkipSides,
- const nsStyleBorder* aStyleBorder = nullptr)
+/* static */ nsRect
+nsCSSRendering::BoxDecorationRectForBorder(nsIFrame* aFrame,
+ const nsRect& aBorderArea,
+ Sides aSkipSides,
+ const nsStyleBorder* aStyleBorder)
{
if (!aStyleBorder) {
aStyleBorder = aFrame->StyleBorder();
}
// If aSkipSides.IsEmpty() then there are no continuations, or it's
// a ::first-letter that wants all border sides on the first continuation.
- return ::IsBoxDecorationSlice(*aStyleBorder) && !aSkipSides.IsEmpty()
+ return IsBoxDecorationSlice(*aStyleBorder) && !aSkipSides.IsEmpty()
? ::JoinBoxesForSlice(aFrame, aBorderArea, eForBorder)
: aBorderArea;
}
-static nsRect
-BoxDecorationRectForBackground(nsIFrame* aFrame, const nsRect& aBorderArea,
- Sides aSkipSides,
- const nsStyleBorder* aStyleBorder = nullptr)
+/* static */ nsRect
+nsCSSRendering::BoxDecorationRectForBackground(nsIFrame* aFrame,
+ const nsRect& aBorderArea,
+ Sides aSkipSides,
+ const nsStyleBorder* aStyleBorder)
{
if (!aStyleBorder) {
aStyleBorder = aFrame->StyleBorder();
}
// If aSkipSides.IsEmpty() then there are no continuations, or it's
// a ::first-letter that wants all border sides on the first continuation.
- return ::IsBoxDecorationSlice(*aStyleBorder) && !aSkipSides.IsEmpty()
+ return IsBoxDecorationSlice(*aStyleBorder) && !aSkipSides.IsEmpty()
? ::JoinBoxesForSlice(aFrame, aBorderArea, eForBackground)
: aBorderArea;
}
//----------------------------------------------------------------------
// Thebes Border Rendering Code Start
/*
@@ -807,25 +809,26 @@ ConstructBorderRenderer(nsPresContext* a
nsIFrame* bgFrame = nsCSSRendering::FindNonTransparentBackgroundFrame(aForFrame, quirks);
nsStyleContext* bgContext = bgFrame->StyleContext();
nscolor bgColor = bgContext->
GetVisitedDependentColor(&nsStyleBackground::mBackgroundColor);
// Compute the outermost boundary of the area that might be painted.
// Same coordinate space as aBorderArea & aBGClipRect.
nsRect joinedBorderArea =
- ::BoxDecorationRectForBorder(aForFrame, aBorderArea, aSkipSides, &aStyleBorder);
+ nsCSSRendering::BoxDecorationRectForBorder(aForFrame, aBorderArea,
+ aSkipSides, &aStyleBorder);
RectCornerRadii bgRadii;
::GetRadii(aForFrame, aStyleBorder, aBorderArea, joinedBorderArea, &bgRadii);
PrintAsFormatString(" joinedBorderArea: %d %d %d %d\n", joinedBorderArea.x, joinedBorderArea.y,
joinedBorderArea.width, joinedBorderArea.height);
// start drawing
- if (::IsBoxDecorationSlice(aStyleBorder)) {
+ if (nsCSSRendering::IsBoxDecorationSlice(aStyleBorder)) {
if (joinedBorderArea.IsEqualEdges(aBorderArea)) {
// No need for a clip, just skip the sides we don't want.
border.ApplySkipSides(aSkipSides);
} else {
// We're drawing borders around the joined continuation boxes so we need
// to clip that to the slice that we want for this frame.
*aNeedsClip = true;
}
@@ -1532,17 +1535,17 @@ nsRect
nsCSSRendering::GetShadowRect(const nsRect aFrameArea,
bool aNativeTheme,
nsIFrame* aForFrame)
{
nsRect frameRect = aNativeTheme ?
aForFrame->GetVisualOverflowRectRelativeToSelf() + aFrameArea.TopLeft() :
aFrameArea;
Sides skipSides = aForFrame->GetSkipSides();
- frameRect = ::BoxDecorationRectForBorder(aForFrame, frameRect, skipSides);
+ frameRect = BoxDecorationRectForBorder(aForFrame, frameRect, skipSides);
// Explicitly do not need to account for the spread radius here
// Webrender does it for us or PaintBoxShadow will for non-WR
return frameRect;
}
bool
nsCSSRendering::GetBorderRadii(const nsRect& aFrameRect,
@@ -1780,17 +1783,17 @@ nsCSSRendering::PaintBoxShadowOuter(nsPr
}
nsRect
nsCSSRendering::GetBoxShadowInnerPaddingRect(nsIFrame* aFrame,
const nsRect& aFrameArea)
{
Sides skipSides = aFrame->GetSkipSides();
nsRect frameRect =
- ::BoxDecorationRectForBorder(aFrame, aFrameArea, skipSides);
+ BoxDecorationRectForBorder(aFrame, aFrameArea, skipSides);
nsRect paddingRect = frameRect;
nsMargin border = aFrame->GetUsedBorder();
paddingRect.Deflate(border);
return paddingRect;
}
bool
@@ -1816,17 +1819,17 @@ bool
nsCSSRendering::GetShadowInnerRadii(nsIFrame* aFrame,
const nsRect& aFrameArea,
RectCornerRadii& aOutInnerRadii)
{
// Get any border radius, since box-shadow must also have rounded corners
// if the frame does.
nscoord twipsRadii[8];
nsRect frameRect =
- ::BoxDecorationRectForBorder(aFrame, aFrameArea, aFrame->GetSkipSides());
+ BoxDecorationRectForBorder(aFrame, aFrameArea, aFrame->GetSkipSides());
nsSize sz = frameRect.Size();
nsMargin border = aFrame->GetUsedBorder();
bool hasBorderRadius = aFrame->GetBorderRadii(sz, sz, Sides(), twipsRadii);
const nscoord oneDevPixel = aFrame->PresContext()->DevPixelsToAppUnits(1);
RectCornerRadii borderRadii;
hasBorderRadius = GetBorderRadii(frameRect, aFrameArea, aFrame, borderRadii);
@@ -2298,17 +2301,17 @@ nsCSSRendering::GetImageLayerClip(const
MOZ_ASSERT(!aForFrame->IsFrameOfType(nsIFrame::eSVG) ||
aForFrame->IsSVGOuterSVGFrame());
// Compute the outermost boundary of the area that might be painted.
// Same coordinate space as aBorderArea.
Sides skipSides = aForFrame->GetSkipSides();
nsRect clipBorderArea =
- ::BoxDecorationRectForBorder(aForFrame, aBorderArea, skipSides, &aBorder);
+ BoxDecorationRectForBorder(aForFrame, aBorderArea, skipSides, &aBorder);
bool haveRoundedCorners = false;
LayoutFrameType fType = aForFrame->Type();
if (fType != LayoutFrameType::TableColGroup &&
fType != LayoutFrameType::TableCol &&
fType != LayoutFrameType::TableRow &&
fType != LayoutFrameType::TableRowGroup) {
haveRoundedCorners = GetRadii(aForFrame, aBorder, aBorderArea,
@@ -2745,20 +2748,20 @@ nsCSSRendering::PaintStyleImageLayerWith
if (drawBackgroundColor && !isCanvasFrame) {
DrawBackgroundColor(clipState, &aRenderingCtx, appUnitsPerPixel);
}
// Compute the outermost boundary of the area that might be painted.
// Same coordinate space as aParams.borderArea & aParams.bgClipRect.
Sides skipSides = aParams.frame->GetSkipSides();
nsRect paintBorderArea =
- ::BoxDecorationRectForBackground(aParams.frame, aParams.borderArea,
+ BoxDecorationRectForBackground(aParams.frame, aParams.borderArea,
skipSides, &aBorder);
nsRect clipBorderArea =
- ::BoxDecorationRectForBorder(aParams.frame, aParams.borderArea,
+ BoxDecorationRectForBorder(aParams.frame, aParams.borderArea,
skipSides, &aBorder);
ImgDrawResult result = ImgDrawResult::SUCCESS;
StyleGeometryBox currentBackgroundClip = StyleGeometryBox::BorderBox;
uint32_t count = drawAllLayers
? layers.mImageCount // iterate all image layers.
: layers.mImageCount - aParams.layer; // iterate from the bottom layer to
// the 'aParams.layer-th' layer.
@@ -2864,17 +2867,17 @@ nsCSSRendering::BuildWebRenderDisplayIte
SetupDirtyRects(clipState.mBGClipArea, aParams.dirtyRect, appUnitsPerPixel,
&clipState.mDirtyRectInAppUnits,
&clipState.mDirtyRectInDevPx);
// Compute the outermost boundary of the area that might be painted.
// Same coordinate space as aParams.borderArea & aParams.bgClipRect.
Sides skipSides = aParams.frame->GetSkipSides();
nsRect paintBorderArea =
- ::BoxDecorationRectForBackground(aParams.frame, aParams.borderArea,
+ BoxDecorationRectForBackground(aParams.frame, aParams.borderArea,
skipSides, &aBorder);
const nsStyleImageLayers& layers = aBackgroundSC->StyleBackground()->mImage;
const nsStyleImageLayers::Layer& layer = layers.mLayers[aParams.layer];
// Skip the following layer painting code if we found the dirty region is
// empty or the current layer is not selected for drawing.
if (clipState.mDirtyRectInDevPx.IsEmpty()) {
@@ -3384,17 +3387,17 @@ nsCSSRendering::GetBackgroundLayerRect(n
nsIFrame* aForFrame,
const nsRect& aBorderArea,
const nsRect& aClipRect,
const nsStyleImageLayers::Layer& aLayer,
uint32_t aFlags)
{
Sides skipSides = aForFrame->GetSkipSides();
nsRect borderArea =
- ::BoxDecorationRectForBackground(aForFrame, aBorderArea, skipSides);
+ BoxDecorationRectForBackground(aForFrame, aBorderArea, skipSides);
nsBackgroundLayerState state =
PrepareImageLayer(aPresContext, aForFrame, aFlags, borderArea,
aClipRect, aLayer);
return state.mFillArea;
}
// Begin table border-collapsing section
// These functions were written to not disrupt the normal ones and yet satisfy some additional requirements