Skip to content

Commit

Permalink
Merge pull request #178 from zcorpan/fix-176
Browse files Browse the repository at this point in the history
Make the srcset parser aware of 'h' descriptor. Fixes #176
  • Loading branch information
yoavweiss committed May 21, 2014
2 parents d4b19ff + 2ba0001 commit e463f85
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
22 changes: 21 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,10 @@ Parsing a <code>srcset</code> Attribute</h4>
Let <var>density</var> be
<i title>absent</i>.

<li>
Let <var>future-compat-h</var> be
<i title>absent</i>.

<li>
For each token in <var>descriptor
list</var>, run the appropriate set of
Expand Down Expand Up @@ -777,13 +781,29 @@ Parsing a <code>srcset</code> Attribute</h4>
<dd>
<ol>
<li>
If <var>width</var> and <var>density</var> are not both <i title>absent</i>, then
If <var>width</var>, <var>density</var> and <var>future-compat-h</var> are not all <i title>absent</i>, then
let <var>error</var> be <i title>yes</i>.

<li>
Apply the <a>rules for parsing floating-point number values</a> to the token. Let
<var>density</var> be the result.
</ol>

<dt>If the token consists of a <a>valid non-negative integer</a>
followed by a "h" (U+0068 LATIN SMALL LETTER H) character

<dd>
<ol>
<li>
If <var>future-compat-h</var> and <var>density</var> are not both <i title>absent</i>, then
let <var>error</var> be <i title>yes</i>.

<li>
Apply the <a>rules for parsing non-negative integers</a> to the token.
If the result is zero, let <var>error</var> be <i title>yes</i>.
Otherwise, let <var>future-compat-h</var> be the result.
</ol>

</dl>

<li>
Expand Down
22 changes: 21 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,10 @@ <h4 class="heading settled heading" data-level=3.1.3 id=parse-srcset-attr><span
Let <var>density</var> be
<i title="">absent</i>.

<li>
Let <var>future-compat-h</var> be
<i title="">absent</i>.

<li>
For each token in <var>descriptor
list</var>, run the appropriate set of
Expand Down Expand Up @@ -1321,13 +1325,29 @@ <h4 class="heading settled heading" data-level=3.1.3 id=parse-srcset-attr><span
<dd>
<ol>
<li>
If <var>width</var> and <var>density</var> are not both <i title="">absent</i>, then
If <var>width</var>, <var>density</var> and <var>future-compat-h</var> are not all <i title="">absent</i>, then
let <var>error</var> be <i title="">yes</i>.

<li>
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
<var>density</var> be the result.
</ol>

<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>
followed by a "h" (U+0068 LATIN SMALL LETTER H) character

<dd>
<ol>
<li>
If <var>future-compat-h</var> and <var>density</var> are not both <i title="">absent</i>, then
let <var>error</var> be <i title="">yes</i>.

<li>
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.
If the result is zero, let <var>error</var> be <i title="">yes</i>.
Otherwise, let <var>future-compat-h</var> be the result.
</ol>

</dl>

<li>
Expand Down

0 comments on commit e463f85

Please sign in to comment.