Skip to content

Enable moz-block-height #180

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevennovaryo
Copy link
Contributor

Enable -moz-block-height, internal value for CSS line-height property that is only usable in UA stylesheet.

Specifically, it will resolve the line height calculation to the containing block height, and in the calculation of the block height contribution, it will resolve like line-height: normal.

This property would then be able to be used to correct element widget as specified by https://html.spec.whatwg.org/multipage/rendering.html#the-input-element-as-a-text-entry-widget, where the used value for it's line height should be greater or equal to normal. And, https://drafts.csswg.org/css-ui/#input-rules where by default, one line text control should have it's content be aligned center vertically. Though further encapsulation with UA shadow dom is still necessary.

Stylo side of: 36930

Comment on lines 180 to 184
LineHeight::Normal => CSSPixelLength::new(0.),
LineHeight::Number(number) => font.font_size.computed_size() * number.0,
LineHeight::Length(length) => length.0,
// TODO: this should resolve like `normal` too.
LineHeight::MozBlockHeight => CSSPixelLength::new(0.),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LineHeight::Normal => CSSPixelLength::new(0.),
LineHeight::Number(number) => font.font_size.computed_size() * number.0,
LineHeight::Length(length) => length.0,
// TODO: this should resolve like `normal` too.
LineHeight::MozBlockHeight => CSSPixelLength::new(0.),
// TODO: compute `normal` and `-moz-block-height` from the font metrics.
LineHeight::Normal | LineHeight::MozBlockHeight => CSSPixelLength::new(0.),
LineHeight::Number(number) => font.font_size.computed_size() * number.0,
LineHeight::Length(length) => length.0,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

Signed-off-by: stevennovaryo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants