This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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".
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.
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