- From: Yoav Weiss <yoav@yoav.ws>
- Date: Wed, 20 Nov 2013 13:32:09 +0100
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- Cc: WHATWG <whatwg@lists.whatwg.org>, James Graham <james@hoppipolla.co.uk>, Simon Pieters <simonp@opera.com>
On Tue, Nov 19, 2013 at 11:22 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote: > On Tue, Nov 19, 2013 at 2:07 PM, Simon Pieters <simonp@opera.com> wrote: > > So: > > > > <picture> > > <source ...> > > <source ...> > > <img src="fallback" alt="..."> > > </picture> > > > > The selection algorithm would only consider <source> elements that are > > previous siblings of the <img> if the parent is a <picture> element, and > > would be called in place of the current 'process the image candidates' in > > the spec (called from 'update the image data'). 'Update the image data' > gets > > run when an img element is created, has its src or crossorigin (or > srcset if > > we still want that on img) attributes changed/set/removed, is inserted or > > removed from its parent, when <source> is inserted to a <picture> as a > > previous sibling, or a <source> that is a previous sibling is removed > from > > <picture>, or when a <source> that is a previous sibling and is in > <picture> > > has its src or srcset (or whatever attributes we want to use on <source>) > > attributes changed/set/removed. 'Update the image data' aborts if the > > parser-created flag is set. When img is inserted to the document, if the > > parser-created flag is set, the flag is first unset and then 'update the > > image data' is run but without the await a stable state step. > > +1. I'm totally fine with this, if the people who disliked multiple > attrs are okay with multiple elements. > > We can still handle all the things that src-N did, without the need > for such compact microsyntaxes, too: > > 1. Art direction is handled by <source media>. > 2. Multiple densities is handled by a list of url/density pairs in <source > src>. > 3. Variable-size images can be handled with a <picture sizes> > attribute, and a list of url/size pairs in <source src>. > +1 as well. I think it's worth while to enable the `sizes` attribute and url/density pairs on <img> as well. It would enable authors that have just variable-width images with no art-direction to avoid adding a <picture> with a single <source>. Also, the Client-Hints specification can rely on `sizes` (on both <picture> and <img>) for the resource-width header value, even if only a URL (with no density) is specified.
Received on Wednesday, 20 November 2013 12:32:33 UTC