Skip to content

Commit cbc20e0

Browse files
committed
[CSS22] Updated for errata s.4.1.1e, about parsing at-rules in declaration lists.
1 parent 5287bf2 commit cbc20e0

1 file changed

Lines changed: 102 additions & 3 deletions

File tree

css2/changes.src

Lines changed: 102 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ changes and most changes to examples are not listed here.</p>
264264
<blockquote>
265265
<p>Boxes in the normal flow belong to a <span class="index-def"
266266
title="formatting context">formatting context</span>, which
267-
<ins>in CSS&nbsp;2.2</ins> may be <ins>table,</ins> block or
267+
<ins>in CSS&nbsp;2</ins> may be <ins>table,</ins> block or
268268
inline<del>, but not both simultaneously</del>. <ins>In future
269269
levels of CSS, other types of formatting context will be
270270
introduced.</ins> <a href="#block-level">Block-level</a> boxes
@@ -766,7 +766,7 @@ term
766766

767767
<p><del>Except for table boxes, which are described in a later
768768
chapter, and replaced elements,</del> <ins>In
769-
CSS&nbsp;2.2,</ins> a block-level box is also a block container
769+
CSS&nbsp;2,</ins> a block-level box is also a block container
770770
box <ins>unless it is a table box or the principal box of a
771771
replaced element</ins>. A <dfn >block container box</dfn> either
772772
contains only block-level boxes or establishes an inline
@@ -898,7 +898,7 @@ term
898898

899899
<p><ins>However, if no boxes are generated for the element whose
900900
background would be used for the background of the canvas, then
901-
the canvas background is transparent. (in CSS&nbsp;2.2, that is the
901+
the canvas background is transparent. (in CSS&nbsp;2, that is the
902902
case when the element or an ancestor has 'display: none'.)</ins>
903903

904904
<p><ins>Note that, if the element has 'visibility: hidden' but
@@ -934,6 +934,105 @@ term
934934
<!-- Status: not edited, waiting for concrete text -->
935935
<!-- https://lists.w3.org/Archives/Public/www-style/2015Jul/0032.html -->
936936

937+
938+
939+
<li id=s.4.1.1e class=change>
940+
<p><span class=updated>[2015-09-05]</span> Malformed declarations
941+
are handled differently when the start of the malformed
942+
declaration conforms to the syntax of an at-rule. In that case,
943+
parsing resumes not at the next semicolon or at the closing curly
944+
brace of the enclosing block, but immediately after that
945+
at-rule. This is expressed by adding the at-rule to the core
946+
syntax for rulesets, as shown below.
947+
948+
<p>In <a href="syndata.html#tokenization" >&ldquo;4.1.1
949+
Tokenization&rdquo;,</a> change the production for ruleset as
950+
follows:
951+
952+
<blockquote>
953+
<pre>
954+
<del>ruleset : selector? '{' S* declaration? [ ';' S* declaration? ]* '}' S*;</del>
955+
<ins>ruleset : selector? '{' S* declaration-list '}' S*;
956+
declaration-list: declaration [ ';' S* declaration-list ]?
957+
| at-rule declaration-list
958+
| /* empty */;</ins></pre>
959+
</blockquote>
960+
961+
<p>In <a href="syndata.html#rule-sets" >&ldquo;4.1.7 Rule sets,
962+
declaration blocks, and selectors&rdquo;,</a> change the second
963+
paragraph as follows:
964+
965+
<blockquote>
966+
<p>A declaration block starts with a left curly brace ({) and
967+
ends with the matching right curly brace (}). In between there
968+
must be a list of zero or more <del>semicolon-separated (;)
969+
declarations</del> <ins>declarations and at-rules. Declarations
970+
must end with a semicolon (;) unless they are last in the
971+
list.</ins>
972+
973+
<p class=note><ins>Note: CSS level&nbsp;2 has no at-rules that
974+
may appear inside rule sets, but such at-rules may be defined in
975+
future levels.</ins>
976+
</blockquote>
977+
978+
<p>In <a href="syndata.html#parsing-errors" >&ldquo;4.2 Rules for
979+
handling parsing errors&rdquo;,</a> change the rule for malformed
980+
declarations as follows:
981+
982+
<blockquote>
983+
<ul>
984+
<li>
985+
<p><strong>Malformed declarations.</strong> User agents must
986+
handle unexpected tokens encountered while parsing a
987+
declaration by reading until the end of the declaration, while
988+
observing the rules for matching pairs of (), [], {}, "", and
989+
'', and correctly handling escapes. For example, a malformed
990+
declaration may be missing a property name, colon (:), or
991+
property value.
992+
993+
<p><ins>When the UA expects the start of a declaration or
994+
at-rule (i.e., an IDENT token or an ATKEYWORD token) but finds
995+
an unexpected token instead, that token is considered to be
996+
the first token of a malformed declaration. I.e., the rule for
997+
malformed declarations, rather than malformed statements is
998+
used to determine which tokens to ignore in that case.</ins>
999+
1000+
<p>The following are all equivalent:
1001+
1002+
<pre class=example>
1003+
<code>p { color:green }
1004+
<ins>p { @foo { bar: baz } color:green } /* unknown at-rule */</ins>
1005+
p { color:green; color } /* malformed declaration missing ':', value */
1006+
p { color:red; color; color:green } /* same with expected recovery */
1007+
p { color:green; color: } /* malformed declaration missing value */
1008+
p { color:red; color:; color:green } /* same with expected recovery */
1009+
p { color:green; color{;color:maroon} } /* unexpected tokens { } */
1010+
p { color:red; color{;color:maroon}; color:green } /* same with recovery */</code></pre>
1011+
</li>
1012+
</ul>
1013+
</blockquote>
1014+
1015+
<p>And, finally, in <a href="page.html#page-box" >&ldquo;13.2 Page
1016+
boxes: the @page rule&rdquo,</a> remove the following text, which
1017+
is now redundant:
1018+
1019+
<blockquote>
1020+
<p><del>The rules for handling malformed declarations, malformed
1021+
statements, and invalid at-rules inside @page are as defined in
1022+
<a href="syndata.html#parsing-errors" >section&nbsp;4.2,</a>
1023+
with the following addition: when the UA expects the start of a
1024+
declaration or at-rule (i.e., an IDENT token or an ATKEYWORD
1025+
token) but finds an unexpected token instead, that token is
1026+
considered to be the first token of a malformed
1027+
declaration. I.e., the rule for malformed declarations, rather
1028+
than malformed statements is used to determine which tokens to
1029+
ignore in that case.</del>
1030+
</blockquote>
1031+
1032+
<!-- Status: edited -->
1033+
<!-- http://lists.w3.org/Archives/Public/www-style/2013May/0783.html -->
1034+
1035+
9371036
</ul>
9381037

9391038
</BODY>

0 commit comments

Comments
 (0)