W3C home > Mailing lists > Public > www-style@w3.org > September 2001

Re: Extended clipping

From: Bert Bos <bert@w3.org>
Date: Thu, 27 Sep 2001 21:11:27 +0200
Message-ID: <15283.31199.356762.609367@lanalana.inria.fr>
To: www-style@w3.org
Bjoern Hoehrmann writes:
> Hi,
>    I wonder why the current box model draft still lacks of opportunitys
> to specify anything beyond clipping retangular boxes. I miss the ability
> to define "clipping" circles, polygons and clipping depending on
> replaced content's transparency. Especially I miss the ability to define
> an image map framework as available through HTML markup or linking
> shapes in SVG.
> SVG is a nice solution for image maps in general, since it defines
> linking regions of the graphic in the graphic, rather than outside, but
> this is still required for most raster graphics formats.

Rather than adding (fairly complex) facilities that already exist in
SVG, I would like to have one simple "toggle" for non-rectangular
wrap-arounds (i.e., the proposed 'contour' keyword on 'float'), and
leave the actual clipping, scaling, whatever, to SVG, which, after
all, is *designed* to do graphics things.

SVG actually works very well with raster graphics. (Many would argue
that it works better than HTML, because all SVG viewers, in contrast
to typical HTML browsers, scale raster graphics by spline
interpolation, which removes most "jaggies" and loss of data when
scaling. On the other hand, tricks like
http://www.echo.fr/FR/Stuff/KoolEfant/ won't work in SVG :-) )

The idea is that you put an SVG image in your HTML, and the SVG image
in turn includes the raster image you want to show. The SVG then
allows you to scale, clip, transform, attach image maps, and anything
you want.

> I am, by the way, not happy with the border-radius property in the
> current draft. It changes the retangular nature of the box visually, so
> it should change this nature also logically. Defining a generic method
> to change the retangular nature of boxes would solve dependencies of
> other properties (e.g. 'background' and the proposed 'box-shadow'
> properties).

There are certainly cases where you want a paragraph in the shape of a
crescent or the face or Einstein. I'm thinking of advertisements and
graphic art. But you are probably outside the realm of style sheets
then. The text and the shape are so intimitely tied together that any
amount of cascading will destroy the effect. You're probably better of
using SVG again.

> Several graphic formats also provide means to specify transparency. It's
> a quite common effect in desktop publishing and word processing to let
> text only flow around acutally visual parts of graphics. CSS should also
> provide means to achieve such effects.

That's why I (re-)proposed the 'contour' keyword for 'float'. (It
dates from 1996[1])

[1] http://www.w3.org/TR/WD-css1-960717.html

> Section 23 of the current drafts reads by the way:
> [...]
>   Note that the 'clip' property only has effect on elements that have a
>   'overflow' property with a value other than 'visible'. <shape> is
>   either 'rect(...)' or 'inset(...)'. Values have the following
>   meanings:
> [...]
> 'Has' should be replaced by 'may have' since the overflow property may
> be set to 'auto' and therfore depend on the user agent whether the clip
> property does apply to that box.

No, 'auto' means something else. It means the UA is free to remove the
scrollbar in case the contents do *not* overflow. But in case of
overflowing content, the behavior is exactly like 'scroll'.

  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Thursday, 27 September 2001 15:11:29 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:59 UTC