Skip to content

[css-inline-3] 'vertical-align: middle' on table cells #5234

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

Closed
fantasai opened this issue Jun 18, 2020 · 1 comment
Closed

[css-inline-3] 'vertical-align: middle' on table cells #5234

fantasai opened this issue Jun 18, 2020 · 1 comment

Comments

@fantasai
Copy link
Collaborator

fantasai commented Jun 18, 2020

So... vertical-align: middle has special behavior on table cells: it causes align-content: normal to be treated as center (similar to how the top and bottom values trigger start and end, respectively).

Splitting 'vertical-align' into longhands means we have to map the behavior over from the longhands instead. Unfortunately since middle is an actual baseline (halfway between the alphabetic baseline and the ex-height) it's in alignment-baseline whereas top and bottom are line-relative values that shift content but don't represent an actual baseline, and are therefore in baseline-shift. Which means it's possible to specify alignment-baseline: middle; baseline-shift: top. Need to define whether that's treated as vertical-align: top or vertical-align: middle. My suggestion is that top and bottom take precedence, because that's what happens in inline layout as well (alignment baselines are ignored for alignment within the parent in favor of top/bottom alignment within the line box).

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-inline-3] 'vertical-align: middle' on table cells, and agreed to the following:

  • RESOLVED: top and bottom take precedence over middle
The full IRC log of that discussion <dael> Topic: [css-inline-3] 'vertical-align: middle' on table cells
<dael> github: https://github.com//issues/5234
<dael> fantasai: has top keyword and bottom keyword which are special b/c don't work off baseline. THey shift based on total linebox size.
<dael> fantasai: Also has middle which is x-middle baseline and aligns to x-middle of parent. Same as alphabetic
<dael> fantasai: We also have vertical-align top, middle, bottom all behave completely unrelated to inline layout and they are basically start, center and end. By splitting to longhand it means we have to map to magic. Middle is part of alignment-baseline and top and bottom are line relative
<dael> fantasai: Can spec vertical-align top middle on a table cell. What does that mean?
<dael> fantasai: I prefer top and bottom take precedence
<dbaron> sounds fine to me
<dael> AmeliaBR: Did debate recently about which longhand top and bottom go to. One solution is move them into other longhand to solve this one issue
<dael> AmeliaBR: It would meant that alignment-baseline controls table alignment b/c that makes no less sense than anything else
<dael> florian: THink we had reasons to put in longhand we picked
<dael> fantasai: B/c not possible to combine top or bottom with shift. Can in theory with everything else
<dael> fantasai: I don't have a strong feeling about this. Don't know if anyone else does
<dael> florian: To extent we keep in longhand your proposal seems reasonable. Should they be moved is separate
<dael> fantasai: Right, we can re-open that issue and tag for discussion
<dael> fantasai: This top and bottom take precedence over middle
<florian> s/keep in longhand/keep in this longhand/
<dael> Rossen_: Other comments or objections?
<fantasai> s/we can/anyone who wants can/
<dael> RESOLVED: top and bottom take precedence over middle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants