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 file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
7 /* These objects support visualization of a css-grid by the dev tools. */
10 * Explicit and implicit types apply to tracks, lines, and areas.
11 * https://drafts.csswg.org/css-grid/#explicit-grids
12 * https://drafts.csswg.org/css-grid/#implicit-grids
14 enum GridDeclaration { "explicit", "implicit" };
17 * Tracks expanded from auto-fill are repeat , auto-fits with elements are
18 * also repeat, auto-fits with no elements are removed, other tracks are static.
20 enum GridTrackState { "static", "repeat", "removed" };
26 readonly attribute GridDimension rows;
27 readonly attribute GridDimension cols;
29 readonly attribute sequence<GridArea> areas;
34 interface GridDimension
36 readonly attribute GridLines lines;
37 readonly attribute GridTracks tracks;
44 readonly attribute unsigned long length;
47 * This accessor method allows array-like access to lines.
48 * @param index A 0-indexed value.
50 getter GridLine? item(unsigned long index);
58 * Names include both explicit names and implicit names, which will be
59 * assigned if the line contributes to a named area.
60 * https://drafts.csswg.org/css-grid/#implicit-named-lines
63 readonly attribute sequence<DOMString> names;
65 readonly attribute double start;
68 * Breadth is the gap between the start of this line and the start of the
69 * next track in flow direction. It primarily is set by use of the -gap
71 * https://drafts.csswg.org/css-grid/#gutters
73 readonly attribute double breadth;
75 readonly attribute GridDeclaration type;
78 * Number is the 1-indexed index of the line in flow order. The
79 * first explicit line has number 1, and numbers increment by 1 for
80 * each line after that. Lines before the first explicit line
81 * have number 0, which is not a valid addressable line number, and
82 * should be filtered out by callers.
84 readonly attribute unsigned long number;
87 * NegativeNumber is the 1-indexed index of the line in reverse
88 * flow order. The last explicit line has negativeNumber -1, and
89 * negativeNumbers decrement by 1 for each line before that.
90 * Lines after the last explicit line have negativeNumber 0, which
91 * is not a valid addressable line number, and should be filtered
94 readonly attribute long negativeNumber;
101 readonly attribute unsigned long length;
104 * This accessor method allows array-like access to tracks.
105 * @param index A 0-indexed value.
107 getter GridTrack? item(unsigned long index);
114 readonly attribute double start;
115 readonly attribute double breadth;
116 readonly attribute GridDeclaration type;
117 readonly attribute GridTrackState state;
124 readonly attribute DOMString name;
125 readonly attribute GridDeclaration type;
128 * These values are 1-indexed line numbers bounding the area.
130 readonly attribute unsigned long rowStart;
131 readonly attribute unsigned long rowEnd;
132 readonly attribute unsigned long columnStart;
133 readonly attribute unsigned long columnEnd;