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

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

Issue 18045006: Use toSVGFontElement() instead of static_cast<SVGFontElement*> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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/SVGHKernElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGVKernElement.cpp
diff --git a/Source/core/svg/SVGVKernElement.cpp b/Source/core/svg/SVGVKernElement.cpp
index 126023e9d491c9c5ee78ebb33742784f4fb37c4e..d78c777901ca9d19c5d2fbeb8b4ed95487e80b29 100644
--- a/Source/core/svg/SVGVKernElement.cpp
+++ b/Source/core/svg/SVGVKernElement.cpp
@@ -44,10 +44,8 @@ Node::InsertionNotificationRequest SVGVKernElement::insertedInto(ContainerNode*
{
if (rootParent->inDocument()) {
ContainerNode* fontNode = parentNode();
- if (fontNode && fontNode->hasTagName(SVGNames::fontTag)) {
- if (SVGFontElement* element = static_cast<SVGFontElement*>(fontNode))
- element->invalidateGlyphCache();
- }
+ if (fontNode && fontNode->hasTagName(SVGNames::fontTag))
+ toSVGFontElement(fontNode)->invalidateGlyphCache();
}
return SVGElement::insertedInto(rootParent);
@@ -56,10 +54,9 @@ Node::InsertionNotificationRequest SVGVKernElement::insertedInto(ContainerNode*
void SVGVKernElement::removedFrom(ContainerNode* rootParent)
{
ContainerNode* fontNode = parentNode();
- if (fontNode && fontNode->hasTagName(SVGNames::fontTag)) {
- if (SVGFontElement* element = static_cast<SVGFontElement*>(fontNode))
- element->invalidateGlyphCache();
- }
+ if (fontNode && fontNode->hasTagName(SVGNames::fontTag))
+ toSVGFontElement(fontNode)->invalidateGlyphCache();
+
SVGElement::removedFrom(rootParent);
}
« no previous file with comments | « Source/core/svg/SVGHKernElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698