Skip to content
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

[css-inline-3] line-height and content height of inline box #3820

Open
prjnt opened this issue Apr 10, 2019 · 4 comments
Open

[css-inline-3] line-height and content height of inline box #3820

prjnt opened this issue Apr 10, 2019 · 4 comments
Labels
css-inline-3 Current Work

Comments

@prjnt
Copy link

prjnt commented Apr 10, 2019

css-inline-3 §2.4 (#valdef-line-sizing-normal) says:

Half-leading is inserted inside the content box edges

and

Negative half-leading is applied to all inline boxes,- reducing the size of the content box as needed

which I would take to mean that half-leading (and hence 'line-height') affects the content height of the inline box, but it does not actually specify what the content height is. Furthermore, §3.1 does specify the content height, but none of its definitions are affected by line-height. Furthermore, note that only negative half-leading is involved here, and it seems strange to specify that a reduced line-height should cause borders to overlap the ascenders and/or descenders of the text (at least in absence of padding).

I suggest (i) removing the quoted parts that suggest that 'line-height' affects content height; and (ii) that either the contribution of an inline box to the line-box height is determined solely by one of margin-box height and line-height (or conceivably the minimum of the two); or that some other property is involved in deciding the contribution (whether 'line-sizing', 'line-box-contain' or other).

@prjnt
Copy link
Author

prjnt commented Apr 12, 2019

I retract the "strange to specify ... overlap" part: overlapping asc & desc metrics doesn't necessarily imply overlapping ascenders or descenders, and if the author does want to reduce the space between border and text then the alternatives (leading-trim, or maybe use of inline-block) have costs of their own.

@fantasai fantasai added the css-inline-3 Current Work label Apr 12, 2019
@fantasai
Copy link
Collaborator

it does not actually specify what the content height is

That text hasn't been ported from CSS2.1 yet, which is why it's incorporated by reference.

Furthermore, §3.1 does specify the content height, but none of its definitions are affected by line-height.

It does seem that the interactions of line-sizing and inline-sizing weren't correctly handled.

Furthermore, note that only negative half-leading is involved here, and it seems strange to specify that a reduced line-height should cause borders to overlap the ascenders and/or descenders of the text (at least in absence of padding). I suggest (i) removing the quoted parts that suggest that 'line-height' affects content height; and (ii) that either the contribution of an inline box to the line-box height is determined solely by one of margin-box height and line-height (or conceivably the minimum of the two);

It's intentional that negative line-heights affect the content box of an inline, because if they didn't any child element inside a paragraph with e.g. line-height: 0.9 would force the line-height back up to 1.

@frivoal
Copy link
Collaborator

frivoal commented Apr 15, 2019

Note that the CSS2.1 text about line-height / content height itself is not up to date, pending #3749 being reapplied.

@fantasai
Copy link
Collaborator

fantasai commented May 28, 2020

Did some clean-up here, and in particular handled the interaction of inline-sizing: normal and line-sizing. Spec still needs more clean-up work overall, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-inline-3 Current Work
Projects
None yet
Development

No branches or pull requests

3 participants