Re: [whatwg] Implementation complexity with elements vs an attribute (responsive images)

On Sat, 12 May 2012, Mathew Marquis wrote:

> While that information may be available at the time the img tag is 
> parsed, I don’t believe it will be available at the time of prefetching 
> — I’m happy to research this further and report back with citations.

I am very confused about what you are claiming here. I have difficulty 
imagining any scheme that would make prefetching work worse with an 
attribute than with multiple elements. As Simon says there is a lot more 
that can go wrong in the multiple-element case because a single attribute 
can be processed atomically, but multiple elements can have all sorts of 
other junk between them that makes naieve processing (of a type likely to 
be used when prefetching) more likely to go wrong e.g.

<picture>
<img src="foo">
<script>document.write("</picture>")</script>
<source src="bar">
</picture>

Received on Saturday, 12 May 2012 14:36:46 UTC