michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: * michael@0: * The origin of this IDL file is michael@0: * http://domparsing.spec.whatwg.org/#the-domparser-interface michael@0: */ michael@0: michael@0: interface Principal; michael@0: interface URI; michael@0: interface InputStream; michael@0: michael@0: enum SupportedType { michael@0: "text/html", michael@0: "text/xml", michael@0: "application/xml", michael@0: "application/xhtml+xml", michael@0: "image/svg+xml" michael@0: }; michael@0: michael@0: // the latter is Mozilla-specific michael@0: [Constructor, michael@0: Constructor(Principal? prin, optional URI? documentURI = null, michael@0: optional URI? baseURI = null)] michael@0: interface DOMParser { michael@0: [NewObject, Throws] michael@0: Document parseFromString(DOMString str, SupportedType type); michael@0: michael@0: // Mozilla-specific stuff michael@0: // Throws if the passed-in length is greater than the actual sequence length michael@0: [NewObject, Throws, ChromeOnly] michael@0: Document parseFromBuffer(sequence buf, unsigned long bufLen, michael@0: SupportedType type); michael@0: // Throws if the passed-in length is greater than the actual typed array length michael@0: [NewObject, Throws, ChromeOnly] michael@0: Document parseFromBuffer(Uint8Array buf, unsigned long bufLen, michael@0: SupportedType type); michael@0: [NewObject, Throws, ChromeOnly] michael@0: Document parseFromStream(InputStream stream, DOMString? charset, michael@0: long contentLength, SupportedType type); michael@0: [Throws, ChromeOnly] michael@0: void init(optional Principal? principal = null, michael@0: optional URI? documentURI = null, michael@0: optional URI? baseURI = null); michael@0: }; michael@0: