Skip to content

Commit

Permalink
Make the srcset parser aware of 'h' descriptor. Fixes #176
Browse files Browse the repository at this point in the history
  • Loading branch information
zcorpan committed May 21, 2014
1 parent 1f44f07 commit 2ba0001
Show file tree
Hide file tree
Showing 2 changed files with 189 additions and 164 deletions.
22 changes: 21 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,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 @@ -753,13 +757,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
Loading

0 comments on commit 2ba0001

Please sign in to comment.