From ebbe3d993040ede7a07efda2a6949130d21b2370 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Wed, 9 Apr 2014 12:05:44 +0200 Subject: [PATCH] Tighten up the allowed syntax for sizes. Allow the attribute to be omitted when using w descriptors. --- index.bs | 13 ++++++++----- index.html | 17 ++++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/index.bs b/index.bs index 4e2825a0..5a220b4e 100644 --- a/index.bs +++ b/index.bs @@ -817,9 +817,12 @@ Parsing a srcset Attribute If the source or img element has a sizes attribute present, all image candidate strings for that - element must have the width descriptor specified. If the - sizes attribute is not present, all image candidate strings for - that element must not have the width descriptor specified. + element must have the width descriptor specified. + + If an image candidate string for an source or img element + has the width descriptor specified, + all other image candidate strings for that element + must also have the width descriptor specified.

Parsing a sizes Attribute

@@ -890,8 +893,8 @@ Parsing a sizes Attribute A valid source size list is a string that matches the following grammar: [[!CSS3VAL]]
-		<source-size-list> = <>#?
-		<source-size> = <>? <>
+		<source-size-list> = <>#+ [ , <> ]? | <>
+		<source-size> = <> <>
 		<source-size-value> = <> | <>
 	
diff --git a/index.html b/index.html index 60ecf521..0011a931 100644 --- a/index.html +++ b/index.html @@ -552,14 +552,14 @@

The picture Element

Editor’s Draft, - 8 April 2014

+ 9 April 2014
This version:
http://picture.responsiveimages.org
Editor’s Draft:
http://picture.responsiveimages.org
Test Suite:
None Yet
Editors:
Tab Atkins (Google)
Marcos Cáceres (Mozilla)
Mat Marquis
Yoav Weiss
(Opera Software)
Version History:
Commit History
Github commits on Twitter
Participate:
Join the Responsive Images Community Group
Public Mailing List
IRC: #respimg on W3C’s IRC
Twitter
Github

If the source or img element has a sizes attribute present, all image candidate strings for that - element must have the width descriptor specified. If the - sizes attribute is not present, all image candidate strings for - that element must not have the width descriptor specified. + element must have the width descriptor specified. + +

If an image candidate string for an source or img element + has the width descriptor specified, + all other image candidate strings for that element + must also have the width descriptor specified.

3.1.4 Parsing a sizes Attribute

@@ -1438,8 +1441,8 @@

A valid source size list is a string that matches the following grammar: [CSS3VAL] -
  <source-size-list> = <source-size>#?
-  <source-size> = <media-condition>? <source-size-value>
+	
  <source-size-list> = <source-size>#+ [ , <source-size-value> ]? | <source-size-value>
+  <source-size> = <media-condition> <source-size-value>
   <source-size-value> = <length> | <percentage>
 

A <source-size-value> must not be negative.