Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 4 | * |
michael@0 | 5 | * The origin of this IDL file is |
michael@0 | 6 | * http://domparsing.spec.whatwg.org/#the-domparser-interface |
michael@0 | 7 | */ |
michael@0 | 8 | |
michael@0 | 9 | interface Principal; |
michael@0 | 10 | interface URI; |
michael@0 | 11 | interface InputStream; |
michael@0 | 12 | |
michael@0 | 13 | enum SupportedType { |
michael@0 | 14 | "text/html", |
michael@0 | 15 | "text/xml", |
michael@0 | 16 | "application/xml", |
michael@0 | 17 | "application/xhtml+xml", |
michael@0 | 18 | "image/svg+xml" |
michael@0 | 19 | }; |
michael@0 | 20 | |
michael@0 | 21 | // the latter is Mozilla-specific |
michael@0 | 22 | [Constructor, |
michael@0 | 23 | Constructor(Principal? prin, optional URI? documentURI = null, |
michael@0 | 24 | optional URI? baseURI = null)] |
michael@0 | 25 | interface DOMParser { |
michael@0 | 26 | [NewObject, Throws] |
michael@0 | 27 | Document parseFromString(DOMString str, SupportedType type); |
michael@0 | 28 | |
michael@0 | 29 | // Mozilla-specific stuff |
michael@0 | 30 | // Throws if the passed-in length is greater than the actual sequence length |
michael@0 | 31 | [NewObject, Throws, ChromeOnly] |
michael@0 | 32 | Document parseFromBuffer(sequence<octet> buf, unsigned long bufLen, |
michael@0 | 33 | SupportedType type); |
michael@0 | 34 | // Throws if the passed-in length is greater than the actual typed array length |
michael@0 | 35 | [NewObject, Throws, ChromeOnly] |
michael@0 | 36 | Document parseFromBuffer(Uint8Array buf, unsigned long bufLen, |
michael@0 | 37 | SupportedType type); |
michael@0 | 38 | [NewObject, Throws, ChromeOnly] |
michael@0 | 39 | Document parseFromStream(InputStream stream, DOMString? charset, |
michael@0 | 40 | long contentLength, SupportedType type); |
michael@0 | 41 | [Throws, ChromeOnly] |
michael@0 | 42 | void init(optional Principal? principal = null, |
michael@0 | 43 | optional URI? documentURI = null, |
michael@0 | 44 | optional URI? baseURI = null); |
michael@0 | 45 | }; |
michael@0 | 46 |