michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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://www.whatwg.org/specs/web-apps/current-work/#htmlimageelement michael@0: * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis michael@0: * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and michael@0: * Opera Software ASA. You are granted a license to use, reproduce michael@0: * and create derivative works of this document. michael@0: */ michael@0: michael@0: interface imgINotificationObserver; michael@0: interface imgIRequest; michael@0: interface URI; michael@0: interface MozChannel; michael@0: interface nsIStreamListener; michael@0: michael@0: [NamedConstructor=Image(optional unsigned long width, optional unsigned long height)] michael@0: interface HTMLImageElement : HTMLElement { michael@0: [SetterThrows] michael@0: attribute DOMString alt; michael@0: [SetterThrows] michael@0: attribute DOMString src; michael@0: // attribute DOMString srcset; michael@0: [SetterThrows] michael@0: attribute DOMString crossOrigin; michael@0: [SetterThrows] michael@0: attribute DOMString useMap; michael@0: [SetterThrows] michael@0: attribute boolean isMap; michael@0: [SetterThrows] michael@0: attribute unsigned long width; michael@0: [SetterThrows] michael@0: attribute unsigned long height; michael@0: readonly attribute unsigned long naturalWidth; michael@0: readonly attribute unsigned long naturalHeight; michael@0: readonly attribute boolean complete; michael@0: }; michael@0: michael@0: // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis michael@0: partial interface HTMLImageElement { michael@0: [SetterThrows] michael@0: attribute DOMString name; michael@0: [SetterThrows] michael@0: attribute DOMString align; michael@0: [SetterThrows] michael@0: attribute unsigned long hspace; michael@0: [SetterThrows] michael@0: attribute unsigned long vspace; michael@0: [SetterThrows] michael@0: attribute DOMString longDesc; michael@0: michael@0: [TreatNullAs=EmptyString,SetterThrows] attribute DOMString border; michael@0: }; michael@0: michael@0: // Mozilla extensions. michael@0: partial interface HTMLImageElement { michael@0: attribute DOMString lowsrc; michael@0: michael@0: // These attributes are offsets from the closest view (to mimic michael@0: // NS4's "offset-from-layer" behavior). michael@0: readonly attribute long x; michael@0: readonly attribute long y; michael@0: }; michael@0: michael@0: [NoInterfaceObject] michael@0: interface MozImageLoadingContent { michael@0: // Mirrored chrome-only nsIImageLoadingContent methods. Please make sure michael@0: // to update this list if nsIImageLoadingContent changes. michael@0: [ChromeOnly] michael@0: const long UNKNOWN_REQUEST = -1; michael@0: [ChromeOnly] michael@0: const long CURRENT_REQUEST = 0; michael@0: [ChromeOnly] michael@0: const long PENDING_REQUEST = 1; michael@0: michael@0: [ChromeOnly] michael@0: attribute boolean loadingEnabled; michael@0: [ChromeOnly] michael@0: readonly attribute short imageBlockingStatus; michael@0: [ChromeOnly] michael@0: void addObserver(imgINotificationObserver aObserver); michael@0: [ChromeOnly] michael@0: void removeObserver(imgINotificationObserver aObserver); michael@0: [ChromeOnly,Throws] michael@0: imgIRequest? getRequest(long aRequestType); michael@0: [ChromeOnly,Throws] michael@0: long getRequestType(imgIRequest aRequest); michael@0: [ChromeOnly,Throws] michael@0: readonly attribute URI? currentURI; michael@0: [ChromeOnly,Throws] michael@0: nsIStreamListener? loadImageWithChannel(MozChannel aChannel); michael@0: [ChromeOnly,Throws] michael@0: void forceReload(); michael@0: [ChromeOnly] michael@0: void forceImageState(boolean aForce, unsigned long long aState); michael@0: }; michael@0: michael@0: HTMLImageElement implements MozImageLoadingContent;