2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2016-07-06 21:45:18 +03: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/.
|
|
|
|
*/
|
|
|
|
|
2016-08-23 23:34:51 +03:00
|
|
|
/* These objects support visualization of a css-grid by the dev tools. */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Explicit and implicit types apply to tracks, lines, and areas.
|
|
|
|
* https://drafts.csswg.org/css-grid/#explicit-grids
|
|
|
|
* https://drafts.csswg.org/css-grid/#implicit-grids
|
|
|
|
*/
|
|
|
|
enum GridDeclaration { "explicit", "implicit" };
|
|
|
|
|
|
|
|
/**
|
2016-09-21 21:49:29 +03:00
|
|
|
* Tracks expanded from auto-fill are repeat , auto-fits with elements are
|
|
|
|
* also repeat, auto-fits with no elements are removed, other tracks are static.
|
2016-08-23 23:34:51 +03:00
|
|
|
*/
|
2016-09-21 21:49:29 +03:00
|
|
|
enum GridTrackState { "static", "repeat", "removed" };
|
2016-08-23 23:34:51 +03:00
|
|
|
|
2019-09-27 18:26:14 +03:00
|
|
|
[ChromeOnly,
|
|
|
|
Exposed=Window]
|
2016-07-06 21:45:18 +03:00
|
|
|
interface Grid
|
|
|
|
{
|
|
|
|
readonly attribute GridDimension rows;
|
|
|
|
readonly attribute GridDimension cols;
|
2016-08-23 23:34:51 +03:00
|
|
|
[Cached, Constant]
|
|
|
|
readonly attribute sequence<GridArea> areas;
|
2016-07-06 21:45:18 +03:00
|
|
|
};
|
|
|
|
|
2019-09-27 18:26:14 +03:00
|
|
|
[ChromeOnly,
|
|
|
|
Exposed=Window]
|
2016-07-06 21:45:18 +03:00
|
|
|
interface GridDimension
|
|
|
|
{
|
|
|
|
readonly attribute GridLines lines;
|
|
|
|
readonly attribute GridTracks tracks;
|
|
|
|
};
|
|
|
|
|
2019-09-27 18:26:14 +03:00
|
|
|
[ChromeOnly,
|
|
|
|
Exposed=Window]
|
2016-07-06 21:45:18 +03:00
|
|
|
interface GridLines
|
|
|
|
{
|
|
|
|
readonly attribute unsigned long length;
|
2016-08-23 23:34:51 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This accessor method allows array-like access to lines.
|
|
|
|
* @param index A 0-indexed value.
|
|
|
|
*/
|
2016-07-06 21:45:18 +03:00
|
|
|
getter GridLine? item(unsigned long index);
|
|
|
|
};
|
|
|
|
|
2019-09-27 18:26:14 +03:00
|
|
|
[ChromeOnly,
|
|
|
|
Exposed=Window]
|
2016-07-06 21:45:18 +03:00
|
|
|
interface GridLine
|
|
|
|
{
|
2016-08-23 23:34:51 +03:00
|
|
|
/**
|
|
|
|
* Names include both explicit names and implicit names, which will be
|
|
|
|
* assigned if the line contributes to a named area.
|
|
|
|
* https://drafts.csswg.org/css-grid/#implicit-named-lines
|
|
|
|
*/
|
|
|
|
[Cached, Constant]
|
|
|
|
readonly attribute sequence<DOMString> names;
|
|
|
|
|
2016-07-06 21:45:18 +03:00
|
|
|
readonly attribute double start;
|
2016-08-23 23:34:51 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Breadth is the gap between the start of this line and the start of the
|
|
|
|
* next track in flow direction. It primarily is set by use of the -gap
|
|
|
|
* properties.
|
|
|
|
* https://drafts.csswg.org/css-grid/#gutters
|
|
|
|
*/
|
2016-07-06 21:45:18 +03:00
|
|
|
readonly attribute double breadth;
|
2016-08-23 23:34:51 +03:00
|
|
|
|
|
|
|
readonly attribute GridDeclaration type;
|
|
|
|
|
|
|
|
/**
|
2017-11-09 00:25:16 +03:00
|
|
|
* Number is the 1-indexed index of the line in flow order. The
|
|
|
|
* first explicit line has number 1, and numbers increment by 1 for
|
|
|
|
* each line after that. Lines before the first explicit line
|
|
|
|
* have number 0, which is not a valid addressable line number, and
|
|
|
|
* should be filtered out by callers.
|
2016-08-23 23:34:51 +03:00
|
|
|
*/
|
2016-07-06 21:45:18 +03:00
|
|
|
readonly attribute unsigned long number;
|
2017-11-09 00:25:16 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* NegativeNumber is the 1-indexed index of the line in reverse
|
|
|
|
* flow order. The last explicit line has negativeNumber -1, and
|
|
|
|
* negativeNumbers decrement by 1 for each line before that.
|
|
|
|
* Lines after the last explicit line have negativeNumber 0, which
|
|
|
|
* is not a valid addressable line number, and should be filtered
|
|
|
|
* out by callers.
|
|
|
|
*/
|
|
|
|
readonly attribute long negativeNumber;
|
2016-07-06 21:45:18 +03:00
|
|
|
};
|
|
|
|
|
2019-09-27 18:26:14 +03:00
|
|
|
[ChromeOnly,
|
|
|
|
Exposed=Window]
|
2016-07-06 21:45:18 +03:00
|
|
|
interface GridTracks
|
|
|
|
{
|
|
|
|
readonly attribute unsigned long length;
|
2016-08-23 23:34:51 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This accessor method allows array-like access to tracks.
|
|
|
|
* @param index A 0-indexed value.
|
|
|
|
*/
|
2016-07-06 21:45:18 +03:00
|
|
|
getter GridTrack? item(unsigned long index);
|
|
|
|
};
|
|
|
|
|
2019-09-27 18:26:14 +03:00
|
|
|
[ChromeOnly,
|
|
|
|
Exposed=Window]
|
2016-07-06 21:45:18 +03:00
|
|
|
interface GridTrack
|
|
|
|
{
|
|
|
|
readonly attribute double start;
|
|
|
|
readonly attribute double breadth;
|
2016-08-23 23:34:51 +03:00
|
|
|
readonly attribute GridDeclaration type;
|
2016-07-06 21:45:18 +03:00
|
|
|
readonly attribute GridTrackState state;
|
|
|
|
};
|
2016-08-23 23:34:51 +03:00
|
|
|
|
2019-09-27 18:26:14 +03:00
|
|
|
[ChromeOnly,
|
|
|
|
Exposed=Window]
|
2016-08-23 23:34:51 +03:00
|
|
|
interface GridArea
|
|
|
|
{
|
|
|
|
readonly attribute DOMString name;
|
|
|
|
readonly attribute GridDeclaration type;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* These values are 1-indexed line numbers bounding the area.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long rowStart;
|
|
|
|
readonly attribute unsigned long rowEnd;
|
|
|
|
readonly attribute unsigned long columnStart;
|
|
|
|
readonly attribute unsigned long columnEnd;
|
|
|
|
};
|