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