I have a question about the procedure to compute the used value of "line-height".
I'm currently making a change on blink in
https://chromium-review.googlesource.com/c/chromium/src/+/1522053/3.
This change is for "line-height" to return used value instead of "normal keyword"
as resolved value.
In case of WebKit, fontMetrics().lineSpacing() value is used instead of 'normal' as below.
int RenderStyle::computedLineHeight() const
{
const Length& lh = lineHeight();
// Negative value means the line height is not set. Use the font's built-in spacing.
if (lh.isNegative())
return fontMetrics().lineSpacing();
if (lh.isPercentOrCalculated())
return minimumValueForLength(lh, computedFontPixelSize());
return clampTo<int>(lh.value());
}
And Firefox returns used value "px" instead of "normal" also.
But I'm not sure what is the exact procedure to compute the used value for "line-height",
because I coundn't find that in spec.
Is it ok to use font metircs linespacing value like WebKit, or is there a exact procedure to compute the used value?
I have a question about the procedure to compute the used value of "line-height".
I'm currently making a change on blink in
https://chromium-review.googlesource.com/c/chromium/src/+/1522053/3.
This change is for "line-height" to return used value instead of "normal keyword"
as resolved value.
In case of WebKit, fontMetrics().lineSpacing() value is used instead of 'normal' as below.
And Firefox returns used value "px" instead of "normal" also.
But I'm not sure what is the exact procedure to compute the used value for "line-height",
because I coundn't find that in spec.
Is it ok to use font metircs linespacing value like WebKit, or is there a exact procedure to compute the used value?