Bug 1517197. Fix SVG masking and clipping regression. r=mattwoodrow, a=RyanVM
authorJonathan Watt <jwatt@jwatt.org>
Tue, 15 Jan 2019 00:20:52 +0000
changeset 506743 e3e8f1521ebd73942d22185df7d166f74eee41cd
parent 506742 e5741dae0f4e8399e514af1a9acbf80732c16dd9
child 506744 b0abaa9984f6b6434da2477ffdbfa0307b115f32
push id10532
push userryanvm@gmail.com
push dateWed, 16 Jan 2019 15:34:31 +0000
treeherdermozilla-beta@548bb5b013ff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, RyanVM
bugs1517197
milestone65.0
Bug 1517197. Fix SVG masking and clipping regression. r=mattwoodrow, a=RyanVM This Make nsSVGIntegrationUtils::AdjustInvalidAreaForSVGEffects return the original area if there are no filter effects (instead of using some bogus fallback code). Differential Revision: https://phabricator.services.mozilla.com/D16516
layout/reftests/invalidation/reftest.list
layout/svg/nsSVGIntegrationUtils.cpp
--- a/layout/reftests/invalidation/reftest.list
+++ b/layout/reftests/invalidation/reftest.list
@@ -39,18 +39,18 @@ pref(layout.animated-image-layers.enable
 == filter-userspace-offset.svg?offsetContainer=foreignObject&mask=boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=rect&mask=userSpace-at100 filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=use&mask=userSpace-atZero filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=innerSVG&mask=userSpace-atZero filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=foreignObject&mask=userSpace-at100 filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-fillPaint-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-fillPaint-userSpace-at100 filter-userspace-offset.svg
 
-fails-if(!Android) != scroll-inactive-layers.html about:blank   # bug 1494110 for the fails-if(!Android) (Android is a false pass, no doubt)
-fails-if(!Android) != scroll-inactive-layers-2.html about:blank # bug 1494110 for the fails-if(!Android) (Android is a false pass, no doubt)
+fails-if(webrender) != scroll-inactive-layers.html about:blank
+fails-if(webrender) != scroll-inactive-layers-2.html about:blank
 != inactive-layertree-visible-region-1.html about:blank
 != inactive-layertree-visible-region-2.html about:blank
 != transform-floating-point-invalidation.html about:blank
 != transform-floating-point-invalidation.html?reverse about:blank
 != nudge-to-integer-invalidation.html about:blank
 != nudge-to-integer-invalidation.html?reverse about:blank
 != clipped-animated-transform-1.html about:blank
 != paintedlayer-recycling-1.html about:blank
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -305,39 +305,31 @@ nsRect nsSVGIntegrationUtils::ComputePos
 
 nsIntRegion nsSVGIntegrationUtils::AdjustInvalidAreaForSVGEffects(
     nsIFrame* aFrame, const nsPoint& aToReferenceFrame,
     const nsIntRegion& aInvalidRegion) {
   if (aInvalidRegion.IsEmpty()) {
     return nsIntRect();
   }
 
-  int32_t appUnitsPerDevPixel = aFrame->PresContext()->AppUnitsPerDevPixel();
   nsIFrame* firstFrame =
       nsLayoutUtils::FirstContinuationOrIBSplitSibling(aFrame);
 
   // If we have any filters to observe then we should have started doing that
   // during reflow/ComputeFrameEffectsRect, so we use GetFiltersIfObserving
   // here to avoid needless work (or masking bugs by setting up observers at
   // the wrong time).
   if (!aFrame->StyleEffects()->HasFilters() ||
       SVGObserverUtils::GetFiltersIfObserving(firstFrame, nullptr) ==
           SVGObserverUtils::eHasRefsSomeInvalid) {
-    // The frame is either not there or not currently available,
-    // perhaps because we're in the middle of tearing stuff down.
-    // Be conservative, return our visual overflow rect relative
-    // to the reference frame.
-    // XXX we may get here purely due to an SVG mask, in which case there is
-    // no need to do this it causes over-invalidation. See:
-    // https://bugzilla.mozilla.org/show_bug.cgi?id=1494110
-    // Do we still even need this for filters? If so, why?
-    nsRect overflow = aFrame->GetVisualOverflowRect() + aToReferenceFrame;
-    return overflow.ToOutsidePixels(appUnitsPerDevPixel);
+    return aInvalidRegion;
   }
 
+  int32_t appUnitsPerDevPixel = aFrame->PresContext()->AppUnitsPerDevPixel();
+
   // Convert aInvalidRegion into bounding box frame space in app units:
   nsPoint toBoundingBox =
       aFrame->GetOffsetTo(firstFrame) + GetOffsetToBoundingBox(firstFrame);
   // The initial rect was relative to the reference frame, so we need to
   // remove that offset to get a rect relative to the current frame.
   toBoundingBox -= aToReferenceFrame;
   nsRegion preEffectsRegion =
       aInvalidRegion.ToAppUnits(appUnitsPerDevPixel).MovedBy(toBoundingBox);