New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
should textPath elements parented to tspans or other textPaths render? #580
Comments
Note that, per the CSS #3302 issue, the resolution of this issue has an effect on how we should specify I'm gradually figuring out what an appropriate layout model should be for these text elements, based on fooling around a bit with them, but yeah, the current spec does not describe this sufficiently. Note that the layout model of some definitely valid content isn't even specified, and browsers vary significantly: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/6361 Chrome lays out the "bar" horizontally, starting from the point where the path would have laid out its next character. Firefox instead totally ignores the In other words, it looks like, in Firefox, Notably, the So what I'm saying is, the entire text rendering system is underspecified when you do anything remotely weird, and definitely needs fixing. Might as well figure out a model that works well for mixing these things while we're at it. |
I spent a bunch of time a few years ago to figure this out and come up with as consistent a model as I could for how positioning attributes, |
I couldn't immediately find a description of what happens in my earlier example, where there's more text continuing after the textpath. Is it obvious and I'm missing something (likely)? |
I think that would be covered by (prose):
(https://svgwg.org/svg2-draft/text.html#TextLayoutPath just before 11.9) And also, maybe more importantly, part of the text layout algorithm (https://svgwg.org/svg2-draft/text.html#TextLayoutAlgorithm) where I think the words to look for are "after path" (referenced near the end). |
Ah, cool, that's exactly it. (And, as it turns out, nobody follows that: Chrome starts up the rendering right where it would have rendered the next character on the path, rather than at the end of the path; Firefox starts up the rendering at an x position where it would have rendered the next character in the path, and at a y position where it would have been without any Okay, so we have an answer.
I'm not sure if either one is more obviously "correct" than the other. |
Option (1) sounds about like what I would expect - a bit depending on what "ignores" is supposed to encompass I guess. When you reach the |
Yup, exactly. Just render according to the path (and any descendant |
#274 seems to be related to this issue. |
Wow. I had no idea no one supported textPath inside tspan. That does make things more annoying. As for @tabatkins example of cross-browser inconsistencies when text follows the end of a textPath: The undefined/inconsistent behavior was noted and a result specified two years ago, it's just that no one has followed up to get browsers to implement the specified version. See #104 |
I only edited what the group agreed to... I wasn't the one pushing for text outside of a textPath to be rendered (it never occurred to me that it would be until the issue was brought up). |
The SVG Working Group just discussed
The full IRC log of that discussion<AmeliaBR> Topic: should textPath elements parented to tspans or other textPaths render?<AmeliaBR> github: https://github.com//issues/580 <AmeliaBR> Dirk: This issue discussion is bigger than the title, but let's focus on that specific question. <AmeliaBR> ... based on browser testing, textPath that is a child of tspan is not rendered. <AmeliaBR> ... so we'd need to change the content model of tspan to not include textPath. Also textPath could not have a textPath as a child. <AmeliaBR> ... textPath would only be valid as a child of text <AmeliaBR> Amelia: Well, there are also link elements, which confuse up the content models. <AmeliaBR> Chris: Yes, that sort of pass-through content model is difficult to define. <AmeliaBR> Dirk: With that complication, do we agree on the change? Then we can figure out how to specify it. <AmeliaBR> Amelia: I agree that we should change the spec to match reality, even if that's not the most logical model. <AmeliaBR> RESOLVED: textPath is invalid as a child of tspan or textPath <AmeliaBR> Amelia: And then we need some testing for the `a` element to see if it correctly behaves as a transparent content model. <AmeliaBR> rrsagent, publish minutes <RRSAgent> I have made the request to generate https://www.w3.org/2018/12/03-svg-minutes.html AmeliaBR <krit> Thanks AmeliaBR for scribing! <AmeliaBR> trackbot, end telcon |
No browser renders nested
<textPath>
s or those that are parented to a<tspan>
, but the spec doesn't disallow this. I'm not sure if the text layout algorithm handles this (or what the behavior should be) if it is meant to be allowed.The text was updated successfully, but these errors were encountered: