Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / dom / webidl / HTMLImageElement.webidl
blobc22c6bf1ad4723e892e39f25d6183cd1042ff7bc
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * The origin of this IDL file is
7  * http://www.whatwg.org/specs/web-apps/current-work/#htmlimageelement
8  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
9  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
10  * Opera Software ASA. You are granted a license to use, reproduce
11  * and create derivative works of this document.
12  */
14 interface imgINotificationObserver;
15 interface imgIRequest;
16 interface URI;
17 interface MozChannel;
18 interface nsIStreamListener;
20 [NamedConstructor=Image(optional unsigned long width, optional unsigned long height)]
21 interface HTMLImageElement : HTMLElement {
22            [SetterThrows]
23            attribute DOMString alt;
24            [SetterThrows]
25            attribute DOMString src;
26            [SetterThrows, Pref="dom.image.srcset.enabled"]
27            attribute DOMString srcset;
28            [SetterThrows]
29            attribute DOMString? crossOrigin;
30            [SetterThrows]
31            attribute DOMString useMap;
32            [SetterThrows]
33            attribute boolean isMap;
34            [SetterThrows]
35            attribute unsigned long width;
36            [SetterThrows]
37            attribute unsigned long height;
38   readonly attribute unsigned long naturalWidth;
39   readonly attribute unsigned long naturalHeight;
40   readonly attribute boolean complete;
43 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
44 partial interface HTMLImageElement {
45            [SetterThrows]
46            attribute DOMString name;
47            [SetterThrows]
48            attribute DOMString align;
49            [SetterThrows]
50            attribute unsigned long hspace;
51            [SetterThrows]
52            attribute unsigned long vspace;
53            [SetterThrows]
54            attribute DOMString longDesc;
56   [TreatNullAs=EmptyString,SetterThrows] attribute DOMString border;
59 // [Update me: not in whatwg spec yet]
60 // http://picture.responsiveimages.org/#the-img-element
61 partial interface HTMLImageElement {
62            [SetterThrows, Pref="dom.image.picture.enabled"]
63            attribute DOMString sizes;
64            [Pref="dom.image.srcset.enabled"]
65   readonly attribute DOMString? currentSrc;
68 // Mozilla extensions.
69 partial interface HTMLImageElement {
70            attribute DOMString lowsrc;
72   // These attributes are offsets from the closest view (to mimic
73   // NS4's "offset-from-layer" behavior).
74   readonly attribute long x;
75   readonly attribute long y;
78 [NoInterfaceObject]
79 interface MozImageLoadingContent {
80   // Mirrored chrome-only nsIImageLoadingContent methods.  Please make sure
81   // to update this list if nsIImageLoadingContent changes.
82   [ChromeOnly]
83   const long UNKNOWN_REQUEST = -1;
84   [ChromeOnly]
85   const long CURRENT_REQUEST = 0;
86   [ChromeOnly]
87   const long PENDING_REQUEST = 1;
89   [ChromeOnly]
90   attribute boolean loadingEnabled;
91   [ChromeOnly]
92   readonly attribute short imageBlockingStatus;
93   [ChromeOnly]
94   void addObserver(imgINotificationObserver aObserver);
95   [ChromeOnly]
96   void removeObserver(imgINotificationObserver aObserver);
97   [ChromeOnly,Throws]
98   imgIRequest? getRequest(long aRequestType);
99   [ChromeOnly,Throws]
100   long getRequestType(imgIRequest aRequest);
101   [ChromeOnly,Throws]
102   readonly attribute URI? currentURI;
103   [ChromeOnly,Throws]
104   nsIStreamListener? loadImageWithChannel(MozChannel aChannel);
105   [ChromeOnly,Throws]
106   void forceReload(optional boolean aNotify);
107   [ChromeOnly]
108   void forceImageState(boolean aForce, unsigned long long aState);
111 HTMLImageElement implements MozImageLoadingContent;