Bug 835978 - crash in nsDisplayList::HitTest r=jwatt a=lsblakk
authorRobert Longson <longsonr@gmail.com>
Sat, 02 Feb 2013 18:08:05 +0000
changeset 127390 26872b25c4d008b4bea394ae42ce87ab32def087
parent 127389 420b0a242eb0a40e3938a6d52a04633a22533413
child 127391 22a04b2329295ab727423d3b19a316b9a6f726f2
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt, lsblakk
bugs835978
milestone20.0a2
Bug 835978 - crash in nsDisplayList::HitTest r=jwatt a=lsblakk
content/svg/content/src/SVGContentUtils.cpp
content/svg/content/src/SVGLocatableElement.cpp
--- a/content/svg/content/src/SVGContentUtils.cpp
+++ b/content/svg/content/src/SVGContentUtils.cpp
@@ -241,21 +241,16 @@ GetCTMInternal(nsSVGElement *aElement, b
     }
   }
   return matrix * gfxMatrix().Translate(gfxPoint(x, y));
 }
 
 gfxMatrix
 SVGContentUtils::GetCTM(nsSVGElement *aElement, bool aScreenCTM)
 {
-  nsIDocument* currentDoc = aElement->GetCurrentDoc();
-  if (currentDoc) {
-    // Flush all pending notifications so that our frames are up to date
-    currentDoc->FlushPendingNotifications(Flush_Layout);
-  }
   return GetCTMInternal(aElement, aScreenCTM, false);
 }
 
 double
 SVGContentUtils::ComputeNormalizedHypotenuse(double aWidth, double aHeight)
 {
   return sqrt((aWidth*aWidth + aHeight*aHeight)/2);
 }
--- a/content/svg/content/src/SVGLocatableElement.cpp
+++ b/content/svg/content/src/SVGLocatableElement.cpp
@@ -93,32 +93,42 @@ SVGLocatableElement::GetCTM(nsISupports 
 {
   *aCTM = GetCTM().get();
   return NS_OK;
 }
 
 already_AddRefed<DOMSVGMatrix>
 SVGLocatableElement::GetCTM()
 {
+  nsIDocument* currentDoc = GetCurrentDoc();
+  if (currentDoc) {
+    // Flush all pending notifications so that our frames are up to date
+    currentDoc->FlushPendingNotifications(Flush_Layout);
+  }
   gfxMatrix m = SVGContentUtils::GetCTM(this, false);
   nsCOMPtr<DOMSVGMatrix> mat = m.IsSingular() ? nullptr : new DOMSVGMatrix(m);
   return mat.forget();
 }
 
 /* DOMSVGMatrix getScreenCTM (); */
 NS_IMETHODIMP
 SVGLocatableElement::GetScreenCTM(nsISupports * *aCTM)
 {
   *aCTM = GetScreenCTM().get();
   return NS_OK;
 }
 
 already_AddRefed<DOMSVGMatrix>
 SVGLocatableElement::GetScreenCTM()
 {
+  nsIDocument* currentDoc = GetCurrentDoc();
+  if (currentDoc) {
+    // Flush all pending notifications so that our frames are up to date
+    currentDoc->FlushPendingNotifications(Flush_Layout);
+  }
   gfxMatrix m = SVGContentUtils::GetCTM(this, true);
   nsCOMPtr<DOMSVGMatrix> mat = m.IsSingular() ? nullptr : new DOMSVGMatrix(m);
   return mat.forget();
 }
 
 /* DOMSVGMatrix getTransformToElement (in nsIDOMSVGElement element); */
 NS_IMETHODIMP
 SVGLocatableElement::GetTransformToElement(nsIDOMSVGElement *element,