@@ -657,10 +657,23 @@ Parsing a <code>srcset</code> Attribute</h4>
657
657
<a>Collect a sequence of characters</a> that are not
658
658
<a>space characters</a> , and let that be <var> url</var> .
659
659
660
+ <li>
661
+ Let <var> descriptors</var> be the empty string.
662
+
660
663
<li>
661
664
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,
664
677
follow these substeps:
665
678
666
679
<ol>
@@ -670,10 +683,26 @@ Parsing a <code>srcset</code> Attribute</h4>
670
683
parser</i> .
671
684
672
685
<li>
686
+ <i title> Descriptor collection loop</i> :
673
687
<a>Collect a sequence of characters</a>
674
688
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> .
677
706
</ol>
678
707
679
708
<li>
@@ -685,11 +714,6 @@ Parsing a <code>srcset</code> Attribute</h4>
685
714
<var> input</var> , then jump to the step labeled
686
715
<i title> descriptor parser</i> .
687
716
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
-
693
717
<li>
694
718
Return to the step labeled <i title> splitting loop</i> .
695
719
0 commit comments