Index: Source/core/svg/SVGFontFaceElement.cpp |
diff --git a/Source/core/svg/SVGFontFaceElement.cpp b/Source/core/svg/SVGFontFaceElement.cpp |
index e52ed511c450515e48cde7ed0ba37340d23ee861..9464886ab3df2594818216e9326f6d001683bdd1 100644 |
--- a/Source/core/svg/SVGFontFaceElement.cpp |
+++ b/Source/core/svg/SVGFontFaceElement.cpp |
@@ -275,7 +275,7 @@ void SVGFontFaceElement::rebuildFontFace() |
return; |
} |
- bool describesParentFont = parentNode()->hasTagName(SVGNames::fontTag); |
+ bool describesParentFont = isSVGFontElement(*parentNode()); |
RefPtrWillBeRawPtr<CSSValueList> list; |
if (describesParentFont) { |
@@ -286,12 +286,8 @@ void SVGFontFaceElement::rebuildFontFace() |
} else { |
m_fontElement = 0; |
// we currently ignore all but the last src element, alternatively we could concat them |
- for (Node* child = lastChild(); child && !list; child = child->previousSibling()) { |
- if (child->hasTagName(font_face_srcTag)) { |
- list = toSVGFontFaceSrcElement(child)->srcValue(); |
- break; |
- } |
- } |
+ if (SVGFontFaceSrcElement* element = Traversal<SVGFontFaceSrcElement>::lastChild(*this)) |
+ list = element->srcValue(); |
} |
if (!list || !list->length()) |