1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/ImageDocument.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 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 + * content/html/document/public/nsIImageDocument.idl 1.11 + */ 1.12 + 1.13 +interface imgIRequest; 1.14 + 1.15 +[ChromeOnly, OverrideBuiltins] 1.16 +interface ImageDocument : HTMLDocument { 1.17 + /* Whether the pref for image resizing has been set. */ 1.18 + readonly attribute boolean imageResizingEnabled; 1.19 + 1.20 + /* Whether the image is overflowing visible area. */ 1.21 + readonly attribute boolean imageIsOverflowing; 1.22 + 1.23 + /* Whether the image has been resized to fit visible area. */ 1.24 + readonly attribute boolean imageIsResized; 1.25 + 1.26 + /* The image request being displayed in the content area */ 1.27 + [Throws] 1.28 + readonly attribute imgIRequest? imageRequest; 1.29 + 1.30 + /* Resize the image to fit visible area. */ 1.31 + void shrinkToFit(); 1.32 + 1.33 + /* Restore image original size. */ 1.34 + void restoreImage(); 1.35 + 1.36 + /* Restore the image, trying to keep a certain pixel in the same position. 1.37 + * The coordinate system is that of the shrunken image. 1.38 + */ 1.39 + void restoreImageTo(long x, long y); 1.40 + 1.41 + /* A helper method for switching between states. 1.42 + * The switching logic is as follows. If the image has been resized 1.43 + * restore image original size, otherwise if the image is overflowing 1.44 + * current visible area resize the image to fit the area. 1.45 + */ 1.46 + void toggleImageSize(); 1.47 +};