Screen.webidl (2446B)
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 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 [Exposed=Window] 7 interface Screen : EventTarget { 8 // CSSOM-View 9 // http://dev.w3.org/csswg/cssom-view/#the-screen-interface 10 readonly attribute long availWidth; 11 readonly attribute long availHeight; 12 readonly attribute long width; 13 readonly attribute long height; 14 readonly attribute long colorDepth; 15 readonly attribute long pixelDepth; 16 17 readonly attribute long top; 18 readonly attribute long left; 19 readonly attribute long availTop; 20 readonly attribute long availLeft; 21 22 /** 23 * DEPRECATED, use ScreenOrientation API instead. 24 * Returns the current screen orientation. 25 * Can be: landscape-primary, landscape-secondary, 26 * portrait-primary or portrait-secondary. 27 */ 28 [NeedsCallerType, Deprecated="MozorientationDeprecated"] 29 readonly attribute DOMString mozOrientation; 30 31 [Deprecated="MozorientationchangeDeprecated"] 32 attribute EventHandler onmozorientationchange; 33 34 /** 35 * DEPRECATED, use ScreenOrientation API instead. 36 * Lock/unlock screen orientation to the specified type. 37 * 38 * FIXME(emilio): These do literally nothing, we should 39 * try to remove these. 40 */ 41 [Deprecated="MozlockorientationDeprecated"] 42 boolean mozLockOrientation(DOMString orientation); 43 44 [Deprecated="MozlockorientationDeprecated"] 45 boolean mozLockOrientation(sequence<DOMString> orientation); 46 47 [Deprecated="MozunlockorientationDeprecated"] 48 undefined mozUnlockOrientation(); 49 }; 50 51 // https://w3c.github.io/screen-orientation 52 partial interface Screen { 53 readonly attribute ScreenOrientation orientation; 54 }; 55 56 // https://wicg.github.io/media-capabilities/#idl-index 57 enum ScreenColorGamut { 58 "srgb", 59 "p3", 60 "rec2020", 61 }; 62 63 [Func="nsScreen::MediaCapabilitiesEnabled", 64 Exposed=Window] 65 interface ScreenLuminance { 66 readonly attribute double min; 67 readonly attribute double max; 68 readonly attribute double maxAverage; 69 }; 70 71 partial interface Screen { 72 [Func="nsScreen::MediaCapabilitiesEnabled"] 73 readonly attribute ScreenColorGamut colorGamut; 74 [Func="nsScreen::MediaCapabilitiesEnabled"] 75 readonly attribute ScreenLuminance? luminance; 76 77 [Func="nsScreen::MediaCapabilitiesEnabled"] 78 attribute EventHandler onchange; 79 };