From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/svg/SVGDocument.h | 47 +++++++++++++++------------------------- 1 file changed, 17 insertions(+), 30 deletions(-) (limited to 'Source/WebCore/svg/SVGDocument.h') 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 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis + * 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 create(Frame* frame, const URL& url) - { - return adoptRef(new SVGDocument(frame, url)); - } + static Ref 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 cloneDocumentWithoutChildren() const override; + Ref 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::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(node) && isType(downcast(node)); } +SPECIALIZE_TYPE_TRAITS_END() -- cgit v1.2.1