зеркало из https://github.com/mozilla/gecko-dev.git
Use nsIFrame::GetBorderRadii so that we pick up when it is overridden. (Bug 459144, patch 7) r=roc a2.0=blocking:beta6+
This commit is contained in:
Родитель
f350baca0b
Коммит
bc123def7f
|
@ -571,9 +571,14 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::ComputeBorderRadii(aStyleBorder.mBorderRadius,
|
nsSize frameSize = aForFrame->GetSize();
|
||||||
aForFrame->GetSize(), aBorderArea.Size(),
|
if (&aStyleBorder == aForFrame->GetStyleBorder() &&
|
||||||
aSkipSides, twipsRadii);
|
frameSize == aBorderArea.Size()) {
|
||||||
|
aForFrame->GetBorderRadii(twipsRadii);
|
||||||
|
} else {
|
||||||
|
nsIFrame::ComputeBorderRadii(aStyleBorder.mBorderRadius, frameSize,
|
||||||
|
aBorderArea.Size(), aSkipSides, twipsRadii);
|
||||||
|
}
|
||||||
|
|
||||||
// Turn off rendering for all of the zero sized sides
|
// Turn off rendering for all of the zero sized sides
|
||||||
if (aSkipSides & SIDE_BIT_TOP) border.top = 0;
|
if (aSkipSides & SIDE_BIT_TOP) border.top = 0;
|
||||||
|
@ -1108,9 +1113,8 @@ nsCSSRendering::PaintBoxShadowOuter(nsPresContext* aPresContext,
|
||||||
} else {
|
} else {
|
||||||
nativeTheme = PR_FALSE;
|
nativeTheme = PR_FALSE;
|
||||||
nscoord twipsRadii[8];
|
nscoord twipsRadii[8];
|
||||||
hasBorderRadius = nsIFrame::ComputeBorderRadii(styleBorder->mBorderRadius,
|
NS_ASSERTION(aFrameArea.Size() == aForFrame->GetSize(), "unexpected size");
|
||||||
aFrameArea.Size(), aFrameArea,
|
hasBorderRadius = aForFrame->GetBorderRadii(twipsRadii);
|
||||||
aForFrame->GetSkipSides(), twipsRadii);
|
|
||||||
if (hasBorderRadius) {
|
if (hasBorderRadius) {
|
||||||
ComputePixelRadii(twipsRadii, twipsPerPixel, &borderRadii);
|
ComputePixelRadii(twipsRadii, twipsPerPixel, &borderRadii);
|
||||||
}
|
}
|
||||||
|
@ -1287,10 +1291,8 @@ nsCSSRendering::PaintBoxShadowInner(nsPresContext* aPresContext,
|
||||||
|
|
||||||
// Get any border radius, since box-shadow must also have rounded corners if the frame does
|
// Get any border radius, since box-shadow must also have rounded corners if the frame does
|
||||||
nscoord twipsRadii[8];
|
nscoord twipsRadii[8];
|
||||||
PRBool hasBorderRadius = nsIFrame::ComputeBorderRadii(
|
NS_ASSERTION(aFrameArea.Size() == aForFrame->GetSize(), "unexpected size");
|
||||||
styleBorder->mBorderRadius, aFrameArea.Size(),
|
PRBool hasBorderRadius = aForFrame->GetBorderRadii(twipsRadii);
|
||||||
aFrameArea.Size(), aForFrame->GetSkipSides(),
|
|
||||||
twipsRadii);
|
|
||||||
nscoord twipsPerPixel = aPresContext->DevPixelsToAppUnits(1);
|
nscoord twipsPerPixel = aPresContext->DevPixelsToAppUnits(1);
|
||||||
|
|
||||||
nsRect paddingRect = aFrameArea;
|
nsRect paddingRect = aFrameArea;
|
||||||
|
@ -2179,9 +2181,15 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
|
||||||
PRBool haveRoundedCorners;
|
PRBool haveRoundedCorners;
|
||||||
{
|
{
|
||||||
nscoord radii[8];
|
nscoord radii[8];
|
||||||
haveRoundedCorners = nsIFrame::ComputeBorderRadii(aBorder.mBorderRadius,
|
nsSize frameSize = aForFrame->GetSize();
|
||||||
aForFrame->GetSize(), aBorderArea.Size(),
|
if (&aBorder == aForFrame->GetStyleBorder() &&
|
||||||
aForFrame->GetSkipSides(), radii);
|
frameSize == aBorderArea.Size()) {
|
||||||
|
haveRoundedCorners = aForFrame->GetBorderRadii(radii);
|
||||||
|
} else {
|
||||||
|
haveRoundedCorners = nsIFrame::ComputeBorderRadii(aBorder.mBorderRadius,
|
||||||
|
frameSize, aBorderArea.Size(),
|
||||||
|
aForFrame->GetSkipSides(), radii);
|
||||||
|
}
|
||||||
if (haveRoundedCorners)
|
if (haveRoundedCorners)
|
||||||
ComputePixelRadii(radii, appUnitsPerPixel, &bgRadii);
|
ComputePixelRadii(radii, appUnitsPerPixel, &bgRadii);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1009,10 +1009,7 @@ nsDisplayBoxShadowOuter::ComputeVisibility(nsDisplayListBuilder* aBuilder,
|
||||||
// the visible region is entirely inside the border-rect, and box shadows
|
// the visible region is entirely inside the border-rect, and box shadows
|
||||||
// never render within the border-rect (unless there's a border radius).
|
// never render within the border-rect (unless there's a border radius).
|
||||||
nscoord twipsRadii[8];
|
nscoord twipsRadii[8];
|
||||||
PRBool hasBorderRadii = nsIFrame::ComputeBorderRadii(
|
PRBool hasBorderRadii = mFrame->GetBorderRadii(twipsRadii);
|
||||||
mFrame->GetStyleBorder()->mBorderRadius,
|
|
||||||
frameRect.Size(), frameRect.Size(),
|
|
||||||
mFrame->GetSkipSides(), twipsRadii);
|
|
||||||
if (!hasBorderRadii)
|
if (!hasBorderRadii)
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
|
|
||||||
|
|
|
@ -279,6 +279,8 @@ nsFieldSetFrame::PaintBorderBackground(nsIRenderingContext& aRenderingContext,
|
||||||
|
|
||||||
// if the border is smaller than the legend. Move the border down
|
// if the border is smaller than the legend. Move the border down
|
||||||
// to be centered on the legend.
|
// to be centered on the legend.
|
||||||
|
// FIXME: This means border-radius clamping is incorrect; we should
|
||||||
|
// override nsIFrame::GetBorderRadii.
|
||||||
if (topBorder < mLegendRect.height)
|
if (topBorder < mLegendRect.height)
|
||||||
yoff = (mLegendRect.height - topBorder)/2;
|
yoff = (mLegendRect.height - topBorder)/2;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче