[whatwg] Built-in image sprite support in HTML5

Silvia Pfeiffer silviapfeiffer1 at gmail.com
Tue Aug 3 18:38:58 PDT 2010


On Wed, Aug 4, 2010 at 10:19 AM, Ian Hickson <ian at hixie.ch> wrote:

> 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. :-)



Well, that goes into implementation issues and really has nothing to do with
the URI specification itself. The media fragment URI specification can
propose what is possible to happen for representing a media fragment URI and
it does so by now:
http://www.w3.org/2008/WebVideo/Fragments/WD-media-fragments-spec/#media-fragment-display.
But really, the application has to decide for itself what makes sense.

As we adopt media fragment URIs into the HTML5 spec, we should prescribe
what the user experience is meant to be, such that UAs can implement a
consistent handling.

Cheers,
Silvia.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100804/bc61cf9d/attachment-0002.htm>


More information about the whatwg mailing list