Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

SVG Preview (Scaled)

Preview of https://raw.githubusercontent.com/mozilla-firefox/firefox/main/testing/web-platform/tests/svg/text/reftests/textpath-pathlength-zero-offset-zero.svg
<svg width="400" height="100" xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml">
<title>pathLength of zero leaves a startOffset of zero at the start of the path</title>
<metadata>
<html:link rel="author" title="Karl Dubost" href="mailto:k_dubost@apple.com"/>
<html:link rel="match" href="textpath-pathlength-zero-offset-zero-ref.svg"/>
<html:meta name="assert" content="A pathLength of zero is valid and must be treated as a scaling factor of infinity, and a value of zero scaled infinitely must remain zero. So a startOffset of zero is unaffected, and the text starts at the beginning of the path exactly as it would with no pathLength at all. The reference is the same markup without pathLength. An implementation that multiplies without guarding the zero computes zero times infinity, which is not a number, and either loses the text or places it at a meaningless position."/>
</metadata>
<defs>
<path id="line" d="M 10 50 L 390 50" pathLength="0"/>
</defs>
<text>
<textPath href="#line" startOffset="0">Zero offset stays at the start</textPath>
</text>
</svg>