Bug 1234485 - Part 11. Paint SVG mask on PaintedLayer before bug 1313877 fixed. draft
authorcku <cku@mozilla.com>
Sun, 30 Oct 2016 02:55:24 +0800
changeset 435842 8fa51e31b56cb6949c51877905891b1d28a47dcf
parent 435841 c1777175cd471287a1c0f5de5934ac14ccecd64b
child 435843 833e117c064861a661004af56c9b15985dd3e9eb
push id35137
push userbmo:cku@mozilla.com
push dateWed, 09 Nov 2016 09:16:18 +0000
bugs1234485, 1313877
milestone52.0a1
Bug 1234485 - Part 11. Paint SVG mask on PaintedLayer before bug 1313877 fixed. MozReview-Commit-ID: C8XIZ4ttp1P
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -7099,16 +7099,30 @@ bool nsDisplayMask::ShouldPaintOnMaskLay
       maskUsage.shouldGenerateClipMaskLayer) {
     return false;
   }
 
   if (!nsSVGIntegrationUtils::IsMaskResourceReady(mFrame)) {
     return false;
   }
 
+  // XXX temporary disable drawing SVG mask onto mask layer before bug 1313877
+  // been fixed.
+  nsIFrame* firstFrame =
+    nsLayoutUtils::FirstContinuationOrIBSplitSibling(mFrame);
+  nsSVGEffects::EffectProperties effectProperties =
+    nsSVGEffects::GetEffectProperties(firstFrame);
+  nsTArray<nsSVGMaskFrame *> maskFrames = effectProperties.GetMaskFrames();
+  for (size_t i = 0; i < maskFrames.Length() ; i++) {
+    nsSVGMaskFrame *maskFrame = maskFrames[i];
+    if (maskFrame) {
+      return false; // Found SVG mask.
+    }
+  }
+
   return true;
 }
 
 bool nsDisplayMask::ComputeVisibility(nsDisplayListBuilder* aBuilder,
                                       nsRegion* aVisibleRegion)
 {
   // Our children may be made translucent or arbitrarily deformed so we should
   // not allow them to subtract area from aVisibleRegion.