Oriol Brufau 2024-03-30 14:30:13 +01:00 committed by GitHub
parent a7ad92d9a3
commit fff9ef87e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 97 additions and 181 deletions

View file

@ -23,7 +23,7 @@ use style::computed_values::word_break::T as WordBreak;
use style::logical_geometry::{LogicalSize, WritingMode};
use style::properties::style_structs::Font as FontStyleStruct;
use style::properties::ComputedValues;
use style::values::generics::text::LineHeight;
use style::values::generics::font::LineHeight;
use style::values::specified::text::{TextTransform, TextTransformCase};
use unicode_bidi as bidi;
use unicode_script::Script;
@ -550,8 +550,9 @@ pub fn font_metrics_for_style(
/// Returns the line block-size needed by the given computed style and font size.
pub fn line_height_from_style(style: &ComputedValues, metrics: &FontMetrics) -> Au {
let font_size = style.get_font().font_size.computed_size();
match style.get_inherited_text().line_height {
let font = style.get_font();
let font_size = font.font_size.computed_size();
match font.line_height {
LineHeight::Normal => metrics.line_gap,
LineHeight::Number(l) => Au::from(font_size * l.0),
LineHeight::Length(l) => Au::from(l),