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.)

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

mercurial