Skip to content

Commit

Permalink
Make invalid sizes skip to the next source, or ignore the srcset attr…
Browse files Browse the repository at this point in the history
…ibute for img. Fixes ResponsiveImagesCG#113
  • Loading branch information
zcorpan committed Feb 27, 2014
1 parent aab0b33 commit 6ff708c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
18 changes: 14 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -552,14 +552,14 @@
</p>
<h1 class="p-name no-ref" id=title>The picture Element</h1>
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
<span class=dt-updated><span class=value-title title=20140226>26 February 2014</span></span></span></h2>
<span class=dt-updated><span class=value-title title=20140227>27 February 2014</span></span></span></h2>
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://picture.responsiveimages.org>http://picture.responsiveimages.org</a><dt>Editor’s Draft:<dd><a href=http://picture.responsiveimages.org>http://picture.responsiveimages.org</a><dt>Test Suite:<dd>None Yet<dt>Editors:
<dd class="p-author h-card vcard"><a class="p-name fn u-url url" href=http://xanthir.com/contact/>Tab Atkins</a> (<span class="p-org org">Google</span>)<dd class="p-author h-card vcard"><span class="p-name fn">Marcos Cáceres</span> (<span class="p-org org">Mozilla</span>)<dd class="p-author h-card vcard"><a class="p-name fn u-url url" href=http://matmarquis.com/>Mat Marquis</a><dd class="p-author h-card vcard"><a class="p-name fn u-url url" href=http://blog.yoav.ws/>Yoav Weiss</a><dd class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:[email protected]>Simon Pieters</a> (<span class="p-org org">Opera Software</span>)<dt>Version History:<dd><a href=https://github.com/ResponsiveImagesCG/picture-element/commits/gh-pages>Commit History</a><dd><a href=https://twitter.com/respimg_commits>Github commits on Twitter</a><dt>Participate:<dd><a href=http://w3c.responsiveimages.org>Join the Responsive Images Community Group</a><dd><a href=http://list.responsiveimages.org>Public Mailing List</a><dd><a href=irc://irc.w3.org:6665/#respimg>IRC: #respimg on W3C’s IRC</a><dd><a href=https://twitter.com/respimg>Twitter</a><dd><a href=https://github.com/ResponsiveImagesCG/picture-element>Github</a></dl></div>
<div data-fill-with=warning></div>
<p class=copyright data-fill-with=copyright><a href=http://creativecommons.org/publicdomain/zero/1.0/ rel=license><img alt=CC0 src=http://i.creativecommons.org/p/zero/1.0/80x15.png></a>
To the extent possible under law, the editors have waived all copyright
and related or neighboring rights to this work.
In addition, as of 26 February 2014,
In addition, as of 27 February 2014,
the editors have made this specification available under the
<a href=http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0 rel=license>Open Web Foundation Agreement Version 1.0</a>,
which is available at http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
Expand Down Expand Up @@ -894,7 +894,8 @@ <h2 class="heading settled heading" data-level=3 id=the-picture-element><span cl
and optionally either a density descriptor,
or a width descriptor.

<p> A <dfn data-dfn-type=dfn data-export="" id=source-size-list>source size list<a class=self-link href=#source-size-list></a></dfn> is a list of zero or more pairs of a <a data-link-type=dfn href=http://dev.w3.org/csswg/mediaqueries-4/#media-query title="media query">media query</a> and a <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>">&lt;length&gt;</a>,
<p> A <dfn data-dfn-type=dfn data-export="" id=source-size-list>source size list<a class=self-link href=#source-size-list></a></dfn> is either an error or a list of
zero or more pairs of a <a data-link-type=dfn href=http://dev.w3.org/csswg/mediaqueries-4/#media-query title="media query">media query</a> and a <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>">&lt;length&gt;</a>,
and optionally a default <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>">&lt;length&gt;</a>.

<p> The <dfn data-dfn-type=dfn data-noexport="" id=relevant-mutations>relevant mutations<a class=self-link href=#relevant-mutations></a></dfn> for an <a data-link-type=element href=http://www.w3.org/html/wg/drafts/html/CR/embedded-content-0.html#the-img-element title=img>img</a> element are as follows:
Expand Down Expand Up @@ -1081,6 +1082,11 @@ <h4 class="heading settled heading" data-level=3.1.2 id=update-source-sets><span
and let <var>source set</var>’s <a data-link-type=dfn href=#source-size-list title="source size list">source size list</a> be the returned value.
Otherwise,
let <var>source set</var>’s <a data-link-type=dfn href=#source-size-list title="source size list">source size list</a> be an empty <a data-link-type=dfn href=#source-size-list title="source size list">source size list</a>.

<li>
If the <var>source set</var>’s <a data-link-type=dfn href=#source-size-list title="source size list">source size list</a> is an error, let <var>source
set</var> be an empty <a data-link-type=dfn href=#source-set title="source set">source set</a>.

<li>
If <var>child</var> has a <a data-link-for=img data-link-type=element-attr title=src>src</a> attribute and <var>source set</var> does not contain a
<var>source</var> with a <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#resolution-value title="<resolution>">&lt;resolution&gt;</a> value of 1,
Expand Down Expand Up @@ -1124,6 +1130,10 @@ <h4 class="heading settled heading" data-level=3.1.2 id=update-source-sets><span
Otherwise,
let <var>source set</var>’s <a data-link-type=dfn href=#source-size-list title="source size list">source size list</a> be an empty <a data-link-type=dfn href=#source-size-list title="source size list">source size list</a>.

<li>
If the <var>source set</var>’s <a data-link-type=dfn href=#source-size-list title="source size list">source size list</a> is an error, continue
to the next child.

<li>
If <var>child</var> has a <a data-link-for=source data-link-type=element-attr title=type>type</a> attribute,
and its value is an unknown or unsupported MIME type,
Expand Down Expand Up @@ -1347,7 +1357,7 @@ <h4 class="heading settled heading" data-level=3.1.4 id=parse-sizes-attr><span c
<p> The above grammar must be interpreted per the grammar definition in <a data-biblio-type=normative data-link-type=biblio href=#css3val title=css3val>[CSS3VAL]</a>.

<p> If the value does not parse successfully according to the above grammar,
return an empty <a data-link-type=dfn href=#source-size-list title="source size list">source size list</a>.
return an error.

<p> Otherwise,
let <var>source size list</var> initially be an empty <a data-link-type=dfn href=#source-size-list title="source size list">source size list</a>.
Expand Down
14 changes: 12 additions & 2 deletions index.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ <h2 id='the-picture-element'>
and optionally either a density descriptor,
or a width descriptor.

A <dfn export>source size list</dfn> is a list of zero or more pairs of a <a>media query</a> and a <<length>>,
A <dfn export>source size list</dfn> is either an error or a list of
zero or more pairs of a <a>media query</a> and a <<length>>,
and optionally a default <<length>>.

The <dfn>relevant mutations</dfn> for an <a element>img</a> element are as follows:
Expand Down Expand Up @@ -529,6 +530,11 @@ <h4 id='update-source-sets'>
and let <var>source set</var>’s <a>source size list</a> be the returned value.
Otherwise,
let <var>source set</var>’s <a>source size list</a> be an empty <a>source size list</a>.

<li>
If the <var>source set</var>’s <a>source size list</a> is an error, let <var>source
set</var> be an empty <a>source set</a>.

<li>
If <var>child</var> has a <a element-attr for="img">src</a> attribute and <var>source set</var> does not contain a
<var>source</var> with a <<resolution>> value of 1,
Expand Down Expand Up @@ -572,6 +578,10 @@ <h4 id='update-source-sets'>
Otherwise,
let <var>source set</var>’s <a>source size list</a> be an empty <a>source size list</a>.

<li>
If the <var>source set</var>’s <a>source size list</a> is an error, continue
to the next child.

<li>
If <var>child</var> has a <a element-attr for="source">type</a> attribute,
and its value is an unknown or unsupported MIME type,
Expand Down Expand Up @@ -797,7 +807,7 @@ <h4 id='parse-sizes-attr'>
The above grammar must be interpreted per the grammar definition in [[!CSS3VAL]].

If the value does not parse successfully according to the above grammar,
return an empty <a>source size list</a>.
return an error.

Otherwise,
let <var>source size list</var> initially be an empty <a>source size list</a>.
Expand Down

0 comments on commit 6ff708c

Please sign in to comment.