These are the errata for CSS level 2 revision 1, CR version of 19 July 2007. These corrections have the status of a draft.
[2009-04-15] The notation “&&” may be used in syntax definitions in future CSS specifications.
[2008-08-19] The first part of the section is not normative.
[2007-11-14] Append For raster
images without reliable resolution information, a size of 1 px
unit per image source pixel must be assumed.
to the
definition of intrinsic dimensions.
[2007-09-27] Remove DELIM?
from
the grammar rule
declaration :DELIM?property S* ':' S* value;
The DELIM was allowed there so that unofficial properties could
start with a dash (-), but the dash was already allowed because of the
definition of IDENT.
[2009-02-02] Change U to
u in token UNICODE-RANGE. (It means the same, but seems to
avoid confusion.)
[2009-02-02] Clarify where comments are allowed:
COMMENT tokens do not occur in the grammar (to keep it readable), but any number of these tokens may appear anywhere
betweenoutside other tokens. (Note, however, that a comment before or within the @charset rule disables the @charset.)
[2008-12-09] Other known vendor prefixes are: -xv-, -ah-, prince-, -webkit-, and -khtml-.
[2007-11-14] In the second bullet, change
to [a-z0-9][a-zA-Z0-9]
; in the
third bullet, change
to
[0-9a-f][0-9a-fA-F]
.
Although the preceding bullet already says that CSS is case-insensitive, the explicit mention of upper and lower case letters helps avoid mistakes.
[2008-03-05] CSS is now case-sensitive, except for certain parts:
All CSS syntax is case-insensitive within the ASCII range (i.e. [a-z] and [A-Z] are equivalent), except for parts that are not under the control of CSS.
[2008-12-02] The pair “*/” ends a comment, even if preceded by a backslash. Change this sentence in the third bullet:
Except within CSS comments, any character (except a hexadecimal digit) can be escaped with a backslash to remove its special meaning.
[2009-04-15] Text added to match the grammar:
[…] any character (except a hexadecimal digit , linefeed, carriage return or form feed) can be escaped […]
[2009-04-15] Clarified that unknown statements are ignored when looking for @import:
CSS 2.1 user agents must ignore any '@import' rule that occurs inside a block or after any
validnon-ignored statement other than an @charset or an @import rule.
[2008-11-26] More precise statement of what is ignored:
When a user agent can't parse the selector (i.e., it is not valid CSS 2.1), it must ignore the selector and the following declaration block (if any) as well.
[2009-04-15] Added error recovery rule for unexpected tokens at the top level:
Malformed statements. User agents must handle unexpected tokens encountered while parsing a statement by reading until the end of the statement, while observing the rules for matching pairs of (), [], {}, "", and '', and correctly handling escapes. For example, a malformed statement may contain an unexpected closing brace or at-keyword. E.g., the following lines are all ignored:
p @here {color: red} /* ruleset with unexpected at-keyword "@here" */ @foo @bar; /* at-rule with unexpected at-keyword "@bar" */ }} {{ - }} /* ruleset with unexpected right brace */ ) [ {} ] p {color: red } /* ruleset with unexpected right parenthesis */
[2008-11-26] Change “or block” as follows:
User agents must ignore an invalid at-keyword together with everything following it, up to and including the next semicolon (;),
or block ({...})the next block ({...}), or the end of the block (}) that contains the invalid at-keyword, whichever comes first.
[2008-08-19] Add recommendation about size of px:
[…] the user agent should rescale pixel values. It is recommended that the pixel unit refer to the whole number of device pixels that best approximates the reference pixel.
[2008-03-05] Insert case-sensitive
in Counters are denoted by case-sensitive
identifiers
.
[2008-04-07] Clarified ~= and |= by using the definitions from the Selectors module.
[2008-11-03] Clarified that [foo~=""] (i.e., with an empty value) will not match anything.
[2007-11-14] Replace
by tag
selectortype selector
.
[2009-04-15] The language code is case-insensitive.
[2008-11-03] Clarified text:
When the :first-letter and :first-line pseudo-elements are
combined withapplied to an element having content generated using :before and :after, they apply to the first letter or line of the element including theinserted textgenerated content.
[2008-08-19] Add “In CSS 2.1” and “See the section on parsing for when user agents must ignore @import rules” to
In CSS 2.1, any @import rules must precede all other rules (except the @charset rule, if present). See the section on parsing for when user agents must ignore @import rules.
[2008-11-26] Define what it means to import a style sheet twice and how the media list is matched. Add at the end:
In the absence of any media types, the import is unconditional. Specifying 'all' for the medium has the same effect. The import only takes effect if the target medium matches the media list.
A target medium matches a media list if one of the items in the media list is the target medium or 'all'.
Note that Media Queries [MEDIAQ] extends the syntax of media lists and the definition of matching.
When the same style sheet is imported or linked to a document in multiple places, user agents must process (or act as though they do) each link as though the link were to a separate style sheet.
[2007-11-22] Spelling error:
prece
.
ndence
[2008-11-26] Define the meaning of a media list:
Find all declarations that apply to the element and property in question, for the target media type. Declarations apply if the associated selector matches the element in question and the target medium matches the media list on all @media rules containing the declaration and on all links on the path through which the style sheet was reached.
[2008-12-02] The rules for parsing unknown statements inside @media blocks were ambiguous. Change the first sentence as follows:
An @media rule specifies the target media types (separated by commas) of a set of
rulesstatements (delimited by curly braces). Invalid statements must be ignored per 4.1.7 "Rule sets, declaration blocks, and selectors" and 4.2 "Rules for handling parsing errors."
Also make it explicit that CSS level 2 (unlike higher levels) has no nested @-rules. Add at the end of the section: “At-rules inside @media are invalid in CSS 2.1.”
[2008-08-18] In bullet 6, sub-bullet 2, the position of the top border edge is determined by assuming the element has a non-zero bottom (not: top) border.
[2009-02-02] Rephrased the rule for adjoining margins so that the 'min-height' and 'max-height' of an element have no influence over whether the element's bottom margin is adjoining to its last child's bottom margin.
[2008-12-02] Not only elements with 'overflow' other than 'visible', but all block formatting contexts avoid collapsing their margins with their children. Change the third bullet as follows:
- Vertical margins of elements
with 'overflow' other than 'visible'that establish new block formatting contexts (such as floats and elements with 'overflow' other than 'visible') do not collapse with their in-flow children.
[2008-12-02] Added missing 'inline-block' in: “Several values of the 'display' property make an element inline: 'inline', 'inline-table', 'inline-block' and 'run-in' (part of the time; see run-in boxes).”
[2008-04-07] Clarified that 'display: none' also applies to non-visual media.
[2008-08-19] Remove true but confusing note (occurs 4×):
Note: For absolutely positioned elements whose containing block is based on a block-level element, this property is an offset from the padding edge of that element.
[2008-08-19] Positioned descendants of a float are in the stacking context of the float's parent. Add “positioned elements and” to
[…] except that any positioned elements and elements that actually create new stacking contexts take part in the float's parent's stacking context.
Same change in Section 9.9 Layered presentation:
[…] except that any positioned elements and any elements that actually create new stacking contexts take part in the parent stacking context.”
[2008-12-02] Remove “'s” that
may be misinterpreted: “the float's parent's stacking
context.”
[2009-02-02] Add an example of negative clearance after the first note.
[2008-11-03] Added:
Boxes with fixed position that are larger than the page box are clipped. Parts of the fixed position box that are not visible in the initial containing block will not print.
[2008-12-02] The list of stacking levels is ambiguous: relatively positioned elements could fall under items 3/4/5 or under item 6. Meant is item 6, so exclude them from 3/4/5 as follows:
- the background and borders of the element forming the stacking context.
- the stacking contexts of descendants with negative stack levels.
- a stacking level containing in-flow non-inline-level non-positioned descendants.
- a stacking level for non-positioned floats and their contents.
- a stacking level for in-flow inline-level non-positioned descendants.
- a stacking level for positioned descendants with 'z-index: auto', and any descendant stacking contexts with 'z-index: 0'.
- the stacking contexts of descendants with positive stack levels.
[2009-02-02] Rephrase first bullet point to make easier to read:
The containing block in which the root element lives is a rectangle with the dimensions of the viewport, anchored at the canvas origin for continuous media, and the page area for paged media. This containing block is called the initial containing block.
The containing block in which the root element lives is a rectangle called the initial containing block. For continuous media, it has the dimensions of the viewport and is anchored at the canvas origin; it is the page area for paged media.
[2009-04-15] The values of 'left' and 'right' are only determined by section 9.4.3 in the case of relatively positioned elements:
For Points 1-6 and 9-10, the values of 'left' and 'right'
used for layoutin the case of relatively positioned elements are determined by the rules in section 9.4.3.
[2009-04-15] The only case in which 'left' or 'right' can be 'auto' is when the element is statically positioned. In that case 'left' and 'right are ignored and there is thus no need to determine a used value:
A computed value of 'auto' for
'left', 'right','margin-left' or 'margin-right' becomes a used value of '0'.
[2007-11-14] Add the following paragraph:
Otherwise, if 'width' has a computed value of 'auto', and the element has an intrinsic width, then that intrinsic width is the used value of 'width'.
just before the paragraph beginning Otherwise, if 'width' has a
computed value of 'auto', but none of the conditions above are met,
[…]
.
[2008-03-05] Change the last paragraph as follows:
If it does,
then a percentage intrinsic width on that element can't be resolved and the element is assumed to have no intrinsic widththen the resulting layout is undefined in CSS2.1.
[2008-03-05] Scrollbar widths are no longer included in the containing block width. Remove scrollbar width from:
'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right'
+ scrollbar width (if any)= width of containing block
and from:
If 'width' is not 'auto' and 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width'
+ scrollbar width (if any)[...]
and remove the paragraph:
The "scrollbar width" value is only relevant if the user agent uses a scrollbar as its scrolling mechanism. See the definition of the 'overflow' property.
[2008-03-05] Scrollbar widths are no longer included in the containing block width. Remove scrollbar width from:
'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right'
+ scrollbar width (if any)= width of containing block
and remove the paragraph:
The "scrollbar width" value is only relevant if the user agent uses a scrollbar as its scrolling mechanism. See the definition of the 'overflow' property.
[2008-03-05] Add the following definition.
[2008-08-19] Add the following note to that definition.
The static-position containing block is the containing block of a hypothetical box that would have been the first box of the element if its specified 'position' property had been 'static' and its 'float' had been 'none'. (Note that due to the rules in section 9.7 this hypothetical calculation might require also assuming a different computed value for 'display'.)
And change which 'direction' property is used as follows (two occurrences):
[...] if the 'direction' property of the element establishing the static-position containing block is [...]
[2008-03-05] Change bullet 2 as follows:
[...] if the 'direction' property of the element establishing the static-position containing block is [...]
[2008-03-05] Clarification. Replace
This situation is similar to the previous one, except that the element has an intrinsic width. The sequence of substitutions is now:
by
In this case, section 10.3.7 applies up through and including the constraint equation, but the rest of section 10.3.7 is replaced by the following rules:
[2008-04-07] Clarified that margins are not calculated as for inline elements.
Under “<percentage>,” add the same note as under “<percentage>,” in section 10.2 (“Content width: the 'width' property”).
[2007-11-14] Add the following paragraph:
Otherwise, if 'height' has a computed value of 'auto', and the element has an intrinsic height, then that intrinsic height is the used value of 'height'.
just before the paragraph beginning Otherwise, if 'height' has a
computed value of 'auto', but none of the conditions above are
met […]
.
[2008-11-26] The static position is determined considering neither float nor clear. Add this:
[…] and its specified 'float' had been 'none' and 'clear' had been 'none'.
[2008-04-07] Clarified that margins are not calculated as for inline elements.
[2007-11-14] In the Note under
'vertical-align', remove slightly
from Values of
this property have
slightly different meanings in the
context of tables.
[2008-03-05] Scrollbar widths are no longer included in the containing block width. Replace
The space taken up by the scrollbars affects the computation of the dimensions in the rendering model.
by
Any space taken up by the scrollbars should be taken out of (subtracted from the dimensions of) the containing block formed by the element with the scrollbars.
[2008-11-03] 'Overflow' on BODY is special
not only in HTML but also in XHTML. Change the sentence
“HTML UAs must instead apply the 'overflow' property from
the BODY element to the viewport, if the value on the HTML element is
'visible'.” to:
When the root element is an HTML "HTML" element or an XHTML "html" element, and that element has an HTML "BODY" element or an XHTML "body" element as a child, user agents must instead apply the 'overflow' property from the first such child element to the viewport, if the value on the root element is 'visible'.
[2008-03-05] Insert (but not a
combination)
in User agents must support separation with
commas, but may also support separation without commas (but not a
combination)
.
[2009-04-15] (And also in section 12.4:) certain keywords, in particular 'none', 'inherit' and 'initial' (the latter being reserved for future use) cannot be used as names for counters.
[2008-03-05] Error in example. Replace hebrew by lower-greek:
BLOCKQUOTE:after { content: " [" counter(bq,hebrewlower-greek) "]" }
[2008-12-01] Change “in” to “with respect to” in
The list properties describe basic visual formatting of lists: they allow style sheets to specify the marker type (image, glyph, or number), and the marker position
inwith respect to the principal box (outside it or within it before content).
because the marker is, as the rest of the sentence itself makes clear, not necessarily in the principal box.
[2008-04-07] The size of list style markers without an intrinsic size is now defined.
[2008-12-01] CSS 2.1 does not specify the position of the list item marker, but does require it to be on the left or right of the content. Also, the marker is not affected by 'overflow', but may influence the height of the principal box. Add to the definition of 'outside':
… but does require that for list items whose 'direction' property is 'ltr' the marker box be on the left side of the content and for elements whose 'direction' property is 'rtl' the marker box be on the right side of the content. 'overflow' on the element does not clip the marker box. The marker box is fixed with respect to the principal block box's border and does not scroll with the principal block box's content. The size or contents of the marker box may affect the height of the principal block box and/or the height of its first line box, and in some cases may cause the creation of a new line box. Note: This interaction may be more precisely defined in a future level of CSS.
[2009-04-015] Meaning of 'none' for 'list-style' was only defined by an example.
[2008-08-19] Add rules for drawing canvas to:
- The page area. The page area includes the boxes laid out on that page. The edges of the first page area establish the rectangle that is the initial containing block of the document. The canvas background is painted within and covers the page area.
- The margin area, which surrounds the page area. The page margin area is transparent.
[2009-02-02]
Remove sections 13.2.1.1 and 13.2.1.2. (The described situations cannot occur in CSS 2.1, because CSS 2.1 doesn't have a 'size' property.)
[2008-11-03] Clarified what locations are inconvenient for printing:
When formatting content in the page model, some content may end up outside the current page box. For example, an element whose 'white-space' property has the value 'pre' may generate a box that is wider than the page box. As another example, when boxes are positioned absolutely or relatively, they may end up in “inconvenient” locations. For example, images may be placed on the edge of the page box or 100,000 meters below the page box.
[2008-04-30] The 'page-break-inside' property no longer inherits.
[2008-12-01] UAs may apply 'page-break-before', 'page-break-after' and 'page-break-inside' to other elements than block-level ones.
[2009-02-02] “Paragraph” is not
a defined term. Change of a paragraph to in a block
element (twice).
[2009-04-15] 'Widows' and 'orphans' only accept positive values.
[2008-04-30] The 'page-break-inside' property of all ancestors is checked for page-breaking restrictions, not just that of the breakpoint's parent.
[2009-02-02] Remove possible confusion:
Rule D: In addition, breaking at (2) is allowed only if the 'page-break-inside' property of the element and all its ancestors is 'auto'.
[2009-02-02] Top margins do not disappear at a page break that is forced by a 'page-break-after' or 'page-break-before'. Correct the first bullet to:
When an unforced page break occurs here, the used values of the relevant 'margin-top' and 'margin-bottom' properties are set to '0'. When a forced page break occurs here, the used value of the relevant 'margin-bottom' property is set to '0'; the relevant 'margin-top' used value may either be set to '0' or retained.
And add the following note:
Note: It is expected that CSS3 will specify that the relevant 'margin-top' applies (i.e., is not set to '0') after a forced page break.
[2009-02-02] Remove the advice to user agents to avoid breaking inside elements with borders, inside tables or inside floating elements; add the advice to avoid breaking inside replaced elements.
[2008-11-03] The 'background' property is special on BODY not only in HTMLÂ but also in XHTML.
[2009-04-15] The whole 'background' property is used for the canvas, not just the color and the image:
For documents whose root element is an HTML "HTML" element or an XHTML "html" element that has computed values of 'transparent' for 'background-color' and 'none' for 'background-image', user agents must instead use the computed value of
thosethe background properties from that element's first HTML "BODY" element or XHTML "body" element child […]
[2008-04-07] The size of background images without an intrinsic size is now defined.
[2008-11-26] Remove incorrect text:
- 'bolder' selects the next weight that is assigned to a font that is darker than the inherited one.
If there is no such weight, it simply results in the next darker numerical value (and the font remains unchanged), unless the inherited value was '900' in which case the resulting weight is also '900'.- 'lighter' is similar, but works in the opposite direction: it selects the next lighter keyword with a different font from the inherited one,
unless there is no such font, in which case it selects the next lighter numerical value (and keeps the font unchanged).
and:
The computed value of "font-weight" is either:
one of the legal number values, orone of the legal number values combined with one or more of the relative values (bolder or lighter). This type of computed values is necessary to use when the font in question does not have all weight variations that are needed.
And instead add this note:
Note: A set of nested elements that mix 'bolder' and 'lighter' will give unpredictable results depending on the UA, OS, and font availability. This behavior will be more precisely defined in CSS3.
[2008-08-19] Remove rules about generated text from:
The following examples show what whitespace behavior is expected from the PRE and P elements, the “nowrap” attribute in HTML,
and in generated content.pre { white-space: pre } p { white-space: normal } td[nowrap] { white-space: nowrap }:before,:after { white-space: pre-line }
[2009-02-02] Collapsing of white space does not remove any line breaking oppportunities. Add the following clarification:
Then, the entire block is rendered. Inlines are laid out, taking bidi reordering into account, and wrapping as specified by the 'white-space' property. When wrapping, line breaking opportunities are determined based on the text prior to the white space collapsing steps above.
[2007-11-14] Spelling error:
boxes
.
s
[2008-10-13] Added new rule after bullet 4:
5. If a child T of a 'table', 'inline-table', 'table-row-group', 'table-header-group', 'table-footer-group', or 'table-row' box is an anonymous inline box that contains only white space, then it is treated as if it has 'display: none'.
[2009-02-02] The anonymous block containing the table and its caption establishes a block formatting context:
The anonymous box is a 'block' box if the table is block-level, and an 'inline-block' box if the table is inline-level
except that this block is never considered as a block for 'run-in' interaction, and thatThe anonymous box establishes a block formatting context. The table box (not the anonymous box) is used when doing baseline vertical alignment for an 'inline-table'.
The diagram now shows the caption's margins inside the anonymous box.
[2008-04-07] Clarification:
The horizontal alignment of a cell's inline content within a cell box
iscan be specifiedwith the 'text-align' propertyby the value of the 'text-align' property on the cell.
[2008-04-07] The size of cursors without an intrinsic size is now defined.
[2007-11-14] Spelling error: change
to ?likÇelik
(2×).
[2008-08-19] Replace
br:before { content: "\A" } :before, :after { white-space: pre-line }
with
br:before { content: "\A"; white-space: pre-line }
[2008-08-19] Add tr to:
td, th, tr { vertical-align: inherit }
[2007-11-14] Replace but any descendants
which actually create a new stacking context
by but any
positioned descendants and descendants which actually
create a new stacking context
.
[2007-09-27] Change the last S
in
the grammar rule for combinator
to
S+
:
combinator : PLUS S* | GREATER S* | S+
and remove the rule
{s}+\/\*[^*]*\*+([^/*][^*]*\*+)*\/ {unput(' '); /*replace by space*/}
in the tokenizer. The resulting language is the same, but the grammar is easier to read and relies less on specific notations of Flex.
[2007-09-27] Changes to remove ambiguity with respect to the S token and avoid nullable non-terminals.
[2007-09-27] Change the tokenizer rule
@{C}{H}{A}{R}{S}{E}{T}{return CHARSET_SYM;}
to
"@charset " {return CHARSET_SYM;}
The @charset must be in lowercase and must have a space after it (as defined in section 4.4 CSS style sheet representation).
[2008-03-05] Change the tokenizer rules
"url("{w}{string}{w}")" {return URI;}"url("{w}{url}{w}")" {return URI;}
to
{U}{R}{L}"("{w}{string}{w}")" {return URI;} {U}{R}{L}"("{w}{url}{w}")" {return URI;}
[2008-04-07] The definition of the macro
“O” is wrong. The letters O
and o can be written with hexadecimal escapes as
“\4f
” and “\6f
”
respectively (not as “\51
” and
“\71
”). The macro should therefore be
O o|\\0{0,4}(4f|6f)(\r\n|[ \t\r\n\f])?|\\o
“The two occurrences of "\377"…”: There is in fact only one occurrence.
Add a TITLE attribute to all links and which is equal to the lemma.
Bert Bos