Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / chrome-webidl / XULTreeElement.webidl
blobdf9dc6a0f9e242d7a26cdc675e0f844c3e4c6c41
2 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5  * You can obtain one at http://mozilla.org/MPL/2.0/.
6  */
8 interface MozTreeView;
10 dictionary TreeCellInfo {
11     long row = 0;
12     TreeColumn? col = null;
13     DOMString childElt = "";
16 [ChromeOnly,
17  Exposed=Window]
18 interface XULTreeElement : XULElement
20   [HTMLConstructor] constructor();
22   /**
23    * Obtain the columns.
24    */
25   readonly attribute TreeColumns? columns;
27   /**
28    * The view that backs the tree and that supplies it with its data.
29    * It is dynamically settable, either using a view attribute on the
30    * tree tag or by setting this attribute to a new value.
31    */
32   [SetterThrows, NeedsCallerType]
33   attribute MozTreeView? view;
35   /**
36    * Whether or not we are currently focused.
37    */
38   attribute boolean focused;
40   /**
41    * Obtain the treebody content node
42    */
43   readonly attribute Element? treeBody;
45   /**
46    * Obtain the height of a row.
47    */
48   readonly attribute long rowHeight;
50   /**
51    * Obtain the width of a row.
52    */
53   readonly attribute long rowWidth;
55   /**
56    * Get the pixel position of the horizontal scrollbar.
57    */
58   readonly attribute long horizontalPosition;
60   /**
61    * Get the index of the first visible row.
62    */
63   long getFirstVisibleRow();
65   /**
66    * Get the index of the last visible row.
67    */
68   long getLastVisibleRow();
70   /**
71    * Gets the number of possible visible rows.
72    */
73   long getPageLength();
75   /**
76    * Ensures that a row at a given index is visible.
77    */
78   undefined ensureRowIsVisible(long index);
80   /**
81    * Ensures that a given cell in the tree is visible.
82    */
83   [Throws]
84   undefined ensureCellIsVisible(long row, TreeColumn? col);
86   /**
87    * Scrolls such that the row at index is at the top of the visible view.
88    */
89   undefined scrollToRow(long index);
91   /**
92    * Scroll the tree up or down by numLines lines. Positive
93    * values move down in the tree. Prevents scrolling off the
94    * end of the tree.
95    */
96   undefined scrollByLines(long numLines);
98   /**
99    * Scroll the tree up or down by numPages pages. A page
100    * is considered to be the amount displayed by the tree.
101    * Positive values move down in the tree. Prevents scrolling
102    * off the end of the tree.
103    */
104   undefined scrollByPages(long numPages);
106   /**
107    * Invalidation methods for fine-grained painting control.
108    */
109   undefined invalidate();
110   undefined invalidateColumn(TreeColumn? col);
111   undefined invalidateRow(long index);
112   undefined invalidateCell(long row, TreeColumn? col);
113   undefined invalidateRange(long startIndex, long endIndex);
115   /**
116    * A hit test that can tell you what row the mouse is over.
117    * returns -1 for invalid mouse coordinates.
118    *
119    * The coordinate system is the client coordinate system for the
120    * document this tree lives in, and the units are CSS pixels.
121    */
122   long getRowAt(long x, long y);
124   /**
125    * A hit test that can tell you what cell the mouse is over.
126    * TreeCellInfo.row is the row index hit,  returns -1 for invalid mouse
127    * coordinates.  TreeCellInfo.col is the column hit.
128    * TreeCellInfo.childElt is the pseudoelement hit: this can have values of
129    * "cell", "twisty", "image", and "text".
130    *
131    * The coordinate system is the client coordinate system for the
132    * document this tree lives in, and the units are CSS pixels.
133    */
134   [Throws]
135   TreeCellInfo getCellAt(long x, long y);
137   /**
138    * Find the coordinates of an element within a specific cell.
139    */
140   [Throws]
141   DOMRect? getCoordsForCellItem(long row, TreeColumn col, DOMString element);
143   /**
144    * Determine if the text of a cell is being cropped or not.
145    */
146   [Throws]
147   boolean isCellCropped(long row, TreeColumn? col);
149   /**
150    * The view is responsible for calling these notification methods when
151    * rows are added or removed.  Index is the position at which the new
152    * rows were added or at which rows were removed.  For
153    * non-contiguous additions/removals, this method should be called multiple times.
154    */
155   undefined rowCountChanged(long index, long count);
157   /**
158    * Notify the tree that the view is about to perform a batch
159    * update, that is, add, remove or invalidate several rows at once.
160    * This must be followed by calling endUpdateBatch(), otherwise the tree
161    * will get out of sync.
162    */
163   undefined beginUpdateBatch();
165   /**
166    * Notify the tree that the view has completed a batch update.
167    */
168   undefined endUpdateBatch();
170   /**
171    * Called on a theme switch to flush out the tree's style and image caches.
172    */
173   undefined clearStyleAndImageCaches();
175   /**
176    * Remove an image source from the image cache to allow its invalidation.
177    */
178   [Throws]
179   undefined removeImageCacheEntry(long row, TreeColumn col);