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/. */
7 #include "mozilla/dom/SVGDocument.h"
9 #include "mozilla/css/Loader.h"
10 #include "nsNetUtil.h"
11 #include "nsServiceManagerUtils.h"
13 #include "nsLiteralString.h"
14 #include "mozilla/dom/Element.h"
15 #include "SVGElement.h"
16 #include "mozilla/StyleSheet.h"
17 #include "mozilla/StyleSheetInlines.h"
19 using namespace mozilla::css
;
20 using namespace mozilla::dom
;
22 namespace mozilla::dom
{
24 //----------------------------------------------------------------------
27 nsresult
SVGDocument::Clone(dom::NodeInfo
* aNodeInfo
, nsINode
** aResult
) const {
28 NS_ASSERTION(aNodeInfo
->NodeInfoManager() == mNodeInfoManager
,
29 "Can't import this document into another document!");
31 RefPtr
<SVGDocument
> clone
= new SVGDocument();
32 nsresult rv
= CloneDocHelper(clone
.get());
33 NS_ENSURE_SUCCESS(rv
, rv
);
35 clone
.forget(aResult
);
39 } // namespace mozilla::dom
41 ////////////////////////////////////////////////////////////////////////
42 // Exported creation functions
44 nsresult
NS_NewSVGDocument(Document
** aInstancePtrResult
,
45 nsIPrincipal
* aPrincipal
,
46 nsIPrincipal
* aPartitionedPrincipal
) {
47 RefPtr
<SVGDocument
> doc
= new SVGDocument();
49 nsresult rv
= doc
->Init(aPrincipal
, aPartitionedPrincipal
);
54 doc
.forget(aInstancePtrResult
);