2015-05-03 19:32:37 +00: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 11:12:37 +00: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 07:59:31 +00:00
|
|
|
|
2013-03-20 16:22:26 +00:00
|
|
|
#include "mozilla/dom/SVGDocument.h"
|
2014-05-24 20:37:48 +00:00
|
|
|
|
|
|
|
#include "mozilla/css/Loader.h"
|
|
|
|
#include "nsNetUtil.h"
|
|
|
|
#include "nsServiceManagerUtils.h"
|
2002-03-21 01:43:51 +00:00
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsLiteralString.h"
|
2010-05-05 18:18:05 +00:00
|
|
|
#include "mozilla/dom/Element.h"
|
2018-12-21 08:58:14 +00:00
|
|
|
#include "SVGElement.h"
|
2016-09-26 12:03:25 +00:00
|
|
|
#include "mozilla/StyleSheet.h"
|
|
|
|
#include "mozilla/StyleSheetInlines.h"
|
2010-04-30 13:12:05 +00:00
|
|
|
|
2014-05-24 20:37:48 +00:00
|
|
|
using namespace mozilla::css;
|
2010-04-30 13:12:05 +00:00
|
|
|
using namespace mozilla::dom;
|
2004-11-18 23:32:06 +00:00
|
|
|
|
2022-05-09 20:41:16 +00:00
|
|
|
namespace mozilla::dom {
|
2013-03-20 16:22:26 +00:00
|
|
|
|
2004-11-18 23:32:06 +00:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Implementation
|
|
|
|
|
2018-08-08 23:58:44 +00:00
|
|
|
nsresult SVGDocument::Clone(dom::NodeInfo* aNodeInfo, nsINode** aResult) const {
|
2009-12-11 04:02:13 +00:00
|
|
|
NS_ASSERTION(aNodeInfo->NodeInfoManager() == mNodeInfoManager,
|
|
|
|
"Can't import this document into another document!");
|
|
|
|
|
2015-10-18 05:24:48 +00:00
|
|
|
RefPtr<SVGDocument> clone = new SVGDocument();
|
2018-08-08 23:58:44 +00:00
|
|
|
nsresult rv = CloneDocHelper(clone.get());
|
2009-12-11 04:02:13 +00:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2018-09-27 14:59:55 +00:00
|
|
|
clone.forget(aResult);
|
|
|
|
return NS_OK;
|
2009-12-11 04:02:13 +00:00
|
|
|
}
|
|
|
|
|
2022-05-09 20:41:16 +00:00
|
|
|
} // namespace mozilla::dom
|
2013-03-20 16:22:26 +00:00
|
|
|
|
2004-11-18 23:32:06 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// Exported creation functions
|
|
|
|
|
2019-01-02 13:05:23 +00:00
|
|
|
nsresult NS_NewSVGDocument(Document** aInstancePtrResult) {
|
2015-10-18 05:24:48 +00: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 12:39:26 +00:00
|
|
|
|
|
|
|
nsresult rv = doc->Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2013-04-13 07:08:49 +00: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 12:39:26 +00:00
|
|
|
return rv;
|
2001-12-12 07:59:31 +00:00
|
|
|
}
|