Bug 311185

Summary: SVG tspan positioning bug with xml:space="preserve"
Product: WebKit Reporter: Karl Dubost <karlcow>
Component: SVGAssignee: Karl Dubost <karlcow>
Status: RESOLVED FIXED    
Severity: Normal CC: sabouhallawa, webkit-bug-importer, zimmermann
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://github.com/web-platform-tests/wpt/pull/58897
Attachments:
Description Flags
testcase none

Karl Dubost
Reported 2026-03-31 07:19:11 PDT
Created attachment 478860 [details] testcase When SVG <tspan> elements have xml:space="preserve" and are separated by whitespace text nodes (typical of indented markup), the tspan x/y positions are assigned to the wrong characters. This causes text to be visually split and mispositioned. <text transform="translate(300 300)" fill="black"> <tspan font-family="Helvetica Neue" font-size="16" x="120" y="70.34399" xml:space="preserve">A</tspan> <tspan font-family="Helvetica Neue" font-size="16" x="120" y="88.79199" xml:space="preserve">AB</tspan> <tspan font-family="Helvetica Neue" font-size="16" x="120" y="107.23999" xml:space="preserve">Z</tspan> </text> Renders in Firefox/Chrome A AB Z Renders in Safari A A BZ
Attachments
testcase (806 bytes, image/svg+xml)
2026-03-31 07:19 PDT, Karl Dubost
no flags
Karl Dubost
Comment 1 2026-03-31 07:20:19 PDT
Karl Dubost
Comment 2 2026-03-31 07:21:00 PDT
Karl Dubost
Comment 3 2026-03-31 07:43:34 PDT
EWS
Comment 4 2026-03-31 17:24:04 PDT
Committed 310347@main (279d4c423fd2): <https://commits.webkit.org/310347@main> Reviewed commits have been landed. Closing PR #61764 and removing active labels.
Karl Dubost
Comment 5 2026-03-31 17:26:17 PDT
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/58897
Note You need to log in before you can comment on or make changes to this bug.