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

Unified Diff: Source/core/svg/SVGFEComponentTransferElement.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/SVGElement.cpp ('k') | Source/core/svg/SVGFEDiffuseLightingElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGFEComponentTransferElement.cpp
diff --git a/Source/core/svg/SVGFEComponentTransferElement.cpp b/Source/core/svg/SVGFEComponentTransferElement.cpp
index 1e1bce974bfbe1297f143395b44d32ed5442a2c9..75eeac1cfc202281e55a4d25fa01eba7d22afa8e 100644
--- a/Source/core/svg/SVGFEComponentTransferElement.cpp
+++ b/Source/core/svg/SVGFEComponentTransferElement.cpp
@@ -23,12 +23,13 @@
#include "core/svg/SVGFEComponentTransferElement.h"
#include "SVGNames.h"
-#include "platform/graphics/filters/FilterEffect.h"
+#include "core/dom/ElementTraversal.h"
#include "core/svg/SVGFEFuncAElement.h"
#include "core/svg/SVGFEFuncBElement.h"
#include "core/svg/SVGFEFuncGElement.h"
#include "core/svg/SVGFEFuncRElement.h"
#include "core/svg/graphics/filters/SVGFilterBuilder.h"
+#include "platform/graphics/filters/FilterEffect.h"
namespace WebCore {
@@ -82,15 +83,15 @@ PassRefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder*
ComponentTransferFunction blue;
ComponentTransferFunction alpha;
- for (Node* node = firstChild(); node; node = node->nextSibling()) {
- if (node->hasTagName(SVGNames::feFuncRTag))
- red = toSVGFEFuncRElement(node)->transferFunction();
- else if (node->hasTagName(SVGNames::feFuncGTag))
- green = toSVGFEFuncGElement(node)->transferFunction();
- else if (node->hasTagName(SVGNames::feFuncBTag))
- blue = toSVGFEFuncBElement(node)->transferFunction();
- else if (node->hasTagName(SVGNames::feFuncATag))
- alpha = toSVGFEFuncAElement(node)->transferFunction();
+ for (SVGElement* element = Traversal<SVGElement>::firstChild(*this); element; element = Traversal<SVGElement>::nextSibling(*element)) {
+ if (isSVGFEFuncRElement(*element))
+ red = toSVGFEFuncRElement(*element).transferFunction();
+ else if (isSVGFEFuncGElement(*element))
+ green = toSVGFEFuncGElement(*element).transferFunction();
+ else if (isSVGFEFuncBElement(*element))
+ blue = toSVGFEFuncBElement(*element).transferFunction();
+ else if (isSVGFEFuncAElement(*element))
+ alpha = toSVGFEFuncAElement(*element).transferFunction();
}
RefPtr<FilterEffect> effect = FEComponentTransfer::create(filter, red, green, blue, alpha);
« no previous file with comments | « Source/core/svg/SVGElement.cpp ('k') | Source/core/svg/SVGFEDiffuseLightingElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698