2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-10-14 11:40:11 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2019-09-27 18:26:14 +03:00
|
|
|
[Exposed=Window]
|
2012-10-14 11:40:11 +04:00
|
|
|
interface Screen : EventTarget {
|
|
|
|
// CSSOM-View
|
|
|
|
// http://dev.w3.org/csswg/cssom-view/#the-screen-interface
|
|
|
|
readonly attribute long availWidth;
|
|
|
|
readonly attribute long availHeight;
|
|
|
|
readonly attribute long width;
|
|
|
|
readonly attribute long height;
|
|
|
|
readonly attribute long colorDepth;
|
|
|
|
readonly attribute long pixelDepth;
|
|
|
|
|
|
|
|
readonly attribute long top;
|
|
|
|
readonly attribute long left;
|
|
|
|
readonly attribute long availTop;
|
|
|
|
readonly attribute long availLeft;
|
|
|
|
|
|
|
|
/**
|
2015-08-19 00:55:21 +03:00
|
|
|
* DEPRECATED, use ScreenOrientation API instead.
|
2012-10-14 11:40:11 +04:00
|
|
|
* Returns the current screen orientation.
|
|
|
|
* Can be: landscape-primary, landscape-secondary,
|
|
|
|
* portrait-primary or portrait-secondary.
|
|
|
|
*/
|
2016-12-22 22:05:54 +03:00
|
|
|
[NeedsCallerType]
|
2012-10-14 11:40:11 +04:00
|
|
|
readonly attribute DOMString mozOrientation;
|
|
|
|
|
|
|
|
attribute EventHandler onmozorientationchange;
|
|
|
|
|
|
|
|
/**
|
2015-08-19 00:55:21 +03:00
|
|
|
* DEPRECATED, use ScreenOrientation API instead.
|
2023-11-10 12:29:14 +03:00
|
|
|
* Lock/unlock screen orientation to the specified type.
|
|
|
|
*
|
|
|
|
* FIXME(emilio): These do literally nothing, we should
|
|
|
|
* try to remove these.
|
2012-10-14 11:40:11 +04:00
|
|
|
*/
|
|
|
|
boolean mozLockOrientation(DOMString orientation);
|
|
|
|
boolean mozLockOrientation(sequence<DOMString> orientation);
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined mozUnlockOrientation();
|
2012-10-14 11:40:11 +04:00
|
|
|
};
|
2015-08-19 00:55:21 +03:00
|
|
|
|
|
|
|
// https://w3c.github.io/screen-orientation
|
|
|
|
partial interface Screen {
|
|
|
|
readonly attribute ScreenOrientation orientation;
|
|
|
|
};
|
2018-05-31 17:01:31 +03:00
|
|
|
|
|
|
|
// https://wicg.github.io/media-capabilities/#idl-index
|
|
|
|
enum ScreenColorGamut {
|
|
|
|
"srgb",
|
|
|
|
"p3",
|
|
|
|
"rec2020",
|
|
|
|
};
|
|
|
|
|
2019-09-27 18:26:14 +03:00
|
|
|
[Func="nsScreen::MediaCapabilitiesEnabled",
|
|
|
|
Exposed=Window]
|
2018-05-31 17:01:31 +03:00
|
|
|
interface ScreenLuminance {
|
|
|
|
readonly attribute double min;
|
|
|
|
readonly attribute double max;
|
|
|
|
readonly attribute double maxAverage;
|
|
|
|
};
|
|
|
|
|
|
|
|
partial interface Screen {
|
2018-08-10 00:05:55 +03:00
|
|
|
[Func="nsScreen::MediaCapabilitiesEnabled"]
|
2018-05-31 17:01:31 +03:00
|
|
|
readonly attribute ScreenColorGamut colorGamut;
|
2018-08-10 00:05:55 +03:00
|
|
|
[Func="nsScreen::MediaCapabilitiesEnabled"]
|
2018-05-31 17:01:31 +03:00
|
|
|
readonly attribute ScreenLuminance? luminance;
|
|
|
|
|
2018-08-10 00:05:55 +03:00
|
|
|
[Func="nsScreen::MediaCapabilitiesEnabled"]
|
2018-05-31 17:01:31 +03:00
|
|
|
attribute EventHandler onchange;
|
|
|
|
};
|