- From: Yoav Weiss <yoav@yoav.ws>
- Date: Sun, 19 Jul 2015 18:27:44 +0200
- To: Greg Whitworth <gwhit@microsoft.com>
- Cc: "public-respimg@w3.org" <public-respimg@w3.org>
- Message-ID: <CACj=BEjWm5ZnpObjka9X1hok5Z7XYyop2Lbp5jxuE9_yEtdUyw@mail.gmail.com>
That's part of the authoring requirements, not the processing model. That syntax is invalid, yet processed just fine. The reason it is invalid IIRC, is that in that construct, the <source> element always gets picked, making following <source> elements and the <img> redundant as far as resource selection is concerned. In your example, the following syntax would have been sufficient: <img sizes="(min-width: 500px) 100px" srcset="http://placehold.it/1000 1000w"> Feel free to open GH bugs in the future if there's anything unclear regarding the spec :) Cheers, Yoav On Fri, Jul 17, 2015 at 9:37 PM, Greg Whitworth <gwhit@microsoft.com> wrote: > 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 Sunday, 19 July 2015 16:28:12 UTC