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

Unified Diff: Source/core/svg/SVGGradientElement.h

Issue 19729002: Introduce toSVGGradientElement(), use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased 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/rendering/svg/SVGResources.cpp ('k') | Source/core/svg/SVGLinearGradientElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGGradientElement.h
diff --git a/Source/core/svg/SVGGradientElement.h b/Source/core/svg/SVGGradientElement.h
index 09cb256799e3a245530b6610c0806126d433a1b9..dc578af8df0b80dce5f0c134848e1d873c2f9e77 100644
--- a/Source/core/svg/SVGGradientElement.h
+++ b/Source/core/svg/SVGGradientElement.h
@@ -21,6 +21,7 @@
#ifndef SVGGradientElement_h
#define SVGGradientElement_h
+#include "SVGNames.h"
#include "core/platform/graphics/Gradient.h"
#include "core/svg/SVGAnimatedBoolean.h"
#include "core/svg/SVGAnimatedEnumeration.h"
@@ -106,6 +107,12 @@ private:
END_DECLARE_ANIMATED_PROPERTIES
};
+inline SVGGradientElement* toSVGGradientElement(Node* node)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!node || (node->hasTagName(SVGNames::radialGradientTag) || node->hasTagName(SVGNames::linearGradientTag)));
+ return static_cast<SVGGradientElement*>(node);
+}
+
} // namespace WebCore
#endif
« no previous file with comments | « Source/core/rendering/svg/SVGResources.cpp ('k') | Source/core/svg/SVGLinearGradientElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698