[css-inline-3] text-edge
only has an effect by itself in corner cases
#8475
Labels
css-inline-3
Current Work
[This is one of a series of issues we're filing about the design feedback of
leading-trim
andtext-edge
. As far as we know, these properties are unimplemented in any browser, which means now is a good time to give feedback on their overall design. For each of the issues we're filing, we don't have a fully-formed proposal that would solve the problem, but we do have some avenues of potential mitigation in mind, and we're offering these ideas as a starting point for further discussion.]When supplied alone,
text-edge
does nothing in the common case. But it can have an effect in certain situations. It is capable of producing a behavior change when supplied alone, when there’s an inline box on the line whose metrics are way larger than the root inline box’s metrics.The spec says:
The fact that the root inline box is excluded is the source of the problem. The line box stretches to include the tallest ascender and deepest descender of any line boxes on the line. In standards-mode (as opposed to quirks mode) this includes the metrics of the root inline box. So, if all the non-root inline boxes get smaller, but the root inline box stays the same, that won’t have any effect on the line!
But, what happens if there’s a font fallback? Well, if the used font has smaller metrics than the primary font’s metrics, then, again, there will be no change on the line. If the used font’s metrics are slightly bigger than the primary font’s metrics, then the specified text edge of the inline box won’t exceed the leading bounds of the root inline box, and there won’t be any effect on the line either. You’ll get a behavior change if the used font’s metrics are SO much larger than the primary font’s metrics that the specified text edge of the inline box DOES exceed the leading bounds of the root inline box - at that point, the line box will grow.
The fact that it does nothing in the common case means authors are more likely to sprinkle it around in places where it doesn’t belong. Authors don’t know which fallback fonts are picked by the browser, so having a behavior change occur only when the browser picks a particular fallback font seems like a footgun for portability.
One potential solution is to make
text-edge
apply to the root inline box too.An alternative potential solution is to make
text-edge
always have no behavior change when applied alone, but instead have it just set some internal variable (kind of similar to howcurrentColor
works) which can then be referenced by other properties likeleading-trim
. The use-case of wanting more rhythmic line positions (which is something thattext-edge
aspires to do today) could instead be worked into other properties - perhaps the properties in the rhythmic sizing spec, or maybe even theline-height
property. These properties would be made to use this internal variable to achieve the use-case.The text was updated successfully, but these errors were encountered: