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/dom/XMLSerializerBinding.h"
14 class nsIOutputStream
;
20 class nsDOMSerializer final
: public mozilla::dom::NonRefcountedDOMObject
{
25 static mozilla::UniquePtr
<nsDOMSerializer
> Constructor(
26 const mozilla::dom::GlobalObject
& aOwner
) {
27 return mozilla::MakeUnique
<nsDOMSerializer
>();
30 void SerializeToString(nsINode
& aRoot
, nsAString
& aStr
,
31 mozilla::ErrorResult
& rv
);
33 void SerializeToStream(nsINode
& aRoot
, nsIOutputStream
* aStream
,
34 const nsAString
& aCharset
, mozilla::ErrorResult
& aRv
);
36 bool WrapObject(JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
,
37 JS::MutableHandle
<JSObject
*> aReflector
) {
38 return mozilla::dom::XMLSerializer_Binding::Wrap(aCx
, this, aGivenProto
,