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

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