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

Re: [gradients] basics

From: Simon Fraser <smfr@me.com>
Date: Sun, 08 Nov 2009 08:50:50 -0800
Cc: news@terrainformatica.com, www-style <www-style@w3.org>
Message-id: <B07F08CA-8FA2-4E08-BDD4-3FE8D99BE39B@me.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

On Nov 8, 2009, at 6:54 am, Tab Atkins Jr. wrote:

> On Sat, Nov 7, 2009 at 5:41 PM, Simon Fraser <smfr@me.com> wrote:
>> The current gradient proposals address the application of gradients  
>> to CSS images. This is not to say that these are the only types of  
>> gradients we would ever want in CSS; you could imagine border  
>> gradients, outline gradients, and perhaps even shadow gradients.  
>> But these would be separate properties, or new values for existing  
>> properties, which I don't believe would conflict with the current  
>> proposal.
>
> Indeed.  There is no reason to assume that we'll never address the use
> of generalized brushes in CSS, but that does *not* mean that the color
> property is the best place to do so.  It isn't.  Colors are
> intrinsically simpler than images - they have no dimension or
> direction.  Gradients have both, because they're images.
>
>>> If to think that gradient is such a background-image then we need to
>>> define how such an image is affected by say:
>>> background-size: ...;
>>> background-attachment: ... | fixed | local;
>>> background-repeat: ...;
>>
>> You are correct. Gradient images have no intrinsic size, so the  
>> behavior of these properties needs to be specified. At one point  
>> Gecko used background-repeat as an indication that it should paint  
>> a repeating gradient, but that is not in Tab's current proposal.
>
> I don't understand how this is unclear.  If these properties have
> undefined interactions with images lacking intrinsic sizes, then the
> problem lies in CSS2.1.  It is not appropriate to define that
> treatment here.

I see that <http://www.w3.org/TR/css3-background/#the-background-size>  
etc. describe behavior when lacking intrinsic size. I stand corrected.

Making gradients always have no intrinsic size does prevent one  
possible effect an author may desire: generating a gradient image of a  
particular size, and then having that tiled over the background.

>>> And second paragraph:
>>> "In many places this specification references a box, such ...."
>>> definitely requires more formal specification. E.g. "would be filled
>>> by an SVG image" is just sort of guess or appellation to
>>> reader's intuition.
>>
>> Agreed, this could be improved.
>
> Again, I don't know how this is unclear, or how it relies on any sort
> of intuition.  CSS2.1 is clear about how to size an image without
> intrinsic dimensions; if it's not, the definition needs to be fixed
> *there*.  File a bug on it if you feel it is underdefined.

The text is:
> In many places this specification references a box, such as "the  
> box's top-left corner" or "the box's right side". In all of these  
> circumstances, the box refers to the rectangle that would be filled  
> by an SVG image without intrinsic dimensions used in the same  
> context. See the CSS 2.1 spec for clarification on this.

I think the points made need to be:
* gradient images have no intrinsic size,
* therefore they fill the box they are being rendered into (like SVG  
images with no intrinsic size)
* and therefore, when applied to backrounds, background-size etc have  
no effect.

If you refer to the CSS 2.1 spec I think you should be more specific  
about which section you are referencing.

Simon
Received on Sunday, 8 November 2009 16:51:36 GMT

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