mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Set flex-basis to 0% when omitted in flex shorthand.
This commit is contained in:
parent
aca09436b7
commit
acb7242304
4 changed files with 34 additions and 4 deletions
|
@ -735,6 +735,12 @@ impl Percentage {
|
|||
Self::parse_with_clamping_mode(input, AllowedNumericType::NonNegative)
|
||||
}
|
||||
|
||||
/// 0%
|
||||
#[inline]
|
||||
pub fn zero() -> Self {
|
||||
Percentage(0.)
|
||||
}
|
||||
|
||||
/// 100%
|
||||
#[inline]
|
||||
pub fn hundred() -> Self {
|
||||
|
@ -999,6 +1005,11 @@ impl LengthOrPercentageOrAuto {
|
|||
pub fn zero() -> Self {
|
||||
LengthOrPercentageOrAuto::Length(NoCalcLength::zero())
|
||||
}
|
||||
|
||||
/// Returns a value representing `0%`.
|
||||
pub fn zero_percent() -> Self {
|
||||
LengthOrPercentageOrAuto::Percentage(Percentage::zero())
|
||||
}
|
||||
}
|
||||
|
||||
impl Parse for LengthOrPercentageOrAuto {
|
||||
|
@ -1157,6 +1168,11 @@ impl LengthOrPercentageOrAutoOrContent {
|
|||
pub fn zero() -> Self {
|
||||
LengthOrPercentageOrAutoOrContent::Length(NoCalcLength::zero())
|
||||
}
|
||||
|
||||
/// Returns a value representing `0%`.
|
||||
pub fn zero_percent() -> Self {
|
||||
LengthOrPercentageOrAutoOrContent::Percentage(Percentage::zero())
|
||||
}
|
||||
}
|
||||
|
||||
impl ToCss for LengthOrPercentageOrAutoOrContent {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue