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

Unified Diff: Source/core/svg/SVGFontFaceSrcElement.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/SVGFontFaceFormatElement.cpp ('k') | Source/core/svg/SVGFontFaceUriElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGFontFaceSrcElement.cpp
diff --git a/Source/core/svg/SVGFontFaceSrcElement.cpp b/Source/core/svg/SVGFontFaceSrcElement.cpp
index 5bb34db4b9fa017ab7f7c76bf9ff0a0c63bd9dec..f1cd5a5e7d0d2b9bfe7576ed150ab4349911e420 100644
--- a/Source/core/svg/SVGFontFaceSrcElement.cpp
+++ b/Source/core/svg/SVGFontFaceSrcElement.cpp
@@ -25,6 +25,7 @@
#include "SVGNames.h"
#include "core/css/CSSFontFaceSrcValue.h"
#include "core/css/CSSValueList.h"
+#include "core/dom/ElementTraversal.h"
#include "core/svg/SVGFontFaceElement.h"
#include "core/svg/SVGFontFaceNameElement.h"
#include "core/svg/SVGFontFaceUriElement.h"
@@ -47,12 +48,12 @@ PassRefPtr<SVGFontFaceSrcElement> SVGFontFaceSrcElement::create(Document& docume
PassRefPtrWillBeRawPtr<CSSValueList> SVGFontFaceSrcElement::srcValue() const
{
RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- for (Node* child = firstChild(); child; child = child->nextSibling()) {
+ for (SVGElement* element = Traversal<SVGElement>::firstChild(*this); element; element = Traversal<SVGElement>::nextSibling(*element)) {
RefPtrWillBeRawPtr<CSSFontFaceSrcValue> srcValue;
- if (child->hasTagName(font_face_uriTag))
- srcValue = toSVGFontFaceUriElement(child)->srcValue();
- else if (child->hasTagName(font_face_nameTag))
- srcValue = toSVGFontFaceNameElement(child)->srcValue();
+ if (isSVGFontFaceUriElement(*element))
+ srcValue = toSVGFontFaceUriElement(*element).srcValue();
+ else if (isSVGFontFaceNameElement(*element))
+ srcValue = toSVGFontFaceNameElement(*element).srcValue();
if (srcValue && srcValue->resource().length())
list->append(srcValue);
@@ -63,8 +64,8 @@ PassRefPtrWillBeRawPtr<CSSValueList> SVGFontFaceSrcElement::srcValue() const
void SVGFontFaceSrcElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{
SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
- if (parentNode() && parentNode()->hasTagName(font_faceTag))
- toSVGFontFaceElement(parentNode())->rebuildFontFace();
+ if (isSVGFontFaceElement(parentNode()))
+ toSVGFontFaceElement(*parentNode()).rebuildFontFace();
}
}
« no previous file with comments | « Source/core/svg/SVGFontFaceFormatElement.cpp ('k') | Source/core/svg/SVGFontFaceUriElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698