dom/webidl/HTMLImageElement.webidl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/webidl/HTMLImageElement.webidl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,101 @@
     1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 + *
     1.9 + * The origin of this IDL file is
    1.10 + * http://www.whatwg.org/specs/web-apps/current-work/#htmlimageelement
    1.11 + * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
    1.12 + * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
    1.13 + * Opera Software ASA. You are granted a license to use, reproduce
    1.14 + * and create derivative works of this document.
    1.15 + */
    1.16 +
    1.17 +interface imgINotificationObserver;
    1.18 +interface imgIRequest;
    1.19 +interface URI;
    1.20 +interface MozChannel;
    1.21 +interface nsIStreamListener;
    1.22 +
    1.23 +[NamedConstructor=Image(optional unsigned long width, optional unsigned long height)]
    1.24 +interface HTMLImageElement : HTMLElement {
    1.25 +           [SetterThrows]
    1.26 +           attribute DOMString alt;
    1.27 +           [SetterThrows]
    1.28 +           attribute DOMString src;
    1.29 +//           attribute DOMString srcset;
    1.30 +           [SetterThrows]
    1.31 +           attribute DOMString crossOrigin;
    1.32 +           [SetterThrows]
    1.33 +           attribute DOMString useMap;
    1.34 +           [SetterThrows]
    1.35 +           attribute boolean isMap;
    1.36 +           [SetterThrows]
    1.37 +           attribute unsigned long width;
    1.38 +           [SetterThrows]
    1.39 +           attribute unsigned long height;
    1.40 +  readonly attribute unsigned long naturalWidth;
    1.41 +  readonly attribute unsigned long naturalHeight;
    1.42 +  readonly attribute boolean complete;
    1.43 +};
    1.44 +
    1.45 +// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
    1.46 +partial interface HTMLImageElement {
    1.47 +           [SetterThrows]
    1.48 +           attribute DOMString name;
    1.49 +           [SetterThrows]
    1.50 +           attribute DOMString align;
    1.51 +           [SetterThrows]
    1.52 +           attribute unsigned long hspace;
    1.53 +           [SetterThrows]
    1.54 +           attribute unsigned long vspace;
    1.55 +           [SetterThrows]
    1.56 +           attribute DOMString longDesc;
    1.57 +
    1.58 +  [TreatNullAs=EmptyString,SetterThrows] attribute DOMString border;
    1.59 +};
    1.60 +
    1.61 +// Mozilla extensions.
    1.62 +partial interface HTMLImageElement {
    1.63 +           attribute DOMString lowsrc;
    1.64 +
    1.65 +  // These attributes are offsets from the closest view (to mimic
    1.66 +  // NS4's "offset-from-layer" behavior).
    1.67 +  readonly attribute long x;
    1.68 +  readonly attribute long y;
    1.69 +};
    1.70 +
    1.71 +[NoInterfaceObject]
    1.72 +interface MozImageLoadingContent {
    1.73 +  // Mirrored chrome-only nsIImageLoadingContent methods.  Please make sure
    1.74 +  // to update this list if nsIImageLoadingContent changes.
    1.75 +  [ChromeOnly]
    1.76 +  const long UNKNOWN_REQUEST = -1;
    1.77 +  [ChromeOnly]
    1.78 +  const long CURRENT_REQUEST = 0;
    1.79 +  [ChromeOnly]
    1.80 +  const long PENDING_REQUEST = 1;
    1.81 +
    1.82 +  [ChromeOnly]
    1.83 +  attribute boolean loadingEnabled;
    1.84 +  [ChromeOnly]
    1.85 +  readonly attribute short imageBlockingStatus;
    1.86 +  [ChromeOnly]
    1.87 +  void addObserver(imgINotificationObserver aObserver);
    1.88 +  [ChromeOnly]
    1.89 +  void removeObserver(imgINotificationObserver aObserver);
    1.90 +  [ChromeOnly,Throws]
    1.91 +  imgIRequest? getRequest(long aRequestType);
    1.92 +  [ChromeOnly,Throws]
    1.93 +  long getRequestType(imgIRequest aRequest);
    1.94 +  [ChromeOnly,Throws]
    1.95 +  readonly attribute URI? currentURI;
    1.96 +  [ChromeOnly,Throws]
    1.97 +  nsIStreamListener? loadImageWithChannel(MozChannel aChannel);
    1.98 +  [ChromeOnly,Throws]
    1.99 +  void forceReload();
   1.100 +  [ChromeOnly]
   1.101 +  void forceImageState(boolean aForce, unsigned long long aState);
   1.102 +};
   1.103 +
   1.104 +HTMLImageElement implements MozImageLoadingContent;

mercurial