W3C home > Mailing lists > Public > www-style@w3.org > November 2010

Re: [css3-images] Color as an image type

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 29 Nov 2010 16:54:39 -0800
Message-ID: <AANLkTimR_rZS2z5XEFyXBYJ0GYywEPZkDJF3V5kBFZbk@mail.gmail.com>
To: David Singer <singer@apple.com>
Cc: www-style list <www-style@w3.org>
On Mon, Nov 29, 2010 at 4:27 PM, David Singer <singer@apple.com> wrote:
> On Nov 29, 2010, at 14:34 , Tab Atkins Jr. wrote:
>> Images don't always have dimensions.  They can have any, all, or none
>> of an intrinsic width, height, or aspect-ratio.  And that's okay.
>> Gradients don't have any dimensions, and SVG can have any of the valid
>> combinations.
>>
>> Imo, colors most naturally convert into a dimensionless image.
>
> I think a gradient has to have dimensions, or we don't know what we're grading over.  So I think it's fine to say that something has intrinsic dimensions, or is dimensioned to fit into something else, and indeed the gradient discussions have had a lot on how you determine the end-points (and the effective side-extension perpendicular to the gradient), which are the dimensions.
>
> But I think we would have a problem if we say "size this doofer to fit its contents" and the contents in turn say "size me to fit my container" :-).

The problem you cite has been defined out of existence.  ^_^  As it
obviously has to be, given that SVG images may be dimensionless as
well.

The size negotiation process is defined in the spec.  First CSS asks
the image for its dimensions, then it combines this information with
the size of the rendering area to produce a rectangle with definite
dimensions.  It then hands this rectangle to the image and asks it to
render into this.  It's up to the image to figure out how it wants to
then render.

In the case of images with no intrinsic dimensions, the rectangle is
always the size of the rendering area.  In the opposite case of images
with all three dimensions, the rectangle is always the size of those
dimensions.  In the middle cases the provided dimensions are filled in
via some simple scaling.

The rendering of gradients is defined entirely in terms of this final
rectangle, so it all works out.

(To use your words, dimensionless images like gradients are
dimensioned to fit into the provided rendering area.)

You can't tell a box to be the size of a background image, so the
other circular dependency you mention can't happen either.

~TJ
Received on Tuesday, 30 November 2010 00:55:31 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:34 GMT