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/. */
8 * nsIContentSerializer implementation that can be used with an
9 * nsIDocumentEncoder to convert an HTML (not XHTML!) DOM to an HTML
10 * string that could be parsed into more or less the original DOM.
13 #ifndef nsHTMLContentSerializer_h__
14 #define nsHTMLContentSerializer_h__
16 #include "mozilla/Attributes.h"
17 #include "nsXHTMLContentSerializer.h"
22 class nsHTMLContentSerializer final
: public nsXHTMLContentSerializer
{
24 nsHTMLContentSerializer();
25 virtual ~nsHTMLContentSerializer();
27 NS_IMETHOD
AppendElementStart(
28 mozilla::dom::Element
* aElement
,
29 mozilla::dom::Element
* aOriginalElement
) override
;
31 NS_IMETHOD
AppendElementEnd(mozilla::dom::Element
* aElement
,
32 mozilla::dom::Element
* aOriginalElement
) override
;
34 NS_IMETHOD
AppendDocumentStart(mozilla::dom::Document
* aDocument
) override
;
38 virtual bool SerializeHTMLAttributes(mozilla::dom::Element
* aContent
,
39 mozilla::dom::Element
* aOriginalElement
,
40 nsAString
& aTagPrefix
,
41 const nsAString
& aTagNamespaceURI
,
42 nsAtom
* aTagName
, int32_t aNamespace
,
46 virtual bool AppendAndTranslateEntities(const nsAString
& aStr
,
47 nsAString
& aOutputStr
) override
;
50 nsresult
NS_NewHTMLContentSerializer(nsIContentSerializer
** aSerializer
);