Re: CSS: Extended tiling. Proposal

Andrew Fedoniouk writes:
> 
> More author's comments:
> 
> I am proposing following attributes:
> 
>   background-image-margin-top: length;
>   background-image-margin-bottom: length;
>   background-image-margin-left: length;
>   background-image-margin-right: length;
> 
> with additional:
>   background-image-fill-policy: [middle-stretch] [top-stretch]
> [bottom-stretch] [left-stretch] [right-stretch];
> 
> Instead of all proposed border-image-* and new background-image-*
> attributes.
> 
> Some thoughts about existing CSS3 proposal:
> 
> To render box with borders and background will take 10 images to download.
> This feature will be quite popular,
> but each http: connection takes near 40 kbytes of machine instructions just
> to establish and serve connection (without transfer). To be short it is
> better to reduce pollution.
> 
> Artistic borders being designed will be used in 99% with artistic (image)
> backgrounds. I think it is better to keep such borders and background design
> in one image.

It's apparently an idea whose time has come :-)

In the CSS WG, we had very similar ideas to yours: the Border module
has too many properties to do what in most cases will indeed be
designed as a single border+background image. Some of the 'border-fit'
values also seem a bit overkill.

So we're testing what it would look like if we merged the Border and
the Background modules into one and replace most of the new
image-related properties with a single shorthand, that sets the border
*and* the background to a single image. That solves the problem of how
to suppress the border when the image has its own border, and how to
calculate the proper padding: no need to increase the padding, since
the edges of the image will go into the border area instead.

In an attempt to reduce the number of properties as much as possible
and limit the work for implementers, we are even investigating if it
is good enough if we allow only a single image: IF you want an image
for the border, THEN all borders must come from that image. (You can
omit parts of the border, simply by not including them in the image,
but you cannot mix images with other borders or with other images.)

But, that is just the most extreme of the ideas that might go into the
next draft.

Also, so as not to have to introduce 'background-image-margin-top' and
its kin and thereby introduce new dependencies between properties, we
may be able to put those four lengths in the value instead:

    bg-and-border-shorthand-whatsit: tile(foo.png, 12, 20, 12, 20)

where 'tile(<url>, top, right, bottom, left)' represents an image and
the positions of four slices through that image, which are either
numbers (coordinates in the image's own coordinate space) or
percentages.

Your idea of putting the four numbers in a metadata file and linking
to that would work as well, except that such a file format isn't
readily available and it requires a second download: first the
metadata and then the image. If there are other applications than CSS
of this nine-part image idea, we could go that way, or maybe add an
extension to PNG, JFIF/JPEG and SVG, but for the moment it seems
easier to put the four numbers in CSS.



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Wednesday, 5 May 2004 12:28:42 UTC