зеркало из https://github.com/mozilla/gecko-dev.git
Bug 351297 - textPath elements must have text element parents r=tor,sr=roc
This commit is contained in:
Родитель
43ee106c73
Коммит
28dcfe891e
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<nsIDOMSVGTextPathElement> tspan_elem = do_QueryInterface(aContent);
|
||||
if (!tspan_elem) {
|
||||
nsCOMPtr<nsIDOMSVGTextPathElement> 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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче