Bug 1509394. Fix pointer events regression for SVG clipPath clipped content. r=longsonr a=jcristau
authorJonathan Watt <jwatt@jwatt.org>
Mon, 12 Nov 2018 14:59:31 +0000
changeset 501408 390cd25cecd6b5c73d33b842522a0a789affbe00
parent 501407 460fc055455eee173a13d73f7f9cf44609f7576c
child 501409 307b6790d4109a19d88a529fead1337e48f4656f
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslongsonr, jcristau
bugs1509394
milestone64.0
Bug 1509394. Fix pointer events regression for SVG clipPath clipped content. r=longsonr a=jcristau References to a clipPath that is non-existent or invalid should be ignored, not cause the referencing element to ignore pointer events. Differential Revision: https://phabricator.services.mozilla.com/D12959
layout/svg/nsSVGUtils.cpp
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -869,21 +869,20 @@ nsSVGUtils::PaintFrameWithEffects(nsIFra
     MOZ_ASSERT(target != &aContext);
     blender.BlendToTarget();
   }
 }
 
 bool
 nsSVGUtils::HitTestClip(nsIFrame *aFrame, const gfxPoint &aPoint)
 {
+  // If the clip-path property references non-existent or invalid clipPath
+  // element(s) we ignore it.
   nsSVGClipPathFrame* clipPathFrame;
-  if (SVGObserverUtils::GetAndObserveClipPath(aFrame, &clipPathFrame) ==
-        SVGObserverUtils::eHasRefsSomeInvalid) {
-    return false; // everything clipped away if clip path is invalid
-  }
+  SVGObserverUtils::GetAndObserveClipPath(aFrame, &clipPathFrame);
   if (clipPathFrame) {
     return clipPathFrame->PointIsInsideClipPath(aFrame, aPoint);
   }
   if (aFrame->StyleSVGReset()->HasClipPath()) {
     return nsCSSClipPathInstance::HitTestBasicShapeOrPathClip(aFrame, aPoint);
   }
   return true;
 }