From 28dcfe891e609fade431bf87a9f6a2296d87070c Mon Sep 17 00:00:00 2001 From: "longsonr%gmail.com" Date: Fri, 8 Sep 2006 12:27:27 +0000 Subject: [PATCH] Bug 351297 - textPath elements must have text element parents r=tor,sr=roc --- layout/base/nsCSSFrameConstructor.cpp | 5 ++--- layout/svg/base/src/nsSVGTextPathFrame.cpp | 8 +++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 9a4ea0d995ed..e282330f886b 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -7774,9 +7774,8 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState, newFrame = NS_NewSVGClipPathFrame(mPresShell, aContent, aStyleContext); } else if (aTag == nsSVGAtoms::textPath) { - nsISVGTextContentMetrics* metrics; - CallQueryInterface(aParentFrame, &metrics); - if (metrics) { + if (aParentFrame && + aParentFrame->GetType() == nsLayoutAtoms::svgTextFrame) { newFrame = NS_NewSVGTextPathFrame(mPresShell, aContent, aParentFrame, aStyleContext); } } diff --git a/layout/svg/base/src/nsSVGTextPathFrame.cpp b/layout/svg/base/src/nsSVGTextPathFrame.cpp index c63cc712090f..4814ef05235b 100644 --- a/layout/svg/base/src/nsSVGTextPathFrame.cpp +++ b/layout/svg/base/src/nsSVGTextPathFrame.cpp @@ -60,15 +60,13 @@ NS_NewSVGTextPathFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* parentFrame, nsStyleContext* aContext) { NS_ASSERTION(parentFrame, "null parent"); - nsISVGTextContentMetrics *metrics; - CallQueryInterface(parentFrame, &metrics); - if (!metrics) { + if (parentFrame->GetType() != nsLayoutAtoms::svgTextFrame) { NS_ERROR("trying to construct an SVGTextPathFrame for an invalid container"); return nsnull; } - nsCOMPtr tspan_elem = do_QueryInterface(aContent); - if (!tspan_elem) { + nsCOMPtr tpath_elem = do_QueryInterface(aContent); + if (!tpath_elem) { NS_ERROR("Trying to construct an SVGTextPathFrame for a " "content element that doesn't support the right interfaces"); return nsnull;