Skip to content

Commit 7676c17

Browse files
committed
[css-syntax] \EOF turns into U+FFFD except when inside a string, in which case it just gets dropped.
WG resolution: http://www.w3.org/2013/06/05-css-irc#T08-32-49
1 parent 150870a commit 7676c17

2 files changed

Lines changed: 22 additions & 15 deletions

File tree

css-syntax/Overview.html

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,16 +1821,16 @@ <h4 id=consume-a-string-token><span class=secno>4.3.4. </span> <dfn
18211821

18221822
<dt>U+005C REVERSE SOLIDUS (\)
18231823

1824-
<dd> If the stream <a
1825-
href="#check-if-two-characters-are-a-valid-esca0"><i>starts with a valid
1826-
escape</i></a>, <a href="#consume-an-escaped-character0"><i>consume an
1827-
escaped character</i></a> and append the returned character to the
1828-
〈string〉’s value.
1824+
<dd> If the <a href="#next-input-character"><i>next input
1825+
character</i></a> is EOF, do nothing.
18291826
<p> Otherwise, if the <a href="#next-input-character"><i>next input
18301827
character</i></a> is a newline, consume it.
18311828

1832-
<p> Otherwise, this is a <a href="#parse-errors"><i>parse error</i></a>.
1833-
Create a 〈bad-string〉 and return it.
1829+
<p> Otherwise, if the stream <a
1830+
href="#check-if-two-characters-are-a-valid-esca0"><i>starts with a valid
1831+
escape</i></a>, <a href="#consume-an-escaped-character0"><i>consume an
1832+
escaped character</i></a> and append the returned character to the
1833+
〈string〉’s value.
18341834

18351835
<dt>anything else
18361836

@@ -2021,6 +2021,10 @@ <h4 id=consume-an-escaped-character><span class=secno>4.3.7. </span>
20212021
codepoint</i></a>, return U+FFFD REPLACEMENT CHARACTER (�).
20222022
Otherwise, return the character with that codepoint.
20232023

2024+
<dt>EOF character
2025+
2026+
<dd> Return U+FFFD REPLACEMENT CHARACTER (�).
2027+
20242028
<dt>anything else
20252029

20262030
<dd> Return the <a href="#current-input-character"><i>current input
@@ -2049,7 +2053,7 @@ <h4 id=check-if-two-characters-are-a-valid-esca><span
20492053
false.
20502054

20512055
<p> Otherwise, if the second character is a <a
2052-
href="#newline"><i>newline</i></a> or EOF character, return false.
2056+
href="#newline"><i>newline</i></a>, return false.
20532057

20542058
<p> Otherwise, return true.
20552059

css-syntax/Overview.src.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,9 +1092,8 @@ <h4>
10921092

10931093
<dt>U+005C REVERSE SOLIDUS (\)
10941094
<dd>
1095-
If the stream <i>starts with a valid escape</i>,
1096-
<i>consume an escaped character</i>
1097-
and append the returned character to the 〈string〉’s value.
1095+
If the <i>next input character</i> is EOF,
1096+
do nothing.
10981097

10991098
<p>
11001099
Otherwise,
@@ -1103,8 +1102,9 @@ <h4>
11031102

11041103
<p>
11051104
Otherwise,
1106-
this is a <i>parse error</i>.
1107-
Create a 〈bad-string〉 and return it.
1105+
if the stream <i>starts with a valid escape</i>,
1106+
<i>consume an escaped character</i>
1107+
and append the returned character to the 〈string〉’s value.
11081108

11091109
<dt>anything else
11101110
<dd>
@@ -1312,6 +1312,10 @@ <h4>
13121312
return U+FFFD REPLACEMENT CHARACTER (�).
13131313
Otherwise, return the character with that codepoint.
13141314

1315+
<dt>EOF character
1316+
<dd>
1317+
Return U+FFFD REPLACEMENT CHARACTER (�).
1318+
13151319
<dt>anything else
13161320
<dd>
13171321
Return the <i>current input character</i>.
@@ -1339,8 +1343,7 @@ <h4>
13391343

13401344
<p>
13411345
Otherwise,
1342-
if the second character is a <i>newline</i>
1343-
or EOF character,
1346+
if the second character is a <i>newline</i>,
13441347
return false.
13451348

13461349
<p>

0 commit comments

Comments
 (0)