SVGDocument.h (1117B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef DOM_SVG_SVGDOCUMENT_H_ 8 #define DOM_SVG_SVGDOCUMENT_H_ 9 10 #include "mozilla/dom/XMLDocument.h" 11 12 namespace mozilla { 13 14 namespace dom { 15 16 class SVGElement; 17 class SVGForeignObjectElement; 18 19 class SVGDocument final : public XMLDocument { 20 public: 21 explicit SVGDocument(LoadedAsData aLoadedAsData) 22 : XMLDocument("image/svg+xml", aLoadedAsData) { 23 mType = eSVG; 24 } 25 26 nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; 27 }; 28 29 inline SVGDocument* Document::AsSVGDocument() { 30 MOZ_ASSERT(IsSVGDocument()); 31 return static_cast<SVGDocument*>(this); 32 } 33 34 inline const SVGDocument* Document::AsSVGDocument() const { 35 MOZ_ASSERT(IsSVGDocument()); 36 return static_cast<const SVGDocument*>(this); 37 } 38 39 } // namespace dom 40 } // namespace mozilla 41 42 #endif // DOM_SVG_SVGDOCUMENT_H_