/src/mozilla-central/dom/svg/SVGDocument.cpp
Line | Count | Source (jump to first uncovered line) |
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 | | #include "mozilla/dom/SVGDocument.h" |
8 | | |
9 | | #include "mozilla/css/Loader.h" |
10 | | #include "nsICategoryManager.h" |
11 | | #include "nsISimpleEnumerator.h" |
12 | | #include "nsIStyleSheetService.h" |
13 | | #include "nsISupportsPrimitives.h" |
14 | | #include "nsLayoutStylesheetCache.h" |
15 | | #include "nsNetUtil.h" |
16 | | #include "nsServiceManagerUtils.h" |
17 | | #include "nsString.h" |
18 | | #include "nsLiteralString.h" |
19 | | #include "mozilla/dom/Element.h" |
20 | | #include "nsSVGElement.h" |
21 | | #include "mozilla/StyleSheet.h" |
22 | | #include "mozilla/StyleSheetInlines.h" |
23 | | |
24 | | using namespace mozilla::css; |
25 | | using namespace mozilla::dom; |
26 | | |
27 | | namespace mozilla { |
28 | | namespace dom { |
29 | | |
30 | | //---------------------------------------------------------------------- |
31 | | // Implementation |
32 | | |
33 | | nsresult |
34 | | SVGDocument::Clone(dom::NodeInfo* aNodeInfo, nsINode** aResult) const |
35 | 0 | { |
36 | 0 | NS_ASSERTION(aNodeInfo->NodeInfoManager() == mNodeInfoManager, |
37 | 0 | "Can't import this document into another document!"); |
38 | 0 |
|
39 | 0 | RefPtr<SVGDocument> clone = new SVGDocument(); |
40 | 0 | nsresult rv = CloneDocHelper(clone.get()); |
41 | 0 | NS_ENSURE_SUCCESS(rv, rv); |
42 | 0 |
|
43 | 0 | return CallQueryInterface(clone.get(), aResult); |
44 | 0 | } |
45 | | |
46 | | } // namespace dom |
47 | | } // namespace mozilla |
48 | | |
49 | | //////////////////////////////////////////////////////////////////////// |
50 | | // Exported creation functions |
51 | | |
52 | | nsresult |
53 | | NS_NewSVGDocument(nsIDocument** aInstancePtrResult) |
54 | 0 | { |
55 | 0 | RefPtr<SVGDocument> doc = new SVGDocument(); |
56 | 0 |
|
57 | 0 | nsresult rv = doc->Init(); |
58 | 0 | if (NS_FAILED(rv)) { |
59 | 0 | return rv; |
60 | 0 | } |
61 | 0 | |
62 | 0 | doc.forget(aInstancePtrResult); |
63 | 0 | return rv; |
64 | 0 | } |