-
Notifications
You must be signed in to change notification settings - Fork 711
[css-size-adjust] Clarify interaction between text-size-adjust and em units #11636
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
This seems more generally to be a question about what Based on both discussion and testing, it seems the behavior definitely doesn't match the spec, but also differs significantly between iOS and Android. In particular:
Philip didn't test explicitly for the effects of inheritance; you can see it in this test case (load it up on a phone, or in an emulator; <!DOCTYPE html>
<p class=unscaled>unscaled text</p>
<div id=parent>
parent
<div id=child>
child
</div>
</div>
<style>
html { font-size: 16px; }
.unscaled, #parent, #child { font-size: 2em; margin: 0; }
#parent { text-size-adjust: 300%; -webkit-text-size-adjust: 300%; }
#parent, #child {
height: 1em;
background: repeating-linear-gradient(white 0 16px, silver 0 32px);
outline: dotted thin red;
padding-left: 10px;
}
</style> The gradient bars are there for scale - each bar is On Android, the parent is On iOS, the parent is 6rem tall and the child is I'm not entirely sure what our conclusions should be here. However, the spec definitely needs to be fixed in some way, and how we resolve this also affects how we want to specify the ( Can someone from Apple shed some light on how exactly iOS text scaling works? I'm not sure who works on text over there anymore - @hober @stubbornella help? The important bit here is that the behavior is almost certainly at least somewhat motivated by compat, but the lack of compat in I suspect that we still want to minimize the amount of magic we introduce for this, so there's two possible routes I find that are relatively minimal in magic:
I lean slightly towards the Android behavior here, because of its simplicity in the model, but I could be convinced either way. |
It is not clear how
text-size-adjust
andem
units should interact (spec). Not adjusting em units leads to clipped text. Adjusting em units leads to double-adjustment of line-height.Example (live):
Comparison between Webkit (left) and Chromium (right):

The text was updated successfully, but these errors were encountered: