diff --git a/layout/svg/base/src/nsSVGGlyphFrame.cpp b/layout/svg/base/src/nsSVGGlyphFrame.cpp index e993e147105..e2c8addf6c1 100644 --- a/layout/svg/base/src/nsSVGGlyphFrame.cpp +++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp @@ -78,12 +78,6 @@ NS_NewSVGGlyphFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* pa return new (aPresShell) nsSVGGlyphFrame(aContext); } -nsSVGGlyphFrame::nsSVGGlyphFrame(nsStyleContext* aContext) - : nsSVGGlyphFrameBase(aContext), - mWhitespaceHandling(COMPRESS_WHITESPACE) -{ -} - //---------------------------------------------------------------------- // nsISupports methods @@ -107,9 +101,6 @@ nsSVGGlyphFrame::CharacterDataChanged(nsPresContext* aPresContext, nsresult nsSVGGlyphFrame::UpdateGraphic(PRBool suppressInvalidation) { - if (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) - return NS_OK; - nsSVGTextContainerFrame *containerFrame = static_cast(mParent); if (containerFrame) @@ -470,8 +461,6 @@ nsSVGGlyphFrame::UpdateCoveredRegion() NS_IMETHODIMP nsSVGGlyphFrame::InitialUpdate() { - nsresult rv = UpdateGraphic(); - NS_ASSERTION(!(mState & NS_FRAME_IN_REFLOW), "We don't actually participate in reflow"); @@ -479,7 +468,7 @@ nsSVGGlyphFrame::InitialUpdate() mState &= ~(NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN); - return rv; + return NS_OK; } NS_IMETHODIMP diff --git a/layout/svg/base/src/nsSVGGlyphFrame.h b/layout/svg/base/src/nsSVGGlyphFrame.h index d87b75b384b..a6f1f268eab 100644 --- a/layout/svg/base/src/nsSVGGlyphFrame.h +++ b/layout/svg/base/src/nsSVGGlyphFrame.h @@ -56,11 +56,13 @@ class nsSVGGlyphFrame : public nsSVGGlyphFrameBase, public nsISVGGlyphFragmentLeaf, // : nsISVGGlyphFragmentNode public nsISVGChildFrame { -protected: friend nsIFrame* NS_NewSVGGlyphFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* parentFrame, nsStyleContext* aContext); - nsSVGGlyphFrame(nsStyleContext* aContext); +protected: + nsSVGGlyphFrame(nsStyleContext* aContext) + : nsSVGGlyphFrameBase(aContext), + mWhitespaceHandling(COMPRESS_WHITESPACE) {} public: // nsISupports interface: diff --git a/layout/svg/base/src/nsSVGTextContainerFrame.cpp b/layout/svg/base/src/nsSVGTextContainerFrame.cpp index 4f8b1e8f0bb..8e1a00afae7 100755 --- a/layout/svg/base/src/nsSVGTextContainerFrame.cpp +++ b/layout/svg/base/src/nsSVGTextContainerFrame.cpp @@ -132,6 +132,19 @@ nsSVGTextContainerFrame::GetDy() //---------------------------------------------------------------------- // nsIFrame methods +NS_IMETHODIMP +nsSVGTextContainerFrame::InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) +{ + nsresult rv = nsSVGDisplayContainerFrame::InsertFrames(aListName, + aPrevFrame, + aFrameList); + + UpdateGraphic(); + return rv; +} + NS_IMETHODIMP nsSVGTextContainerFrame::RemoveFrame(nsIAtom *aListName, nsIFrame *aOldFrame) { diff --git a/layout/svg/base/src/nsSVGTextContainerFrame.h b/layout/svg/base/src/nsSVGTextContainerFrame.h index fe5ea222614..8d966c0b9e2 100755 --- a/layout/svg/base/src/nsSVGTextContainerFrame.h +++ b/layout/svg/base/src/nsSVGTextContainerFrame.h @@ -67,6 +67,9 @@ private: public: // nsIFrame + NS_IMETHOD InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList); NS_IMETHOD RemoveFrame(nsIAtom *aListName, nsIFrame *aOldFrame); // nsISVGTextContentMetrics diff --git a/layout/svg/base/src/nsSVGTextFrame.cpp b/layout/svg/base/src/nsSVGTextFrame.cpp index 4066207a1fe..abb478939b4 100644 --- a/layout/svg/base/src/nsSVGTextFrame.cpp +++ b/layout/svg/base/src/nsSVGTextFrame.cpp @@ -61,29 +61,27 @@ nsIFrame* NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext) { - nsCOMPtr text_elem = do_QueryInterface(aContent); - if (!text_elem) { -#ifdef DEBUG - printf("warning: trying to construct an SVGTextFrame for a " - "content element that doesn't support the right interfaces\n"); -#endif + nsCOMPtr text = do_QueryInterface(aContent); + if (!text) { + NS_ERROR("Can't create frame! Content is not an SVG text"); return nsnull; } return new (aPresShell) nsSVGTextFrame(aContext); } -nsSVGTextFrame::nsSVGTextFrame(nsStyleContext* aContext) - : nsSVGTextFrameBase(aContext), - mMetricsState(unsuspended), - mPropagateTransform(PR_TRUE), - mPositioningDirty(PR_FALSE) -{ -} - //---------------------------------------------------------------------- // nsIFrame methods +NS_IMETHODIMP +nsSVGTextFrame::SetInitialChildList(nsIAtom* aListName, + nsIFrame* aChildList) +{ + nsresult rv = nsSVGTextFrameBase::SetInitialChildList(aListName, aChildList); + NotifyGlyphMetricsChange(); + return rv; +} + NS_IMETHODIMP nsSVGTextFrame::AttributeChanged(PRInt32 aNameSpaceID, nsIAtom* aAttribute, diff --git a/layout/svg/base/src/nsSVGTextFrame.h b/layout/svg/base/src/nsSVGTextFrame.h index c63f4bd9b4e..697c73c2a84 100755 --- a/layout/svg/base/src/nsSVGTextFrame.h +++ b/layout/svg/base/src/nsSVGTextFrame.h @@ -48,14 +48,19 @@ class nsSVGTextFrame : public nsSVGTextFrameBase friend nsIFrame* NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext); protected: - nsSVGTextFrame(nsStyleContext* aContext); + nsSVGTextFrame(nsStyleContext* aContext) + : nsSVGTextFrameBase(aContext), + mMetricsState(unsuspended), + mPropagateTransform(PR_TRUE), + mPositioningDirty(PR_FALSE) {} public: // nsIFrame: + NS_IMETHOD SetInitialChildList(nsIAtom* aListName, + nsIFrame* aChildList); NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType); - NS_IMETHOD DidSetStyleContext(); /**