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

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

Issue 205983004: Use new Traversal<*Element> API in svg code for clarity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix typo 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.cpp ('k') | Source/core/svg/SVGUseElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGSVGElement.cpp
diff --git a/Source/core/svg/SVGSVGElement.cpp b/Source/core/svg/SVGSVGElement.cpp
index dbe9c075db6237495f081c8735c6c785a0e4e5fc..fa325caac3edbdc4678a132f1f0b5cbd955ca4ff 100644
--- a/Source/core/svg/SVGSVGElement.cpp
+++ b/Source/core/svg/SVGSVGElement.cpp
@@ -30,7 +30,6 @@
#include "core/css/CSSHelper.h"
#include "core/dom/Document.h"
#include "core/dom/ElementTraversal.h"
-#include "core/dom/NodeTraversal.h"
#include "core/dom/StaticNodeList.h"
#include "core/editing/FrameSelection.h"
#include "core/events/EventListener.h"
@@ -825,11 +824,7 @@ Element* SVGSVGElement::getElementById(const AtomicString& id) const
// Fall back to traversing our subtree. Duplicate ids are allowed, the first found will
// be returned.
- for (Node* node = firstChild(); node; node = NodeTraversal::next(*node, this)) {
- if (!node->isElementNode())
- continue;
-
- Element* element = toElement(node);
+ for (Element* element = ElementTraversal::firstWithin(*this); element; element = ElementTraversal::next(*element, this)) {
if (element->getIdAttribute() == id)
return element;
}
« no previous file with comments | « Source/core/svg/SVGElement.cpp ('k') | Source/core/svg/SVGUseElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698