mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Support prefixed intrinsic size value for flex-basis.
auto() and zero() are used in the parser for flex shorthand property.
This commit is contained in:
parent
3a3bc03eb8
commit
d06af8971d
4 changed files with 38 additions and 16 deletions
|
@ -1090,6 +1090,23 @@
|
|||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct SpecifiedValue(pub ${length_type});
|
||||
|
||||
% if length_type == "MozLength":
|
||||
impl SpecifiedValue {
|
||||
/// Returns the `auto` value.
|
||||
pub fn auto() -> Self {
|
||||
use values::specified::length::LengthOrPercentageOrAuto;
|
||||
SpecifiedValue(MozLength::LengthOrPercentageOrAuto(LengthOrPercentageOrAuto::Auto))
|
||||
}
|
||||
|
||||
/// Returns a value representing a `0` length.
|
||||
pub fn zero() -> Self {
|
||||
use values::specified::length::{LengthOrPercentageOrAuto, NoCalcLength};
|
||||
SpecifiedValue(MozLength::LengthOrPercentageOrAuto(
|
||||
LengthOrPercentageOrAuto::Length(NoCalcLength::zero())))
|
||||
}
|
||||
}
|
||||
% endif
|
||||
|
||||
#[inline]
|
||||
pub fn get_initial_value() -> computed_value::T {
|
||||
use values::computed::${length_type};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue