Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / svg / graphics / SVGImage.h
index 023438e..1132dae 100644 (file)
 #define SVGImage_h
 
 #include "platform/graphics/Image.h"
+#include "platform/heap/Handle.h"
+#include "platform/weborigin/KURL.h"
 
-namespace WebCore {
+namespace blink {
 
-class Element;
 class FrameView;
-class ImageBuffer;
 class Page;
 class RenderBox;
 class SVGImageChromeClient;
@@ -46,24 +46,28 @@ public:
         return adoptRef(new SVGImage(observer));
     }
 
-    static bool isInSVGImage(const Element*);
+    static bool isInSVGImage(const Node*);
 
     RenderBox* embeddedContentBox() const;
 
     virtual bool isSVGImage() const OVERRIDE { return true; }
     virtual IntSize size() const OVERRIDE { return m_intrinsicSize; }
+    void setURL(const KURL& url) { m_url = url; }
 
     virtual bool currentFrameHasSingleSecurityOrigin() const OVERRIDE;
 
-    virtual bool hasRelativeWidth() const OVERRIDE;
-    virtual bool hasRelativeHeight() const OVERRIDE;
-
-    virtual void startAnimation(bool /*catchUpIfNecessary*/ = true) OVERRIDE;
+    virtual void startAnimation(CatchUpAnimation = CatchUp) OVERRIDE;
     virtual void stopAnimation() OVERRIDE;
     virtual void resetAnimation() OVERRIDE;
 
     virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() OVERRIDE;
 
+    // Returns the SVG image document's frame.
+    FrameView* frameView() const;
+
+    // Does the SVG image/document contain any animations?
+    bool hasAnimations() const;
+
 private:
     friend class AXRenderObject;
     friend class SVGImageChromeClient;
@@ -71,8 +75,6 @@ private:
 
     virtual ~SVGImage();
 
-    // Returns the SVG image document's frame.
-    FrameView* frameView() const;
 
     virtual String filenameExtension() const OVERRIDE;
 
@@ -97,8 +99,9 @@ private:
         CompositeOperator, const FloatRect&, blink::WebBlendMode, const IntSize& repeatSpacing);
 
     OwnPtr<SVGImageChromeClient> m_chromeClient;
-    OwnPtr<Page> m_page;
+    OwnPtrWillBePersistent<Page> m_page;
     IntSize m_intrinsicSize;
+    KURL m_url;
 };
 
 DEFINE_IMAGE_TYPE_CASTS(SVGImage);