mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Move flex-basis out of gecko_size_type.
This commit is contained in:
parent
45ba167030
commit
a0d0769998
3 changed files with 25 additions and 11 deletions
|
@ -930,12 +930,6 @@
|
||||||
use values::specified::length::LengthOrPercentageOrAuto;
|
use values::specified::length::LengthOrPercentageOrAuto;
|
||||||
SpecifiedValue(MozLength::LengthOrPercentageOrAuto(LengthOrPercentageOrAuto::zero()))
|
SpecifiedValue(MozLength::LengthOrPercentageOrAuto(LengthOrPercentageOrAuto::zero()))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a value representing a `0%` length.
|
|
||||||
pub fn zero_percent() -> Self {
|
|
||||||
use values::specified::length::LengthOrPercentageOrAuto;
|
|
||||||
SpecifiedValue(MozLength::LengthOrPercentageOrAuto(LengthOrPercentageOrAuto::zero_percent()))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
|
|
|
@ -167,11 +167,18 @@ ${helpers.predefined_type("order", "Integer", "0",
|
||||||
// and should be converted to just LengthOrPercentage.
|
// and should be converted to just LengthOrPercentage.
|
||||||
% if product == "gecko":
|
% if product == "gecko":
|
||||||
// FIXME: Gecko doesn't support content value yet.
|
// FIXME: Gecko doesn't support content value yet.
|
||||||
${helpers.gecko_size_type("flex-basis", "MozLength", "auto()",
|
//
|
||||||
logical=False,
|
// FIXME(emilio): I suspect this property shouldn't allow quirks, and this
|
||||||
spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property",
|
// was just a mistake.
|
||||||
extra_prefixes="webkit",
|
${helpers.predefined_type(
|
||||||
animation_value_type="MozLength")}
|
"flex-basis",
|
||||||
|
"MozLength",
|
||||||
|
"computed::MozLength::auto()",
|
||||||
|
extra_prefixes="webkit",
|
||||||
|
animation_value_type="ComputedValue",
|
||||||
|
allow_quirks=True,
|
||||||
|
spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property"
|
||||||
|
)}
|
||||||
% else:
|
% else:
|
||||||
// FIXME: This property should be animatable.
|
// FIXME: This property should be animatable.
|
||||||
${helpers.predefined_type("flex-basis",
|
${helpers.predefined_type("flex-basis",
|
||||||
|
|
|
@ -933,6 +933,7 @@ impl LengthOrPercentageOrAuto {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a value representing `0%`.
|
/// Returns a value representing `0%`.
|
||||||
|
#[inline]
|
||||||
pub fn zero_percent() -> Self {
|
pub fn zero_percent() -> Self {
|
||||||
LengthOrPercentageOrAuto::Percentage(computed::Percentage::zero())
|
LengthOrPercentageOrAuto::Percentage(computed::Percentage::zero())
|
||||||
}
|
}
|
||||||
|
@ -1142,6 +1143,18 @@ impl MozLength {
|
||||||
)?;
|
)?;
|
||||||
Ok(MozLength::LengthOrPercentageOrAuto(length))
|
Ok(MozLength::LengthOrPercentageOrAuto(length))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns `auto`.
|
||||||
|
#[inline]
|
||||||
|
pub fn auto() -> Self {
|
||||||
|
MozLength::LengthOrPercentageOrAuto(LengthOrPercentageOrAuto::auto())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns `0%`.
|
||||||
|
#[inline]
|
||||||
|
pub fn zero_percent() -> Self {
|
||||||
|
MozLength::LengthOrPercentageOrAuto(LengthOrPercentageOrAuto::zero_percent())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A value suitable for a `max-width` or `max-height` property.
|
/// A value suitable for a `max-width` or `max-height` property.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue