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/. */
|
|
|
|
|
|
|
|
interface Screen : EventTarget {
|
|
|
|
// CSSOM-View
|
|
|
|
// http://dev.w3.org/csswg/cssom-view/#the-screen-interface
|
|
|
|
[Throws]
|
|
|
|
readonly attribute long availWidth;
|
|
|
|
[Throws]
|
|
|
|
readonly attribute long availHeight;
|
|
|
|
[Throws]
|
|
|
|
readonly attribute long width;
|
|
|
|
[Throws]
|
|
|
|
readonly attribute long height;
|
|
|
|
[Throws]
|
|
|
|
readonly attribute long colorDepth;
|
|
|
|
[Throws]
|
|
|
|
readonly attribute long pixelDepth;
|
|
|
|
|
|
|
|
[Throws]
|
|
|
|
readonly attribute long top;
|
|
|
|
[Throws]
|
|
|
|
readonly attribute long left;
|
|
|
|
[Throws]
|
|
|
|
readonly attribute long availTop;
|
|
|
|
[Throws]
|
|
|
|
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.
|
2012-10-14 11:40:11 +04:00
|
|
|
* Lock screen orientation to the specified type.
|
|
|
|
*/
|
2017-12-15 01:03:14 +03:00
|
|
|
[Throws]
|
2012-10-14 11:40:11 +04:00
|
|
|
boolean mozLockOrientation(DOMString orientation);
|
2017-12-15 01:03:14 +03:00
|
|
|
[Throws]
|
2012-10-14 11:40:11 +04:00
|
|
|
boolean mozLockOrientation(sequence<DOMString> orientation);
|
|
|
|
|
|
|
|
/**
|
2015-08-19 00:55:21 +03:00
|
|
|
* DEPRECATED, use ScreenOrientation API instead.
|
2012-10-14 11:40:11 +04:00
|
|
|
* Unlock the screen orientation.
|
|
|
|
*/
|
|
|
|
void mozUnlockOrientation();
|
|
|
|
};
|
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",
|
|
|
|
};
|
|
|
|
|
2018-08-10 00:05:55 +03:00
|
|
|
[Func="nsScreen::MediaCapabilitiesEnabled"]
|
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;
|
|
|
|
};
|