summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGDocument.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/svg/SVGDocument.h')
-rw-r--r--Source/WebCore/svg/SVGDocument.h47
1 files changed, 17 insertions, 30 deletions
diff --git a/Source/WebCore/svg/SVGDocument.h b/Source/WebCore/svg/SVGDocument.h
index 573dcec4f..233f11b74 100644
--- a/Source/WebCore/svg/SVGDocument.h
+++ b/Source/WebCore/svg/SVGDocument.h
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -18,54 +19,40 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGDocument_h
-#define SVGDocument_h
-#if ENABLE(SVG)
+#pragma once
-#include "Document.h"
-#include "FloatPoint.h"
+#include "XMLDocument.h"
namespace WebCore {
-class DOMImplementation;
-class SVGElement;
class SVGSVGElement;
-class SVGDocument final : public Document {
+class SVGDocument final : public XMLDocument {
public:
- static PassRefPtr<SVGDocument> create(Frame* frame, const URL& url)
- {
- return adoptRef(new SVGDocument(frame, url));
- }
+ static Ref<SVGDocument> create(Frame*, const URL&);
- SVGSVGElement* rootElement() const;
-
- void dispatchZoomEvent(float prevScale, float newScale);
- void dispatchScrollEvent();
+ static SVGSVGElement* rootElement(const Document&);
bool zoomAndPanEnabled() const;
-
void startPan(const FloatPoint& start);
- void updatePan(const FloatPoint& pos) const;
+ void updatePan(const FloatPoint& position) const;
private:
SVGDocument(Frame*, const URL&);
- virtual bool childShouldCreateRenderer(const Node&) const override;
-
- virtual PassRefPtr<Document> cloneDocumentWithoutChildren() const override;
+ Ref<Document> cloneDocumentWithoutChildren() const override;
- FloatPoint m_translate;
+ FloatSize m_panningOffset;
};
-inline bool isSVGDocument(const Document& document) { return document.isSVGDocument(); }
-void isSVGDocument(const SVGDocument&); // Catch unnecessary runtime check of type known at compile time.
-
-DOCUMENT_TYPE_CASTS(SVGDocument)
+inline Ref<SVGDocument> SVGDocument::create(Frame* frame, const URL& url)
+{
+ return adoptRef(*new SVGDocument(frame, url));
+}
} // namespace WebCore
-#endif // ENABLE(SVG)
-#endif // SVGDocument_h
-
-// vim:ts=4:noet
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::SVGDocument)
+ static bool isType(const WebCore::Document& document) { return document.isSVGDocument(); }
+ static bool isType(const WebCore::Node& node) { return is<WebCore::Document>(node) && isType(downcast<WebCore::Document>(node)); }
+SPECIALIZE_TYPE_TRAITS_END()