[whatwg] Simplified <picture> element draft

James Graham james at hoppipolla.co.uk
Mon Nov 25 03:01:45 PST 2013

On 25/11/13 10:32, Kornel Lesiński wrote:
> On 25 November 2013 08:00:10 Yoav Weiss <yoav at yoav.ws> wrote:
>> It contains some parts that I'm not sure have a consensus around them
>> yet:
>> * It defines <picture> as controlling <img>, where earlier on this
>> list we
>> discussed mostly the opposite (<img> querying its parent <picture>, if
>> one
>> exists)
> Controlling image is a great idea. It greatly simplifies the spec and
> hopefully implementations as well.
> I chose not to expose that implementation detail, assuming that one day
> (when all UAs, crawlers implement it) we will not need explicit <img>
> fallback any more.

This suffers from some of the same problems that were previously brought 
up with <picture>; because it defines a new element that should behave 
like <img> you have to test that the new element works in all the same 
places that <img> ought to work. The fact that the spec tries to define 
this in terms of the shadow DOM isn't really helpful; you still need to 
ensure that implementations actually proxy the underlying <img> 
correctly in all situations.

The advantage of the scheme that zcorpan proposed is that there is no 
magic proxy; we just add a capability to <img> to select its source 
using more than just a src attribute. This has better fallback than your 
design and is easier to implement.

More information about the whatwg mailing list