Bug 1526591 - Remove devtools.inspector.shapesHighlighter.enabled pref. r=rcaliman
[gecko.git] / dom / webidl / HTMLImageElement.webidl
blobae91af091c5745af8a4bd82162a475e7402b811b
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 nsIStreamListener;
19 [HTMLConstructor,
20  NamedConstructor=Image(optional unsigned long width, optional unsigned long height)]
21 interface HTMLImageElement : HTMLElement {
22            [CEReactions, SetterThrows]
23            attribute DOMString alt;
24            [CEReactions, SetterNeedsSubjectPrincipal=NonSystem, SetterThrows]
25            attribute DOMString src;
26            [CEReactions, SetterNeedsSubjectPrincipal=NonSystem, SetterThrows]
27            attribute DOMString srcset;
28            [CEReactions, SetterThrows]
29            attribute DOMString? crossOrigin;
30            [CEReactions, SetterThrows]
31            attribute DOMString useMap;
32            [CEReactions, SetterThrows]
33            attribute DOMString referrerPolicy;
34            [CEReactions, SetterThrows]
35            attribute boolean isMap;
36            [CEReactions, SetterThrows]
37            attribute unsigned long width;
38            [CEReactions, SetterThrows]
39            attribute unsigned long height;
40            [CEReactions, SetterThrows]
41            attribute DOMString decoding;
42   readonly attribute unsigned long naturalWidth;
43   readonly attribute unsigned long naturalHeight;
44   readonly attribute boolean complete;
47 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
48 partial interface HTMLImageElement {
49            [CEReactions, SetterThrows]
50            attribute DOMString name;
51            [CEReactions, SetterThrows]
52            attribute DOMString align;
53            [CEReactions, SetterThrows]
54            attribute unsigned long hspace;
55            [CEReactions, SetterThrows]
56            attribute unsigned long vspace;
57            [CEReactions, SetterThrows]
58            attribute DOMString longDesc;
60   [CEReactions, TreatNullAs=EmptyString,SetterThrows] attribute DOMString border;
63 // [Update me: not in whatwg spec yet]
64 // http://picture.responsiveimages.org/#the-img-element
65 partial interface HTMLImageElement {
66            [CEReactions, SetterThrows]
67            attribute DOMString sizes;
68   readonly attribute DOMString currentSrc;
71 // Mozilla extensions.
72 partial interface HTMLImageElement {
73            [CEReactions, SetterThrows]
74            attribute DOMString lowsrc;
76   // These attributes are offsets from the closest view (to mimic
77   // NS4's "offset-from-layer" behavior).
78   readonly attribute long x;
79   readonly attribute long y;
82 [NoInterfaceObject]
83 interface MozImageLoadingContent {
84   // Mirrored chrome-only nsIImageLoadingContent methods.  Please make sure
85   // to update this list if nsIImageLoadingContent changes.
86   [ChromeOnly]
87   const long UNKNOWN_REQUEST = -1;
88   [ChromeOnly]
89   const long CURRENT_REQUEST = 0;
90   [ChromeOnly]
91   const long PENDING_REQUEST = 1;
93   [ChromeOnly]
94   attribute boolean loadingEnabled;
95   [ChromeOnly]
96   readonly attribute short imageBlockingStatus;
97   /**
98    * Same as addNativeObserver but intended for scripted observers or observers
99    * from another or without a document.
100    */
101   [ChromeOnly]
102   void addObserver(imgINotificationObserver aObserver);
103   /**
104    * Same as removeNativeObserver but intended for scripted observers or
105    * observers from another or without a document.
106    */
107   [ChromeOnly]
108   void removeObserver(imgINotificationObserver aObserver);
109   [ChromeOnly,Throws]
110   imgIRequest? getRequest(long aRequestType);
111   [ChromeOnly,Throws]
112   long getRequestType(imgIRequest aRequest);
113   [ChromeOnly,Throws]
114   readonly attribute URI? currentURI;
115   // Gets the final URI of the current request, if available.
116   // Otherwise, returns null.
117   [ChromeOnly]
118   readonly attribute URI? currentRequestFinalURI;
119   /**
120    * forceReload forces reloading of the image pointed to by currentURI
121    *
122    * @param aNotify request should notify
123    * @throws NS_ERROR_NOT_AVAILABLE if there is no current URI to reload
124    */
125   [ChromeOnly,Throws]
126   void forceReload(optional boolean aNotify = true);
127   [ChromeOnly]
128   void forceImageState(boolean aForce, unsigned long long aState);
131 HTMLImageElement implements MozImageLoadingContent;