summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGGradientElement.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/svg/SVGGradientElement.h')
-rw-r--r--Source/WebCore/svg/SVGGradientElement.h40
1 files changed, 21 insertions, 19 deletions
diff --git a/Source/WebCore/svg/SVGGradientElement.h b/Source/WebCore/svg/SVGGradientElement.h
index 904547a78..e26a185e9 100644
--- a/Source/WebCore/svg/SVGGradientElement.h
+++ b/Source/WebCore/svg/SVGGradientElement.h
@@ -18,10 +18,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGGradientElement_h
-#define SVGGradientElement_h
+#pragma once
-#if ENABLE(SVG)
#include "Gradient.h"
#include "SVGAnimatedBoolean.h"
#include "SVGAnimatedEnumeration.h"
@@ -51,11 +49,11 @@ struct SVGPropertyTraits<SVGSpreadMethodType> {
case SVGSpreadMethodUnknown:
return emptyString();
case SVGSpreadMethodPad:
- return "pad";
+ return ASCIILiteral("pad");
case SVGSpreadMethodReflect:
- return "reflect";
+ return ASCIILiteral("reflect");
case SVGSpreadMethodRepeat:
- return "repeat";
+ return ASCIILiteral("repeat");
}
ASSERT_NOT_REACHED();
@@ -90,29 +88,33 @@ public:
protected:
SVGGradientElement(const QualifiedName&, Document&);
- bool isSupportedAttribute(const QualifiedName&);
- virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
- virtual void svgAttributeChanged(const QualifiedName&) override;
+ static bool isSupportedAttribute(const QualifiedName&);
+ void parseAttribute(const QualifiedName&, const AtomicString&) override;
+ void svgAttributeChanged(const QualifiedName&) override;
private:
- virtual bool needsPendingResourceHandling() const override { return false; }
+ bool needsPendingResourceHandling() const override { return false; }
- virtual void childrenChanged(const ChildChange&) override;
+ void childrenChanged(const ChildChange&) override;
BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGGradientElement)
DECLARE_ANIMATED_ENUMERATION(SpreadMethod, spreadMethod, SVGSpreadMethodType)
DECLARE_ANIMATED_ENUMERATION(GradientUnits, gradientUnits, SVGUnitTypes::SVGUnitType)
DECLARE_ANIMATED_TRANSFORM_LIST(GradientTransform, gradientTransform)
- DECLARE_ANIMATED_STRING(Href, href)
- DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STRING_OVERRIDE(Href, href)
+ DECLARE_ANIMATED_BOOLEAN_OVERRIDE(ExternalResourcesRequired, externalResourcesRequired)
END_DECLARE_ANIMATED_PROPERTIES
};
-void isSVGGradientElement(const SVGGradientElement&); // Catch unnecessary runtime check of type known at compile time.
-bool isSVGGradientElement(const Node&);
-NODE_TYPE_CASTS(SVGGradientElement)
-
} // namespace WebCore
-#endif // ENABLE(SVG)
-#endif
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::SVGGradientElement)
+static bool isType(const WebCore::SVGElement& element)
+{
+ return element.hasTagName(WebCore::SVGNames::radialGradientTag) || element.hasTagName(WebCore::SVGNames::linearGradientTag);
+}
+static bool isType(const WebCore::Node& node)
+{
+ return is<WebCore::SVGElement>(node) && isType(downcast<WebCore::SVGElement>(node));
+}
+SPECIALIZE_TYPE_TRAITS_END()