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 445793 13352363b9063c2f142a91ec78ee10b2faea0064
parent 445792 df4c62d68f1d2949825a53518522ebe84d53ce2f
child 445794 f51ece633f96b01989276dd1bbab04a08f573534
push id37609
push userbmo:cku@mozilla.com
push dateWed, 30 Nov 2016 08:03:11 +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