Bug 835978 - crash in nsDisplayList::HitTest r=jwatt.
authorRobert Longson <longsonr@gmail.com>
Wed, 30 Jan 2013 13:59:13 +0000
changeset 120370 0bbcb088b1b8d6df646a516f3be193883b128135
parent 120369 f6a638c16bd4a30b06cbf535b84b226a7ab47c6f
child 120371 01b9474f522ce2b381be96544e94efbaa872d8fa
push id24251
push userryanvm@gmail.com
push dateThu, 31 Jan 2013 20:56:22 +0000
treeherdermozilla-central@683b08dc1afd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs835978
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 835978 - crash in nsDisplayList::HitTest r=jwatt.
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
@@ -58,24 +58,34 @@ SVGLocatableElement::GetBBox(ErrorResult
   nsCOMPtr<nsIDOMSVGRect> rect;
   rv = NS_NewSVGRect(getter_AddRefs(rect), nsSVGUtils::GetBBox(frame));
   return rect.forget();
 }
 
 already_AddRefed<SVGMatrix>
 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<SVGMatrix> mat = m.IsSingular() ? nullptr : new SVGMatrix(m);
   return mat.forget();
 }
 
 already_AddRefed<SVGMatrix>
 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<SVGMatrix> mat = m.IsSingular() ? nullptr : new SVGMatrix(m);
   return mat.forget();
 }
 
 already_AddRefed<SVGMatrix>
 SVGLocatableElement::GetTransformToElement(SVGLocatableElement& aElement,
                                            ErrorResult& rv)