OSDN Git Service

Merge WebKit at r71558: Initial merge by git.
[android-x86/external-webkit.git] / WebCore / svg / properties / SVGAnimatedPropertyMacros.h
index 12d0565..e1c75b9 100644 (file)
 
 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()