W3C home > Mailing lists > Public > www-svg@w3.org > May 2009

Re: SVG and CSS Properties (SVG ACTION-2535)

From: G. Wade Johnson <gwadej@anomaly.org>
Date: Fri, 1 May 2009 17:59:59 -0500
To: Doug Schepers <schepers@w3.org>
Cc: www-style CSS <www-style@w3.org>, www-svg <www-svg@w3.org>
Message-ID: <20090501175959.3510acef@sovvan>
On Fri, 01 May 2009 03:19:01 -0400
Doug Schepers <schepers@w3.org> wrote:

> Hi, CSS WG-
> 
> The SVG WG has been considering (for quite some time) adding new 
> attribute value syntax to allow the mixture of absolute and relative 
> values.  For example, a rectangle that sticks near the right side of
> the browser window might look like this:
> 
>   <rect x="100% - 50px" y="10px" width="40px" height="200px" />
> 
> There have been experimental implementations with various syntaxes
> [1], and Mozilla has expressed interest in this basic functionality
> recently [2].

I know I could use this.

> In light of our mutual interest in having CSS and SVG work more 
> seamlessly together, we thought a good solution (for at least the
> simple cases) would be to adopt the syntax found in CSS3 Values and
> Units, specifically the 'calc()' function.  We are wondering where
> this specification stands with the CSS WG, and what your opinion is
> for the inclusion of this into SVG as well.  We already use the
> 'url()' functional notation, and are considering expanding our use of
> such value types.

I think calc() would be a reasonable way to deal with this issue. As a
developer, I wouldn't find it to be difficult to make use of.

> On a related topic, the SVG WG is interested in examining allowing 
> certain SVG geometric attributes to be specified using CSS, either 
> inline or as classes.  Specifically, we are thinking of adding the 
> following properties: x, y, width, height, cx, cy, r, rx, ry, x1, x2, 
> y1, y2.  We recognize that there may be some incompatibilities
> between SVG and CSS particularly with the x, y, width, and height,
> but we hope that we can find some middle ground that serves authors
> best.

I can think of places where I might have used width, height, r, rx, or
ry as a styled property. I normally end up using definitions instead.
Off the top of my head I can't think of a case where I would use x, y,
cx, cy, x1, x2, y1, or y2 this way. But, since I haven't had access to
the feature, I've never thought about it.

> This would not be backwards compatible with earlier versions of SVG,
> but we are considering whether this would help authors already
> familiar with CSS to pick up SVG more quickly, and whether it could
> be implemented and deployed rapidly and interoperably enough to avoid
> catastrophe.  Since SVG is already undergoing some incompatible
> changes as part of SVG-in-text/html, this might simply be growing
> pains that will allow SVG to be used in more contexts.

If we were to make a change like this, it sounds like the right time.

G. Wade
-- 
"Very sad life. Probably also have sad death. But at least there is
symmetry."                                                -- Zathras
Received on Friday, 1 May 2009 23:01:04 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:42 GMT