-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathconform.src
More file actions
254 lines (214 loc) · 10.2 KB
/
conform.src
File metadata and controls
254 lines (214 loc) · 10.2 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<!-- $Id: conform.src,v 1.34 1998-01-08 20:13:56 ijacobs Exp $ -->
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>Conformance: requirements and recommendations</TITLE>
<LINK rel="next" href="syndata.html">
<LINK rel="previous" href="intro.html">
<LINK rel="STYLESHEET" href="style/default.css" type="text/css">
</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, documents, users, and user
agents.
<P>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in <a rel="biblioentry"
href="./refs.html#ref-RFC2119" class="normref">[RFC2119]</a>. However, for
readability, these words do not appear in all upper case letters in
this specification.
<P>At times, the authors of this specification recommend 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><dfn><strong>Style sheet</strong></dfn>
<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>.</P>
<dt><dfn><strong><a name="valid-style-sheet">Valid style sheet</a></strong></dfn></dt>
<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.
<P>All style sheets of level N-1 are valid level N style sheets. Thus,
all CSS1 style sheets are valid CSS2 style sheets.
<P>A valid CSS2 style sheet must respect the <a
href="grammar.html">grammar of CSS2</a> and the <a
href="selector.html">selector syntax</a>. Furthermore, it must only
contain at-rules, property names, and property values defined in this
specification.</P>
<dt><dfn><strong>Source document</strong></dfn>
<dd>The document to which one or more style sheets refer.</dd>
<dt><dfn><strong><a name="doclanguage">Document language</a></strong></dfn>
<dd>The computer language of the source
document (e.g., HTML, XML, etc.).
<P>The primary syntactic constructs of the document language are
called <span class="index-def"
title="element"><em>elements,</em></span> (an SGML term, see <a
rel="biblioentry" href="./refs.html#ref-ISO8879"
class="normref">[ISO8879]</a>). Most CSS style sheet rules refer to
these elements and specify rendering information for them. Examples
of elements in HTML include "P" (for structuring paragraphs), "TABLE"
(for creating tables), "OL" (for creating ordered lists), etc.
<P>The <span class="index-def" title="element::content"> <a
name="element-content"><dfn>content</dfn></a></span> of an element is
the content of that element in the source document; not all elements
have content. The <span class="index-def" title="element::rendered
content"> <a name="rendered-content"><dfn>rendered
content</dfn></a></span> of an element is the content actually
rendered. An element's content is generally its rendered content. The
rendered content of a <span class="index-def" title="replaced
element"><a name="replaced-element"><dfn>replaced
element</dfn></a></span> comes from outside the source
document; some replaced element content (e.g., images)
may have "intrinsic dimensions" that affect its
<a href="flowobj.html">layout</a>.
Rendered content may also be <span class="index-def"
title="alternate text"> <a name="alternate-text"><dfn>alternate
text</dfn></a></span> for an element (e.g., the value of the HTML
"alt" attribute).
<dt><dfn><strong><a name="doctree">Document tree</a></strong></dfn></dt>
<dd>User agents transform a document written in the document language
into a <dfn>document tree</dfn> where every element except one has
exactly one <span class="index-def" title="parent">parent</span>
element. (See the SGML (<a href="refs.html#ref-ISO8879"
class="normref">[ISO8879]</a>) and XML (<a href="refs.html#ref-XML"
class="normref">[XML]</a>) specifications for the definition of
parent.) The one exception is the <span class="index-def"
title="root"><dfn>root</dfn></span> element, which has no parent.
<P>An element A is called an <span class="index-def"
title="ancestor"><dfn>ancestor</dfn></span> of an element B, if either
(1) A is the parent B, or (2) A is the parent of some element C that
is an ancestor of B.
<P>An element A is called a <span class="index-def"
title="descendant"><dfn>descendant</dfn></span> of an element B, if
and only if B is an ancestor of A. An element A is called a <span
class="index-def" title="child">child</span> of an element B, if and
only if B is the parent of A.
<P>An element A is called a <span class="index-def"
title="sibling"><dfn>sibling</dfn></span> 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.
<div class="html-example"><P>
For example, the following HTML document:
<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>results in the following tree:</P>
<IMG src="images/doctree.gif" alt="Sample document tree">
<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.
</div>
</dd>
<dt><dfn><strong><a name="author">Author</a></strong></dfn>
<dd>An author is a person or program that
writes or generates style sheets.</dd>
<dt><dfn><strong><a name="user">User</a></strong></dfn>
<dd>A user is a person who interacts with a user agent to view, hear,
or otherwise use a document and its associated style sheets.</dd>
<dt><dfn><strong><a name="user-agent">User agent</a></strong></dfn>
<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 by 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>
<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 user agents
claiming conformance to this specification:</P>
<ol>
<li>It must identify the CSS2 <a href="media.html">media types</a> it
supports.
<li>For each source document, it must retrieve all
associated style sheets that are appropriate for the supported media
types.
<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 legal
values and must
<span class="index-inst" title="skip">skip</span> other 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>.
</ol>
<P>Not every user agent must observe every point, however:
<ul>
<li>A user agent that <em>inputs</em> style sheets must
respect points 1 - 3.
<li>A user agent that <em>outputs</em> style sheets 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 - 4 and render the document
according to the media-specific requirements set forth in this
specification.
</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 also recommends that a user agent offer the following
functionality to the user (these do not refer to any specific
user interface):
<UL>
<LI>Allow the user to specify user style sheets
<LI>Allow the user to turn on or off specific style sheets .
<LI>Approximate style sheet values even if it can't implement
them in strict accordance with this specification.
</UL>
<h2>Error conditions</h2>
<P>In general, this document does not specify error handling behavior
for user agents.
<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.
</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:
-->