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 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<HEAD>
<TITLE>Conformance: requirements and recommendations</TITLE>
<link rel="stylesheet" href="style/default.css" type="text/css">
<link rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/W3C-CR.css" type="text/css">
<link rel="prev" href="intro.html">
<link rel="next" href="syndata.html">
<link rel="contents" href="cover.html#minitoc">
<link rel="CSS-properties" href="propidx.html" title="properties">
<link rel="index" href="indexlist.html" title="index">
<link rel="first" href="cover.html">
</HEAD>
<BODY>
<div class="navbar">
<p><a href="intro.html">previous</a>
<a href="syndata.html">next</a>
<a href="cover.html#minitoc">contents</a>
<a href="propidx.html">properties</a>
<a href="indexlist.html">index</a>
</div>
<hr class="navbar">
<H1><a name="q0">3 Conformance: Requirements and Recommendations</a></H1>
<div class="subtoc">
<p><strong>Contents</strong>
<ul class="toc">
<li class="tocline2"><a href="conform.html#defs" class="tocxref">3.1 Definitions</a>
<li class="tocline2"><a href="conform.html#conformance" class="tocxref">3.2 UA Conformance</a>
<li class="tocline2"><a href="conform.html#errors" class="tocxref">3.3 Error conditions</a>
<li class="tocline2"><a href="conform.html#text-css" class="tocxref">3.4 <span class="index-def" title="text/css">The text/css content type</span></a>
</ul>
</div>
<H2>3.1 <a name="defs">Definitions</a></H2>
<P>The key words <a name="x0"><span class="index-def" title="MUST">"MUST"</span></a>,
<a name="x1"><span class="index-def" title="MUST NOT">"MUST NOT"</span></a>, <a name="x2"><span
class="index-def" title="REQUIRED">"REQUIRED"</span></a>, <a name="x3"><span
class="index-def" title="SHALL">"SHALL"</span></a>, <a name="x4"><span
class="index-def" title="SHALL NOT">"SHALL NOT"</span></a>, <a name="x5"><span
class="index-def" title="SHOULD">"SHOULD"</span></a>, <a name="x6"><span
class="index-def" title="SHOULD NOT">"SHOULD NOT"</span></a>, <a name="x7"><span
class="index-def" title="RECOMMENDED">"RECOMMENDED"</span></a>, <a name="x8"><span
class="index-def" title="MAY">"MAY"</span></a>, and <a name="x9"><span
class="index-def" title="OPTIONAL">"OPTIONAL"</span></a> in this document
are to be interpreted as described in RFC 2119 (see <a href="refs.html#ref-RFC2119" rel="biblioentry" class="noxref"><span class="normref">[RFC2119]</span></a>).
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>
<P>The fact that a feature is marked as deprecated (namely the <a
href="aural.html#aural-media-group">'aural'</a> keyword) or going to
be deprecated in CSS3 (namely the <a
href="ui.html#system-colors">system colors</a>) also has no influence
on conformance. (For example, 'aural' is marked as non-normative, so
UAs do not need to support it; the system colors are normative, so UAs
must support them.)
<p>All sections of this specification, including appendices, are
normative unless otherwise noted.
<p><a href="about.html#notes-and-examples">Examples and notes</a>
are not normative.
<div class=example><P style="display:none">Example(s):</P><p>Examples usually have the word "example" near
their start ("Example:", "The following example…," "For
example," etc.) and are shown in the color maroon, like this
paragraph.</p></div>
<div class=note><p>Notes start with the word "Note," are indented and
shown in green, like this paragraph.</p></div>
<p>Figures are for illustration only, they are not reference
renderings, unless explicitly stated.
<dl>
<dt><strong><span class="index-def" title="style
sheet"><a name="style-sheet">Style sheet</a></span></strong>
<dd>A set of statements that specify presentation of a document.
<P>Style sheets may have three different origins: <a
href="conform.html#author">author</a>, <a href="conform.html#user">user</a>, and <a
href="conform.html#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><span class="index-def" title="valid style
sheet|validity"><a name="valid-style-sheet">Valid style
sheet</a></span></strong>
<dd>The validity of a style sheet depends on the level of CSS
used for the style sheet. All valid CSS1 style sheets are valid CSS 2.1
style sheets, but some changes from CSS1 mean that
a few CSS1 style sheets will have slightly different semantics in
CSS 2.1. Some features in CSS2 are not part of CSS 2.1, so not all CSS2
style sheets are valid CSS 2.1 style sheets.
<P>A valid CSS 2.1 style sheet must be written according to the <a
href="grammar.html">grammar of CSS 2.1</a>. Furthermore, it must contain
only at-rules, property names, and property values defined in this
specification.
An <span
class="index-def"><strong><a
name="illegal">illegal</a></strong></span> (invalid) at-rule,
property name, or property value is one that is not valid.
<dt><strong><span class="index-def" title="source
document"><a name="source-document">Source
document</a></span></strong>
<dd>The document to which one or more style sheets apply. This is
encoded in some language that represents the document as a tree of <a
href="conform.html#element">elements</a>. Each element consists of a name that
identifies the type of element, optionally a number of <a
href="conform.html#attribute">attributes</a>, and a (possibly empty) <a
href="conform.html#content">content</a>. For example, the source document could be
an XML or SGML instance.</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, XHTML or
SVG). CSS is used to describe the presentation of document languages
and CSS does not change the underlying semantics of the document
languages.
<dt><strong><span class="index-def" title="element"><a
name="element">Element</a></span></strong>
<dd>(An SGML term, see <a href="refs.html#ref-ISO8879" rel="biblioentry" class="noxref"><span class="normref">[ISO8879]</span></a>.) 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 in HTML) to specify
how the elements should be rendered.
<dt><strong><span class="index-def" title="replaced element">
<a name="replaced-element">Replaced
element</a></span></strong>
<dd><p>An element whose content is outside the scope of the CSS
formatting model, such as an image, embedded document, or applet. For
example, the content of the HTML IMG element is often replaced by the
image that its "src" attribute designates. Replaced elements often
have intrinsic dimensions: an intrinsic width, an intrinsic height,
and an intrinsic ratio. For example, a bitmap image has an intrinsic
width and an intrinsic height specified in absolute units (from which
the intrinsic ratio can obviously be determined). On the other hand,
other documents may not have any intrinsic dimensions (for example a
blank HTML document).
<p>User agents may consider a replaced element to not have any
intrinsic dimensions if it is believed that those dimensions could
leak sensitive information to a third party. For example, if an HTML
document changed intrinsic size depending on the user's bank balance,
then the UA might want to act as if that resource had no intrinsic
dimensions.
<dt><strong><span class="index-def" title="intrinsic
dimensions"><a name="intrinsic">Intrinsic dimensions</a></span></strong>
<dd>The width and height as defined by the element itself, not imposed
by the surroundings. CSS does not define how the intrinsic dimensions
are found. In CSS 2.1 only replaced elements can come with
intrinsic dimensions.
For raster images without reliable resolution information, a size of
1 px unit per image source pixel must be assumed.
<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.
Some elements have no content, in which case they are
called <strong><span class="index-def"
title="empty"><a name="empty">empty</a></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"><a name="parent">parent</a></span></strong> of those
sub-elements.
<dt><strong><span class="index-def"
title="ignore"><a name="ignore">Ignore</a></span></strong>
<dd>This term has two slightly different meanings in this
specification. First, a CSS parser must follow certain rules when it
discovers unknown or illegal syntax in a style sheet. The parser must
then ignore certain parts of the style sheets. The exact rules for
what parts must be ignored is given in these section: <a
href="syndata.html#declaration">Declarations and properties</a>, <a
href="syndata.html#parsing-errors">Rules for handling parsing
errors</a>, <a href="syndata.html#unsupported-values">Unsupported
Values</a>, or may be explained in the text where the term "ignore"
appears. Second, a user agent may (and, in some cases must) disregard
certain properties or values in the style sheet even if the syntax is
legal. For example, table-column elements can't affect the font of the
column, so the font properties must be ignored.
<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. How a
replaced element's content is rendered is not defined by this
specification. Rendered content may also be
alternate text for an element (e.g., the value of the XHTML "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"><a name="child">Child</a></span></strong>
<dd>An element A is called the child of element B if and only if B is
the parent of A.
<dt><strong><span class="index-def"
title="descendant"><a name="descendant">Descendant</a></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"><a name="ancestor">Ancestor</a></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"><a name="sibling">Sibling</a></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 A 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"><a name="following">Following
element</a></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><strong><span
class="index-def"><a name="author">Author</a></span></strong>
<dd>An author is a person who writes documents and associated style
sheets.
An <strong><span class="index-def"><a name="authoring">authoring
tool</a></span></strong> is a <a href="conform.html#user-agent">User Agent</a>
that generates style sheets.</dd>
<dt><strong><span
class="index-def"><a name="user">User</a></span></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><span class="index-def"><a name="user-agent">User agent
(UA)</a></span></strong>
<dd>A <span class="index-def" title="user agent|UA"><a name="ua">user
agent</a></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>
<DD>An HTML user agent is one that supports the HTML 2.x, HTML 3.x, or
HTML 4.x specifications. A user agent that supports XHTML <a href="refs.html#ref-XHTML" rel="biblioentry" class="noxref"><span class="informref">[XHTML]</span></a>,
but not HTML (as listed in the previous sentence) is not considered an
HTML user agent for the purpose of conformance with this
specification.
<dt><strong><span
class="index-def"><a name="property">Property</a></span></strong>
<dd>CSS defines a finite set of parameters, called properties, that
direct the rendering of a document. Each property has a name (e.g.,
'color', 'font' or border') and a value (e.g., 'red', '12pt Times' or
'dotted'). Properties are attached to various parts of the document
and to the page on which the document is to be displayed by the
mechanisms of specificity, cascading and inheritance (see the chapter
on <a href="cascade.html">Assigning property values, Cascading, and
Inheritance</a>).
</dl>
<div class="html-example">
<p>Here is an example of a source document written in HTML:
<PRE>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<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>
<div class="figure">
<P><IMG src="images/doctree.png" alt="Sample document tree"><SPAN class="dlink"> <A name="img-doctree" href="images/longdesc/doctree-desc.html" title="Long description for sample document tree diagram">[D]</A></SPAN></p>
</div>
<P>According to the definition of HTML 4, 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 LI elements end, even though there are no
</p> and </li> tags in the source.
<P>Documents written in XHTML (and other XML-based languages) behave
differently: there are no inferred elements and all elements must have
end tags.
</div>
<h2>3.2 <a name="conformance">UA Conformance</a></h2>
<P>This section defines <span class="index-def"
title="conformance"><a name="conformance-term">conformance</a></span> with
the CSS 2.1
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 recognize one or more of the CSS 2.1 <a href="media.html">media types</a>.
<li>For each source document, it must attempt to retrieve all
associated style sheets that are appropriate for the recognized 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 CSS 2.1</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
<a name="x44"><span class="index-inst" title="ignore">ignore</span></a> declarations with
invalid values. User
agents must <a name="x45"><span class="index-inst" title="ignore">ignore</span></a>
rules that apply to unsupported <a href="media.html">media
types</a>.
<li>For each element in a <a href="conform.html#doctree">document tree</a>, it
must assign a value for every property according to the
property's definition and the rules of <a
href="cascade.html">cascading and inheritance</a>.
<li>If the source document comes with alternate style sheet sets (such as
with the "alternate" keyword in HTML 4 <a href="refs.html#ref-HTML4" rel="biblioentry" class="noxref"><span class="informref">[HTML4]</span></a>), the UA must
allow the user to select which style sheet set the UA should apply.
<li>The UA must allow the user to turn off the influence of author style sheets.
</ol>
<P>Not every user agent must observe every point, however:</p>
<ul>
<li>An application that reads style sheets without rendering any
content (e.g., a CSS 2.1 validator) must respect points 1-3.
<li>An authoring tool is only required to output <a
href="conform.html#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-6 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>UAs must allow users to specify a file that contains the user style
sheet. UAs that run on devices without any means of writing or
specifying files are exempted from this requirement. Additionally, UAs
may offer other means to specify user preferences, for example through
a GUI.
<p>CSS 2.1 does not define which properties apply to form controls and
frames, or how CSS can be used to style them. User agents may apply CSS
properties to these elements. Authors are recommended to treat such
support as experimental. A future level of CSS may specify this further.
<h2>3.3 <a name="errors">Error conditions</a></h2>
<p>In general, this document specifies error handling behavior
throughout the specification. For example, see the <a
href="syndata.html#parsing-errors">rules for handling parsing errors</a>.
<h2>3.4 <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. 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 2616 (see
<a href="refs.html#ref-RFC2045" rel="biblioentry" class="noxref"><span class="normref">[RFC2045]</span></a> and <a href="refs.html#ref-RFC2616" rel="biblioentry" class="noxref"><span class="normref">[RFC2616]</span></a>). A message entity with a content type of
"text/css" represents an independent CSS document. The "text/css"
content type has been registered by RFC 2318 (<a href="refs.html#ref-2318" rel="biblioentry" class="noxref"><span class="normref">[RFC2318]</span></a>).
<hr class="navbar">
<div class="navbar">
<p><a href="intro.html">previous</a>
<a href="syndata.html">next</a>
<a href="cover.html#minitoc">contents</a>
<a href="propidx.html">properties</a>
<a href="indexlist.html">index</a>
</div>
</BODY>
</html>
|