Skip to content

Commit 4df4f5d

Browse files
committed
[css-syntax] Wording tweaks.
1 parent 2f036b1 commit 4df4f5d

2 files changed

Lines changed: 50 additions & 48 deletions

File tree

css-syntax/Overview.html

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4465,42 +4465,43 @@ <h2 class="heading settled heading" data-level=9 id=serialization><span class=se
44654465
In particular, the serialization of comments an whitespace is not defined.
44664466

44674467
<p> The only requirement for serialization is that it must "round-trip" with parsing,
4468-
ie. parsing again the serialized output must result in identical tokens or other structures,
4469-
except for consecutive <a class="production css-code" data-link-type=type href=#typedef-whitespace-token title="<whitespace-token>">&lt;whitespace-token&gt;</a>s
4470-
that may be collapsed into a single token.
4468+
that is, parsing the stylesheet must produce the same data structures as
4469+
parsing, serializing, and parsing again,
4470+
except for consecutive <a class="production css-code" data-link-type=type href=#typedef-whitespace-token title="<whitespace-token>">&lt;whitespace-token&gt;</a>s,
4471+
which may be collapsed into a single token.
44714472

44724473
<p class=note> Note: This exception can exist because
44734474
CSS grammars always interpret any amount of whitespace as identical to a single space.
44744475

4475-
<div class=note id=serialization-tables><style scoped>
4476-
#serialization-tables table { margin: 1em 0 }
4477-
#serialization-tables table { border-collapse: collapse }
4478-
#serialization-tables tr:nth-child(even) { background: rgba(0, 0, 0, .1) }
4479-
#serialization-tables th { padding: .2em .5em; line-height: 1.1; font-size: 90% }
4480-
#serialization-tables th, td { text-align: center }
4481-
</style>
4482-
4483-
<a class=self-link href=#serialization-tables></a>
4476+
<div class=note id=serialization-tables><a class=self-link href=#serialization-tables></a>
44844477
Note: In order to satisfy this requirement:
44854478

44864479
<p> <ul>
44874480
<li>
4488-
A <a class="production css-code" data-link-type=type href=#typedef-delim-token title="<delim-token>">&lt;delim-token&gt;</a> containing U+005C REVERSE SOLIDUS (\)
4489-
must be followed when serialized by a <a data-link-type=dfn href=#newline title=newline>newline</a>.
4481+
A <a class="production css-code" data-link-type=type href=#typedef-delim-token title="<delim-token>">&lt;delim-token&gt;</a> containing U+005C REVERSE SOLIDUS (\)\
4482+
must be serialized as U+005C REVERSE SOLIDUS
4483+
followed by a <a data-link-type=dfn href=#newline title=newline>newline</a>.
44904484
(The tokenizer only ever emits such a token followed by a <a class="production css-code" data-link-type=type href=#typedef-whitespace-token title="<whitespace-token>">&lt;whitespace-token&gt;</a>
44914485
that starts with a newline.)
44924486
<li>
4493-
Consecutive pairs of tokens that have a ✓ in either of the two tables below
4494-
must be serialized with a comment in-between.
4495-
If no comment was preserved from tokenization,
4496-
an empty comment <code>/**/</code> should be inserted.
4497-
Rows and columns represent a token and its following token, respectively.
4498-
Single character represent a <a class="production css-code" data-link-type=type href=#typedef-delim-token title="<delim-token>">&lt;delim-token&gt;</a> with that value,
4499-
except for "<code>(</code>" that
4500-
represents a <a href=#tokendef-open-paren>(-token</a>.
4487+
4488+
<p> For any consecutive pair of tokens,
4489+
if the first token shows up in the row headings of either of the following two tables,
4490+
and the second token shows up in the column headings,
4491+
and there’s a ✓ in the cell denoted by the intersection of the chosen row and column,
4492+
the pair of tokens must be serialized with a comment between them.
4493+
4494+
<p> If the tokenizer preserves comments,
4495+
the preserved comment should be used;
4496+
otherwise, an empty comment (<code>/**/</code>) must be inserted.
4497+
(Preserved comments may be reinserted even if the following tables don’t require a comment between two tokens.)
4498+
4499+
<p> Single characters in the row and column headings represent a <a class="production css-code" data-link-type=type href=#typedef-delim-token title="<delim-token>">&lt;delim-token&gt;</a> with that value,
4500+
except for "<code>(</code>",
4501+
which represents a <a href=#tokendef-open-paren>(-token</a>.
45014502
</ul>
45024503

4503-
<table>
4504+
<table class=data>
45044505
<tr>
45054506
<td>
45064507
<th>ident
@@ -4549,7 +4550,7 @@ <h2 class="heading settled heading" data-level=9 id=serialization><span class=se
45494550
<td><td><td><td><td><td><td><td><td><td><td>
45504551
</table>
45514552

4552-
<table>
4553+
<table class=data>
45534554
<tr>
45544555
<td>
45554556
<th>=<th>|<th>*

css-syntax/Overview.src.html

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2969,42 +2969,43 @@ <h2 id="serialization">
29692969
In particular, the serialization of comments an whitespace is not defined.
29702970

29712971
The only requirement for serialization is that it must "round-trip" with parsing,
2972-
ie. parsing again the serialized output must result in identical tokens or other structures,
2973-
except for consecutive <<whitespace-token>>s
2974-
that may be collapsed into a single token.
2972+
that is, parsing the stylesheet must produce the same data structures as
2973+
parsing, serializing, and parsing again,
2974+
except for consecutive <<whitespace-token>>s,
2975+
which may be collapsed into a single token.
29752976

29762977
Note: This exception can exist because
29772978
CSS grammars always interpret any amount of whitespace as identical to a single space.
29782979

2979-
<div class=note id=serialization-tables>
2980+
<div class=note id='serialization-tables'>
29802981
Note: In order to satisfy this requirement:
29812982

29822983
<ul>
29832984
<li>
2984-
A <<delim-token>> containing U+005C REVERSE SOLIDUS (\)
2985-
must be followed when serialized by a <a>newline</a>.
2985+
A <<delim-token>> containing U+005C REVERSE SOLIDUS (\)\
2986+
must be serialized as U+005C REVERSE SOLIDUS
2987+
followed by a <a>newline</a>.
29862988
(The tokenizer only ever emits such a token followed by a <<whitespace-token>>
29872989
that starts with a newline.)
29882990
<li>
2989-
Consecutive pairs of tokens that have a ✓ in either of the two tables below
2990-
must be serialized with a comment in-between.
2991-
If no comment was preserved from tokenization,
2992-
an empty comment <code>/**/</code> should be inserted.
2993-
Rows and columns represent a token and its following token, respectively.
2994-
Single character represent a <<delim-token>> with that value,
2995-
except for "<code>(</code>" that
2996-
represents a <a href=#tokendef-open-paren>(-token</a>.
2997-
</ul>
29982991

2999-
<style>
3000-
#serialization-tables table { margin: 1em 0 }
3001-
#serialization-tables table { border-collapse: collapse }
3002-
#serialization-tables tr:nth-child(even) { background: rgba(0, 0, 0, .1) }
3003-
#serialization-tables th { padding: .2em .5em; line-height: 1.1; font-size: 90% }
3004-
#serialization-tables th, td { text-align: center }
3005-
</style>
2992+
For any consecutive pair of tokens,
2993+
if the first token shows up in the row headings of either of the following two tables,
2994+
and the second token shows up in the column headings,
2995+
and there's a ✓ in the cell denoted by the intersection of the chosen row and column,
2996+
the pair of tokens must be serialized with a comment between them.
2997+
2998+
If the tokenizer preserves comments,
2999+
the preserved comment should be used;
3000+
otherwise, an empty comment (<code>/**/</code>) must be inserted.
3001+
(Preserved comments may be reinserted even if the following tables don't require a comment between two tokens.)
3002+
3003+
Single characters in the row and column headings represent a <<delim-token>> with that value,
3004+
except for "<code>(</code>",
3005+
which represents a <a href=#tokendef-open-paren>(-token</a>.
3006+
</ul>
30063007

3007-
<table>
3008+
<table class='data'>
30083009
<tr>
30093010
<td>
30103011
<th>ident
@@ -3053,7 +3054,7 @@ <h2 id="serialization">
30533054
<td><td><td><td><td><td><td><td><td><td><td>
30543055
</table>
30553056

3056-
<table>
3057+
<table class='data'>
30573058
<tr>
30583059
<td>
30593060
<th>=<th>|<th>*

0 commit comments

Comments
 (0)