From 445447b9188948ba06407f76ec2c4651d639a68c Mon Sep 17 00:00:00 2001 From: "tor%cs.brown.edu" Date: Fri, 18 Feb 2005 19:50:41 +0000 Subject: [PATCH] Bug 281742 - text as clip path causes paint loop. r=scooter git-svn-id: svn://10.0.0.236/trunk@169417 18797224-902f-48f8-a5cc-f745e15eee43 --- .../layout/svg/base/src/nsSVGGlyphFrame.cpp | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/mozilla/layout/svg/base/src/nsSVGGlyphFrame.cpp b/mozilla/layout/svg/base/src/nsSVGGlyphFrame.cpp index d9ce80d84cd..8da4eb4acdb 100644 --- a/mozilla/layout/svg/base/src/nsSVGGlyphFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGGlyphFrame.cpp @@ -59,6 +59,7 @@ #include "nsSVGRect.h" #include "nsSVGPoint.h" #include "nsSVGAtoms.h" +#include "nsIViewManager.h" typedef nsFrame nsSVGGlyphFrameBase; @@ -1105,9 +1106,22 @@ void nsSVGGlyphFrame::UpdateGeometry(PRUint32 flags, PRBool bRedraw) NS_ASSERTION(!mMetricsUpdateFlags, "dirty metrics in nsSVGGlyphFrame::UpdateGeometry"); NS_ASSERTION(!mFragmentTreeDirty, "dirty fragmenttree in nsSVGGlyphFrame::UpdateGeometry"); nsCOMPtr dirty_region; - mGeometry->Update(mGeometryUpdateFlags, getter_AddRefs(dirty_region)); - if (dirty_region) - outerSVGFrame->InvalidateRegion(dirty_region, bRedraw); + if (mGeometry) + mGeometry->Update(mGeometryUpdateFlags, getter_AddRefs(dirty_region)); + if (dirty_region) { + // if we're being used as a clippath, this will get called + // during the paint - don't need to invalidate (which causes + // us to loop busy-painting) + + nsIView *view = GetClosestView(); + if (!view) return; + nsIViewManager *vm = view->GetViewManager(); + PRBool painting; + vm->IsPainting(painting); + + if (!painting) + outerSVGFrame->InvalidateRegion(dirty_region, bRedraw); + } mGeometryUpdateFlags = 0; } }