W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

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

From: James Graham <jgraham@opera.com>
Date: Sat, 12 May 2012 16:36:11 +0200 (CEST)
To: Mathew Marquis <mat@matmarquis.com>
Message-ID: <alpine.DEB.2.02.1205121543170.22566@sirius>
Cc: whatwg@whatwg.org


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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:08 GMT