Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / svg / SVGGraphicsElement.h
index 8d202f6..619443b 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
  * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
+ * Copyright (C) 2014 Google, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -30,6 +31,7 @@ namespace WebCore {
 
 class AffineTransform;
 class Path;
+class SVGMatrixTearOff;
 
 class SVGGraphicsElement : public SVGElement, public SVGTests {
 public:
@@ -39,7 +41,11 @@ public:
 
     AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate);
     AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate);
-    AffineTransform getTransformToElement(SVGElement*, ExceptionState&);
+    PassRefPtr<SVGMatrixTearOff> getCTMFromJavascript();
+    PassRefPtr<SVGMatrixTearOff> getScreenCTMFromJavascript();
+
+    PassRefPtr<SVGMatrixTearOff> getTransformToElement(SVGElement*, ExceptionState&);
+
     SVGElement* nearestViewportElement() const;
     SVGElement* farthestViewportElement() const;
 
@@ -48,10 +54,7 @@ public:
     virtual AffineTransform* supplementalTransform() OVERRIDE;
 
     virtual FloatRect getBBox();
-    FloatRect getStrokeBBox();
-
     PassRefPtr<SVGRectTearOff> getBBoxFromJavascript();
-    PassRefPtr<SVGRectTearOff> getStrokeBBoxFromJavascript();
 
     // "base class" methods for all the elements which render as paths
     virtual void toClipPath(Path&);
@@ -59,25 +62,26 @@ public:
 
     virtual bool isValid() const OVERRIDE FINAL { return SVGTests::isValid(); }
 
+    SVGAnimatedTransformList* transform() { return m_transform.get(); }
+    const SVGAnimatedTransformList* transform() const { return m_transform.get(); }
+
+    AffineTransform computeCTM(SVGElement::CTMScope mode, SVGGraphicsElement::StyleUpdateStrategy,
+        const SVGGraphicsElement* ancestor = 0) const;
+
 protected:
     SVGGraphicsElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElement);
 
+    virtual bool supportsFocus() const OVERRIDE { return Element::supportsFocus() || hasFocusEventListeners(); }
+
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
     virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
 
-    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGGraphicsElement)
-        DECLARE_ANIMATED_TRANSFORM_LIST(Transform, transform)
-    END_DECLARE_ANIMATED_PROPERTIES
+    RefPtr<SVGAnimatedTransformList> m_transform;
 
 private:
     virtual bool isSVGGraphicsElement() const OVERRIDE FINAL { return true; }
 
-    // SVGTests
-    virtual void synchronizeRequiredFeatures() OVERRIDE FINAL { SVGTests::synchronizeRequiredFeatures(this); }
-    virtual void synchronizeRequiredExtensions() OVERRIDE FINAL { SVGTests::synchronizeRequiredExtensions(this); }
-    virtual void synchronizeSystemLanguage() OVERRIDE FINAL { SVGTests::synchronizeSystemLanguage(this); }
-
     // Used by <animateMotion>
     OwnPtr<AffineTransform> m_supplementalTransform;
 };
@@ -87,7 +91,7 @@ inline bool isSVGGraphicsElement(const Node& node)
     return node.isSVGElement() && toSVGElement(node).isSVGGraphicsElement();
 }
 
-DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGGraphicsElement);
+DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGGraphicsElement);
 
 } // namespace WebCore