forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathElement.idl
More file actions
225 lines (212 loc) · 11.7 KB
/
Element.idl
File metadata and controls
225 lines (212 loc) · 11.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
partial interface Element {
[Documentation=
"<p>The {@name} {@type}, when invoked, must return the result of the following algorithm:</p>\
<ol>\
<li><p>If the element on which it was invoked does not have an associated\
CSS layout box and is not in the <code>http://www.w3.org/2000/svg</code>\
namespace return an empty <code>ClientRectList</code> object and stop\
this algorithm.</p></li>\
<li><p>If the element does not have an associated CSS layout box and is\
in the <code>http://www.w3.org/2000/svg</code> namespace return a\
<code>ClientRectList</code> object containing a single\
<code>ClientRect</code> object that describes the bounding box of the\
element as defined by the SVG specification.\
<span data-anolis-ref>SVG</span></li>\
<li>\
<p>Return a <code>ClientRectList</code> object containing a list of\
<code>ClientRect</code> objects in content order describing the border\
boxes (including those with a height or width of zero) with the\
following constraints:</p>\
<ul>\
<li><p>If the element on which the method was invoked has a computed\
value for <code>display</code> property of <code>table</code> or\
<code>inline-table</code> include both the table box and the caption\
box, if any, but not the anonymous container box.</li>\
<li><p>Replace each\
<a href='http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level'>anonymous\
block box</a> with its child box(es) and repeat this until no anonymous\
block boxes are left in the final list.</li>\
</ul>\
</li>\
</ol>"
]
ClientRectList getClientRects();
[Documentation=
"<p>The {@name} {@type}, when invoked, must return the result of the following algorithm:</p>\
<ol>\
<li><p>Let <var>list</var> be the result of invoking\
<code title=dom-Element-getClientRects>getClientRects()</code> on the\
same element this method was invoked on.</p></li>\
<li><p>If the <var>list</var> is empty return a <code>ClientRect</code>\
object whose <code title=dom-ClientRect-top>top</code>,\
<code title=dom-ClientRect-right>right</code>,\
<code title=dom-ClientRect-bottom>bottom</code> and\
<code title=dom-ClientRect-left>left</code> members are zero.</p></li>\
<li><p>Otherwise, return a <code>ClientRect</code> object describing the\
smallest rectangle that includes the first rectangle in <var>list</var>\
and all of the remaining rectangles of which the height or width is not\
zero.</p></li>\
</ol>\
<div class='example'>\
<p>The following snippet gets the dimensions of the first\
<code>div</code> element in a document:</p>\
<pre><code>var example = document.getElementsByTagName("div")[0].getBoundingClientRect();
\
var exampleWidth = example.width;
\
var exampleHeight = example.height;</code></pre>\
</div>"
]
ClientRect getBoundingClientRect();
[Documentation=
"<p>The must run these steps:</p>\
<ol>\
<li><p>If the element does not have any associated CSS layout box terminate these steps.</p></li>\
<li><p><span title='scroll an element into view'>Scroll the element into view</span> with the\
<i title>align to top flag</i> set if <var title>top</var> is true or omitted.</p></li>\
</ol>"
]
void scrollIntoView(optional boolean top);
[Documentation=
"<p>The {@name} {@type} must return the result of running these steps:</p>\
<ol>\
<li><p>If the element does not have any associated CSS layout box or the\
element is the root element and the <code data-anolis-spec=dom>Document</code> is in\
<span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span> return zero and terminate these steps.</p></li>\
<li><p>If the element is the root element return the value of\
<code title='dom-Window-scrollY'>scrollY</code>.</p></li>\
<li><p>If the element is <span>the HTML <code>body</code> element</span>,\
the <code data-anolis-spec=dom>Document</code> is in <span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span>, and the element\
does not have any overflow, return the value of\
<code title=dom-Window-scrollY>scrollY</code>.</p></li>\
<li><p>Return the y-coordinate of the <span>content</span> at the\
alignment point with the top of the <span>content edge</span> of the\
element.</p></li>\
</ol>\
<p>When setting the {@name} {@type} these steps must be run:</p>\
<ol>\
<li><p>Let <var title>y</var> be the given value.</p></li>\
<li><p>If the element does not have any associated CSS layout box, the\
element is the root element and the <code data-anolis-spec=dom>Document</code> is in\
<span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span>, or the element has no overflow, terminate these\
steps.</p></li>\
<li><p>If the element is the root element invoke\
<code title=dom-Window-scroll>scroll()</code> with zero as first\
argument and <var title>y</var> as second.</p></li>\
<li><p>If the element is <span>the HTML <code>body</code> element</span>,\
the <code data-anolis-spec=dom>Document</code> is in <span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span>, and the element\
does not have any vertical overflow, invoke\
<code title=dom-Window-scroll>scroll()</code> with\
<code title=dom-Window-scrollX>scrollX</code> as first\
argument and <var title>y</var> as second.</p></li>\
<li><p><span title='scroll an element'>Scroll the element</span> to\
<code title=dom-Element-scrollLeft>scrollLeft</code>,<var title>y</var>.\
</ol>"
]
attribute long scrollTop;
[Documentation=
"<p>The {@name} {@type} must return the result of running these steps:</p>\
<ol>\
<li><p>If the element does not have any associated CSS layout box or the\
element is the root element and the <code data-anolis-spec=dom>Document</code> is in\
<span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span> return zero and terminate these steps.</p></li>\
<li><p>If the element is the root element return the value of\
<code title=dom-Window-scrollX>scrollX</code>.</p></li>\
<li><p>If the element is <span>the HTML <code>body</code> element</span>,\
the <code data-anolis-spec=dom>Document</code> is in <span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span>, and the element\
does not have any overflow, return the value of\
<code title=dom-Window-scrollX>scrollX</code>.</p></li>\
<li><p>Return the x-coordinate of the <span>content</span> at the\
alignment point with the left of the <span>content edge</span> of the\
element.</p></li>\
</ol>\
<p>When setting the {@name} {@type} these steps must be run:</p>\
<ol>\
<li><p>Let <var title>x</var> be the given value.</p></li>\
<li><p>If the element does not have any associated CSS layout box, the\
element is the root element and the <code data-anolis-spec=dom>Document</code> is in\
<span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span>, or the element has no overflow, terminate these\
steps.</p></li>\
<li><p>If the element is the root element invoke\
<code title=dom-Window-scroll>scroll()</code> with\
<var title>x</var> as first argument and zero as second.</p></li>\
<li><p>If the element is <span>the HTML <code>body</code> element</span>,\
the <code data-anolis-spec=dom>Document</code> is in <span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span>, and the element\
does not have any vertical overflow, invoke\
<code title='dom-Window-scroll'>scroll()</code> with\
<var title>x</var> as first argument and\
<code title=dom-Window-scrollY>scrollY</code> as second.</p></li>\
<li><p><span title='Scroll an element'>Scroll the element</span> to\
<var title>x</var>,<code title=dom-Element-scrollTop>scrollTop</code>.\
</ol>"
]
attribute long scrollLeft;
[Documentation=
"<p>The {@name} {@type} must return the result of running these steps:</p>\
<ol>\
<li><p>If the element does not have any associated CSS layout box return\
zero and terminate these steps.</p></li>\
<li><p>If the element is the root element and the\
<code data-anolis-spec=dom>Document</code> is not in\
<span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span>\
return max(<span>document content</span> width, value of <code title=dom-Window-innerWidth>innerWidth</code>).</p></li>\
<li><p>If the element is <span>the HTML <code>body</code> element</span>\
and the <code data-anolis-spec=dom>Document</code> is in\
<span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span>\
return max(<span>document content</span> width, value of <code title=dom-Window-innerWidth>innerWidth</code>).</p></li>\
<li><p>Return the computed value of the '<code>padding-left</code>'\
property, plus the computed value of the '<code>padding-right</code>',\
plus the <span>content</span> width of the element.</p></li>\
</ol>"
]
readonly attribute long scrollWidth;
[Documentation=
"<p>The {@name} {@type} must return the result of running these steps:</p>\
<ol>\
<li><p>If the element does not have any associated CSS layout box return\
zero and terminate these steps.</p></li>\
<li><p>If the element is the root element and the\
<code data-anolis-spec=dom>Document</code> is not in\
<span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span>\
return max(<span>document content</span> height, value of <code title=dom-Window-innerHeight>innerHeight</code>).</p></li>\
<li><p>If the element is <span>the HTML <code>body</code> element</span>\
and the <code data-anolis-spec=dom>Document</code> is in\
<span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span>\
return max(<span>document content</span> height, value of <code title=dom-Window-innerHeight>innerHeight</code>).</p></li>\
<li><p>Return the computed value of the '<code>padding-top</code>'\
property, plus the computed value of the '<code>padding-bottom</code>',\
plus the <span>content</span> height of the element.</p></li>\
</ol>"
]
readonly attribute long scrollHeight;
[Documentation=
"<p>The {@name} {@type} returns the computed value of the\
'<code>border-top-width</code>' property plus the width of any scrollbar\
rendered between the top <span>padding edge</span> and the top\
<span>border edge</span>.</p>"
]
readonly attribute long clientTop;
[Documentation=
"<p>The {@name} {@type} returns the computed value of the\
'<code>border-left-width</code>' property plus the width of any scrollbar\
rendered between the left <span>padding edge</span> and the left\
<span>border edge</span>.</p>"
]
readonly attribute long clientLeft;
[Documentation=
"<p>The {@name} {@type} returns the\
<span>viewport</span> width excluding the size of a rendered scroll bar\
(if any) if the element is the root element and the\
width of the <span>padding edge</span> (excluding the width of any\
rendered scrollbar between the <span>padding edge</span> and the\
<span>border edge</span>) otherwise.</p>"
]
readonly attribute long clientWidth;
[Documentation=
"<p>The {@name} {@type} returns the\
<span>viewport</span> height excluding the size of a rendered scroll bar\
(if any) if the element is the root element and the\
height of the <span>padding edge</span> (excluding the height of any\
rendered scrollbar between the <span>padding edge</span> and the\
<span>border edge</span>) otherwise.</p>"
]
readonly attribute long clientHeight;
};