[svgwg] White-space only text nodes.

Tavmjong has just created a new issue for https://github.com/w3c/svgwg:

== White-space only text nodes. ==
Relevant links:
  https://www.w3.org/TR/SVG2/struct.html#XMLSpaceAttribute
  https://www.w3.org/TR/SVG2/text.html#WhiteSpaceProperty

The attribute xml:space is used to control white space in SVG 1.1 inside <text> elements. As this is an XML attribute, it presumably must also follow XML rules for handling white-space only text nodes (different from text elements) which dictate that a value of "default" results in the removal of text nodes that only contain white space:

  `<text><tspan>A</tspan> <tspan>B</tspan></text>  =>   AB`

   `<text><tspan>A</tspan> B <tspan>C</tspan></text> => A B C`

This behavior is not clearly defined in either the SVG 1.1 or SVG 2 specs and neither Firefox nor Chrome seem to follow this. Inkscape has followed this behavior (except  due to a bug, now fixed, introduced by a change in the libxml2 library).

If this interpretation is wrong, then text should be added to the spec to make it clearer.

Note XHTML2 sets xml:space to preserve for all elements.

PS. It's a real pain that we can't attach SVG files!

Please view or discuss this issue at https://github.com/w3c/svgwg/issues/352 using your GitHub account

Received on Wednesday, 1 November 2017 12:35:46 UTC