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

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

Issue 23705005: Introduce toSVGGlyphElement(), toSVGHKernElement() and toSVGVKernElement(), and use them (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 | « no previous file | Source/core/svg/SVGGlyphElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGFontElement.cpp
diff --git a/Source/core/svg/SVGFontElement.cpp b/Source/core/svg/SVGFontElement.cpp
index 9ae2dbdc818d540430483db359823f07b82ec06a..ab333c079cd154493c311f86ba36d57f5e553d3e 100644
--- a/Source/core/svg/SVGFontElement.cpp
+++ b/Source/core/svg/SVGFontElement.cpp
@@ -124,7 +124,7 @@ void SVGFontElement::ensureGlyphCache()
Vector<String> ligatures;
for (Node* child = firstChild(); child; child = child->nextSibling()) {
if (child->hasTagName(SVGNames::glyphTag)) {
- SVGGlyphElement* glyph = static_cast<SVGGlyphElement*>(child);
+ SVGGlyphElement* glyph = toSVGGlyphElement(child);
AtomicString unicode = glyph->fastGetAttribute(SVGNames::unicodeAttr);
AtomicString glyphId = glyph->getIdAttribute();
if (glyphId.isEmpty() && unicode.isEmpty())
@@ -136,11 +136,9 @@ void SVGFontElement::ensureGlyphCache()
if (unicode.length() > 1 && !U16_IS_SURROGATE(unicode[0]))
ligatures.append(unicode.string());
} else if (child->hasTagName(SVGNames::hkernTag)) {
- SVGHKernElement* hkern = static_cast<SVGHKernElement*>(child);
- hkern->buildHorizontalKerningPair(m_horizontalKerningPairs);
+ toSVGHKernElement(child)->buildHorizontalKerningPair(m_horizontalKerningPairs);
} else if (child->hasTagName(SVGNames::vkernTag)) {
- SVGVKernElement* vkern = static_cast<SVGVKernElement*>(child);
- vkern->buildVerticalKerningPair(m_verticalKerningPairs);
+ toSVGVKernElement(child)->buildVerticalKerningPair(m_verticalKerningPairs);
} else if (child->hasTagName(SVGNames::missing_glyphTag) && !firstMissingGlyphElement) {
firstMissingGlyphElement = toSVGMissingGlyphElement(child);
}
« no previous file with comments | « no previous file | Source/core/svg/SVGGlyphElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698