diff options
Diffstat (limited to 'WebCore/svg/properties/SVGAnimatedPropertyMacros.h')
-rw-r--r-- | WebCore/svg/properties/SVGAnimatedPropertyMacros.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/WebCore/svg/properties/SVGAnimatedPropertyMacros.h b/WebCore/svg/properties/SVGAnimatedPropertyMacros.h index 12d0565..e1c75b9 100644 --- a/WebCore/svg/properties/SVGAnimatedPropertyMacros.h +++ b/WebCore/svg/properties/SVGAnimatedPropertyMacros.h @@ -32,6 +32,42 @@ namespace WebCore { +class SVGElement; + +// GetOwnerElementForType implementation +template<typename OwnerType, bool isDerivedFromSVGElement> +struct GetOwnerElementForType; + +template<typename OwnerType> +struct GetOwnerElementForType<OwnerType, true> { + static SVGElement* ownerElement(OwnerType* type) + { + return type; + } +}; + +template<typename OwnerType> +struct GetOwnerElementForType<OwnerType, false> { + static SVGElement* ownerElement(OwnerType* type) + { + SVGElement* context = type->contextElement(); + ASSERT(context); + return context; + } +}; + +// IsDerivedFromSVGElement implementation +template<typename OwnerType> +struct IsDerivedFromSVGElement { + static const bool value = true; +}; + +class SVGViewSpec; +template<> +struct IsDerivedFromSVGElement<SVGViewSpec> { + static const bool value = false; +}; + template<typename PropertyType> struct SVGSynchronizableAnimatedProperty { SVGSynchronizableAnimatedProperty() |