Skip to content

Support path attribute on <textPath> element#1020

Open
yisibl wants to merge 4 commits intolinebender:mainfrom
yisibl:add-path-on-textPath
Open

Support path attribute on <textPath> element#1020
yisibl wants to merge 4 commits intolinebender:mainfrom
yisibl:add-path-on-textPath

Conversation

@yisibl
Copy link
Copy Markdown
Contributor

@yisibl yisibl commented Feb 13, 2026

Currently, there is a conflict within the SVG2 specification regarding:

If the ‘path’ attribute contains an error, the ‘href’ attribute must be used.
w3.org/TR/SVG2/text.html#TextPathElement:~:text=If the ‘path’ attribute contains an error

Both @AmeliaBR and @karlcow believe this should be removed from the specification w3c/svgwg#393 (comment), which is what the current PR does. This also maintains interoperability with browser implementations.

I added a test case for this purpose: textPath/with-error-path.svg

See also:

Fixes: #417

@yisibl yisibl changed the title Support path attribute on <textPath> element Support path attribute on <textPath> element Feb 13, 2026
@LaurenzV
Copy link
Copy Markdown
Collaborator

LaurenzV commented Mar 1, 2026

In Chrome I'm not seeing any text on most of those, is that intended?
image

Copy link
Copy Markdown
Collaborator

@LaurenzV LaurenzV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just two comments.

xmlns:xlink="http://www.w3.org/1999/xlink">
<title>With partially invalid `path` and `xlink:href` fallback (SVG 2)</title>
<desc>
If the `path` attribute contains any parse error, the `xlink:href` path must be used.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But right now, the text is not using the xlink:href one, right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Seems to be what Firefox and CHrome do, but then the comment itself confuses me.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This oen looks wrong?

@yisibl
Copy link
Copy Markdown
Contributor Author

yisibl commented Mar 19, 2026

Thank you for your review. I'm awaiting updates from SVGWG regarding their findings and tests.

I'll be back later.

@yisibl
Copy link
Copy Markdown
Contributor Author

yisibl commented Mar 19, 2026

Thank you for your review. I'm awaiting updates from SVGWG regarding their findings and tests.

I'll be back later.

@yisibl
Copy link
Copy Markdown
Contributor Author

yisibl commented Mar 19, 2026

Chrome currently does not support using Basic shapes within <textPath>.
You can test it using Firefox.

In Chrome I'm not seeing any text on most of those, is that intended? image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support the path property of textPath

2 participants