This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4888 - Clarify text striping and consolidation of white space characters for nested xml:space
Summary: Clarify text striping and consolidation of white space characters for nested ...
Status: ASSIGNED
Alias: None
Product: SVG
Classification: Unclassified
Component: Text (show other bugs)
Version: All Specifications
Hardware: All All
: P2 normal
Target Milestone: Errata
Assignee: Doug Schepers
QA Contact: Doug Schepers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-27 19:32 UTC by dtc-w3
Modified: 2007-08-06 09:32 UTC (History)
1 user (show)

See Also:


Attachments
Text case. (2.76 KB, image/svg+xml)
2007-07-27 19:36 UTC, dtc-w3
Details

Description dtc-w3 2007-07-27 19:32:06 UTC
Could the SVG specification clarify the handling of white space characters when
there are nested text elements that differ in their xml:space attribute.

When xml:space is 'default' the SVG specification requires the application to
'strip off all leading and trailing space characters', but also requires the
application to preserve leading and trailing white space characters when
xml:space is 'preserve'.  But what is expected when there are leading and trailing
white space characters defined in a mixture of elements with xml:space of 'preserve'
and 'default'?

When xml:space is 'default' the SVG specification requires the application to
'all contiguous space characters will be consolidated', but also requires the
application to preserve white space characters when xml:space is 'preserve'.
But what is expected when there are white space characters to consolidate that
are defined in a mixture of elements with xml:space of 'preserve' and 'default'?

Suggested clarification:
When stripping leading and trailing white space characters, or consolidating white
space characters, white space characters defined within a element with xml:space
of "preserve" are not stripped or consolidated and they are recognized as white space
characters for the purpose of stripping and consolidation and do not prevent the
stripping or consolidation of adjacent white space characters defined in elements
with xml:space="default".

Example:
Let 'P' represent a white space character defined in an element with xml:space of 'preserve'.
Let 'D' represent a white space character defined in an element with xml:space of 'default'.
Let 'T' represent non-space text characters.

Given the string "DPDPDTDDTPTDPTPDTDPDTPDPTDPDPD" the application will strip and consolidate
the white space characters to give the string: "PPTDTPTPTPTPTPPTPP"

The current practice of SVG viewers appears to be to preserve white space characters defined
within a xml:space="preserve" element even when mixed with adjacent whitespace characters
defined in elements with xml:space="default".  However the handling of white space characters
defined in elements with xml:space="default" varies widely when mixed with adjacent whitespace
characters defined in elements with xml:space="preserve".
Comment 1 dtc-w3 2007-07-27 19:36:05 UTC
Created attachment 480 [details]
Text case.

A test for some of the cases.  This test gives different results
in a range of SVG browsers: Batik, Adobe SVG, Inkscape, Opera.
Comment 2 Doug Schepers 2007-08-06 09:28:03 UTC
Hi, Douglas-

We discussed this in the SVG WG, and we agree with both your characterization of the issue and with your proposed clarification.  We will tweak the wording, find the places in the spec that need to be changed, and get back to you soon to make sure you agree that we've addressed your issue to your satisfaction.

We will add this to the errata for SVG 1.1, and make sure that the same changes are carried over into SVG 1.2.

Thanks for pointing out this issue.  It was very helpful, and will make the spec better.  

Regards-
-Doug Schepers
W3C Staff Contact, SVG, CDF, and WebAPI