content/base/src/nsHTMLContentSerializer.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /*
michael@0 7 * nsIContentSerializer implementation that can be used with an
michael@0 8 * nsIDocumentEncoder to convert an HTML (not XHTML!) DOM to an HTML
michael@0 9 * string that could be parsed into more or less the original DOM.
michael@0 10 */
michael@0 11
michael@0 12 #ifndef nsHTMLContentSerializer_h__
michael@0 13 #define nsHTMLContentSerializer_h__
michael@0 14
michael@0 15 #include "mozilla/Attributes.h"
michael@0 16 #include "nsXHTMLContentSerializer.h"
michael@0 17 #include "nsIEntityConverter.h"
michael@0 18 #include "nsString.h"
michael@0 19
michael@0 20 class nsIContent;
michael@0 21 class nsIAtom;
michael@0 22
michael@0 23 class nsHTMLContentSerializer : public nsXHTMLContentSerializer {
michael@0 24 public:
michael@0 25 nsHTMLContentSerializer();
michael@0 26 virtual ~nsHTMLContentSerializer();
michael@0 27
michael@0 28 NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
michael@0 29 mozilla::dom::Element* aOriginalElement,
michael@0 30 nsAString& aStr) MOZ_OVERRIDE;
michael@0 31
michael@0 32 NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
michael@0 33 nsAString& aStr) MOZ_OVERRIDE;
michael@0 34
michael@0 35 NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument,
michael@0 36 nsAString& aStr) MOZ_OVERRIDE;
michael@0 37 protected:
michael@0 38
michael@0 39 virtual void SerializeHTMLAttributes(nsIContent* aContent,
michael@0 40 nsIContent *aOriginalElement,
michael@0 41 nsAString& aTagPrefix,
michael@0 42 const nsAString& aTagNamespaceURI,
michael@0 43 nsIAtom* aTagName,
michael@0 44 int32_t aNamespace,
michael@0 45 nsAString& aStr);
michael@0 46
michael@0 47 virtual void AppendAndTranslateEntities(const nsAString& aStr,
michael@0 48 nsAString& aOutputStr) MOZ_OVERRIDE;
michael@0 49
michael@0 50 };
michael@0 51
michael@0 52 nsresult
michael@0 53 NS_NewHTMLContentSerializer(nsIContentSerializer** aSerializer);
michael@0 54
michael@0 55 #endif

mercurial