From d3d49b0a777d9f6aceeeeb80fa6c70505509df4a Mon Sep 17 00:00:00 2001 From: "longsonr@gmail.com" Date: Mon, 31 Dec 2007 05:43:51 -0800 Subject: [PATCH] Bug 409376 - getScreenCTM testcase fails on reload. r+sr=bzbarsky,a1.9=beltzner --- content/svg/content/src/nsSVGGraphicElement.cpp | 12 ++++++++++++ content/svg/content/src/nsSVGSVGElement.cpp | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/content/svg/content/src/nsSVGGraphicElement.cpp b/content/svg/content/src/nsSVGGraphicElement.cpp index ca02d988720..2fb987d6160 100644 --- a/content/svg/content/src/nsSVGGraphicElement.cpp +++ b/content/svg/content/src/nsSVGGraphicElement.cpp @@ -141,6 +141,12 @@ NS_IMETHODIMP nsSVGGraphicElement::GetCTM(nsIDOMSVGMatrix **_retval) nsresult rv; *_retval = nsnull; + nsIDocument* currentDoc = GetCurrentDoc(); + if (currentDoc) { + // Flush all pending notifications so that our frames are uptodate + currentDoc->FlushPendingNotifications(Flush_Layout); + } + nsBindingManager *bindingManager = nsnull; // XXXbz I _think_ this is right. We want to be using the binding manager // that would have attached the binding that gives us our anonymous parent. @@ -183,6 +189,12 @@ NS_IMETHODIMP nsSVGGraphicElement::GetScreenCTM(nsIDOMSVGMatrix **_retval) nsresult rv; *_retval = nsnull; + nsIDocument* currentDoc = GetCurrentDoc(); + if (currentDoc) { + // Flush all pending notifications so that our frames are uptodate + currentDoc->FlushPendingNotifications(Flush_Layout); + } + nsBindingManager *bindingManager = nsnull; // XXXbz I _think_ this is right. We want to be using the binding manager // that would have attached the binding that gives us our anonymous parent. diff --git a/content/svg/content/src/nsSVGSVGElement.cpp b/content/svg/content/src/nsSVGSVGElement.cpp index cceaa7408b4..e9cee0a6898 100644 --- a/content/svg/content/src/nsSVGSVGElement.cpp +++ b/content/svg/content/src/nsSVGSVGElement.cpp @@ -701,6 +701,12 @@ nsSVGSVGElement::GetCTM(nsIDOMSVGMatrix **_retval) nsresult rv; *_retval = nsnull; + nsIDocument* currentDoc = GetCurrentDoc(); + if (currentDoc) { + // Flush all pending notifications so that our frames are uptodate + currentDoc->FlushPendingNotifications(Flush_Layout); + } + // first try to get the "screen" CTM of our nearest SVG ancestor nsBindingManager *bindingManager = nsnull; @@ -817,6 +823,12 @@ nsSVGSVGElement::GetScreenCTM(nsIDOMSVGMatrix **_retval) nsresult rv; *_retval = nsnull; + nsIDocument* currentDoc = GetCurrentDoc(); + if (currentDoc) { + // Flush all pending notifications so that our frames are uptodate + currentDoc->FlushPendingNotifications(Flush_Layout); + } + // first try to get the "screen" CTM of our nearest SVG ancestor nsBindingManager *bindingManager = nsnull;