-
Notifications
You must be signed in to change notification settings - Fork 791
Expand file tree
/
Copy pathOverview.src.html
More file actions
336 lines (239 loc) · 12.9 KB
/
Overview.src.html
File metadata and controls
336 lines (239 loc) · 12.9 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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<!doctype html>
<html lang="en-US">
<head>
<meta charset=utf-8>
<title>CSSOM Values Module</title>
<link rel=stylesheet href=../default.css>
<link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-[STATUS]">
</head>
<body class="draft">
<div class="head">
<!--logo-->
<h1>CSSOM Values Module</h1>
<h2 class="no-num no-toc" id="w3c-doctype">[LONGSTATUS] [DATE: 3 August 2002]</h2>
<dl>
<dt>This Version:</dt>
<dd class=dontpublish><a href="http://dev.w3.org/csswg/cssom-values/">http://dev.w3.org/csswg/cssom-values/</a></dd>
<dd class=publish><a href="[VERSION]">[VERSION]</a></dd>
<dt class=dontpublish>Participate:</dt>
<dd class=dontpublish><a href="mailto:www-style@w3.org?subject=%5Bcssom-values%5D%20">www-style@w3.org</a> (<a href="http://lists.w3.org/Archives/Public/www-style/">archives</a>)
<dd class=dontpublish><a href="https://www.w3.org/Bugs/Public/enter_bug.cgi?product=CSS&component=CSSOM%20Values">File a bug</a> (<a href="https://www.w3.org/Bugs/Public/buglist.cgi?component=CSSOM%20Values&product=CSS&resolution=---">open bugs</a>) <script async="" src="https://w3c-test.org/resources.whatwg.org/file-bug.js"></script>
<dd class=dontpublish><a href="irc://irc.w3.org:6665/css">IRC: #css on W3C</a></dd>
<dt class=publish>Latest Version:</dt>
<dd class=publish><a href="[LATEST]">[LATEST]</a></dd>
<dt class=publish>Latest Editor's draft:</dt>
<dd class=publish><a href="http://dev.w3.org/csswg/cssom-values/">http://dev.w3.org/csswg/cssom-values/</a></dd>
<dt class=dontpublish>Previous Version:</dt>
<dt>Editors:</dt>
<dd>Simon Pieters
(<a href="http://www.opera.com/">Opera Software ASA</a>)
<<a href="mailto:simonp@opera.com">simonp@opera.com</a>></dd>
<dd><a href="http://www.w3.org/wiki/User:Gadams">Glenn Adams</a>
(<a href="http://www.cox.com/">Cox Communications, Inc.</a>)
<<a href="mailto:glenn.adams@cox.com">glenn.adams@cox.com</a>></dd>
</dl>
<!--copyright-->
</div>
<hr class="top">
<h2 class="no-num no-toc">Abstract</h2>
<p>This CSSOM Values module defines APIs for accessing and manipulating CSS property
values using object oriented value representations. These APIs are intended to replace
the underimplemented and underutilized <code title>CSSValue</code> and related APIs defined by
<span class=informative data-anolis-ref>DOM2STYLE</span>.</p>
<h2 class="no-num no-toc" id="sotd">Status of this Document</h2>
<p><em>This section describes the status of this document at the time of
its publication. Other documents may supersede this document. A list of
current W3C publications and the latest revision of this technical report
can be found in the
<a href="http://www.w3.org/TR/">W3C technical reports index at http://www.w3.org/TR/.</a></em>
<p>This is the [DATE: 3 August 2002] [LONGSTATUS] of CSSOM. Please send
comments to
<a href="mailto:www-style@w3.org?subject=%5Bcssom-values%5D%20">www-style@w3.org</a>
(<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
with <samp>[cssom-values]</samp> at the start of the subject line.
<!-- XXX include this text upon FPWD publishing
<p>This is the [DATE] First Public Working Draft of CSSOM, produced by the
<a href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part
of the <a href="http://www.w3.org/Style/">Style Activity</a>).
-->
<!--XXX remove "First Public" after initial publication -->
<p>This document was produced by a group operating under the
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>.
W3C maintains a
<a href="http://www.w3.org/2004/01/pp-impl/32061/status" rel=disclosure>public list of any patent disclosures</a>
made in connection with the deliverables of the group; that page also
includes instructions for disclosing a patent. An individual who has
actual knowledge of a patent which the individual believes contains
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a>
must disclose the information in accordance with
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>.</p>
<p>Publication as a Working Draft does not imply endorsement by the W3C
Membership. This is a draft document and may be updated, replaced or
obsoleted by other documents at any time. It is inappropriate to cite this
document as other than work in progress.</p>
<h2 class="no-num no-toc" id="toc">Table of Contents</h2>
<!--toc-->
<h2>Introduction</h2>
<p>This CSSOM Values module defines APIs for accessing and manipulating CSS property
values using object oriented value representations.</p>
<h2>Conformance</h2>
<p>All diagrams, examples, and notes in this specification are
non-normative, as are all sections explicitly marked non-normative.
Everything else in this specification is normative.
<p>The key words "MUST", "MUST NOT", "REQUIRED", <!--"SHALL", "SHALL
NOT",--> "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in the normative parts of this document are to be
interpreted as described in RFC2119. For readability, these words do
not appear in all uppercase letters in this specification.
<span data-anolis-ref>RFC2119</span>
<p>Requirements phrased in the imperative as part of algorithms
(such as "strip any leading space characters" or "return false and
terminate these steps") are to be interpreted with the meaning of the
key word ("must", "should", "may", etc) used in introducing the
algorithm.
<p>Conformance requirements phrased as algorithms or specific steps
may be implemented in any manner, so long as the end result is
equivalent. (In particular, the algorithms defined in this
specification are intended to be easy to follow, and not intended to
be performant.)
<p>Unless otherwise stated, string comparisons are done in a
<span data-anolis-spec=dom>case-sensitive</span> manner.
<h3>Dependencies</h3>
<p>This specification relies upon the following underlying specifications:</p>
<dl>
<dt>CSSOM</dt>
<dd><p>A conforming user agent must support the CSS Object
Model. <span data-anolis-ref>CSSOM</span></p>
<p class="issue">Narrow this dependency to specific features of CSSOM.</p>
</dd>
</dl>
<h2>CSS Values</h2>
<h3>The <code title>CSSValue</code> Interface</h3>
<pre class=idl>interface <dfn>CSSValue</dfn> {
<span class="issue" title>// ...</span>
};</pre>
<h3>The <code title>CSSStyleDeclaration</code> Interface</h3>
<pre class="idl">partial interface <dfn>CSSStyleDeclaration</dfn> {
readonly attribute <span>CSSStyleDeclarationValue</span> <span title="dom-CSSStyleDeclaration-values">values</span>;
};</pre>
<p class="issue"><dfn title=dom-CSSStyleDeclaration-values><code>values</code></dfn>
<h3>The <code title>CSSStyleDeclarationValue</code> Interface</h3>
<pre class="idl">interface <dfn>CSSStyleDeclarationValue</dfn> {
// CSS Properties
<!--CSSOM-DECLARATIONVALUEIDL-->
};</pre>
<p class="issue">The rough idea is that this interface exposes the full
list of supported properties as well that each return a
<code>CSSPropertyValue</code> object. That object can implement other
objects depending on the property involved. E.g. for '<code title>width</code>'
the object would implement <code>CSSLengthComponentValue</code> and
<code>CSSPercentageComponentValue</code>.</p>
<h3>The <code title>CSSPropertyValue</code> Interface</h3>
<pre class="idl">interface <dfn>CSSPropertyValue</dfn> {
attribute DOMString <span title="dom-CSSPropertyValue-cssText">cssText</span>;
};</pre>
<p class="issue"><dfn title=dom-CSSPropertyValue-cssText><code>cssText</code></dfn>
<!--
what does the CSSValue represent
"map"
"list"
"space-list"
"component"
if it is a CSSComponentValue
-->
<h3>The <code title>CSSPropertyValueList</code> Interface</h3>
<pre class="idl">[NoInterfaceObject] interface <dfn>CSSPropertyValueList</dfn> {
readonly attribute <span>CSSValue</span>[] <span title="dom-CSSPropertyValue-list">list</span>;
};</pre>
<p class="issue"><dfn title=dom-CSSPropertyValue-list><code>list</code></dfn>
<p class="issue">Ideally this attribute just returns a mutable array.</p>
<h3>The <code title>CSSMapValue</code> Interface</h3>
<pre class="idl">[NoInterfaceObject] interface <dfn>CSSMapValue</dfn> {
getter <span>CSSValue</span> (DOMString <var>name</var>);
};</pre>
<!-- see HTML5 DOMStringMap -->
<p class="issue">This seems the simplest we can get away with.</p>
<h3>The <code title>CSSComponentValue</code> Interface</h3>
<pre class="idl">[NoInterfaceObject] interface <dfn>CSSComponentValue</dfn> {
readonly attribute DOMString <span title="dom-CSSComponentValue-type">type</span>;
attribute any <span title="dom-CSSComponentValue-value">value</span>;
};</pre>
<p class="issue"><dfn title=dom-CSSComponentValue-type><code>type</code></dfn>
<p class="issue"><dfn title=dom-CSSComponentValue-value><code>value</code></dfn>
<p class="issue">type returns "string", "keyword", "identifier", "color", "em", "ex", "px", "url".</p>
<h4>The <code title>CSSColorComponentValue</code> Interface</h4>
<pre class="idl">[NoInterfaceObject] interface <dfn>CSSColorComponentValue</dfn> {
attribute short <span title="dom-CSSColorComponentValue-red">red</span>;
attribute short <span title="dom-CSSColorComponentValue-green">green</span>;
attribute short <span title="dom-CSSColorComponentValue-blue">blue</span>;
attribute float <span title="dom-CSSColorComponentValue-alpha">alpha</span>;
};</pre>
<p class="issue"><dfn title=dom-CSSColorComponentValue-red><code>red</code></dfn>
<p class="issue"><dfn title=dom-CSSColorComponentValue-green><code>green</code></dfn>
<p class="issue"><dfn title=dom-CSSColorComponentValue-blue><code>blue</code></dfn>
<p class="issue"><dfn title=dom-CSSColorComponentValue-alpha><code>alpha</code></dfn>
<p class="issue">We can make this more complex later. This will probably move into the CSS Color Level 4.</p>
<h4>The <code title>CSSIdentifierComponentValue</code> Interface</h4>
<pre class="idl">[NoInterfaceObject] interface <dfn>CSSIdentifierComponentValue</dfn> {
attribute DOMString <span title="dom-CSSStringComponentValue-identifier">identifier</span>;
};</pre>
<p class="issue"><dfn title=dom-CSSStringComponentValue-identifier><code>identifier</code></dfn>
<h4>The <code title>CSSKeywordComponentValue</code> Interface</h4>
<pre class="idl">[NoInterfaceObject] interface <dfn>CSSKeywordComponentValue</dfn> {
attribute DOMString <span title="dom-CSSStringComponentValue-keyword">keyword</span>;
};</pre>
<p class="issue"><dfn title=dom-CSSStringComponentValue-keyword><code>keyword</code></dfn>
<h4>The <code title>CSSLengthComponentValue</code> Interface</h4>
<pre class="idl">[NoInterfaceObject] interface <dfn>CSSLengthComponentValue</dfn> {
attribute float <span title="dom-CSSLengthComponentValue-em">em</span>;
attribute float <span title="dom-CSSLengthComponentValue-ex">ex</span>;
attribute float <span title="dom-CSSLengthComponentValue-px">px</span>;
<span class="issue" title>// figure out what to do with absolute lengths</span>
};</pre>
<p class="issue"><dfn title=dom-CSSLengthComponentValue-em><code>em</code></dfn>
<p class="issue"><dfn title=dom-CSSLengthComponentValue-ex><code>ex</code></dfn>
<p class="issue"><dfn title=dom-CSSLengthComponentValue-px><code>px</code></dfn>
<h4>The <code title>CSSPercentageComponentValue</code> Interface</h4>
<pre class="idl">[NoInterfaceObject] interface <dfn>CSSPercentageComponentValue</dfn> {
attribute float <span title="dom-CSSPercentageComponentValue-percent">percent</span>;
};</pre>
<p class="issue"><dfn title=dom-CSSPercentageComponentValue-percent><code>percent</code></dfn>
<h4>The <code title>CSSStringComponentValue</code> Interface</h4>
<pre class="idl">[NoInterfaceObject] interface <dfn>CSSStringComponentValue</dfn> {
attribute DOMString <span title="dom-CSSStringComponentValue-string">string</span>;
};</pre>
<p class="issue"><dfn title=dom-CSSStringComponentValue-string><code>string</code></dfn>
<h4>The <code title>CSSURLComponentValue</code> Interface</h4>
<pre class="idl">[NoInterfaceObject] interface <dfn>CSSURLComponentValue</dfn> {
attribute DOMString? <span title="dom-CSSURLComponentValue-url">url</span>;
};</pre>
<p class="issue"><dfn title=dom-CSSURLComponentValue-url><code>url</code></dfn>
<h2 class=no-num>References</h2>
<div id=anolis-references></div>
<h2 class="no-num">Acknowledgments</h2>
<p>The editors would like to thank
Alexey Feldgendler,
Björn Höhrmann,
Brian Kardell,
Christian Krebs,
Daniel Glazman,
David Baron,
<i>fantasai</i>,
Hallvord R. M. Steen,
Ian Hickson,
John Daggett,
Lachlan Hunt,
Morten Stenshorne,
Philip Taylor,
Robert O'Callahan,
Sjoerd Visscher,
<!--Simon Pieters,-->
Sylvain Galineau,
Tarquin Wilton-Jones, and
Zack Weinberg
for contributing to this specification.</p>
<p>Special thanks to Anne van Kesteren who authored the material upon which this work is based.</p>
<!-- XXX NOTES
-->
</body>
</html>