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

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

Issue 189463005: Generate the isSVG*Element() / toSVG*Element() helper functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove blank line change 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/SVGElement.h ('k') | Source/core/svg/SVGEllipseElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGElement.cpp
diff --git a/Source/core/svg/SVGElement.cpp b/Source/core/svg/SVGElement.cpp
index 090cef090a93377ebe8e8c0f3aff7d56c0159e03..d959015ab48f163d9fafea30ba7538e9fb5c11dc 100644
--- a/Source/core/svg/SVGElement.cpp
+++ b/Source/core/svg/SVGElement.cpp
@@ -45,6 +45,7 @@
#include "core/svg/SVGElementRareData.h"
#include "core/svg/SVGGraphicsElement.h"
#include "core/svg/SVGSVGElement.h"
+#include "core/svg/SVGTitleElement.h"
#include "core/svg/SVGUseElement.h"
#include "wtf/TemporaryChange.h"
@@ -251,14 +252,8 @@ String SVGElement::title() const
// If we aren't an instance in a <use> or the <use> title was not found, then find the first
// <title> child of this element.
- Element* titleElement = ElementTraversal::firstWithin(*this);
- for (; titleElement; titleElement = ElementTraversal::nextSkippingChildren(*titleElement, this)) {
- if (titleElement->hasTagName(SVGNames::titleTag) && titleElement->isSVGElement())
- break;
- }
-
// If a title child was found, return the text contents.
- if (titleElement)
+ if (Element* titleElement = Traversal<SVGTitleElement>::firstChild(*this))
return titleElement->innerText();
// Otherwise return a null/empty string.
« no previous file with comments | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGEllipseElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698