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 #ifndef nsDOMSerializer_h_
8 #define nsDOMSerializer_h_
10 #include "mozilla/dom/NonRefcountedDOMObject.h"
11 #include "mozilla/ErrorResult.h"
12 #include "mozilla/dom/XMLSerializerBinding.h"
15 class nsIOutputStream
;
17 class nsDOMSerializer final
: public mozilla::dom::NonRefcountedDOMObject
{
22 static nsDOMSerializer
* Constructor(const mozilla::dom::GlobalObject
& aOwner
,
23 mozilla::ErrorResult
& rv
) {
24 return new nsDOMSerializer();
27 void SerializeToString(nsINode
& aRoot
, nsAString
& aStr
,
28 mozilla::ErrorResult
& rv
);
30 void SerializeToStream(nsINode
& aRoot
, nsIOutputStream
* aStream
,
31 const nsAString
& aCharset
, mozilla::ErrorResult
& aRv
);
33 bool WrapObject(JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
,
34 JS::MutableHandle
<JSObject
*> aReflector
) {
35 return mozilla::dom::XMLSerializer_Binding::Wrap(aCx
, this, aGivenProto
,