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
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;
17 readonly attribute long top;
18 readonly attribute long left;
19 readonly attribute long availTop;
20 readonly attribute long availLeft;
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.
29 readonly attribute DOMString mozOrientation;
31 attribute EventHandler onmozorientationchange;
34 * DEPRECATED, use ScreenOrientation API instead.
35 * Lock/unlock screen orientation to the specified type.
37 * FIXME(emilio): These do literally nothing, we should
38 * try to remove these.
40 boolean mozLockOrientation(DOMString orientation);
41 boolean mozLockOrientation(sequence<DOMString> orientation);
42 undefined mozUnlockOrientation();
45 // https://w3c.github.io/screen-orientation
46 partial interface Screen {
47 readonly attribute ScreenOrientation orientation;
50 // https://wicg.github.io/media-capabilities/#idl-index
51 enum ScreenColorGamut {
57 [Func="nsScreen::MediaCapabilitiesEnabled",
59 interface ScreenLuminance {
60 readonly attribute double min;
61 readonly attribute double max;
62 readonly attribute double maxAverage;
65 partial interface Screen {
66 [Func="nsScreen::MediaCapabilitiesEnabled"]
67 readonly attribute ScreenColorGamut colorGamut;
68 [Func="nsScreen::MediaCapabilitiesEnabled"]
69 readonly attribute ScreenLuminance? luminance;
71 [Func="nsScreen::MediaCapabilitiesEnabled"]
72 attribute EventHandler onchange;