W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2010

[whatwg] Built-in image sprite support in HTML5

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 4 Aug 2010 00:19:45 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.1008040016000.7470@ps20323.dreamhostps.com>
On Fri, 21 May 2010, David Weitzman wrote:
> There are various approaches to using image sprites with HTML and CSS, 
> but at the end of the day they are all essentially hacks. A solution 
> that would be simpler than any existing approach would be to introduce 
> new attributes for <img> to specify x and y offsets and clipping on 
> images. With that you would get simpler markup for sprites and better 
> accessibility.
> One downside of this approach is that with background image sprites you 
> can have a CSS class that abstracts away the name of the sprite image. 
> With <img> tags you would have to specify the URL and height/width 
> individually on every sprited image.

I think the right solution is a fragment identifier.

On Sat, 22 May 2010, Silvia Pfeiffer wrote:
> On Sat, May 22, 2010 at 3:23 AM, Tab Atkins Jr. <jackalmage at gmail.com> wrote:
> >
> > The Media Fragments WG has a draft spec out for, well, Media 
> > Fragments, which let you specify which section of an image you want 
> > right in the url. ?The browser should then automatically cut it out 
> > and serve just the sprite you want.
> Yes, I was going to suggest that spec, too, see
> http://www.w3.org/2008/WebVideo/Fragments/WD-media-fragments-spec/#naming-space
> However, what exactly happens with a media fragment URI like
> http://example.com/picture.png#xywh=160,120,320,240 is not fully
> specified in the Media Fragment URI spec.

I would recommend fixing that. :-)

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 3 August 2010 17:19:45 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:59 UTC