Bug 1861467 - [wpt-sync] Update web-platform-tests to eedf737ce39c512d0ca3471f988972e...
[gecko.git] / dom / webidl / Screen.webidl
blobf237019e93477458b3c2013283c4e5c64cce6740
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/. */
6 [Exposed=Window]
7 interface Screen : EventTarget {
8   // CSSOM-View
9   // http://dev.w3.org/csswg/cssom-view/#the-screen-interface
10   [Throws]
11   readonly attribute long availWidth;
12   [Throws]
13   readonly attribute long availHeight;
14   [Throws]
15   readonly attribute long width;
16   [Throws]
17   readonly attribute long height;
18   [Throws]
19   readonly attribute long colorDepth;
20   [Throws]
21   readonly attribute long pixelDepth;
23   [Throws]
24   readonly attribute long top;
25   [Throws]
26   readonly attribute long left;
27   [Throws]
28   readonly attribute long availTop;
29   [Throws]
30   readonly attribute long availLeft;
32   /**
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.
37    */
38   [NeedsCallerType]
39   readonly attribute DOMString mozOrientation;
41   attribute EventHandler onmozorientationchange;
43   /**
44    * DEPRECATED, use ScreenOrientation API instead.
45    * Lock screen orientation to the specified type.
46    */
47   [Throws]
48   boolean mozLockOrientation(DOMString orientation);
49   [Throws]
50   boolean mozLockOrientation(sequence<DOMString> orientation);
52   /**
53    * DEPRECATED, use ScreenOrientation API instead.
54    * Unlock the screen orientation.
55    */
56   undefined 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 {
66   "srgb",
67   "p3",
68   "rec2020",
71 [Func="nsScreen::MediaCapabilitiesEnabled",
72  Exposed=Window]
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;