Skip to content

Commit

Permalink
The 'font-size' property needs to use context.inherited_font_size, no…
Browse files Browse the repository at this point in the history
…t context.font_size
  • Loading branch information
luniv committed Mar 5, 2015
1 parent c066377 commit dc5a9e5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions components/style/properties.mako.rs
Expand Up @@ -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};
Expand Down Expand Up @@ -3775,7 +3775,14 @@ pub fn cascade(viewport_size: Size2D<Au>,
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,
}
Expand Down

0 comments on commit dc5a9e5

Please sign in to comment.