Skip to content

Commit e463f85

Browse files
committed
Merge pull request #178 from zcorpan/fix-176
Make the srcset parser aware of 'h' descriptor. Fixes #176
2 parents d4b19ff + 2ba0001 commit e463f85

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

index.bs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,10 @@ Parsing a <code>srcset</code> Attribute</h4>
748748
Let <var>density</var> be
749749
<i title>absent</i>.
750750

751+
<li>
752+
Let <var>future-compat-h</var> be
753+
<i title>absent</i>.
754+
751755
<li>
752756
For each token in <var>descriptor
753757
list</var>, run the appropriate set of
@@ -777,13 +781,29 @@ Parsing a <code>srcset</code> Attribute</h4>
777781
<dd>
778782
<ol>
779783
<li>
780-
If <var>width</var> and <var>density</var> are not both <i title>absent</i>, then
784+
If <var>width</var>, <var>density</var> and <var>future-compat-h</var> are not all <i title>absent</i>, then
781785
let <var>error</var> be <i title>yes</i>.
782786

783787
<li>
784788
Apply the <a>rules for parsing floating-point number values</a> to the token. Let
785789
<var>density</var> be the result.
786790
</ol>
791+
792+
<dt>If the token consists of a <a>valid non-negative integer</a>
793+
followed by a "h" (U+0068 LATIN SMALL LETTER H) character
794+
795+
<dd>
796+
<ol>
797+
<li>
798+
If <var>future-compat-h</var> and <var>density</var> are not both <i title>absent</i>, then
799+
let <var>error</var> be <i title>yes</i>.
800+
801+
<li>
802+
Apply the <a>rules for parsing non-negative integers</a> to the token.
803+
If the result is zero, let <var>error</var> be <i title>yes</i>.
804+
Otherwise, let <var>future-compat-h</var> be the result.
805+
</ol>
806+
787807
</dl>
788808

789809
<li>

index.html

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,10 @@ <h4 class="heading settled heading" data-level=3.1.3 id=parse-srcset-attr><span
12921292
Let <var>density</var> be
12931293
<i title="">absent</i>.
12941294

1295+
<li>
1296+
Let <var>future-compat-h</var> be
1297+
<i title="">absent</i>.
1298+
12951299
<li>
12961300
For each token in <var>descriptor
12971301
list</var>, run the appropriate set of
@@ -1321,13 +1325,29 @@ <h4 class="heading settled heading" data-level=3.1.3 id=parse-srcset-attr><span
13211325
<dd>
13221326
<ol>
13231327
<li>
1324-
If <var>width</var> and <var>density</var> are not both <i title="">absent</i>, then
1328+
If <var>width</var>, <var>density</var> and <var>future-compat-h</var> are not all <i title="">absent</i>, then
13251329
let <var>error</var> be <i title="">yes</i>.
13261330

13271331
<li>
13281332
Apply the <a data-link-type=dfn href=#dfn-rules-for-parsing-floating-point-number-values title="rules for parsing floating-point number values">rules for parsing floating-point number values</a> to the token. Let
13291333
<var>density</var> be the result.
13301334
</ol>
1335+
1336+
<dt>If the token consists of a <a data-link-type=dfn href=#dfn-valid-non-negative-integer title="valid non-negative integer">valid non-negative integer</a>
1337+
followed by a "h" (U+0068 LATIN SMALL LETTER H) character
1338+
1339+
<dd>
1340+
<ol>
1341+
<li>
1342+
If <var>future-compat-h</var> and <var>density</var> are not both <i title="">absent</i>, then
1343+
let <var>error</var> be <i title="">yes</i>.
1344+
1345+
<li>
1346+
Apply the <a data-link-type=dfn href=#dfn-rules-for-parsing-non-negative-integers title="rules for parsing non-negative integers">rules for parsing non-negative integers</a> to the token.
1347+
If the result is zero, let <var>error</var> be <i title="">yes</i>.
1348+
Otherwise, let <var>future-compat-h</var> be the result.
1349+
</ol>
1350+
13311351
</dl>
13321352

13331353
<li>

0 commit comments

Comments
 (0)