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/. */
7 interface Screen : EventTarget {
9 // http://dev.w3.org/csswg/cssom-view/#the-screen-interface
11 readonly attribute long availWidth;
13 readonly attribute long availHeight;
15 readonly attribute long width;
17 readonly attribute long height;
19 readonly attribute long colorDepth;
21 readonly attribute long pixelDepth;
24 readonly attribute long top;
26 readonly attribute long left;
28 readonly attribute long availTop;
30 readonly attribute long availLeft;
33 * DEPRECATED, use ScreenOrientation API instead.
34 * Returns the current screen orientation.
35 * Can be: landscape-primary, landscape-secondary,
36 * portrait-primary or portrait-secondary.
39 readonly attribute DOMString mozOrientation;
41 attribute EventHandler onmozorientationchange;
44 * DEPRECATED, use ScreenOrientation API instead.
45 * Lock screen orientation to the specified type.
48 boolean mozLockOrientation(DOMString orientation);
50 boolean mozLockOrientation(sequence<DOMString> orientation);
53 * DEPRECATED, use ScreenOrientation API instead.
54 * Unlock the screen orientation.
56 void mozUnlockOrientation();
59 // https://w3c.github.io/screen-orientation
60 partial interface Screen {
61 readonly attribute ScreenOrientation orientation;
64 // https://wicg.github.io/media-capabilities/#idl-index
65 enum ScreenColorGamut {
71 [Func="nsScreen::MediaCapabilitiesEnabled",
73 interface ScreenLuminance {
74 readonly attribute double min;
75 readonly attribute double max;
76 readonly attribute double maxAverage;
79 partial interface Screen {
80 [Func="nsScreen::MediaCapabilitiesEnabled"]
81 readonly attribute ScreenColorGamut colorGamut;
82 [Func="nsScreen::MediaCapabilitiesEnabled"]
83 readonly attribute ScreenLuminance? luminance;
85 [Func="nsScreen::MediaCapabilitiesEnabled"]
86 attribute EventHandler onchange;