<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>311185</bug_id>
          
          <creation_ts>2026-03-31 07:19:11 -0700</creation_ts>
          <short_desc>SVG tspan positioning bug with xml:space=&quot;preserve&quot;</short_desc>
          <delta_ts>2026-03-31 17:26:17 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>SVG</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://github.com/web-platform-tests/wpt/pull/58897</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Karl Dubost">karlcow</reporter>
          <assigned_to name="Karl Dubost">karlcow</assigned_to>
          <cc>sabouhallawa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2195527</commentid>
    <comment_count>0</comment_count>
      <attachid>478860</attachid>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2026-03-31 07:19:11 -0700</bug_when>
    <thetext>Created attachment 478860
testcase

When SVG &lt;tspan&gt; elements have xml:space=&quot;preserve&quot; 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.

&lt;text transform=&quot;translate(300 300)&quot; fill=&quot;black&quot;&gt;
  &lt;tspan font-family=&quot;Helvetica Neue&quot; font-size=&quot;16&quot; x=&quot;120&quot; y=&quot;70.34399&quot; xml:space=&quot;preserve&quot;&gt;A&lt;/tspan&gt;
  &lt;tspan font-family=&quot;Helvetica Neue&quot; font-size=&quot;16&quot; x=&quot;120&quot; y=&quot;88.79199&quot; xml:space=&quot;preserve&quot;&gt;AB&lt;/tspan&gt;
  &lt;tspan font-family=&quot;Helvetica Neue&quot; font-size=&quot;16&quot; x=&quot;120&quot; y=&quot;107.23999&quot; xml:space=&quot;preserve&quot;&gt;Z&lt;/tspan&gt;
&lt;/text&gt;

Renders in Firefox/Chrome
A
AB
Z

Renders in Safari
A
A
BZ</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2195528</commentid>
    <comment_count>1</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2026-03-31 07:20:19 -0700</bug_when>
    <thetext>rdar://143722975</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2195529</commentid>
    <comment_count>2</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2026-03-31 07:21:00 -0700</bug_when>
    <thetext>This also creates rendering issue on 
https://github.com/w3c/csswg-drafts/issues/11610#issuecomment-2680514021</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2195539</commentid>
    <comment_count>3</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2026-03-31 07:43:34 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/61764</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2195747</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-03-31 17:24:04 -0700</bug_when>
    <thetext>Committed 310347@main (279d4c423fd2): &lt;https://commits.webkit.org/310347@main&gt;

Reviewed commits have been landed. Closing PR #61764 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2195748</commentid>
    <comment_count>5</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2026-03-31 17:26:17 -0700</bug_when>
    <thetext>Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/58897</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>478860</attachid>
            <date>2026-03-31 07:19:11 -0700</date>
            <delta_ts>2026-03-31 07:19:11 -0700</delta_ts>
            <desc>testcase</desc>
            <filename>minimal.svg</filename>
            <type>image/svg+xml</type>
            <size>806</size>
            <attacher name="Karl Dubost">karlcow</attacher>
            
              <data encoding="base64">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjwh
RE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cu
dzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4x
IiB4bWxuczp4bD0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6ZGM9Imh0dHA6
Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAw
MC9zdmciIHZpZXdCb3g9IjM2MCAzMzMgMzM4IDE0MCIgd2lkdGg9IjMzOCIgaGVpZ2h0PSIxNDAi
PgogICAgICAgIDx0ZXh0IHRyYW5zZm9ybT0idHJhbnNsYXRlKDMwMCAzMDApIiBmaWxsPSJibGFj
ayI+CiAgICAgICAgICA8dHNwYW4gZm9udC1mYW1pbHk9IkhlbHZldGljYSBOZXVlIiBmb250LXNp
emU9IjE2IiBmaWxsPSJibGFjayIgeD0iMTIwIiB5PSI3MC4zNDM5OSIgeG1sOnNwYWNlPSJwcmVz
ZXJ2ZSI+QTwvdHNwYW4+CiAgICAgICAgICA8dHNwYW4gZm9udC1mYW1pbHk9IkhlbHZldGljYSBO
ZXVlIiBmb250LXNpemU9IjE2IiBmaWxsPSJibGFjayIgeD0iMTIwIiB5PSI4OC43OTE5OSIgeG1s
OnNwYWNlPSJwcmVzZXJ2ZSI+QUI8L3RzcGFuPgogICAgICAgICAgPHRzcGFuIGZvbnQtZmFtaWx5
PSJIZWx2ZXRpY2EgTmV1ZSIgZm9udC1zaXplPSIxNiIgZmlsbD0iYmxhY2siIHg9IjEyMCIgeT0i
MTA3LjIzOTk5IiB4bWw6c3BhY2U9InByZXNlcnZlIj5aPC90c3Bhbj4KICAgICAgICA8L3RleHQ+
Cjwvc3ZnPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>