-
Notifications
You must be signed in to change notification settings - Fork 707
[css-values-4] Cyclic dependency between lh
and font-relative units
#9018
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
Comments
(1) is basically #8169
It's already covered in the spec, note that BTW, registered properties introduce another cycle: w3c/css-houdini-drafts#1080 |
Their topics are different, unless we want to repurpose #8169 to discuss dependency instead?
Thanks for the pointer! Then we don't have an issue here.
I think this is already covered by https://drafts.css-houdini.org/css-properties-values-api/#dependency-cycles? However, for backward compatibility reasons, we can't adopt the same approach (i.e., make everything in the cycle invalid) for built-in properties. |
That only handles registered properties with a syntax of |
Can we simply extend the behavior that font-relative units have in |
Anything else to do here after the resolution in #8169 (comment) ? |
Nope |
The spec only covers two cases of cyclic dependency:
font-size
lh
/rlh
used inline-height
There are more cases that are not covered:
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 likeatan2()
andsign()
that can convert a<length>
into a non-length type is properly implemented. This has also been discussed in #8169For (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 implementedlh
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.
The text was updated successfully, but these errors were encountered: