W3C home > Mailing lists > Public > www-svg@w3.org > March 2012

moving from xml:space="" to white-space

From: Cameron McCormack <cam@mcc.id.au>
Date: Fri, 16 Mar 2012 12:59:18 +1100
Message-ID: <4F629E76.805@mcc.id.au>
To: SVG public list <www-svg@w3.org>
As part of aligning with CSS text handling, SVG 2 is going to support 
(and recommend) the use of the white-space property to control whether 
white space characters are collapsed in SVG <text> elements or not.  I 
have a couple of questions about this:

1. What is the expected behaviour for the following:

    <text style="white-space: pre">a

    Would we want to allow a line break there?  If we do, how does that
    sit with our decision not to include SVG Tiny 1.2's <textArea>
    element in SVG 2?  I seem to remember a proposal at some point to
    extend <text> with a width="" attribute, like

    <text x="10" y="10" width="100">some text that would wrap</text>

    but I don't know what came of that.  Regardless, we have a few

      (a) Render those subsequent lines.  (What happens on a text path?)
      (b) Treat the newlines as white space, like xml:space="preserve"
      (c) Don't render any line after the first.

    I'm not really sure which I like.  (a) has the advantage of probably
    doing what the author wanted.  (b) has the disadvantage of changing
    what white-space:pre really means.  (c) seems like it would never
    be what the author wants.

2. Are we able to make xml:space="" a presentation attribute for the
    white-space property?  Its behaviour does not exactly match any of
    the current white-space property values, but I am wondering if it
    is that important to preserve those differences from
    white-space:pre.  xml:space="preserve" is defined to convert
    each tab and newline into a space.  If we could make it map exactly
    to white-space:pre instead that would be good.

This doesn't affect anything, but I just noticed css3-text defines 
white-space as a shorthand property for text-space-collapse (which gives 
the collapsing behaviour) and text-wrap (which gives the line breaking 
Received on Friday, 16 March 2012 01:59:50 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:27 UTC