Skip to content

Commit 0cc5691

Browse files
committed
[css-shadow-parts-1] use "split on commas" #2412
1 parent b7893dc commit 0cc5691

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

css-shadow-parts-1/Overview.bs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -364,18 +364,19 @@ The rules for parsing a list of part mappings are as follow:
364364

365365
1. Let <var>input</var> be the string being parsed.
366366

367-
1. Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start of the string.
367+
1. <span data-x="split a string on commas">Split the string <var>input</var> on
368+
commas</span>. Let <var>unparsed mappings</var> be the resulting list of strings.
368369

369370
1. Let <var>mappings</var> be an initially empty [=list=] of [=pairs=] of tokens.
370371
This [=list=] will be the result of this algorithm.
371372

372-
1. [=Collect a sequence of code points=] that are space characters, U+002C COMMA.
373-
This skips past any leading delimiters.
374-
375-
1. While <var>position</var> is not past the end of <var>input</var>:
373+
1. For each string <var>unparsed mapping</var> in <var>unparsed mappings</var>,
374+
run the following substeps:
376375

377-
1. [=Collect a sequence of code points=] that are not U+002C COMMA characters,
378-
and let <var>unparsed mapping</var> be the result.
379-
1. Let <var>mapping</var> be the result of parsing <var>unparsed mapping</var> using the <span>rules for parsing part mappings</span>.
380-
1. If <var>mapping</var> is an error, continue.
381-
1. Append <var>mapping</var> to <var>mappings</var>.
376+
1. If <var>unparsed mapping</var> is empty or contains only space characters,
377+
continue to the next iteration of the loop.
378+
1. Let <var>mapping</var> be the result of parsing <var>unparsed mapping</var>
379+
using the <span>rules for parsing part mappings</span>.
380+
1. If <var>mapping</var> is an error then continue to the next iteration of the loop.
381+
This allows clients to skip over new syntax that is not understood.
382+
1. Append <var>mapping</var> to <var>mappings</var>.

0 commit comments

Comments
 (0)