mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
stylo: Support most MathML presentation attributes
This commit is contained in:
parent
2e22a006db
commit
1ea8175163
3 changed files with 23 additions and 13 deletions
|
@ -225,7 +225,8 @@ ${helpers.single_keyword("font-style",
|
|||
gecko_constant_prefix="NS_FONT_STYLE",
|
||||
gecko_ffi_name="mFont.style",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-style",
|
||||
animation_type="none")}
|
||||
animation_type="none",
|
||||
needs_conversion=True)}
|
||||
|
||||
${helpers.single_keyword("font-variant",
|
||||
"normal small-caps",
|
||||
|
@ -292,19 +293,24 @@ ${helpers.single_keyword("font-variant-caps",
|
|||
_ => Err(())
|
||||
}
|
||||
}).or_else(|()| {
|
||||
match try!(input.expect_integer()) {
|
||||
100 => Ok(SpecifiedValue::Weight100),
|
||||
200 => Ok(SpecifiedValue::Weight200),
|
||||
300 => Ok(SpecifiedValue::Weight300),
|
||||
400 => Ok(SpecifiedValue::Weight400),
|
||||
500 => Ok(SpecifiedValue::Weight500),
|
||||
600 => Ok(SpecifiedValue::Weight600),
|
||||
700 => Ok(SpecifiedValue::Weight700),
|
||||
800 => Ok(SpecifiedValue::Weight800),
|
||||
900 => Ok(SpecifiedValue::Weight900),
|
||||
SpecifiedValue::from_int(input.expect_integer()?)
|
||||
})
|
||||
}
|
||||
|
||||
impl SpecifiedValue {
|
||||
pub fn from_int(kw: i32) -> Result<Self, ()> {
|
||||
match kw {
|
||||
% for weight in range(100, 901, 100):
|
||||
${weight} => Ok(SpecifiedValue::Weight${weight}),
|
||||
% endfor
|
||||
_ => Err(())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn from_gecko_keyword(kw: u32) -> Self {
|
||||
Self::from_int(kw as i32).expect("Found unexpected value in style
|
||||
struct for font-weight property")
|
||||
}
|
||||
}
|
||||
|
||||
/// Used in @font-face, where relative keywords are not allowed.
|
||||
|
|
|
@ -24,7 +24,8 @@ ${helpers.single_keyword("writing-mode",
|
|||
spec="https://drafts.csswg.org/css-writing-modes/#propdef-writing-mode")}
|
||||
|
||||
${helpers.single_keyword("direction", "ltr rtl", need_clone=True, animation_type="none",
|
||||
spec="https://drafts.csswg.org/css-writing-modes/#propdef-direction")}
|
||||
spec="https://drafts.csswg.org/css-writing-modes/#propdef-direction",
|
||||
needs_conversion=True)}
|
||||
|
||||
<%helpers:single_keyword_computed
|
||||
name="text-orientation"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue