Bug 1311270 - Part 4. Handle rendering of mask-clip:no-clip.
MozReview-Commit-ID: 42n7ywfrc3P
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -1901,33 +1901,44 @@ SetupDirtyRects(const nsRect& aBGClipAre
/* static */ void
nsCSSRendering::GetImageLayerClip(const nsStyleImageLayers::Layer& aLayer,
nsIFrame* aForFrame, const nsStyleBorder& aBorder,
const nsRect& aBorderArea, const nsRect& aCallerDirtyRect,
bool aWillPaintBorder, nscoord aAppUnitsPerPixel,
/* out */ ImageLayerClipState* aClipState)
{
+ StyleGeometryBox backgroundClip = aLayer.mClip;
+
+ if (backgroundClip == StyleGeometryBox::NoClip) {
+ aClipState->mBGClipArea = aCallerDirtyRect;
+ aClipState->mHasAdditionalBGClipArea = false;
+ aClipState->mCustomClip = false;
+
+ SetupDirtyRects(aClipState->mBGClipArea, aCallerDirtyRect,
+ aAppUnitsPerPixel, &aClipState->mDirtyRect,
+ &aClipState->mDirtyRectGfx);
+ return;
+ }
+
// 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);
bool haveRoundedCorners = GetRadii(aForFrame, aBorder, aBorderArea,
clipBorderArea, aClipState->mRadii);
- StyleGeometryBox backgroundClip = aLayer.mClip;
// XXX TODO: bug 1303623 only implements the parser of fill-box|stroke-box|view-box|no-clip.
// So we need to fallback to default value when rendering. We should remove this
// in bug 1311270.
if (backgroundClip == StyleGeometryBox::Fill ||
backgroundClip == StyleGeometryBox::Stroke ||
- backgroundClip == StyleGeometryBox::View ||
- backgroundClip == StyleGeometryBox::NoClip) {
+ backgroundClip == StyleGeometryBox::View) {
backgroundClip = StyleGeometryBox::Border;
}
bool isSolidBorder =
aWillPaintBorder && IsOpaqueBorder(aBorder);
if (isSolidBorder && backgroundClip == StyleGeometryBox::Border) {
// If we have rounded corners, we need to inflate the background
// drawing area a bit to avoid seams between the border and