mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
style: Rename LengthOrPercentage to LengthPercentage.
It does not represent `<length> | <percentage>`, but `<length-percentage>`, so `LengthOrPercentage` is not the right name. This patch is totally autogenerated using: rg 'LengthOrPercentage' servo | cut -d : -f 1 | sort | uniq > files for file in $(cat files); do sed -i "s#LengthOrPercentage#LengthPercentage#g" $file; done Differential Revision: https://phabricator.services.mozilla.com/D15812
This commit is contained in:
parent
4a31509215
commit
daf1f02feb
61 changed files with 709 additions and 702 deletions
|
@ -35,7 +35,7 @@ ${helpers.predefined_type(
|
|||
${helpers.predefined_type(
|
||||
"background-position-" + axis,
|
||||
"position::" + direction + "Position",
|
||||
initial_value="computed::LengthOrPercentage::zero()",
|
||||
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",
|
||||
|
|
|
@ -69,7 +69,7 @@ ${helpers.gecko_keyword_conversion(
|
|||
type="crate::values::specified::BorderStyle",
|
||||
)}
|
||||
|
||||
// FIXME(#4126): when gfx supports painting it, make this Size2D<LengthOrPercentage>
|
||||
// FIXME(#4126): when gfx supports painting it, make this Size2D<LengthPercentage>
|
||||
% for corner in ["top-left", "top-right", "bottom-right", "bottom-left"]:
|
||||
${helpers.predefined_type(
|
||||
"border-" + corner + "-radius",
|
||||
|
@ -189,7 +189,7 @@ impl crate::values::computed::BorderImageWidth {
|
|||
use crate::gecko_bindings::structs::nsStyleUnit::{eStyleUnit_Factor, eStyleUnit_Auto};
|
||||
use crate::gecko_bindings::sugar::ns_style_coord::CoordData;
|
||||
use crate::gecko::values::GeckoStyleCoordConvertible;
|
||||
use crate::values::computed::{LengthOrPercentage, Number};
|
||||
use crate::values::computed::{LengthPercentage, Number};
|
||||
use crate::values::generics::border::BorderImageSideWidth;
|
||||
use crate::values::generics::NonNegative;
|
||||
|
||||
|
@ -207,8 +207,8 @@ impl crate::values::computed::BorderImageWidth {
|
|||
},
|
||||
_ => {
|
||||
BorderImageSideWidth::Length(
|
||||
NonNegative(LengthOrPercentage::from_gecko_style_coord(&sides.data_at(${i}))
|
||||
.expect("sides[${i}] could not convert to LengthOrPercentage")))
|
||||
NonNegative(LengthPercentage::from_gecko_style_coord(&sides.data_at(${i}))
|
||||
.expect("sides[${i}] could not convert to LengthPercentage")))
|
||||
},
|
||||
},
|
||||
% endfor
|
||||
|
|
|
@ -611,10 +611,10 @@ ${helpers.predefined_type(
|
|||
|
||||
${helpers.predefined_type(
|
||||
"shape-margin",
|
||||
"NonNegativeLengthOrPercentage",
|
||||
"computed::NonNegativeLengthOrPercentage::zero()",
|
||||
"NonNegativeLengthPercentage",
|
||||
"computed::NonNegativeLengthPercentage::zero()",
|
||||
products="gecko",
|
||||
animation_value_type="NonNegativeLengthOrPercentage",
|
||||
animation_value_type="NonNegativeLengthPercentage",
|
||||
flags="APPLIES_TO_FIRST_LETTER",
|
||||
spec="https://drafts.csswg.org/css-shapes/#shape-margin-property",
|
||||
)}
|
||||
|
|
|
@ -53,8 +53,8 @@ ${helpers.single_keyword(
|
|||
|
||||
${helpers.predefined_type(
|
||||
"text-indent",
|
||||
"LengthOrPercentage",
|
||||
"computed::LengthOrPercentage::zero()",
|
||||
"LengthPercentage",
|
||||
"computed::LengthPercentage::zero()",
|
||||
animation_value_type="ComputedValue",
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-text-indent",
|
||||
allow_quirks=True,
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
%>
|
||||
${helpers.predefined_type(
|
||||
"margin-%s" % side[0],
|
||||
"LengthOrPercentageOrAuto",
|
||||
"computed::LengthOrPercentageOrAuto::zero()",
|
||||
"LengthPercentageOrAuto",
|
||||
"computed::LengthPercentageOrAuto::zero()",
|
||||
alias=maybe_moz_logical_alias(product, side, "-moz-margin-%s"),
|
||||
allow_quirks=not side[1],
|
||||
animation_value_type="ComputedValue",
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
%>
|
||||
${helpers.predefined_type(
|
||||
"padding-%s" % side[0],
|
||||
"NonNegativeLengthOrPercentage",
|
||||
"computed::NonNegativeLengthOrPercentage::zero()",
|
||||
"NonNegativeLengthPercentage",
|
||||
"computed::NonNegativeLengthPercentage::zero()",
|
||||
alias=maybe_moz_logical_alias(product, side, "-moz-padding-%s"),
|
||||
animation_value_type="NonNegativeLengthOrPercentage",
|
||||
animation_value_type="NonNegativeLengthPercentage",
|
||||
logical=side[1],
|
||||
logical_group="padding",
|
||||
spec=spec,
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
% for side in PHYSICAL_SIDES:
|
||||
${helpers.predefined_type(
|
||||
side,
|
||||
"LengthOrPercentageOrAuto",
|
||||
"computed::LengthOrPercentageOrAuto::Auto",
|
||||
"LengthPercentageOrAuto",
|
||||
"computed::LengthPercentageOrAuto::Auto",
|
||||
spec="https://www.w3.org/TR/CSS2/visuren.html#propdef-%s" % side,
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
animation_value_type="ComputedValue",
|
||||
|
@ -26,8 +26,8 @@
|
|||
% for side in LOGICAL_SIDES:
|
||||
${helpers.predefined_type(
|
||||
"inset-%s" % side,
|
||||
"LengthOrPercentageOrAuto",
|
||||
"computed::LengthOrPercentageOrAuto::Auto",
|
||||
"LengthPercentageOrAuto",
|
||||
"computed::LengthPercentageOrAuto::Auto",
|
||||
spec="https://drafts.csswg.org/css-logical-props/#propdef-inset-%s" % side,
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
alias="offset-%s:layout.css.offset-logical-properties.enabled" % side,
|
||||
|
@ -285,8 +285,8 @@ ${helpers.predefined_type(
|
|||
// servo versions (no keyword support)
|
||||
${helpers.predefined_type(
|
||||
size,
|
||||
"LengthOrPercentageOrAuto",
|
||||
"computed::LengthOrPercentageOrAuto::Auto",
|
||||
"LengthPercentageOrAuto",
|
||||
"computed::LengthPercentageOrAuto::Auto",
|
||||
"parse_non_negative",
|
||||
spec=spec % size,
|
||||
logical_group="size",
|
||||
|
@ -296,8 +296,8 @@ ${helpers.predefined_type(
|
|||
)}
|
||||
${helpers.predefined_type(
|
||||
"min-%s" % size,
|
||||
"LengthOrPercentage",
|
||||
"computed::LengthOrPercentage::zero()",
|
||||
"LengthPercentage",
|
||||
"computed::LengthPercentage::zero()",
|
||||
"parse_non_negative",
|
||||
spec=spec % ("min-%s" % size),
|
||||
logical_group="min-size",
|
||||
|
@ -308,8 +308,8 @@ ${helpers.predefined_type(
|
|||
)}
|
||||
${helpers.predefined_type(
|
||||
"max-%s" % size,
|
||||
"LengthOrPercentageOrNone",
|
||||
"computed::LengthOrPercentageOrNone::None",
|
||||
"LengthPercentageOrNone",
|
||||
"computed::LengthPercentageOrNone::None",
|
||||
"parse_non_negative",
|
||||
spec=spec % ("max-%s" % size),
|
||||
logical_group="max-size",
|
||||
|
@ -408,24 +408,24 @@ ${helpers.predefined_type(
|
|||
|
||||
${helpers.predefined_type(
|
||||
"column-gap",
|
||||
"length::NonNegativeLengthOrPercentageOrNormal",
|
||||
"length::NonNegativeLengthPercentageOrNormal",
|
||||
"Either::Second(Normal)",
|
||||
alias="grid-column-gap" if product == "gecko" else "",
|
||||
extra_prefixes="moz",
|
||||
servo_pref="layout.columns.enabled",
|
||||
spec="https://drafts.csswg.org/css-align-3/#propdef-column-gap",
|
||||
animation_value_type="NonNegativeLengthOrPercentageOrNormal",
|
||||
animation_value_type="NonNegativeLengthPercentageOrNormal",
|
||||
servo_restyle_damage="reflow",
|
||||
)}
|
||||
|
||||
// no need for -moz- prefixed alias for this property
|
||||
${helpers.predefined_type(
|
||||
"row-gap",
|
||||
"length::NonNegativeLengthOrPercentageOrNormal",
|
||||
"length::NonNegativeLengthPercentageOrNormal",
|
||||
"Either::Second(Normal)",
|
||||
alias="grid-row-gap",
|
||||
products="gecko",
|
||||
spec="https://drafts.csswg.org/css-align-3/#propdef-row-gap",
|
||||
animation_value_type="NonNegativeLengthOrPercentageOrNormal",
|
||||
animation_value_type="NonNegativeLengthPercentageOrNormal",
|
||||
servo_restyle_damage="reflow",
|
||||
)}
|
||||
|
|
|
@ -118,7 +118,7 @@ ${helpers.predefined_type(
|
|||
${helpers.predefined_type(
|
||||
"mask-position-" + axis,
|
||||
"position::" + direction + "Position",
|
||||
"computed::LengthOrPercentage::zero()",
|
||||
"computed::LengthPercentage::zero()",
|
||||
products="gecko",
|
||||
extra_prefixes="webkit",
|
||||
initial_specified_value="specified::PositionComponent::Center",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue