From dc5a9e56c74255d6dfd43b6c022a7b6c0e26ce0b Mon Sep 17 00:00:00 2001 From: James Gilbertson Date: Thu, 5 Mar 2015 10:05:58 -0700 Subject: [PATCH] The 'font-size' property needs to use context.inherited_font_size, not context.font_size --- components/style/properties.mako.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index f0215854a164..c2fca142c713 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -21,7 +21,7 @@ use geom::num::Zero; use geom::SideOffsets2D; use geom::size::Size2D; -use values::specified::BorderStyle; +use values::specified::{Length, BorderStyle}; use values::computed::{self, ToComputedValue}; use selectors::matching::DeclarationBlock; use parser::{ParserContext, log_css_error}; @@ -3775,7 +3775,14 @@ pub fn cascade(viewport_size: Size2D, match *declaration { PropertyDeclaration::FontSize(ref value) => { context.font_size = match *value { - DeclaredValue::SpecifiedValue(ref specified_value) => specified_value.0.to_computed_value(&context), + DeclaredValue::SpecifiedValue(ref specified_value) => { + match specified_value.0 { + Length::FontRelative(value) => value.to_computed_value(context.inherited_font_size, + context.root_font_size), + Length::ServoCharacterWidth(value) => value.to_computed_value(context.inherited_font_size), + _ => specified_value.0.to_computed_value(&context) + } + } DeclaredValue::Initial => longhands::font_size::get_initial_value(), DeclaredValue::Inherit => context.inherited_font_size, }