Why will Firefox not measure the length of this SVG path


<g fill="none" stroke-width="0.6">
    <path id="trouble" stroke-miterlimit="10" stroke="#ff5500" d="M1051.19,607.23c3.8-1.9,4.1,4.9,3.5,7c-0.7,2.3-2.6,4.6-5.3,3.8c-3.9-1.1-4.4-6.9-4-10.1c0.8-7.2,7.2-10.7,12.2-4.4c4.1,5.2,5.4,15.4,4.7,21.8c-0.5,4.4-3.3,10.4-8.8,8.1c-4.6-1.9-4.4-9.8-0.1-11.9c7.9-3.8,4.5,12.1-0.3,6.8"/>

Chrome and Firefox both paint the little red squiggle correctly. Chrome measures the path length correctly using path.getTotalLength(). Firefox returns NaN for the path length. Why?

(I have dozens of other paths that Firefox measures the length of correctly. There’s something about this path in particular, generated using Illustrator. The syntax looks correct to me AFAIK.)



Source: javascript

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.