Open Bug 950110 Opened 11 years ago Updated 2 years ago

textLength on SVG <text> elements should adjust dx on child <tspan> elements

Categories

(Core :: SVG, defect)

26 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: john, Unassigned)

References

()

Details

Attachments

(1 file)

Attached image tspan.svg
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:26.0) Gecko/20100101 Firefox/26.0 (Beta/Release)
Build ID: 20131205075310

Steps to reproduce:

Create an SVG <text> element with textLength set, then add a child <tspan> element with its dx attribute set. Here's a test case:

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
  <style>
    text { font: 20px Verdana }
    tspan { fill: red; font-weight: bold }
  </style>
  <text x="15" y="30">You are 
    <tspan dx="10">not</tspan> 
    a banana
  </text>
  <rect x="15" y="37" width="230" height="3" fill="green"/>
  <text x="15" y="60" textLength="230">You are 
    <tspan dx="10">not</tspan> 
    a banana
  </text>
</svg>


Actual results:

The space contributed by the dx is not adjusted.


Expected results:

The spacing contributed by the dx should be adjusted proportionally, i.e. a dx which represents 10% of its parent <text> element's width should represent 10% of that width after the parent <text> element is adjusted.

Right now, this is implemented correctly in the other major browsers, namely:

* IE 9
* Chrome 31
* Safari 7
OS: Mac OS X → All
Hardware: x86 → All
Component: Untriaged → SVG
Product: Firefox → Core
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: