NEW 149659
SVG text and trailing space added as leading space to next tspan
https://bugs.webkit.org/show_bug.cgi?id=149659
Summary SVG text and trailing space added as leading space to next tspan
Dirk Schulze
Reported 2015-09-30 05:08:02 PDT
Created attachment 262152 [details] Preserve spaces and incorrect behavior on trailing wsp <text x="200" y="230"> <tspan text-decoration="underline" xml:space="preserve"> space test</tspan> <tspan text-decoration="underline" x="200" y="250">space </tspan> <tspan text-decoration="underline" xml:space="preserve" x="200" y="270">space </tspan> </text> The trailing space on each span is incorrectly added as leading space to the next span on xml:space=preserve.
Attachments
Preserve spaces and incorrect behavior on trailing wsp (359 bytes, image/svg+xml)
2015-09-30 05:08 PDT, Dirk Schulze
no flags
Dirk Schulze
Comment 1 2015-09-30 05:13:15 PDT
Filed issue for Blink as well. Both, WebKit and Blink share the same code still: https://code.google.com/p/chromium/issues/detail?id=537581
Chinh Nguyen
Comment 2 2015-10-19 08:25:08 PDT
It affects the last character regardless of whether it's a white space. <text x="200" y="230"> <tspan text-decoration="underline" xml:space="preserve"> space test</tspan> <tspan x="200" y="250" xml:space="preserve">space</tspan> <tspan text-decoration="underline" xml:space="preserve" x="200" y="270">space </tspan> </text> <text x="200" y="230"> <tspan xml:space="preserve">ƒ</tspan> <tspan xml:space="preserve">(x)=2e</tspan> <tspan xml:space="preserve" dy="-10">-2x</tspan> </text>
Radar WebKit Bug Importer
Comment 3 2015-10-19 10:01:55 PDT
Ahmad Saleem
Comment 4 2022-10-05 09:10:14 PDT
I am able to reproduce this bug in Safari Technology Preview 154 and the last line has leading space while both Chrome Canary 108 and Firefox Nightly 108 does not. It was fixed by following Blink commit: https://chromium.googlesource.com/chromium/src.git/+/9331211c22aee7b499131aa1c58ce515deceeb45 We do have references to following code here: https://github.com/WebKit/WebKit/blob/8afe31a018b11741abdf9b4d5bb973d7c1d9ff05/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp#L141 Just wanted to updated latest result. Thanks!
Note You need to log in before you can comment on or make changes to this bug.