Issue 231508 in chromium: SVG rendering ignores xml:space="preserve" attribute for text

36 views
Skip to first unread message

chro...@googlecode.com

unread,
Apr 15, 2013, 4:23:12 PM4/15/13
to chromi...@chromium.org
Status: Uncomfirmed
Owner: ----
CC: pb...@chromium.org, dschu...@chromium.org
Labels: Type-Bug Pri-2 OS-All WebKit-ID-112032 Cr-Blink-SVG

New issue 231508 by schen...@chromium.org: SVG rendering ignores
xml:space="preserve" attribute for text
http://code.google.com/p/chromium/issues/detail?id=231508

Migrated from WebKit Bugzilla:
https://bugs.webkit.org/show_bug.cgi?id=112032
Originally reported 2013-03-11 08:39 PST by Peter Boström
(pb...@chromium.org).


Description:
Rendering a SVG file which contains multiple spaces inside text, and the
xml:space="preserve" attribute will will still compact space characters.
(Acting like xml:space="default".)

I think the offending line is in RenderSVGInlineText::RenderSVGInlineText
on line 69 in
chromium/src/third_party/WebKit/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp,
but I am overall unfamiliar with the WebRTC code base. The constructor for
RenderSVGInlineText strips additional whitespace regardless of this tag.

Attaching screenshot of this bug in Chromium, using WebKit 537.32
(trunk@143310), and expected result as rendered inside Firefox.



Attachments:
2013-03-11 08:40 PST: Screenshot of render error
[https://bugs.webkit.org/attachment.cgi?id=192477&action=prettypatch]
2013-03-11 08:41 PST: Example SVG file
[https://bugs.webkit.org/attachment.cgi?id=192478&action=prettypatch]



Comments:
================================

Comment #1
Posted on 2013-03-11 08:40:39 PST by Peter Bostrm (pb...@chromium.org)

Created an attachment (id=192477)
[https://bugs.webkit.org/attachment.cgi?id=192477] [details]
[https://bugs.webkit.org/attachment.cgi?id=192477&action=edit]
SVG rendering in Chromium strips additional whitespace even though
xml:space="preserve" is present

================================

Comment #2
Posted on 2013-03-11 08:41:07 PST by Peter Bostrm (pb...@chromium.org)

Created an attachment (id=192478)
[https://bugs.webkit.org/attachment.cgi?id=192478] [details]
[https://bugs.webkit.org/attachment.cgi?id=192478&action=edit]
Example SVG file

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Apr 15, 2013, 4:40:12 PM4/15/13
to chromi...@chromium.org
Updates:
Status: Assigned
Owner: schen...@chromium.org

Comment #1 on issue 231508 by schen...@chromium.org: SVG rendering ignores
xml:space="preserve" attribute for text
http://code.google.com/p/chromium/issues/detail?id=231508

I think I saw this issue independently.

chro...@googlecode.com

unread,
Apr 16, 2013, 3:51:51 AM4/16/13
to chromi...@chromium.org

Comment #2 on issue 231508 by pb...@chromium.org: SVG rendering ignores
xml:space="preserve" attribute for text
http://code.google.com/p/chromium/issues/detail?id=231508

Issue 226962 has been merged into this issue.

chro...@googlecode.com

unread,
Apr 16, 2013, 3:53:51 AM4/16/13
to chromi...@chromium.org

Comment #3 on issue 231508 by pb...@chromium.org: SVG rendering ignores
xml:space="preserve" attribute for text
http://code.google.com/p/chromium/issues/detail?id=231508

You can easily repro it by opening the above SVG file. :)

As for the bug report, I of course meant that I am overall unfamiliar with
the WebKit code, now Blink code. Nice brain fart..

chro...@googlecode.com

unread,
Oct 20, 2013, 1:07:06 PM10/20/13
to chromi...@chromium.org

Comment #8 on issue 231508 by celso.pr...@gmail.com: SVG rendering ignores
xml:space="preserve" attribute for text
http://code.google.com/p/chromium/issues/detail?id=231508

Hi,

I can confirm this problem. Is there any perspectice of a fix soon ?

Since I am editing SVGs in my application, I wonder if anyone knows a
possible workaround for the time being.

[]

chro...@googlecode.com

unread,
Oct 23, 2013, 8:22:13 AM10/23/13
to chromi...@chromium.org

Comment #9 on issue 231508 by dschu...@chromium.org: SVG rendering ignores
xml:space="preserve" attribute for text
http://code.google.com/p/chromium/issues/detail?id=231508

I thought that I commented to this bug already, but I can't see it. Just in
case if it didn't get through: The SVG WG decided that xml:space should be
replaced by CSS white-space instead. So might be worth looking more into
this direction.

http://www.w3.org/Graphics/SVG/WG/wiki/SVG2_Requirements_Input#Use_CSS_.27white-space.27_instead_of_.27xml:space.27

chro...@googlecode.com

unread,
Oct 23, 2013, 8:34:14 AM10/23/13
to chromi...@chromium.org

Comment #10 on issue 231508 by pb...@chromium.org: SVG rendering ignores
xml:space="preserve" attribute for text
http://code.google.com/p/chromium/issues/detail?id=231508

Should we not still be supporting SVG1/1.1 even if SVG2 deprecates this
feature?

chro...@googlecode.com

unread,
Oct 23, 2013, 10:44:17 AM10/23/13
to chromi...@chromium.org

Comment #11 on issue 231508 by dschu...@chromium.org: SVG rendering ignores
xml:space="preserve" attribute for text
http://code.google.com/p/chromium/issues/detail?id=231508

I guess the point is more that we should encourage users to use the prober
way. Implementing xml:space first (which is not fully compatible to CSS
anyway IIRC) does not seem to be the right way.

Another note, it is deprecated and not mandatory. It is the question if we
still want to focus on SVG1.1 or go to SVG2 directly. Supporting multiple
levels seems to be hard to maintain. Given that we do not get a new version
on the version attribute on SVG2, it will be hard to differ anyway.
(version attribute is deprecated as well IIRC)

chro...@googlecode.com

unread,
Feb 18, 2014, 11:01:55 PM2/18/14
to chromi...@chromium.org

Comment #12 on issue 231508 by bugdro...@chromium.org: SVG rendering
ignores xml:space="preserve" attribute for text
http://code.google.com/p/chromium/issues/detail?id=231508#c12

The following revision refers to this bug:
http://src.chromium.org/viewvc/blink?view=rev&rev=167393

------------------------------------------------------------------------
r167393 | rob....@samsung.com | 2014-02-19T03:20:06.261060Z

Changed paths:
M
http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/linux/svg/W3C-SVG-1.1-SE/text-tspan-02-b-expected.png?r1=167393&r2=167392&pathrev=167393
M
http://src.chromium.org/viewvc/blink/trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/text-tspan-02-b-expected.png?r1=167393&r2=167392&pathrev=167393
M
http://src.chromium.org/viewvc/blink/trunk/LayoutTests/TestExpectations?r1=167393&r2=167392&pathrev=167393
M
http://src.chromium.org/viewvc/blink/trunk/Source/core/css/svg.css?r1=167393&r2=167392&pathrev=167393
M
http://src.chromium.org/viewvc/blink/trunk/LayoutTests/svg/W3C-SVG-1.1-SE/text-tspan-02-b-expected.txt?r1=167393&r2=167392&pathrev=167393

SVG rendering ignores xml:space="preserve" attribute for text

Make tspan and textPath inherit the css-whitespace property by default.
This means it will either use the
same xml:space setting as its parent text container, or use its own
xml:space value if provided.

This actually fixes text-tspan-02-b.svg.

BUG=231508

Review URL: https://codereview.chromium.org/166673006
------------------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages