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/. */
|
2000-09-10 02:17:54 +00:00
|
|
|
|
2006-03-31 08:00:42 +00:00
|
|
|
/*
|
|
|
|
* nsIContentSerializer implementation that can be used with an
|
|
|
|
* nsIDocumentEncoder to convert an HTML (not XHTML!) DOM to an HTML
|
|
|
|
* string that could be parsed into more or less the original DOM.
|
|
|
|
*/
|
|
|
|
|
2000-09-10 19:36:22 +00:00
|
|
|
#ifndef nsHTMLContentSerializer_h__
|
|
|
|
#define nsHTMLContentSerializer_h__
|
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2009-04-25 09:00:14 +00:00
|
|
|
#include "nsXHTMLContentSerializer.h"
|
2000-09-10 06:44:06 +00:00
|
|
|
#include "nsIEntityConverter.h"
|
2002-11-22 12:20:05 +00:00
|
|
|
#include "nsString.h"
|
2000-09-10 06:44:06 +00:00
|
|
|
|
|
|
|
class nsIContent;
|
|
|
|
class nsIAtom;
|
2000-09-10 02:17:54 +00:00
|
|
|
|
2015-03-21 18:35:18 +00:00
|
|
|
class nsHTMLContentSerializer final : public nsXHTMLContentSerializer {
|
2000-09-10 02:17:54 +00:00
|
|
|
public:
|
|
|
|
nsHTMLContentSerializer();
|
|
|
|
virtual ~nsHTMLContentSerializer();
|
|
|
|
|
2010-10-22 21:25:22 +00:00
|
|
|
NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
|
|
|
|
mozilla::dom::Element* aOriginalElement,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsAString& aStr) override;
|
2010-10-22 21:25:22 +00:00
|
|
|
|
|
|
|
NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsAString& aStr) override;
|
2002-08-13 18:41:16 +00:00
|
|
|
|
2010-05-04 13:19:54 +00:00
|
|
|
NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsAString& aStr) override;
|
2000-09-10 02:17:54 +00:00
|
|
|
protected:
|
2009-04-25 09:00:14 +00:00
|
|
|
|
2016-04-27 04:16:50 +00:00
|
|
|
MOZ_MUST_USE
|
2015-03-17 08:55:22 +00:00
|
|
|
virtual bool SerializeHTMLAttributes(nsIContent* aContent,
|
2010-05-04 13:19:54 +00:00
|
|
|
nsIContent *aOriginalElement,
|
2009-09-01 14:31:05 +00:00
|
|
|
nsAString& aTagPrefix,
|
|
|
|
const nsAString& aTagNamespaceURI,
|
|
|
|
nsIAtom* aTagName,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aNamespace,
|
2009-09-01 14:31:05 +00:00
|
|
|
nsAString& aStr);
|
2010-03-18 16:07:32 +00:00
|
|
|
|
2016-04-27 04:16:50 +00:00
|
|
|
MOZ_MUST_USE
|
2015-03-17 08:55:22 +00:00
|
|
|
virtual bool AppendAndTranslateEntities(const nsAString& aStr,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsAString& aOutputStr) override;
|
2010-03-18 16:07:32 +00:00
|
|
|
|
2000-09-10 02:17:54 +00:00
|
|
|
};
|
2000-09-10 19:36:22 +00:00
|
|
|
|
2003-03-05 15:08:41 +00:00
|
|
|
nsresult
|
|
|
|
NS_NewHTMLContentSerializer(nsIContentSerializer** aSerializer);
|
2000-09-10 19:36:22 +00:00
|
|
|
|
|
|
|
#endif
|