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

Unified Diff: Source/core/svg/SVGAltGlyphItemElement.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/SVGAltGlyphElement.cpp ('k') | Source/core/svg/SVGDocument.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGAltGlyphItemElement.cpp
diff --git a/Source/core/svg/SVGAltGlyphItemElement.cpp b/Source/core/svg/SVGAltGlyphItemElement.cpp
index abe9e8d6785b3800f4f1e245bdfe484535c46e49..94c5fafcfbe705665a9920e9a7b3411d9c22795d 100644
--- a/Source/core/svg/SVGAltGlyphItemElement.cpp
+++ b/Source/core/svg/SVGAltGlyphItemElement.cpp
@@ -22,6 +22,7 @@
#if ENABLE(SVG_FONTS)
#include "core/svg/SVGAltGlyphItemElement.h"
+#include "core/dom/ElementTraversal.h"
#include "core/svg/SVGGlyphRefElement.h"
namespace WebCore {
@@ -47,15 +48,13 @@ bool SVGAltGlyphItemElement::hasValidGlyphElements(Vector<AtomicString>& glyphNa
//
// Here we fill glyphNames and return true only if all referenced glyphs are valid and
// there is at least one glyph.
- for (Node* child = firstChild(); child; child = child->nextSibling()) {
- if (child->hasTagName(SVGNames::glyphRefTag)) {
- AtomicString referredGlyphName;
- if (toSVGGlyphRefElement(child)->hasValidGlyphElement(referredGlyphName))
- glyphNames.append(referredGlyphName);
- else {
- glyphNames.clear();
- return false;
- }
+ for (SVGGlyphRefElement* glyph = Traversal<SVGGlyphRefElement>::firstChild(*this); glyph; glyph = Traversal<SVGGlyphRefElement>::nextSibling(*glyph)) {
+ AtomicString referredGlyphName;
+ if (glyph->hasValidGlyphElement(referredGlyphName)) {
+ glyphNames.append(referredGlyphName);
+ } else {
+ glyphNames.clear();
+ return false;
}
}
return !glyphNames.isEmpty();
« no previous file with comments | « Source/core/svg/SVGAltGlyphElement.cpp ('k') | Source/core/svg/SVGDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698