Skip to content

Commit

Permalink
Move CSS line-height property from InheritedBox to InheritedText
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioc committed Apr 5, 2016
1 parent bbc5c51 commit d8222dd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/layout/incremental.rs
Expand Up @@ -202,7 +202,7 @@ pub fn compute_damage(old: Option<&Arc<ServoComputedValues>>, new: &ServoCompute
get_padding.padding_top, get_padding.padding_right,
get_padding.padding_bottom, get_padding.padding_left,
get_box.width, get_box.height,
get_inheritedbox.line_height,
get_inheritedtext.line_height,
get_inheritedtext.text_align, get_inheritedtext.text_indent,
get_table.table_layout,
get_inheritedtable.border_collapse,
Expand Down
2 changes: 1 addition & 1 deletion components/layout/text.rs
Expand Up @@ -417,7 +417,7 @@ pub fn font_metrics_for_style(font_context: &mut FontContext, font_style: Arc<Fo
/// Returns the line block-size needed by the given computed style and font size.
pub fn line_height_from_style(style: &ServoComputedValues, metrics: &FontMetrics) -> Au {
let font_size = style.get_font().font_size;
match style.get_inheritedbox().line_height {
match style.get_inheritedtext().line_height {
line_height::T::Normal => metrics.line_gap,
line_height::T::Number(l) => font_size.scale_by(l),
line_height::T::Length(l) => l
Expand Down
4 changes: 2 additions & 2 deletions components/style/animation.rs
Expand Up @@ -160,7 +160,7 @@ impl PropertyAnimation {
[FontWeight; get_font; font_weight],
[Height; get_box; height],
[Left; get_position; left],
[LineHeight; get_inheritedbox; line_height],
[LineHeight; get_inheritedtext; line_height],
[MarginBottom; get_margin; margin_bottom],
[MarginLeft; get_margin; margin_left],
[MarginRight; get_margin; margin_right],
Expand Down Expand Up @@ -258,7 +258,7 @@ impl PropertyAnimation {
[FontWeight; mutate_font; font_weight],
[Height; mutate_box; height],
[Left; mutate_position; left],
[LineHeight; mutate_inheritedbox; line_height],
[LineHeight; mutate_inheritedtext; line_height],
[MarginBottom; mutate_margin; margin_bottom],
[MarginLeft; mutate_margin; margin_left],
[MarginRight; mutate_margin; margin_right],
Expand Down
8 changes: 4 additions & 4 deletions components/style/properties.mako.rs
Expand Up @@ -674,7 +674,9 @@ pub mod longhands {
"computed::LengthOrPercentageOrNone::None",
"parse_non_negative")}

${switch_to_style_struct("InheritedBox")}
${new_style_struct("InheritedText", is_inherited=True, gecko_name="nsStyleText",
additional_methods=[Method("clone__servo_text_decorations_in_effect",
"longhands::_servo_text_decorations_in_effect::computed_value::T")])}

<%self:longhand name="line-height">
use cssparser::ToCss;
Expand Down Expand Up @@ -1977,9 +1979,7 @@ pub mod longhands {

// CSS 2.1, Section 16 - Text

${new_style_struct("InheritedText", is_inherited=True, gecko_name="nsStyleText",
additional_methods=[Method("clone__servo_text_decorations_in_effect",
"longhands::_servo_text_decorations_in_effect::computed_value::T")])}
${switch_to_style_struct("InheritedText")}

<%self:longhand name="text-align">
pub use self::computed_value::T as SpecifiedValue;
Expand Down

0 comments on commit d8222dd

Please sign in to comment.