Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1499)

Unified Diff: Source/core/svg/SVGFontFaceElement.cpp

Issue 192133002: Use isSVG*Element() helpers more in SVG code (Part 1) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/SVGFontElement.cpp ('k') | Source/core/svg/SVGFontFaceFormatElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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())
« no previous file with comments | « Source/core/svg/SVGFontElement.cpp ('k') | Source/core/svg/SVGFontFaceFormatElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698