W3C home > Mailing lists > Public > public-respimg@w3.org > July 2015

[picture] spec text regarding sibling sources needing media or type attr

From: Greg Whitworth <gwhit@microsoft.com>
Date: Fri, 17 Jul 2015 19:37:54 +0000
To: "public-respimg@w3.org" <public-respimg@w3.org>
Message-ID: <CY1PR03MB1439F80B156C3F197A8A12AEA4980@CY1PR03MB1439.namprd03.prod.outlook.com>
Hello all, hoping I can get an answer to my question regarding this line in the spec:

	# When a source element has a following sibling source element or img element with a srcset attribute specified, it must have at least one of the following:
	# A media attribute...
	# A type attribute...

Reading this makes me believe that the following[1] should error out on at least the first one, the second one is technically valid but the first one is selected in both Chrome and Firefox.

	<picture>
    		<source sizes="(min-width: 500px) 100px" srcset="http://placehold.it/1000 1000w">
    		<source media="(max-width: 500px)" srcset="http://placehold.it/500">
    		<img srcset="http://placehold.it/500">
  	</picture>

Any insight into why this is allowed would be appreciated. Thanks,
Greg

[1]  http://jsbin.com/xojeridipe/1/edit?html,js,output
Received on Friday, 17 July 2015 19:38:24 UTC

This archive was generated by hypermail 2.3.1 : Friday, 17 July 2015 19:38:26 UTC