From 13102b6de34063e7e96ac9ae51d92f0c2066c4f1 Mon Sep 17 00:00:00 2001 From: "tor%cs.brown.edu" Date: Wed, 12 Jul 2006 15:36:23 +0000 Subject: [PATCH] Bug 344173 - Unbounded inner not showing. r+sr=roc --- layout/svg/base/src/nsSVGInnerSVGFrame.cpp | 27 +++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/layout/svg/base/src/nsSVGInnerSVGFrame.cpp b/layout/svg/base/src/nsSVGInnerSVGFrame.cpp index 5f356e34dcd..51d90f5f5c9 100644 --- a/layout/svg/base/src/nsSVGInnerSVGFrame.cpp +++ b/layout/svg/base/src/nsSVGInnerSVGFrame.cpp @@ -57,7 +57,6 @@ class nsSVGInnerSVGFrame : public nsSVGInnerSVGFrameBase, NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext); protected: nsSVGInnerSVGFrame(nsStyleContext* aContext); - NS_IMETHOD InitSVG(); // nsISupports interface: NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); @@ -89,6 +88,7 @@ public: // nsISVGChildFrame interface: NS_IMETHOD PaintSVG(nsISVGRendererCanvas* canvas, nsRect *aDirtyRect); + NS_IMETHOD InitialUpdate(); NS_IMETHOD NotifyCanvasTMChanged(PRBool suppressInvalidation); NS_IMETHOD SetMatrixPropagation(PRBool aPropagate); NS_IMETHOD SetOverrideCTM(nsIDOMSVGMatrix *aCTM); @@ -111,6 +111,9 @@ public: NS_IMETHOD NotifyViewportChange(); protected: + + void UpdateCoordCtx(); + nsCOMPtr mCanvasTM; nsCOMPtr mOverrideCTM; @@ -134,20 +137,14 @@ nsSVGInnerSVGFrame::nsSVGInnerSVGFrame(nsStyleContext* aContext) : #endif } -NS_IMETHODIMP -nsSVGInnerSVGFrame::InitSVG() +void +nsSVGInnerSVGFrame::UpdateCoordCtx() { - NS_ASSERTION(mParent, "no parent"); - - // hook up CoordContextProvider chain: - nsSVGContainerFrame *containerFrame = NS_STATIC_CAST(nsSVGContainerFrame*, mParent); - nsCOMPtr SVGElement = do_QueryInterface(mContent); - NS_ASSERTION(SVGElement, "wrong content element"); - SVGElement->SetParentCoordCtxProvider(nsRefPtr(containerFrame->GetCoordContextProvider())); + nsSVGSVGElement *svgElement = NS_STATIC_CAST(nsSVGSVGElement*, mContent); - return NS_OK; + svgElement->SetParentCoordCtxProvider(nsRefPtr(containerFrame->GetCoordContextProvider())); } //---------------------------------------------------------------------- @@ -212,10 +209,18 @@ nsSVGInnerSVGFrame::NotifyCanvasTMChanged(PRBool suppressInvalidation) { // make sure our cached transform matrix gets (lazily) updated mCanvasTM = nsnull; + UpdateCoordCtx(); return nsSVGInnerSVGFrameBase::NotifyCanvasTMChanged(suppressInvalidation); } +NS_IMETHODIMP +nsSVGInnerSVGFrame::InitialUpdate() +{ + UpdateCoordCtx(); + + return nsSVGInnerSVGFrameBase::InitialUpdate(); +} NS_IMETHODIMP nsSVGInnerSVGFrame::SetMatrixPropagation(PRBool aPropagate)