Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How come getComputedTextLength() gives different results in Chrome and Firefox?

Tags:

javascript

svg

I'm using getComputedTextLength() on SVG text elements to wrap text lines. However, I get different results in Firefox and Chrome. Here is an example that gives different results using Chromium 18.0 and Firefox 12.0: http://jsfiddle.net/cBSp4/2/

How come the result is different and, more importantly, is it fixable?

(Values from getBBox() seem to be alright, so I'm using that as a workaround at the moment).

like image 942
Josef Engelfrost Avatar asked May 10 '12 08:05

Josef Engelfrost


1 Answers

Should be fixed in Firefox 25 when the big SVG text rewrite goes live.

like image 175
Robert Longson Avatar answered Oct 25 '22 01:10

Robert Longson