Re: Image sprites use cases

On Sun, Aug 30, 2009 at 4:59 PM, Brad Kemper <brad.kemper@gmail.com> wrote:

> On Aug 30, 2009, at 4:20 PM, Robert O'Callahan wrote
>
> On Sat, Aug 29, 2009 at 3:07 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:
>
>> (I'll note quickly that my favorite, and I think generally the best
>> solution, is the one being created by the Media Fragments WG where
>> they're defining one form of hash on links to image files.  Using frex
>> "image.png#xywh=0,40,20,20" would select a 20x20 region, starting on
>> the left edge, 40px from the top.
>
>
> The problem with that approach is that it doesn't degrade gracefully for
> browsers without the feature.
>
>
> Wouldn't "image.png#xywh=0,40,20,20" be treated the same as "image.png" in
> UAs that did not support the special meaning of the hash value,
>

It would, which is the problem...


> leaving you with a single image to use for everything, just as with UAs
> that didn't support "-moz-image-rect()"?
>

Yes, the problem is that there is no way to specify an alternative small
image as fallback...

Given
background: url(image-small-05.png);
background: -moz-image-rect(image.png,0,40,20,20);
browsers not supporting the feature use url(image-small-05.png) for the
image and everything's good.

But given
background: url(image-small-05.png);
background: url(image.png#xywh=0,40,20,20);
browsers not supporting the feature will use url(image.png) for the image
and the page is broken. You obviously can't use background-position
conditionally here.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]

Received on Monday, 31 August 2009 00:09:22 UTC