Skip to content

Commit d4b19ff

Browse files
committed
Merge pull request #177 from zcorpan/fix-166
Fix #166
2 parents 1f44f07 + 8013717 commit d4b19ff

File tree

2 files changed

+213
-180
lines changed

2 files changed

+213
-180
lines changed

index.bs

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,23 @@ Parsing a <code>srcset</code> Attribute</h4>
657657
<a>Collect a sequence of characters</a> that are not
658658
<a>space characters</a>, and let that be <var>url</var>.
659659

660+
<li>
661+
Let <var>descriptors</var> be the empty string.
662+
660663
<li>
661664
If <var>url</var> ends with a U+002C COMMA character
662-
(,), remove that character from <var>url</var> and let
663-
<var>descriptors</var> be the empty string. Otherwise,
665+
(,), follow these substeps:
666+
667+
<ol>
668+
<li>
669+
Remove all trailing U+002C COMMA characters from <var>url</var>.
670+
671+
<li>
672+
If <var>url</var> is empty, then jump to
673+
the step labeled <i title>splitting loop</i>.
674+
</ol>
675+
676+
Otherwise,
664677
follow these substeps:
665678

666679
<ol>
@@ -670,10 +683,26 @@ Parsing a <code>srcset</code> Attribute</h4>
670683
parser</i>.
671684

672685
<li>
686+
<i title>Descriptor collection loop</i>:
673687
<a>Collect a sequence of characters</a>
674688
that are not U+002C COMMA characters
675-
(,), and let that be
676-
<var>descriptors</var>.
689+
(,) or U+0028 LEFT PARENTHESIS ((),
690+
and append the result to <var>descriptors</var>.
691+
692+
<li>
693+
If the character at <var>position</var> is a U+002C COMMA character,
694+
jump to the step labeled <i title>skip comma</i>.
695+
696+
<li>
697+
<a>Collect a sequence of characters</a> that are not
698+
U+0029 RIGHT PARENTHESIS ()) and append the result to <var>descriptors</var>.
699+
700+
<li>
701+
Jump to the step labeled <i title>descriptor collection loop</i>.
702+
703+
<li>
704+
<i title>Skip comma</i>: Advance <var>position</var> to the next character in
705+
<var>input</var>.
677706
</ol>
678707

679708
<li>
@@ -685,11 +714,6 @@ Parsing a <code>srcset</code> Attribute</h4>
685714
<var>input</var>, then jump to the step labeled
686715
<i title>descriptor parser</i>.
687716

688-
<li>
689-
Advance <var>position</var> to the next character in
690-
<var>input</var> (skipping past the U+002C COMMA
691-
character (,) separating this candidate from the next).
692-
693717
<li>
694718
Return to the step labeled <i title>splitting loop</i>.
695719

0 commit comments

Comments
 (0)