// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Interface exposing additional per-screen information.
// https://w3c.github.io/window-management/
[
Exposed=Window,
SecureContext
] interface ScreenDetailed : Screen {
// Distance from a multi-screen origin (e.g. primary screen top left) to the
// left edge of the screen area.
[HighEntropy=Direct, Measure] readonly attribute long left;
// Distance from a multi-screen origin (e.g. primary screen top left) to the
// top edge of the screen area.
[HighEntropy=Direct, Measure] readonly attribute long top;
// Whether this screen is designated as the 'primary' screen by the OS
// (otherwise it is a 'secondary' screen).
[HighEntropy=Direct, Measure] readonly attribute boolean isPrimary;
// Whether this screen is an 'internal' panel built into the device, like a
// laptop display (otherwise it is 'external', like a wired monitor).
[HighEntropy=Direct, Measure] readonly attribute boolean isInternal;
// Specifies the ratio between physical and logical pixels.
[HighEntropy=Direct, Measure] readonly attribute float devicePixelRatio;
// A user-friendly label for the screen, determined by the user agent and OS.
[HighEntropy=Direct, Measure] readonly attribute DOMString label;
// The maximum luminance that the screen is capable of displaying across
// the full area of the screen, as a multiple of the luminance of SDR white.
// This will have a value of 1.0 for screens that are not HDR capable.
// https://github.com/w3c/ColorWeb-CG/blob/main/hdr_html_canvas_element.md
[RuntimeEnabled=CanvasHDR] readonly attribute float highDynamicRangeHeadroom;
// The color primaries and white point of the screen, in CIE 1931 xy
// coordinates. These define the color gamut that the screen is capable of
// displaying.
// https://github.com/w3c/ColorWeb-CG/blob/main/hdr_html_canvas_element.md
[RuntimeEnabled=CanvasHDR] readonly attribute float redPrimaryX;
[RuntimeEnabled=CanvasHDR] readonly attribute float redPrimaryY;
[RuntimeEnabled=CanvasHDR] readonly attribute float greenPrimaryX;
[RuntimeEnabled=CanvasHDR] readonly attribute float greenPrimaryY;
[RuntimeEnabled=CanvasHDR] readonly attribute float bluePrimaryX;
[RuntimeEnabled=CanvasHDR] readonly attribute float bluePrimaryY;
[RuntimeEnabled=CanvasHDR] readonly attribute float whitePointX;
[RuntimeEnabled=CanvasHDR] readonly attribute float whitePointY;
};