mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Fix a few initial values in Rust property definitions.
Differential Revision: https://phabricator.services.mozilla.com/D67929
This commit is contained in:
parent
846996ae7e
commit
fa733ecb72
8 changed files with 16 additions and 9 deletions
|
@ -35,8 +35,8 @@ ${helpers.predefined_type(
|
|||
${helpers.predefined_type(
|
||||
"background-position-" + axis,
|
||||
"position::" + direction + "Position",
|
||||
"computed::LengthPercentage::zero_percent()",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
initial_value="computed::LengthPercentage::zero()",
|
||||
initial_specified_value="SpecifiedValue::initial_specified_value()",
|
||||
spec="https://drafts.csswg.org/css-backgrounds-4/#propdef-background-position-" + axis,
|
||||
animation_value_type="ComputedValue",
|
||||
|
|
|
@ -230,7 +230,7 @@ ${helpers.predefined_type(
|
|||
${helpers.predefined_type(
|
||||
"-moz-script-level",
|
||||
"MozScriptLevel",
|
||||
0,
|
||||
"0",
|
||||
engines="gecko",
|
||||
animation_value_type="none",
|
||||
enabled_in="ua",
|
||||
|
|
|
@ -245,7 +245,7 @@ ${helpers.predefined_type(
|
|||
${helpers.predefined_type(
|
||||
"text-emphasis-style",
|
||||
"TextEmphasisStyle",
|
||||
None,
|
||||
"computed::TextEmphasisStyle::None",
|
||||
engines="gecko",
|
||||
initial_specified_value="SpecifiedValue::None",
|
||||
animation_value_type="discrete",
|
||||
|
@ -368,13 +368,12 @@ ${helpers.single_keyword(
|
|||
servo_restyle_damage="rebuild_and_reflow",
|
||||
)}
|
||||
|
||||
// FIXME Firefox expects the initial value of this property to change depending
|
||||
// on the value of the layout.css.control-characters.visible pref.
|
||||
${helpers.single_keyword(
|
||||
"-moz-control-character-visibility",
|
||||
"hidden visible",
|
||||
engines="gecko",
|
||||
gecko_enum_prefix="StyleControlCharacterVisibility",
|
||||
gecko_pref_controlled_initial_value="layout.css.control-characters.visible=visible",
|
||||
animation_value_type="none",
|
||||
gecko_ffi_name="mControlCharacterVisibility",
|
||||
spec="Nonstandard",
|
||||
|
|
|
@ -333,7 +333,7 @@ ${helpers.single_keyword(
|
|||
${helpers.predefined_type(
|
||||
"object-position",
|
||||
"Position",
|
||||
"computed::Position::zero()",
|
||||
"computed::Position::center()",
|
||||
engines="gecko",
|
||||
boxed=True,
|
||||
spec="https://drafts.csswg.org/css-images-3/#the-object-position",
|
||||
|
|
|
@ -111,7 +111,7 @@ ${helpers.predefined_type(
|
|||
${helpers.predefined_type(
|
||||
"mask-position-" + axis,
|
||||
"position::" + direction + "Position",
|
||||
"computed::LengthPercentage::zero()",
|
||||
"computed::LengthPercentage::zero_percent()",
|
||||
engines="gecko",
|
||||
extra_prefixes="webkit",
|
||||
initial_specified_value="specified::PositionComponent::Center",
|
||||
|
|
|
@ -56,7 +56,7 @@ ${helpers.single_keyword(
|
|||
|
||||
${helpers.single_keyword(
|
||||
"-moz-window-shadow",
|
||||
"none default menu tooltip sheet",
|
||||
"default none menu tooltip sheet",
|
||||
engines="gecko",
|
||||
gecko_ffi_name="mWindowShadow",
|
||||
gecko_enum_prefix="StyleWindowShadow",
|
||||
|
|
|
@ -64,10 +64,12 @@ ${helpers.single_keyword(
|
|||
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-pack)",
|
||||
)}
|
||||
|
||||
// NOTE(heycam): Odd that the initial value is 1 yet 0 is a valid value. There
|
||||
// are uses of `-moz-box-ordinal-group: 0` in the tree, too.
|
||||
${helpers.predefined_type(
|
||||
"-moz-box-ordinal-group",
|
||||
"Integer",
|
||||
"0",
|
||||
"1",
|
||||
engines="gecko",
|
||||
parse_method="parse_non_negative",
|
||||
alias="-webkit-box-ordinal-group",
|
||||
|
|
|
@ -193,6 +193,12 @@ impl LengthPercentage {
|
|||
Self::new_length(Length::new(1.))
|
||||
}
|
||||
|
||||
/// 0%
|
||||
#[inline]
|
||||
pub fn zero_percent() -> Self {
|
||||
Self::new_percent(Percentage::zero())
|
||||
}
|
||||
|
||||
fn to_calc_node(&self) -> Cow<CalcNode> {
|
||||
match self.unpack() {
|
||||
Unpacked::Length(l) => Cow::Owned(CalcNode::Leaf(CalcLengthPercentageLeaf::Length(l))),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue