Skip to content

Commit

Permalink
Merge pull request ResponsiveImagesCG#141 from zcorpan/tweak-authorin…
Browse files Browse the repository at this point in the history
…g-reqs-sizes

Tighten up the allowed syntax for sizes. Allow the attribute to be omitt...
  • Loading branch information
yoavweiss committed Apr 9, 2014
2 parents 8666af6 + ebbe3d9 commit cb05464
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
13 changes: 8 additions & 5 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -817,9 +817,12 @@ Parsing a <code>srcset</code> Attribute</h4>

If the <a element>source</a> or <a element>img</a> element has a
sizes attribute present, all <a>image candidate strings</a> for that
element must have the <i title>width descriptor</i> specified. If the
sizes attribute is not present, all <a>image candidate strings</a> for
that element must not have the <i title>width descriptor</i> specified.
element must have the <i title>width descriptor</i> specified.

If an <a>image candidate string</a> for an <a element>source</a> or <a element>img</a> element
has the <i title>width descriptor</i> specified,
all other <a>image candidate strings</a> for that element
must also have the <i title>width descriptor</i> specified.

<h4 id='parse-sizes-attr'>
Parsing a <code>sizes</code> Attribute</h4>
Expand Down Expand Up @@ -890,8 +893,8 @@ Parsing a <code>sizes</code> Attribute</h4>
A <dfn export>valid source size list</dfn> is a string that matches the following grammar: [[!CSS3VAL]]

<pre>
<dfn>&lt;source-size-list></dfn> = <<source-size>>#?
<dfn>&lt;source-size></dfn> = <<media-condition>>? <<source-size-value>>
<dfn>&lt;source-size-list></dfn> = <<source-size>>#+ [ , <<source-size-value>> ]? | <<source-size-value>>
<dfn>&lt;source-size></dfn> = <<media-condition>> <<source-size-value>>
<dfn>&lt;source-size-value></dfn> = <<length>> | <<percentage>>
</pre>

Expand Down
17 changes: 10 additions & 7 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=20140408>8 April 2014</span></span></span></h2>
<span class=dt-updated><span class=value-title title=20140409>9 April 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 8 April 2014,
In addition, as of 9 April 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 @@ -1366,9 +1366,12 @@ <h4 class="heading settled heading" data-level=3.1.3 id=parse-srcset-attr><span

<p> If the <a data-link-type=element href=http://www.w3.org/html/wg/drafts/html/CR/embedded-content-0.html#the-source-element title=source>source</a> or <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 has a
sizes attribute present, all <a data-link-type=dfn href=#image-candidate-string title="image candidate strings">image candidate strings</a> for that
element must have the <i title="">width descriptor</i> specified. If the
sizes attribute is not present, all <a data-link-type=dfn href=#image-candidate-string title="image candidate strings">image candidate strings</a> for
that element must not have the <i title="">width descriptor</i> specified.
element must have the <i title="">width descriptor</i> specified.

<p> If an <a data-link-type=dfn href=#image-candidate-string title="image candidate string">image candidate string</a> for an <a data-link-type=element href=http://www.w3.org/html/wg/drafts/html/CR/embedded-content-0.html#the-source-element title=source>source</a> or <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
has the <i title="">width descriptor</i> specified,
all other <a data-link-type=dfn href=#image-candidate-string title="image candidate strings">image candidate strings</a> for that element
must also have the <i title="">width descriptor</i> specified.

<h4 class="heading settled heading" data-level=3.1.4 id=parse-sizes-attr><span class=secno>3.1.4 </span><span class=content>
Parsing a <code>sizes</code> Attribute</span><a class=self-link href=#parse-sizes-attr></a></h4>
Expand Down Expand Up @@ -1438,8 +1441,8 @@ <h4 class="heading settled heading" data-level=3.1.4 id=parse-sizes-attr><span c

<p> A <dfn data-dfn-type=dfn data-export="" id=valid-source-size-list>valid source size list<a class=self-link href=#valid-source-size-list></a></dfn> is a string that matches the following grammar: <a data-biblio-type=normative data-link-type=biblio href=#css3val title=css3val>[CSS3VAL]</a>

<pre> <dfn class=css-code data-dfn-type=type data-export="" id=typedef-source-size-list>&lt;source-size-list&gt;<a class=self-link href=#typedef-source-size-list></a></dfn> = <a class="production css-code" data-link-type=type href=#typedef-source-size title="<source-size>">&lt;source-size&gt;</a>#?
<dfn class=css-code data-dfn-type=type data-export="" id=typedef-source-size>&lt;source-size&gt;<a class=self-link href=#typedef-source-size></a></dfn> = <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/mediaqueries-4/#typedef-media-condition title="<media-condition>">&lt;media-condition&gt;</a>? <a class="production css-code" data-link-type=type href=#typedef-source-size-value title="<source-size-value>">&lt;source-size-value&gt;</a>
<pre> <dfn class=css-code data-dfn-type=type data-export="" id=typedef-source-size-list>&lt;source-size-list&gt;<a class=self-link href=#typedef-source-size-list></a></dfn> = <a class="production css-code" data-link-type=type href=#typedef-source-size title="<source-size>">&lt;source-size&gt;</a>#+ [ , <a class="production css-code" data-link-type=type href=#typedef-source-size-value title="<source-size-value>">&lt;source-size-value&gt;</a> ]? | <a class="production css-code" data-link-type=type href=#typedef-source-size-value title="<source-size-value>">&lt;source-size-value&gt;</a>
<dfn class=css-code data-dfn-type=type data-export="" id=typedef-source-size>&lt;source-size&gt;<a class=self-link href=#typedef-source-size></a></dfn> = <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/mediaqueries-4/#typedef-media-condition title="<media-condition>">&lt;media-condition&gt;</a> <a class="production css-code" data-link-type=type href=#typedef-source-size-value title="<source-size-value>">&lt;source-size-value&gt;</a>
<dfn class=css-code data-dfn-type=type data-export="" id=typedef-source-size-value>&lt;source-size-value&gt;<a class=self-link href=#typedef-source-size-value></a></dfn> = <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> | <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#percentage-value title="<percentage>">&lt;percentage&gt;</a>
</pre>
<p> A <a class="production css-code" data-link-type=type href=#typedef-source-size-value title="<source-size-value>">&lt;source-size-value&gt;</a> must not be negative.
Expand Down

0 comments on commit cb05464

Please sign in to comment.