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
6interface Screen : EventTarget {
7  // CSSOM-View
8  // http://dev.w3.org/csswg/cssom-view/#the-screen-interface
9  [Throws]
10  readonly attribute long availWidth;
11  [Throws]
12  readonly attribute long availHeight;
13  [Throws]
14  readonly attribute long width;
15  [Throws]
16  readonly attribute long height;
17  [Throws]
18  readonly attribute long colorDepth;
19  [Throws]
20  readonly attribute long pixelDepth;
21
22  [Throws]
23  readonly attribute long top;
24  [Throws]
25  readonly attribute long left;
26  [Throws]
27  readonly attribute long availTop;
28  [Throws]
29  readonly attribute long availLeft;
30};
31
32// https://w3c.github.io/screen-orientation
33partial interface Screen {
34  readonly attribute ScreenOrientation orientation;
35};
36
37// https://wicg.github.io/media-capabilities/#idl-index
38enum ScreenColorGamut {
39  "srgb",
40  "p3",
41  "rec2020",
42};
43
44[Func="mozilla::dom::MediaCapabilities::Enabled"]
45interface ScreenLuminance {
46  readonly attribute double min;
47  readonly attribute double max;
48  readonly attribute double maxAverage;
49};
50
51partial interface Screen {
52  [Func="mozilla::dom::MediaCapabilities::Enabled"]
53  readonly attribute ScreenColorGamut colorGamut;
54  [Func="mozilla::dom::MediaCapabilities::Enabled"]
55  readonly attribute ScreenLuminance? luminance;
56
57  [Func="mozilla::dom::MediaCapabilities::Enabled"]
58  attribute EventHandler onchange;
59};
60