Re: srcN - Alternative to picture and srcset

On Nov 3, 2013, at 3:21 PM, Anselm Hannemann <info@anselm-hannemann.com> wrote:

> On 03.11.2013, at 21:13, David Newton <david@davidnewton.ca> wrote:
> 
>> On Nov 3, 2013, at 3:03 PM, Anselm Hannemann <info@anselm-hannemann.com> wrote:
>> 
>>>> What about just letting usemap take a list of IDs in the same order as src-n?
>>>> 
>>>> <img usemap=“#map1, #map” src-1=“(max-width: 400px) img1.png” src-2=“(max-width: 1000px) img2.png” alt=“whatever” />
>>> 
>>> This is not possible for the very same reason we couldn’t extend the src-attribute. We would need to create a new attribute usemap-n="".
>>> I find this an ugly solution. Still, not supporting usemaps attribute when a src-n attribute exists is also ugly.
>> 
>> What are those reasons specifically? Not saying you’re wrong, but just wondering if the less frequent usage of usemap could make the problems easier to tackle than they were with src. That said, even though usemap-N isn’t ideal, the infrequency with which it would be needed makes it not a terrible compromise IMO.
> 
> It’s that browsers first wouldn’t understand a multi-value usemap attribute and will fail on that.
> This is the reason why a new one has to be created. Not the most elegant solution.

Right. I would argue that breaking usemap this way is a lot less bad than breaking src because, as I said, it’s used so much less frequently. Still not ideal, though, you’re right.


> Also your proposal would differ in the syntax of both attributes which is not great. On the other hand, a multi-attribute usemap-n solution now really messes up / blows up the img element syntax. :/

The more I think about it, the more I think multiple usemap attributes would be fairly horrible. One extra attribute, literally called “usemap-n”, with a list of IDs could work. Sure the syntax would be different, but it would at least be simple, and I think we want as little complication as possible for this.


> That, by the way, are reasons why I still prefer the picture-element.

I also prefer picture and the freedom it gets us, but I think that ship has sailed. :)

Received on Sunday, 3 November 2013 20:34:10 UTC