diff --git a/components/canvas/canvas_data.rs b/components/canvas/canvas_data.rs index 17c63767033..529555f211b 100644 --- a/components/canvas/canvas_data.rs +++ b/components/canvas/canvas_data.rs @@ -488,7 +488,7 @@ impl<'a> CanvasData<'a> { .state .font_style .as_ref() - .map_or(10., |style| style.font_size.size().px()); + .map_or(10., |style| style.font_size.computed_size().px()); let font_style = self.state.font_style.as_ref(); let font = font_style.map_or_else( || load_system_font_from_style(None), diff --git a/components/gfx/font.rs b/components/gfx/font.rs index eb5124f408b..371b3a46ede 100644 --- a/components/gfx/font.rs +++ b/components/gfx/font.rs @@ -137,7 +137,7 @@ impl<'a> From<&'a FontStyleStruct> for FontDescriptor { FontDescriptor { template_descriptor: FontTemplateDescriptor::from(style), variant: style.font_variant_caps, - pt_size: Au::from_f32_px(style.font_size.size().px()), + pt_size: Au::from_f32_px(style.font_size.computed_size().px()), } } } diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs index d8d43fd508f..cd07e658b3e 100644 --- a/components/gfx/font_context.rs +++ b/components/gfx/font_context.rs @@ -95,7 +95,7 @@ impl FontContext { self.expire_font_caches_if_necessary(); let cache_key = FontGroupCacheKey { - size: Au::from_f32_px(style.font_size.size().px()), + size: Au::from_f32_px(style.font_size.computed_size().px()), style, }; diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs index 85f98795d1a..da3eb50d978 100644 --- a/components/layout/multicol.rs +++ b/components/layout/multicol.rs @@ -111,9 +111,13 @@ impl Flow for MulticolFlow { NonNegativeLengthPercentageOrNormal::LengthPercentage(ref len) => { len.0.to_pixel_length(content_inline_size) }, - NonNegativeLengthPercentageOrNormal::Normal => { - self.block_flow.fragment.style.get_font().font_size.size() - }, + NonNegativeLengthPercentageOrNormal::Normal => self + .block_flow + .fragment + .style + .get_font() + .font_size + .computed_size(), }); let column_style = style.get_column(); diff --git a/components/layout/text.rs b/components/layout/text.rs index 230830ae4df..ea476909ef0 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -551,7 +551,7 @@ 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.size(); + let font_size = style.get_font().font_size.computed_size(); match style.get_inherited_text().line_height { LineHeight::Normal => Au::from(metrics.line_gap), LineHeight::Number(l) => Au::from(font_size * l.0), diff --git a/components/layout_2020/flow/inline.rs b/components/layout_2020/flow/inline.rs index 840d60662e1..70b789b8e4b 100644 --- a/components/layout_2020/flow/inline.rs +++ b/components/layout_2020/flow/inline.rs @@ -1886,7 +1886,7 @@ struct TextRunLineItem { } fn line_height(parent_style: &ComputedValues, font_metrics: &FontMetrics) -> Length { - let font_size = parent_style.get_font().font_size.size.0; + let font_size = parent_style.get_font().font_size.computed_size(); match parent_style.get_inherited_text().line_height { LineHeight::Normal => font_metrics.line_gap, LineHeight::Number(number) => font_size * number.0, diff --git a/components/layout_2020/query.rs b/components/layout_2020/query.rs index 3ea4003cd0a..ecdeacd1e64 100644 --- a/components/layout_2020/query.rs +++ b/components/layout_2020/query.rs @@ -278,7 +278,7 @@ pub fn process_resolved_style_request<'dom>( // For line height, the resolved value is the computed value if it // is "normal" and the used value otherwise. if longhand_id == LonghandId::LineHeight { - let font_size = style.get_font().font_size.size.0; + let font_size = style.get_font().font_size.computed_size(); return match style.get_inherited_text().line_height { LineHeight::Normal => computed_style(), LineHeight::Number(value) => (font_size * value.0).to_css_string(),