Description
The spec only covers two cases of cyclic dependency:
- Font-relative units used in
font-size
lh
/rlh
used inline-height
There are more cases that are not covered:
- Font-relative units used in other font properties that affect font selection, e.g.,
font-weight: calc(10ex / 1px)
Dependency cycle formed by font properties andline-height
, e.g.,line-height: 2em; font-size: 1lh
(Edit: 2 is already covered, as lh
is considered a font-relative length unit)
Right now (1) isn't surfaced in any browser because no one supports calc(10ex / 1px)
yet. But this will also surface if functions like atan2()
and sign()
that can convert a <length>
into a non-length type is properly implemented. This has also been discussed in #8169
For (2), currently Blink and WebKit are breaking the cycle by using parent's line height to compute fon-size
(see (test case)[https://jsfiddle.net/3rojdnsc/]). Gecko hasn't implemented lh
yet.
I don't have a strong opinion on how exactly the cycle should be broken, and I guess it doesn't matter because there's no real use case with such dependency cycles. We just need a solution for spec completeness.