W3C home > Mailing lists > Public > www-style@w3.org > January 2006

Re: SVGT 1.2: A proposal for how to define SVG whitespace in terms of CSS whitespace

From: Maciej Stachowiak <mjs@apple.com>
Date: Mon, 30 Jan 2006 19:14:19 -0800
Message-Id: <C9A32551-6550-42EA-90A4-292E74B21A2B@apple.com>
Cc: www-svg@w3.org, www-style@w3.org
To: Bjoern Hoehrmann <derhoermi@gmx.net>


On Jan 30, 2006, at 3:55 PM, Bjoern Hoehrmann wrote:

> * Maciej Stachowiak wrote:
>> As requested by Jon Ferraiolo, here's a rough cut at reformulating
>> SVG whitespace handling in terms of style properties, to eventually
>> phase out use of xml:space and to be more compatible with a CDF
>> environment. I have Cc'd www-style because I believe that changes to
>> CSS may be required.
>
> While xml:space suffers from people not understanding it and it beeing
> underspecified in many environments, I don't think it's unfixable and
> it's certainly more appropriate to use to convey certain semantics  
> than
> CSS. I don't see what's wrong with how SVG clarifies application level
> behavior to ensure applications preserve the author's intention when
> rendering text; the only problem here seems to be that many other  
> specs
> fail to provide such clarification.

The problem is that other languages leave it unspecified, and de  
facto treat all possible values the same as "preserve". SVG requires  
different handling for "default". This creates significant problems  
when trying to parse SVG with the same XML parser as other XML  
applications, especially

> It's true that SVG white space processing is a bit different from CSS
> white space processing, but that's not really unexpected considering
> that SVG 1.1 does not support text wrapping, for example.

But most of the differences are not in any way required by, or even  
related to the lack of text wrapping support. They are just  
arbitrary. I don't think SVG should use a completely different model  
unless there is some clear way in which it is superior. I haven't  
seen any argument for why "xml:space" might be better than whitespace  
control through properties.

> It might make sense to add features to CSS to re-use the same white  
> space processing
> rules for other elements that we have for svg:text, etc. now, but this
> would probably lead to interesting results once and if we try to  
> figure
> out how CSS and SVG interact for properties they don't share, like
>
>   <svg:text style="white-space: pre" ...>
>
> It seems it's unlikely this would suddenly turn svg:text into  
> something
> that supports multiple lines of text.

Defining behavior for explicit line breaks is much simpler than  
defining natural text wrapping, which <text> should not support.  
<text> already allows a way to individually position a character and  
have text begin from there, a hard line break could be defined in  
terms of this. Or <text> could be specified to ignore line breaks  
even if specified by the white-space property.

> I don't think we should change the xml:space attribute such that it  
> triggers some DOM transformations.

Right now the spec doesn't make clear whether "xml:space" triggers  
DOM transformations or not. Does it?

If you think it should not modify the DOM, but should affect  
rendering, then clearly it is a presentational attribute, and should  
be mapped to appropriate properties.

Regards,
Maciej
Received on Tuesday, 31 January 2006 03:14:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:42 GMT