Re: [svgwg] should textPath elements parented to tspans or other textPaths render?

Note that, per the CSS #3302 issue, the resolution of this issue has an effect on how we should specify `display:contents` to work on `tspan`. I was under the impression that `tspan` was "transparent", like `g`, so `display:contents` could "just work", but it looks like in current impls a `textSpan` is valid as a child of `text` but invalid as a child of `tspan`.

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 `textPath`, rendering the "bar" in exactly the position it would be in were the `textPath`'s text just rendered normally by the `text`.

In other words, it looks like, in Firefox, `text` calculates positions for all of its descendant characters, then a nested `textPath` can override those positions for characters inside of it.  In Chrome, the characters are instead laid out char-by-char, so `text` lays out "foo", then `textPath` takes over, then `text` lays out "bar" based on that information. 

Notably, the `dy` information *is* reflected in the positioning of "bar" in Firefox, but is *not* in Chrome; that's apparently not part of the positioning data the `textPath` passes back up to its parent `text`.

--------

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.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/580#issuecomment-437505909 using your GitHub account

Received on Friday, 9 November 2018 21:50:11 UTC