Bug 1311270 - Part 4. Handle rendering of mask-clip:no-clip. draft
authorcku <cku@mozilla.com>
Wed, 23 Nov 2016 02:36:04 +0800
changeset 453290 74732dd4185f554e226c712738592448df215798
parent 453289 a187c3f9519efb8b031913ce0dbf643c05232fa2
child 453291 bfd590b7897c7b1eebda7b642afcdd0bddb3faea
push id39618
push userbmo:cku@mozilla.com
push dateFri, 23 Dec 2016 04:25:44 +0000
bugs1311270
milestone53.0a1
Bug 1311270 - Part 4. Handle rendering of mask-clip:no-clip. MozReview-Commit-ID: 42n7ywfrc3P
layout/painting/nsCSSRendering.cpp
--- 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