Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: Get rid of gecko_size_type. #19966

Merged
merged 5 commits into from Feb 7, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

style: Move flex-basis out of gecko_size_type.

  • Loading branch information
emilio committed Feb 6, 2018
commit a0d07699986a12fb1a93c4ec58622a44c2923045
@@ -930,12 +930,6 @@
use values::specified::length::LengthOrPercentageOrAuto;
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

@@ -167,11 +167,18 @@ ${helpers.predefined_type("order", "Integer", "0",
// and should be converted to just LengthOrPercentage.
% if product == "gecko":
// FIXME: Gecko doesn't support content value yet.
${helpers.gecko_size_type("flex-basis", "MozLength", "auto()",
logical=False,
spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property",
extra_prefixes="webkit",
animation_value_type="MozLength")}
//
// FIXME(emilio): I suspect this property shouldn't allow quirks, and this
// was just a mistake.
${helpers.predefined_type(
"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:
// FIXME: This property should be animatable.
${helpers.predefined_type("flex-basis",
@@ -933,6 +933,7 @@ impl LengthOrPercentageOrAuto {
}

/// Returns a value representing `0%`.
#[inline]
pub fn zero_percent() -> Self {
LengthOrPercentageOrAuto::Percentage(computed::Percentage::zero())
}
@@ -1142,6 +1143,18 @@ impl MozLength {
)?;
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.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.