style: Make MozScriptLevel::Absolute serialize as -moz-absolute(foo).

This commit is contained in:
Emilio Cobos Álvarez 2017-11-12 16:14:20 +01:00
parent 92944cd5eb
commit 194c2712b5
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 5 additions and 4 deletions

View file

@ -326,12 +326,12 @@ impl ToComputedValue for specified::MozScriptLevel {
let parent = cx.builder.get_parent_font().clone__moz_script_level();
parent as i32 + rel
}
specified::MozScriptLevel::Absolute(abs) => abs,
specified::MozScriptLevel::MozAbsolute(abs) => abs,
};
cmp::min(int, i8::MAX as i32) as i8
}
fn from_computed_value(other: &i8) -> Self {
specified::MozScriptLevel::Absolute(*other as i32)
specified::MozScriptLevel::MozAbsolute(*other as i32)
}
}

View file

@ -991,7 +991,8 @@ pub enum MozScriptLevel {
/// Should only be serialized by presentation attributes, so even though
/// serialization for this would look the same as for the `Relative`
/// variant, it is unexposed, so no big deal.
Absolute(i32),
#[css(function)]
MozAbsolute(i32),
/// Change `font-size` automatically.
Auto
}

View file

@ -3202,7 +3202,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetNumberValue(
let prop = match_wrap_declared! { long,
MozScriptSizeMultiplier => value,
// Gecko uses Number values to signal that it is absolute
MozScriptLevel => MozScriptLevel::Absolute(value as i32),
MozScriptLevel => MozScriptLevel::MozAbsolute(value as i32),
};
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
decls.push(prop, Importance::Normal, DeclarationSource::CssOm);