dom/webidl/DOMParser.webidl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/webidl/DOMParser.webidl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 + *
     1.8 + * The origin of this IDL file is
     1.9 + * http://domparsing.spec.whatwg.org/#the-domparser-interface
    1.10 + */
    1.11 +
    1.12 +interface Principal;
    1.13 +interface URI;
    1.14 +interface InputStream;
    1.15 +
    1.16 +enum SupportedType {
    1.17 +  "text/html",
    1.18 +  "text/xml",
    1.19 +  "application/xml",
    1.20 +  "application/xhtml+xml",
    1.21 +  "image/svg+xml"
    1.22 +};
    1.23 +
    1.24 +// the latter is Mozilla-specific
    1.25 +[Constructor,
    1.26 + Constructor(Principal? prin, optional URI? documentURI = null,
    1.27 +             optional URI? baseURI = null)]
    1.28 +interface DOMParser {
    1.29 +  [NewObject, Throws]
    1.30 +  Document parseFromString(DOMString str, SupportedType type);
    1.31 +
    1.32 +  // Mozilla-specific stuff
    1.33 +  // Throws if the passed-in length is greater than the actual sequence length
    1.34 +  [NewObject, Throws, ChromeOnly]
    1.35 +  Document parseFromBuffer(sequence<octet> buf, unsigned long bufLen,
    1.36 +                           SupportedType type);
    1.37 +  // Throws if the passed-in length is greater than the actual typed array length
    1.38 +  [NewObject, Throws, ChromeOnly]
    1.39 +  Document parseFromBuffer(Uint8Array buf, unsigned long bufLen,
    1.40 +                           SupportedType type);
    1.41 +  [NewObject, Throws, ChromeOnly]
    1.42 +  Document parseFromStream(InputStream stream, DOMString? charset,
    1.43 +                           long contentLength, SupportedType type);
    1.44 +  [Throws, ChromeOnly]
    1.45 +  void init(optional Principal? principal = null,
    1.46 +            optional URI? documentURI = null,
    1.47 +            optional URI? baseURI = null);
    1.48 +};
    1.49 +

mercurial