From 8ac56b97a3b1227b591129ae22573c2bd77cf14f Mon Sep 17 00:00:00 2001 From: cku Date: Wed, 23 Nov 2016 02:36:04 +0800 Subject: [PATCH] Bug 1311270 - Part 4. Handle rendering of mask-clip:no-clip. MozReview-Commit-ID: 42n7ywfrc3P --HG-- extra : rebase_source : 74732dd4185f554e226c712738592448df215798 --- layout/painting/nsCSSRendering.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/layout/painting/nsCSSRendering.cpp b/layout/painting/nsCSSRendering.cpp index 22aa65c466e7..ac60543522ad 100644 --- a/layout/painting/nsCSSRendering.cpp +++ b/layout/painting/nsCSSRendering.cpp @@ -1906,6 +1906,19 @@ nsCSSRendering::GetImageLayerClip(const nsStyleImageLayers::Layer& aLayer, 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(); @@ -1914,15 +1927,13 @@ nsCSSRendering::GetImageLayerClip(const nsStyleImageLayers::Layer& aLayer, 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; }