-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathconform.src
More file actions
353 lines (281 loc) · 13.7 KB
/
conform.src
File metadata and controls
353 lines (281 loc) · 13.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
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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<!-- $Id: conform.src,v 2.27 1998-03-20 22:07:22 howcome Exp $ -->
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>Conformance: requirements and recommendations</TITLE>
</HEAD>
<BODY>
<H1 align="center">Conformance: Requirements and Recommendations</H1>
<H2>Definitions</H2>
<p> In this section, we begin the formal specification of CSS2,
starting with the contract between authors, users, and implementers.
<P>The key words <span class="index-def" title="MUST">"MUST"</span>,
<span class="index-def" title="MUST NOT">"MUST NOT"</span>, <span
class="index-def" title="REQUIRED">"REQUIRED"</span>, <span
class="index-def" title="SHALL">"SHALL"</span>, <span
class="index-def" title="SHALL NOT">"SHALL NOT"</span>, <span
class="index-def" title="SHOULD">"SHOULD"</span>, <span
class="index-def" title="SHOULD NOT">"SHOULD NOT"</span>, <span
class="index-def" title="RECOMMENDED">"RECOMMENDED"</span>, <span
class="index-def" title="MAY">"MAY"</span>, and <span
class="index-def" title="OPTIONAL">"OPTIONAL"</span> in this document
are to be interpreted as described in RFC 2119 (see [[RFC2119]]).
However, for readability, these words do not appear in all uppercase
letters in this specification.
<P>At times, this specification recommends good practice
for authors and user agents. These recommendations are not normative
and conformance with this specification does not depend on their
realization. These recommendations contain the expression "We
recommend ...", "This specification recommends ...", or some similar
wording.</P>
<dl>
<dt><strong><span class="index-def" title="style sheet">Style
sheet</span></strong>
<dd>A set of statements that specify presentation of a document.
<P>Style sheets may have three different origins: <a
href="#author">author</a>, <a href="#user">user</a>, and <a
href="#user-agent">user agent</a>. The interaction of these sources is
described in the section on <a href="cascade.html">cascading and
inheritance</a>.
<dt><strong><a name="valid-style-sheet">Valid style sheet</a></strong>
<dd>The <span class="index-def" title="valid style
sheet">validity</span> of a style sheet depends on the level of CSS
used for the style sheet. With very few exceptions, all valid CSS1
style sheets are valid CSS2 style sheets (see the section on <a
href="#changes-from-css1">changes from CSS1</a>). A valid CSS2 style
sheet must be written according to the <a href="grammar.html">grammar
of CSS2</a>. Furthermore, it must contain only at-rules, property
names, and property values defined in this specification. An <span
class="index-def" title="illegal"><strong>illegal</strong></span> or
invalid at-rule, property name, or property value is one that is not
valid.
<dt><strong><span class="index-def" title="source document">Source
document</span></strong>
<dd>The document to which one or more style sheets refer. This is
encoded in some language that represents the document as a tree of <a
href="#element">elements</a>. Each element consists of a name that
identifies the type of element, optionally a number of <a
href="#attribute">attributes</a>, and a (possibly empty) <a
href="#content">content</a>.</dd>
<dt><strong><span class="index-def" title="document language"><a
name="doclanguage">Document language</a></span></strong>
<dd>The encoding language of the source document (e.g., HTML or an
XML application).
<dt><strong><span class="index-def" title="element"><a
name="element">Element</a></span></strong>
<dd>(An SGML term, see [[ISO8879]].) The primary syntactic constructs
of the document language. Most CSS style sheet rules use the names of
these elements (such as "P", "TABLE", and "OL" for HTML) to specify
rendering information for them.
<dt><strong><span class="index-def" title="attribute"><a
name="attribute">Attribute</a></span></strong>
<dd>A value associated with an element, consisting of a name, and an
associated (textual) value.
<dt><strong><span class="index-def" title="content"><a
name="content">Content</a></span></strong>
<dd>The content associated with an element in the source document; not
all elements have content in which case they are called <strong><span
class="index-def" title="empty">empty</span></strong>. The content of
an element may include text, and it may include a number of
sub-elements, in which case the element is called the <strong><span
class="index-def" title="parent">parent</span></strong> of those
sub-elements.
<dt><strong><span class="index-def" title="rendered
content|content::rendered"><a name="rendered-content">Rendered
content</a></span></strong>
<dd>The content of an element after the rendering that applies to it
according to the relevant style sheets has been applied. The rendered
content of a <span class="index-def" title="replaced element"> <a
name="replaced-element">replaced element</a></span> (one that causes
external content to be inserted in the document) may come from outside
the source document (e.g., HTML's IMG element). Rendered content may
also be alternate text for an element (e.g., the value of the HTML
"alt" attribute), and may include items inserted implicitly or
explicitly by the style sheet, such as bullets, numbering, etc.
<dt><strong><span class="index-def" title="document tree">
<a name="doctree">Document
tree</a></span></strong>
<dd>The tree of elements encoded in the source document. Each element
in this tree has exactly one parent, with the exception of the
<strong><span class="index-def" title="root"><a
name="root">root</a></span></strong> element, which has none.
<dt><strong><span class="index-def"
title="child">Child</span></strong>
<dd>An element A is called the child of element B if an only if B is
the parent of A.
<dt><strong><span class="index-def"
title="descendant">Descendant</span></strong>
<dd>An element A is called a descendant of an element B, if either (1)
A is a child of B, or (2) A is the child of some element C that is a
descendant of B.
<dt><strong><span class="index-def"
title="ancestor">Ancestor</span></strong>
<dd>An element A is called an ancestor of an element B, if and only if
B is a descendant of A.
<dt><strong><span class="index-def"
title="sibling">Sibling</span></strong>
<dd>An element A is called a sibling of an element B, if and only if B
and A share the same parent element. Element A is a preceding sibling
if it comes before B in the document tree. Element B is a following
sibling if it comes after B in the document tree.
<dt><strong><span class="index-def" title="preceding
element|element::preceding"><a name="preceding">Preceding element</a></span></strong>
<dd>An element A is called a preceding element of an element B, if and
only if (1) A is an ancestor of B or (2) A is a preceding sibling of
B.
<dt><strong><span class="index-def" title="following
element|element::following">Following element</span></strong>
<dd>An element A is called a following element of an element B, if and
only if B is a preceding element of A.
<!--
<dt>
<span class="index-def" title="anonymous content">
<a name="anonymous">
<strong><strong>Anonymous content</strong></strong></a>
</span></dt>
<dd>At times, content either in the document tree or <a
href="generate.html">generated</a> in the rendering structure may only
receive style information through <a
href="cascade.html#inheritance">inheritance</a>. This content is said
to be "anonymous".
<P><a href="selector.html#pseudo-elements">Pseudo-elements</a> allow
authors to refer to what would otherwise be anonymous content.
[Removed, see visuren.html#anonymous instead. BB] -->
<dt><strong><strong><a name="author">Author</a></strong></strong>
<dd>An author is a person who writes
documents and associated style sheets. An
<span class="index-def" title="authoring tool"><strong>authoring tool</strong></span>
generates documents and associated style sheets.</dd>
<dt><strong><strong><a name="user">User</a></strong></strong>
<dd> A user is a person who interacts with a user agent to view, hear, or
otherwise use a document and its associated style sheet. The user
may provide a personal style sheet that encodes personal
preferences.
</dd>
<dt><strong><strong><a name="user-agent">User agent (UA)</a></strong></strong>
<dd>A <span class="index-def" title="user agent|UA">user
agent</span> is any program that interprets a document written in
the document language and applies associated style sheets according
to the terms of this specification. A user agent may display a
document, read it aloud, cause it to be printed, convert it
to another format, etc.</dd>
</dl>
<div class="html-example">
<p>Here is an example of a source document encoded in HTML:
<PRE>
<HTML>
<TITLE>My home page</TITLE>
<BODY>
<H1>My home page</H1>
<P>Welcome to my home page! Let me tell you about my favorite
composers:
<UL>
<LI> Elvis Costello
<LI> Johannes Brahms
<LI> Georges Brassens
</UL>
</BODY>
</HTML>
</PRE>
<P>This results in the following tree:</P>
<P><IMG src="images/doctree.gif" alt="Sample document tree"></p>
<P>According to the definition of HTML, HEAD elements will be inferred
during parsing and become part of the document tree even if the HEAD
tags are not in the document source. Similarly, the parser knows where
the P and LIs end, even though there are no </P> and </LI> tags
in the source.
</div>
<h2><a name="conformance">Conformance</a></h2>
<P>This section defines <span class="index-def"
title="conformance">conformance</span> with the CSS2
specification only. There may be other levels of CSS in the future
that may require a user agent to implement a different set of features
in order to conform.
<P>In general, the following points must be observed by a user agent
claiming conformance to this specification:</P>
<ol>
<li>It must support one or more of the
CSS2 <a href="media.html">media types</a>.
<li>For each source document, it must retrieve all
associated style sheets that are appropriate for the supported media
types. If it cannot retrieve all associated style sheets (for instance,
because of network errors), it must display the document using those
it can retrieve.
<li>It must parse the style sheets according to this specification.
In particular, it must recognize all at-rules, blocks, declarations,
and selectors (see the <a href="grammar.html">grammar of CSS2</a>).
If a user agent encounters a property that applies for a supported
media type, the user agent must parse the value according to the property
definition. This means that the user agent must accept all valid
values and must
<span class="index-inst" title="skip">skip</span> declarations with
invalid values. User
agents must <span class="index-inst" title="skip">skip</span>
rules that apply to unsupported <a href="media.html">media
types</a>.
<!-- Define "accept"? Include statement that conforming user
agents may only allow one value for certain properties (for
backwards compatibility, see CSS1 for list of these properties),
i.e., the default style sheet value -IJ -->
<li>Given a <a href="#doctree">document tree</a>, it must
assign a value for every supported property according to
the rules of <a href="cascade.html">cascading and inheritance</a>.
<li>If the source document comes with alternate style sheets (such as
with the "alternate" keyword in HTML 4.0 [[-HTML40]]), the UA must
allow the user to select one from among these style sheets and apply
the selected one.
</ol>
<P>Not every user agent must observe every point, however:</p>
<ul>
<li>A user agent that <em>inputs</em> style sheets must
respect points 1 - 3.
<li>An authoring tool is only required to output <a
href="#valid-style-sheet">valid style sheets</a>
<li>A user agent that <em>renders</em> a document with associated style
sheets must respect points 1 - 5 and render the document
according to the media-specific requirements set forth in this
specification. <a href="cascade.html#actual-value">Values</a>
may be approximated when required by the user agent.
</ul>
<P>The inability of a user agent to implement part of this
specification due to the limitations of a particular device (e.g., a
user agent cannot render colors on a monochrome monitor or page) does
not imply non-conformance. </P>
<p>This specification recommends that a user agent allow the user to
specify user style sheets.
<!-- Does the above sentence mean "as style sheets", or can
the functionality be applied through the UA? -IJ -->
<h2>Error conditions</h2>
<P>In general, this document does not specify error handling behavior
for user agents (e.g., how they behave when they cannot find
a resource designated by a URI).
<P>However, user agents must observe the <a
href="syndata.html#parsing-errors">rules for handling parsing errors</a>.
<P>Since user agents may vary in how they handle error conditions,
authors and users must not rely on specific error recovery behavior.
<H2><span class="index-def" title="text/css"><a
name="text-css">The text/css content type</a></span></H2>
<p>CSS style sheets that exist in separate files are sent over the
Internet as a sequence of bytes accompanied by encoding information
(see [[HTML40]], chapter 5). The structure of the transmission,
termed a <span class="index-def" title="message entity"><a
name="message-entity"><strong>message entity,</strong></a></span> is
defined by RFC 2045 and RFC 2068 (see [[RFC2045]] and [[RFC2068]]). A
message entity with a content type of "text/css" represents an
independent CSS document.
<!--
<P>The text/css content type is defined in RFC ??? (see [[RFCCSS]]).
To be completed by an RFC -IJ -->
</BODY>
</html>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-declaration:"~/SGML/HTML4.decl"
sgml-default-doctype-name:"html"
sgml-minimize-attributes:t
sgml-nofill-elements:("pre" "style" "br")
sgml-live-element-indicator:t
End:
-->