Bug 1614879 [wpt PR 21750] - Set request mode for beacon request with non-cors-safeli...
[gecko.git] / dom / webidl / ImageDocument.webidl
blob49f59c159c9d5a01903e16c5326d7a83e816ed13
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  * dom/html/public/nsIImageDocument.idl
8  */
10 interface imgIRequest;
12 [ChromeOnly, OverrideBuiltins,
13  Exposed=Window]
14 interface ImageDocument : HTMLDocument {
15   /* Whether the image is overflowing visible area. */
16   readonly attribute boolean imageIsOverflowing;
18   /* Whether the image has been resized to fit visible area. */
19   readonly attribute boolean imageIsResized;
21   /* The image request being displayed in the content area */
22   [Throws]
23   readonly attribute imgIRequest? imageRequest;
25   /* Resize the image to fit visible area. */
26   void shrinkToFit();
28   /* Restore image original size. */
29   void restoreImage();
31   /* Restore the image, trying to keep a certain pixel in the same position.
32    * The coordinate system is that of the shrunken image.
33    */
34   void restoreImageTo(long x, long y);
36   /* A helper method for switching between states.
37    * The switching logic is as follows. If the image has been resized
38    * restore image original size, otherwise if the image is overflowing
39    * current visible area resize the image to fit the area.
40    */
41   void toggleImageSize();