2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2013-03-20 20:22:26 +04:00
|
|
|
#include "mozilla/dom/SVGDocument.h"
|
2014-05-25 00:37:48 +04:00
|
|
|
|
|
|
|
#include "mozilla/css/Loader.h"
|
|
|
|
#include "nsNetUtil.h"
|
|
|
|
#include "nsServiceManagerUtils.h"
|
2002-03-21 04:43:51 +03:00
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsLiteralString.h"
|
2010-05-05 22:18:05 +04:00
|
|
|
#include "mozilla/dom/Element.h"
|
2018-12-21 11:58:14 +03:00
|
|
|
#include "SVGElement.h"
|
2016-09-26 15:03:25 +03:00
|
|
|
#include "mozilla/StyleSheet.h"
|
|
|
|
#include "mozilla/StyleSheetInlines.h"
|
2010-04-30 17:12:05 +04:00
|
|
|
|
2014-05-25 00:37:48 +04:00
|
|
|
using namespace mozilla::css;
|
2010-04-30 17:12:05 +04:00
|
|
|
using namespace mozilla::dom;
|
2004-11-19 02:32:06 +03:00
|
|
|
|
2013-03-20 20:22:26 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2004-11-19 02:32:06 +03:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Implementation
|
|
|
|
|
2018-08-09 02:58:44 +03:00
|
|
|
nsresult SVGDocument::Clone(dom::NodeInfo* aNodeInfo, nsINode** aResult) const {
|
2009-12-11 07:02:13 +03:00
|
|
|
NS_ASSERTION(aNodeInfo->NodeInfoManager() == mNodeInfoManager,
|
|
|
|
"Can't import this document into another document!");
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<SVGDocument> clone = new SVGDocument();
|
2018-08-09 02:58:44 +03:00
|
|
|
nsresult rv = CloneDocHelper(clone.get());
|
2009-12-11 07:02:13 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2018-09-27 17:59:55 +03:00
|
|
|
clone.forget(aResult);
|
|
|
|
return NS_OK;
|
2009-12-11 07:02:13 +03:00
|
|
|
}
|
|
|
|
|
2013-03-20 20:22:26 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2004-11-19 02:32:06 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// Exported creation functions
|
|
|
|
|
2019-01-02 16:05:23 +03:00
|
|
|
nsresult NS_NewSVGDocument(Document** aInstancePtrResult) {
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<SVGDocument> doc = new SVGDocument();
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
|
|
|
|
nsresult rv = doc->Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2013-04-13 11:08:49 +04:00
|
|
|
doc.forget(aInstancePtrResult);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
return rv;
|
2001-12-12 10:59:31 +03:00
|
|
|
}
|