Interface nsIParserUtilsType

Non-Web HTML parser functionality to Firefox extensions and XULRunner apps. Don't use this from within Gecko--use nsContentUtils, nsTreeSanitizer, etc. directly instead.

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Convert HTML to plain text.

    Parameters

    • src: string

      the HTML source to parse (C++ callers are allowed but not required to use the same string for the return value.)

    • flags: number

      conversion option flags defined in nsIDocumentEncoder

    • wrapCol: number

      number of characters per line; 0 for no auto-wrapping

    Returns string

  • Parses markup into a sanitized document fragment.

    Parameters

    • fragment: string

      the input markup

    • flags: number

      sanitization option flags defined above

    • isXML: boolean

      true if |fragment| is XML and false if HTML

    • baseURI: nsIURI

      the base URL for this fragment

    • element: Element

      the context node for the fragment parsing algorithm

    Returns DocumentFragment

  • Removes conditional CSS (@media / etc) from the input string.

    Parameters

    • src: string

    Returns string