parser/html/nsIScriptableUnescapeHTML.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/parser/html/nsIScriptableUnescapeHTML.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,54 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +interface nsIDOMElement;
    1.12 +interface nsIDOMDocumentFragment;
    1.13 +interface nsIURI;
    1.14 +
    1.15 +/**
    1.16 + * This interface is OBSOLETE and exists solely for legacy extensions.
    1.17 + */
    1.18 +[scriptable, uuid(3ab244a9-f09d-44da-9e3f-ee4d67367f2d)]
    1.19 +interface nsIScriptableUnescapeHTML : nsISupports 
    1.20 +{
    1.21 +  /** 
    1.22 +   * Converts HTML to plain text. This is equivalent to calling
    1.23 +   * nsIParserUtils::convertToPlainText(src, 
    1.24 +   *   nsIDocumentEncoder::OutputSelectionOnly |
    1.25 +   *   nsIDocumentEncoder::OutputAbsoluteLinks, 0).
    1.26 +   *
    1.27 +   * You should call nsIParserUtils::convertToPlainText() instead of calling 
    1.28 +   * this method.
    1.29 +   *
    1.30 +   * @param src The HTML string to convert to plain text.
    1.31 +   */ 
    1.32 +  AString unescape(in AString src);
    1.33 +        
    1.34 +  /**
    1.35 +   * Parses markup into a sanitized document fragment. This is equivalent to
    1.36 +   * calling nsIParserUtils::parseFragment(fragment, 0, isXML, baseURI,
    1.37 +   * element).
    1.38 +   *
    1.39 +   * You should call nsIParserUtils::parseFragment() instead of calling this 
    1.40 +   * method.
    1.41 +   * @param fragment the input markup
    1.42 +   * @param isXML true if |fragment| is XML and false if HTML
    1.43 +   * @param baseURI the base URL for this fragment
    1.44 +   * @param element the context node for the fragment parsing algorithm
    1.45 +   */
    1.46 +  nsIDOMDocumentFragment parseFragment(in AString fragment,
    1.47 +                                       in boolean isXML,
    1.48 +                                       in nsIURI baseURI,
    1.49 +                                       in nsIDOMElement element);
    1.50 +};
    1.51 +
    1.52 +%{ C++
    1.53 +#define NS_SCRIPTABLEUNESCAPEHTML_CONTRACTID \
    1.54 +  "@mozilla.org/feed-unescapehtml;1"
    1.55 +#define NS_SCRIPTABLEUNESCAPEHTML_CID  \
    1.56 +{ 0x10f2f5f0, 0xf103, 0x4901, { 0x98, 0x0f, 0xba, 0x11, 0xbd, 0x70, 0xd6, 0x0d} }
    1.57 +%}

mercurial