W3C home > Mailing lists > Public > www-style@w3.org > February 2012

CSS4 cross-fade() and images without intrinsic size

From: Tim Horton <timothy_horton@apple.com>
Date: Mon, 13 Feb 2012 11:47:18 -0800
Message-id: <093CA308-D932-46ED-8D8F-23FE203D98C1@apple.com>
To: www-style@w3.org
Hi, all!

I've been implementing now-CSS4 cross-fade() in WebKit, and have come across a point I'd like clarified (though I realize the spec isn't remotely in a finished form).

Here's what the spec currently says about the size of the generated image:

> More precisely, given ''cross-fade(A,B,p)'', where A and B are images and
> p is a percentage between 0% and 100%, the function represents an image
> with width equal to widthA  (1-p) + widthB  p and height equal to
> heightA  (1-p) + heightB  p.

This is all fine (and works great!) for images which have an intrinsic size. However, I'm unsure of what to do in the case where one or both of the source images don't have an intrinsic size - for example, a cross-fade between a linear-gradient() and an image, or between two gradients.

There are two options that I can see here:

1) Use the size of the container for the size of non-fixed-size images.

2) Use the size of any fixed-size images for the size of non-fixed-size images.

In both cases, the sizes would then be interpolated as in a simple cross-fade.

Option 1 seems the most appropriate, as option 2 breaks down when cross-fading two images both without intrinsic size. Still, it seemed best to solicit advice in case there's another option that I missed.

Any comments?

Received on Monday, 13 February 2012 21:40:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:12 UTC