Re: 24. Gradient & stretched backgrounds

On Fri, 15 Jan 1999, Rasmus Kaj wrote some suggestions for changes to
the suggested change of the change that I suggested based on change 24
in the list of suggested changes to CSS written by the WG.


Anyway, he wrote:
> I'd like to suggest a further change in this, so that in the
> y-direction the image is neither fitted or repeated, unless repeat-y
> is given. The same change applies to fit-y (and repeat-[xy])
Good idea.

Here is the updated background-repeat. Since it has now been changed
considerably, I have not included [INS:] and [DEL:] markers.

    Value:       repeat | repeat-x | repeat-y | no-repeat | 
                 [ fit-x repeat-y? ] | [ fit-y repeat-x? ] |
                 fit | inherit
    Initial:     repeat
    Applies to:  all elements
    Inherited:   no
    Percentages: N/A
    Media:       visual
If a background image is specified, this property specifies whether
the image is repeated (tiled), scaled to fit (stretched) or both, and
how. If 'background-attachment' has the value 'scroll', then the
image is repeated or scaled so as to cover the entire content and
padding area of the box. If 'background-attachment' has the value
'fixed', then the image is repeated or scaled so as to cover the
viewport. Note that even if the image is repeated or scaled so as to
cover the viewport, it is still only visible where the background or
padding area of the element is actually visible on the viewport.

Values have the following meanings:

         The image is repeated horizontally. The position of the first
         image, where the repeating should start, is given by the
         'background-position' property.

         Analogous to 'repeat-x', but in the vertical direction.
         The image is scaled horizontally so that only one copy of the
         image covers the entire area. The value given for the
         horizontal component of the 'background-position' property
         should be ignored.

         Analogous to 'fit-x', but vertically. During incremental
         rendering, if the final vertical size of the element is not
         yet known (i.e., the value of the 'height' property is
         'auto'), then the UA may ignore this value. (They should not,
         however, treat it as 'repeat-y'.) This will prevent the need
         for stretch calculations to be repeatedly performed.
         The image is repeated in both directions, as if 'repeat-x'
         and 'repeat-y' were both set.
         The image is scaled to fit the entire area, as if 'fit-x' and
         fit-y' were both set. During incremental rendering, this may
         be treated as 'fit-x' (see the discussion under the
         explanation of 'fit-y').
         The image is neither repeated or scaled to fit, thus only one
         copy of the image is drawn (using its intrinsic dimensions).
         The position of the image is given by 'background-position'.

When the value of 'background-image' is a graphic without intrinsic
dimensions (for example some vector graphics may lack this
information), then the UA may replace the value given for the
horizontal direction by 'fit-x', keeping the aspect ratio correct for
the vertical direction.

It is an error for authors to use graphics without intrinsic
dimensions for 'background-image' if 'background-repeat' has any value
other than 'fit'.


Note that I have attempted to make this property as
backwards-compatible as possible. Therefore, the following value:

   background-repeat: repeat-x repeat-y; not allowed by this suggestion.

Ian Hickson

Received on Friday, 29 January 1999 09:47:00 UTC