Bug 1526736 - Rename MozLength to Size, and MaxLength to MaxSize. r=heycam

MozLength is not a very descriptive name. If we're going to use it in both Gecko
and Servo we may as well name it something more accurate.

I would've chosen `ContentSize` per CSS2[1][2] if it wasn't a lie in presence
of box-sizing. I don't have better ideas than `Size`, given that.

[1]: https://drafts.csswg.org/css2/visudet.html#propdef-width
[2]: https://drafts.csswg.org/css2/box.html#content-width

Differential Revision: https://phabricator.services.mozilla.com/D19280

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2019-02-11 10:59:49 +00:00
parent f3266d91e2
commit dc933f3117
12 changed files with 170 additions and 178 deletions

View File

@ -14,7 +14,7 @@ use crate::media_queries::Device;
use crate::values::computed::basic_shape::ShapeRadius as ComputedShapeRadius;
use crate::values::computed::FlexBasis as ComputedFlexBasis;
use crate::values::computed::{Angle, ExtremumLength, Length, LengthPercentage};
use crate::values::computed::{MaxLength as ComputedMaxLength, MozLength as ComputedMozLength};
use crate::values::computed::{MaxSize as ComputedMaxSize, Size as ComputedSize};
use crate::values::computed::{NonNegativeLengthPercentage, Percentage};
use crate::values::computed::{Number, NumberOrPercentage};
use crate::values::generics::basic_shape::ShapeRadius;
@ -22,7 +22,7 @@ use crate::values::generics::box_::Perspective;
use crate::values::generics::flex::FlexBasis;
use crate::values::generics::gecko::ScrollSnapPoint;
use crate::values::generics::grid::{TrackBreadth, TrackKeyword};
use crate::values::generics::length::{LengthPercentageOrAuto, MaxLength, MozLength};
use crate::values::generics::length::{LengthPercentageOrAuto, MaxSize, Size};
use crate::values::generics::{CounterStyleOrNone, NonNegative};
use crate::values::{Auto, Either, None_, Normal};
use crate::Atom;
@ -91,7 +91,7 @@ impl GeckoStyleCoordConvertible for ComputedFlexBasis {
}
fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> {
if let Some(width) = ComputedMozLength::from_gecko_style_coord(coord) {
if let Some(width) = ComputedSize::from_gecko_style_coord(coord) {
return Some(FlexBasis::Width(width));
}
@ -350,43 +350,43 @@ impl GeckoStyleCoordConvertible for ExtremumLength {
}
}
impl GeckoStyleCoordConvertible for ComputedMozLength {
impl GeckoStyleCoordConvertible for ComputedSize {
fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) {
match *self {
MozLength::LengthPercentage(ref lpoa) => lpoa.to_gecko_style_coord(coord),
MozLength::Auto => coord.set_value(CoordDataValue::Auto),
MozLength::ExtremumLength(ref e) => e.to_gecko_style_coord(coord),
Size::LengthPercentage(ref lpoa) => lpoa.to_gecko_style_coord(coord),
Size::Auto => coord.set_value(CoordDataValue::Auto),
Size::ExtremumLength(ref e) => e.to_gecko_style_coord(coord),
}
}
fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> {
if let CoordDataValue::Auto = coord.as_value() {
return Some(MozLength::Auto);
return Some(Size::Auto);
}
if let Some(lp) = NonNegativeLengthPercentage::from_gecko_style_coord(coord) {
return Some(MozLength::LengthPercentage(lp));
return Some(Size::LengthPercentage(lp));
}
ExtremumLength::from_gecko_style_coord(coord).map(MozLength::ExtremumLength)
ExtremumLength::from_gecko_style_coord(coord).map(Size::ExtremumLength)
}
}
impl GeckoStyleCoordConvertible for ComputedMaxLength {
impl GeckoStyleCoordConvertible for ComputedMaxSize {
fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) {
match *self {
MaxLength::LengthPercentage(ref lpon) => lpon.to_gecko_style_coord(coord),
MaxLength::None => coord.set_value(CoordDataValue::None),
MaxLength::ExtremumLength(ref e) => e.to_gecko_style_coord(coord),
MaxSize::LengthPercentage(ref lpon) => lpon.to_gecko_style_coord(coord),
MaxSize::None => coord.set_value(CoordDataValue::None),
MaxSize::ExtremumLength(ref e) => e.to_gecko_style_coord(coord),
}
}
fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> {
if let CoordDataValue::None = coord.as_value() {
return Some(MaxLength::None);
return Some(MaxSize::None);
}
if let Some(lp) = NonNegativeLengthPercentage::from_gecko_style_coord(coord) {
return Some(MaxLength::LengthPercentage(lp));
return Some(MaxSize::LengthPercentage(lp));
}
ExtremumLength::from_gecko_style_coord(coord).map(MaxLength::ExtremumLength)
ExtremumLength::from_gecko_style_coord(coord).map(MaxSize::ExtremumLength)
}
}

View File

@ -1390,8 +1390,8 @@ impl Clone for ${style_struct.gecko_struct_name} {
"LengthOrNormal": impl_style_coord,
"LengthPercentage": impl_simple,
"LengthPercentageOrAuto": impl_style_coord,
"MaxLength": impl_style_coord,
"MozLength": impl_style_coord,
"MaxSize": impl_style_coord,
"Size": impl_style_coord,
"MozScriptMinSize": impl_absolute_length,
"MozScriptSizeMultiplier": impl_simple,
"NonNegativeLengthPercentage": impl_simple,

View File

@ -244,65 +244,40 @@ ${helpers.predefined_type(
if logical:
spec = "https://drafts.csswg.org/css-logical-props/#propdef-%s"
%>
% if product == "gecko":
// width, height, block-size, inline-size
${helpers.predefined_type(
size,
"MozLength",
"computed::MozLength::auto()",
logical=logical,
logical_group="size",
allow_quirks=not logical,
spec=spec % size,
animation_value_type="MozLength",
flags="GETCS_NEEDS_LAYOUT_FLUSH",
servo_restyle_damage="reflow",
)}
// min-width, min-height, min-block-size, min-inline-size,
${helpers.predefined_type(
"min-%s" % size,
"MozLength",
"computed::MozLength::auto()",
logical=logical,
logical_group="min-size",
allow_quirks=not logical,
spec=spec % size,
animation_value_type="MozLength",
servo_restyle_damage="reflow",
)}
% else:
// servo versions (no keyword support)
${helpers.predefined_type(
size,
"NonNegativeLengthPercentageOrAuto",
"computed::NonNegativeLengthPercentageOrAuto::auto()",
spec=spec % size,
logical_group="size",
allow_quirks=not logical,
animation_value_type="ComputedValue", logical = logical,
servo_restyle_damage="reflow",
)}
${helpers.predefined_type(
"min-%s" % size,
"NonNegativeLengthPercentage",
"computed::NonNegativeLengthPercentage::zero()",
spec=spec % ("min-%s" % size),
logical_group="min-size",
animation_value_type="ComputedValue",
logical=logical,
allow_quirks=not logical,
servo_restyle_damage="reflow",
)}
% endif
// width, height, block-size, inline-size
${helpers.predefined_type(
size,
"Size",
"computed::Size::auto()",
logical=logical,
logical_group="size",
allow_quirks=not logical,
spec=spec % size,
animation_value_type="Size",
flags="GETCS_NEEDS_LAYOUT_FLUSH",
servo_restyle_damage="reflow",
)}
// min-width, min-height, min-block-size, min-inline-size
${helpers.predefined_type(
"min-%s" % size,
"Size",
"computed::Size::auto()",
logical=logical,
logical_group="min-size",
allow_quirks=not logical,
spec=spec % size,
animation_value_type="Size",
servo_restyle_damage="reflow",
)}
${helpers.predefined_type(
"max-%s" % size,
"MaxLength",
"computed::MaxLength::none()",
"MaxSize",
"computed::MaxSize::none()",
logical=logical,
logical_group="max-size",
allow_quirks=not logical,
spec=spec % size,
animation_value_type="MaxLength",
animation_value_type="MaxSize",
servo_restyle_damage="reflow",
)}
% endfor

View File

@ -3016,7 +3016,7 @@ impl ComputedValuesInner {
/// Get the logical computed inline size.
#[inline]
pub fn content_inline_size(&self) -> computed::NonNegativeLengthPercentageOrAuto {
pub fn content_inline_size(&self) -> computed::Size {
let position_style = self.get_position();
if self.writing_mode.is_vertical() {
position_style.height
@ -3027,35 +3027,35 @@ impl ComputedValuesInner {
/// Get the logical computed block size.
#[inline]
pub fn content_block_size(&self) -> computed::NonNegativeLengthPercentageOrAuto {
pub fn content_block_size(&self) -> computed::Size {
let position_style = self.get_position();
if self.writing_mode.is_vertical() { position_style.width } else { position_style.height }
}
/// Get the logical computed min inline size.
#[inline]
pub fn min_inline_size(&self) -> computed::NonNegativeLengthPercentage {
pub fn min_inline_size(&self) -> computed::Size {
let position_style = self.get_position();
if self.writing_mode.is_vertical() { position_style.min_height } else { position_style.min_width }
}
/// Get the logical computed min block size.
#[inline]
pub fn min_block_size(&self) -> computed::NonNegativeLengthPercentage {
pub fn min_block_size(&self) -> computed::Size {
let position_style = self.get_position();
if self.writing_mode.is_vertical() { position_style.min_width } else { position_style.min_height }
}
/// Get the logical computed max inline size.
#[inline]
pub fn max_inline_size(&self) -> computed::MaxLength {
pub fn max_inline_size(&self) -> computed::MaxSize {
let position_style = self.get_position();
if self.writing_mode.is_vertical() { position_style.max_height } else { position_style.max_width }
}
/// Get the logical computed max block size.
#[inline]
pub fn max_block_size(&self) -> computed::MaxLength {
pub fn max_block_size(&self) -> computed::MaxSize {
let position_style = self.get_position();
if self.writing_mode.is_vertical() { position_style.max_width } else { position_style.max_height }
}

View File

@ -4,23 +4,16 @@
//! Computed types for CSS values related to flexbox.
use crate::values::computed::Size;
use crate::values::generics::flex::FlexBasis as GenericFlexBasis;
/// The `width` value type.
#[cfg(feature = "servo")]
pub type Width = crate::values::computed::NonNegativeLengthPercentageOrAuto;
/// The `width` value type.
#[cfg(feature = "gecko")]
pub type Width = crate::values::computed::MozLength;
/// A computed value for the `flex-basis` property.
pub type FlexBasis = GenericFlexBasis<Width>;
pub type FlexBasis = GenericFlexBasis<Size>;
impl FlexBasis {
/// `auto`
#[inline]
pub fn auto() -> Self {
GenericFlexBasis::Width(Width::auto())
GenericFlexBasis::Width(Size::auto())
}
}

View File

@ -8,9 +8,7 @@ use super::{Context, Number, Percentage, ToComputedValue};
use crate::values::animated::ToAnimatedValue;
use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
use crate::values::generics::length as generics;
use crate::values::generics::length::{
MaxLength as GenericMaxLength, MozLength as GenericMozLength,
};
use crate::values::generics::length::{MaxSize as GenericMaxSize, Size as GenericSize};
use crate::values::generics::transform::IsZeroLength;
use crate::values::generics::NonNegative;
use crate::values::specified::length::ViewportPercentageLength;
@ -580,12 +578,36 @@ impl NonNegativeLengthPercentage {
}
#[cfg(feature = "servo")]
impl MaxLength {
impl MaxSize {
/// Convert the computed value into used value.
#[inline]
pub fn to_used_value(&self, percentage_basis: Au) -> Option<Au> {
match *self {
GenericMaxLength::None => None,
GenericMaxLength::LengthPercentage(ref lp) => Some(lp.to_used_value(percentage_basis)),
GenericMaxSize::None => None,
GenericMaxSize::LengthPercentage(ref lp) => Some(lp.to_used_value(percentage_basis)),
}
}
}
impl Size {
/// Convert the computed value into used value.
#[inline]
#[cfg(feature = "servo")]
pub fn to_used_value(&self, percentage_basis: Au) -> Option<Au> {
match *self {
GenericSize::Auto => None,
GenericSize::LengthPercentage(ref lp) => Some(lp.to_used_value(percentage_basis)),
}
}
/// Returns true if the computed value is absolute 0 or 0%.
#[inline]
pub fn is_definitely_zero(&self) -> bool {
match *self {
GenericSize::Auto => false,
GenericSize::LengthPercentage(ref lp) => lp.is_definitely_zero(),
#[cfg(feature = "gecko")]
GenericSize::ExtremumLength(..) => false,
}
}
}
@ -821,7 +843,7 @@ pub enum ExtremumLength {
}
/// A computed value for `min-width`, `min-height`, `width` or `height` property.
pub type MozLength = GenericMozLength<NonNegativeLengthPercentage>;
pub type Size = GenericSize<NonNegativeLengthPercentage>;
/// A computed value for `max-width` or `min-height` property.
pub type MaxLength = GenericMaxLength<NonNegativeLengthPercentage>;
pub type MaxSize = GenericMaxSize<NonNegativeLengthPercentage>;

View File

@ -62,7 +62,7 @@ pub use self::gecko::ScrollSnapPoint;
pub use self::image::{Gradient, GradientItem, Image, ImageLayer, LineDirection, MozImageRect};
pub use self::length::{CSSPixelLength, ExtremumLength, NonNegativeLength};
pub use self::length::{Length, LengthOrNumber, LengthPercentage};
pub use self::length::{LengthPercentageOrAuto, MaxLength, MozLength};
pub use self::length::{LengthPercentageOrAuto, MaxSize, Size};
pub use self::length::{NonNegativeLengthPercentage, NonNegativeLengthPercentageOrAuto};
#[cfg(feature = "gecko")]
pub use self::list::ListStyleType;

View File

@ -5,6 +5,7 @@
//! Generic types for CSS values related to length.
use crate::parser::{Parse, ParserContext};
#[cfg(feature = "gecko")]
use crate::values::computed::ExtremumLength;
use cssparser::Parser;
use style_traits::ParseError;
@ -76,7 +77,7 @@ impl<LengthPercentage: Parse> Parse for LengthPercentageOrAuto<LengthPercentage>
/// A generic value for the `width`, `height`, `min-width`, or `min-height` property.
///
/// Unlike `max-width` or `max-height` properties, a MozLength can be `auto`,
/// Unlike `max-width` or `max-height` properties, a Size can be `auto`,
/// and cannot be `none`.
///
/// Note that it only accepts non-negative values.
@ -95,18 +96,25 @@ impl<LengthPercentage: Parse> Parse for LengthPercentageOrAuto<LengthPercentage>
ToComputedValue,
ToCss,
)]
pub enum MozLength<LengthPercentage> {
pub enum Size<LengthPercentage> {
LengthPercentage(LengthPercentage),
Auto,
#[cfg(feature = "gecko")]
#[animation(error)]
ExtremumLength(ExtremumLength),
}
impl<LengthPercentage> MozLength<LengthPercentage> {
impl<LengthPercentage> Size<LengthPercentage> {
/// `auto` value.
#[inline]
pub fn auto() -> Self {
MozLength::Auto
Size::Auto
}
/// Returns whether we're the auto value.
#[inline]
pub fn is_auto(&self) -> bool {
matches!(*self, Size::Auto)
}
}
@ -126,7 +134,7 @@ impl<LengthPercentage> MozLength<LengthPercentage> {
ToComputedValue,
ToCss,
)]
pub enum MaxLength<LengthPercentage> {
pub enum MaxSize<LengthPercentage> {
LengthPercentage(LengthPercentage),
None,
#[cfg(feature = "gecko")]
@ -134,10 +142,10 @@ pub enum MaxLength<LengthPercentage> {
ExtremumLength(ExtremumLength),
}
impl<LengthPercentage> MaxLength<LengthPercentage> {
impl<LengthPercentage> MaxSize<LengthPercentage> {
/// `none` value.
#[inline]
pub fn none() -> Self {
MaxLength::None
MaxSize::None
}
}

View File

@ -6,26 +6,19 @@
use crate::parser::{Parse, ParserContext};
use crate::values::generics::flex::FlexBasis as GenericFlexBasis;
use crate::values::specified::Size;
use cssparser::Parser;
use style_traits::ParseError;
/// The `width` value type.
#[cfg(feature = "servo")]
pub type Width = crate::values::specified::NonNegativeLengthPercentageOrAuto;
/// The `width` value type.
#[cfg(feature = "gecko")]
pub type Width = crate::values::specified::MozLength;
/// A specified value for the `flex-basis` property.
pub type FlexBasis = GenericFlexBasis<Width>;
pub type FlexBasis = GenericFlexBasis<Size>;
impl Parse for FlexBasis {
fn parse<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
if let Ok(width) = input.try(|i| Width::parse(context, i)) {
if let Ok(width) = input.try(|i| Size::parse(context, i)) {
return Ok(GenericFlexBasis::Width(width));
}
try_match_ident_ignore_ascii_case! { input,
@ -38,12 +31,12 @@ impl FlexBasis {
/// `auto`
#[inline]
pub fn auto() -> Self {
GenericFlexBasis::Width(Width::auto())
GenericFlexBasis::Width(Size::auto())
}
/// `0%`
#[inline]
pub fn zero_percent() -> Self {
GenericFlexBasis::Width(Width::zero_percent())
GenericFlexBasis::Width(Size::zero_percent())
}
}

View File

@ -9,11 +9,9 @@
use super::{AllowQuirks, Number, Percentage, ToComputedValue};
use crate::font_metrics::FontMetricsQueryResult;
use crate::parser::{Parse, ParserContext};
use crate::values::computed::{self, CSSPixelLength, Context, ExtremumLength};
use crate::values::computed::{self, CSSPixelLength, Context};
use crate::values::generics::length as generics;
use crate::values::generics::length::{
MaxLength as GenericMaxLength, MozLength as GenericMozLength,
};
use crate::values::generics::length::{MaxSize as GenericMaxSize, Size as GenericSize};
use crate::values::generics::transform::IsZeroLength;
use crate::values::generics::NonNegative;
use crate::values::specified::calc::CalcNode;
@ -1051,56 +1049,18 @@ impl LengthOrNumber {
}
/// A specified value for `min-width`, `min-height`, `width` or `height` property.
pub type MozLength = GenericMozLength<NonNegativeLengthPercentage>;
pub type Size = GenericSize<NonNegativeLengthPercentage>;
impl Parse for MozLength {
impl Parse for Size {
fn parse<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
MozLength::parse_quirky(context, input, AllowQuirks::No)
Size::parse_quirky(context, input, AllowQuirks::No)
}
}
impl MozLength {
/// Parses, with quirks.
pub fn parse_quirky<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks,
) -> Result<Self, ParseError<'i>> {
if let Ok(l) = input.try(ExtremumLength::parse) {
return Ok(GenericMozLength::ExtremumLength(l));
}
if input.try(|i| i.expect_ident_matching("auto")).is_ok() {
return Ok(GenericMozLength::Auto);
}
let length = NonNegativeLengthPercentage::parse_quirky(context, input, allow_quirks)?;
Ok(GenericMozLength::LengthPercentage(length))
}
/// Returns `0%`.
#[inline]
pub fn zero_percent() -> Self {
GenericMozLength::LengthPercentage(NonNegativeLengthPercentage::zero_percent())
}
}
/// A specified value for `max-width` or `max-height` property.
pub type MaxLength = GenericMaxLength<NonNegativeLengthPercentage>;
impl Parse for MaxLength {
fn parse<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
MaxLength::parse_quirky(context, input, AllowQuirks::No)
}
}
impl MaxLength {
impl Size {
/// Parses, with quirks.
pub fn parse_quirky<'i, 't>(
context: &ParserContext,
@ -1109,16 +1069,57 @@ impl MaxLength {
) -> Result<Self, ParseError<'i>> {
#[cfg(feature = "gecko")]
{
if let Ok(l) = input.try(ExtremumLength::parse) {
return Ok(GenericMaxLength::ExtremumLength(l));
if let Ok(l) = input.try(computed::ExtremumLength::parse) {
return Ok(GenericSize::ExtremumLength(l));
}
}
if input.try(|i| i.expect_ident_matching("auto")).is_ok() {
return Ok(GenericSize::Auto);
}
let length = NonNegativeLengthPercentage::parse_quirky(context, input, allow_quirks)?;
Ok(GenericSize::LengthPercentage(length))
}
/// Returns `0%`.
#[inline]
pub fn zero_percent() -> Self {
GenericSize::LengthPercentage(NonNegativeLengthPercentage::zero_percent())
}
}
/// A specified value for `max-width` or `max-height` property.
pub type MaxSize = GenericMaxSize<NonNegativeLengthPercentage>;
impl Parse for MaxSize {
fn parse<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
MaxSize::parse_quirky(context, input, AllowQuirks::No)
}
}
impl MaxSize {
/// Parses, with quirks.
pub fn parse_quirky<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks,
) -> Result<Self, ParseError<'i>> {
#[cfg(feature = "gecko")]
{
if let Ok(l) = input.try(computed::ExtremumLength::parse) {
return Ok(GenericMaxSize::ExtremumLength(l));
}
}
if input.try(|i| i.expect_ident_matching("none")).is_ok() {
return Ok(GenericMaxLength::None);
return Ok(GenericMaxSize::None);
}
let length = NonNegativeLengthPercentage::parse_quirky(context, input, allow_quirks)?;
Ok(GenericMaxLength::LengthPercentage(length))
Ok(GenericMaxSize::LengthPercentage(length))
}
}

View File

@ -59,7 +59,7 @@ pub use self::image::{GradientItem, GradientKind, Image, ImageLayer, MozImageRec
pub use self::length::{AbsoluteLength, CalcLengthPercentage, CharacterWidth};
pub use self::length::{FontRelativeLength, Length, LengthOrNumber};
pub use self::length::{LengthPercentage, LengthPercentageOrAuto};
pub use self::length::{MaxLength, MozLength};
pub use self::length::{MaxSize, Size};
pub use self::length::{NoCalcLength, ViewportPercentageLength};
pub use self::length::{NonNegativeLengthPercentage, NonNegativeLengthPercentageOrAuto};
#[cfg(feature = "gecko")]

View File

@ -4434,7 +4434,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetPixelValue(
) {
use style::properties::longhands::border_spacing::SpecifiedValue as BorderSpacing;
use style::properties::{LonghandId, PropertyDeclaration};
use style::values::generics::length::MozLength;
use style::values::generics::length::Size;
use style::values::generics::NonNegative;
use style::values::generics::length::LengthPercentageOrAuto;
use style::values::specified::length::NonNegativeLengthPercentage;
@ -4447,8 +4447,8 @@ pub extern "C" fn Servo_DeclarationBlock_SetPixelValue(
let lp = LengthPercentage::Length(nocalc);
let lp_or_auto = LengthPercentageOrAuto::LengthPercentage(lp.clone());
let prop = match_wrap_declared! { long,
Height => MozLength::LengthPercentage(NonNegative(lp)),
Width => MozLength::LengthPercentage(NonNegative(lp)),
Height => Size::LengthPercentage(NonNegative(lp)),
Width => Size::LengthPercentage(NonNegative(lp)),
BorderTopWidth => BorderSideWidth::Length(nocalc.into()),
BorderRightWidth => BorderSideWidth::Length(nocalc.into()),
BorderBottomWidth => BorderSideWidth::Length(nocalc.into()),
@ -4497,7 +4497,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetLengthValue(
use style::properties::longhands::_moz_script_min_size::SpecifiedValue as MozScriptMinSize;
use style::properties::{LonghandId, PropertyDeclaration};
use style::values::generics::NonNegative;
use style::values::generics::length::MozLength;
use style::values::generics::length::Size;
use style::values::specified::length::NoCalcLength;
use style::values::specified::length::{AbsoluteLength, FontRelativeLength};
use style::values::specified::length::LengthPercentage;
@ -4525,7 +4525,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetLengthValue(
};
let prop = match_wrap_declared! { long,
Width => MozLength::LengthPercentage(NonNegative(LengthPercentage::Length(nocalc))),
Width => Size::LengthPercentage(NonNegative(LengthPercentage::Length(nocalc))),
FontSize => LengthPercentage::from(nocalc).into(),
MozScriptMinSize => MozScriptMinSize(nocalc),
};
@ -4565,7 +4565,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetPercentValue(
use style::properties::{LonghandId, PropertyDeclaration};
use style::values::computed::Percentage;
use style::values::generics::NonNegative;
use style::values::generics::length::{MozLength, LengthPercentageOrAuto};
use style::values::generics::length::{Size, LengthPercentageOrAuto};
use style::values::specified::length::LengthPercentage;
let long = get_longhand_from_id!(property);
@ -4574,8 +4574,8 @@ pub extern "C" fn Servo_DeclarationBlock_SetPercentValue(
let lp_or_auto = LengthPercentageOrAuto::LengthPercentage(lp.clone());
let prop = match_wrap_declared! { long,
Height => MozLength::LengthPercentage(NonNegative(lp)),
Width => MozLength::LengthPercentage(NonNegative(lp)),
Height => Size::LengthPercentage(NonNegative(lp)),
Width => Size::LengthPercentage(NonNegative(lp)),
MarginTop => lp_or_auto,
MarginRight => lp_or_auto,
MarginBottom => lp_or_auto,
@ -4593,14 +4593,14 @@ pub extern "C" fn Servo_DeclarationBlock_SetAutoValue(
property: nsCSSPropertyID,
) {
use style::properties::{LonghandId, PropertyDeclaration};
use style::values::generics::length::{LengthPercentageOrAuto, MozLength};
use style::values::generics::length::{LengthPercentageOrAuto, Size};
let long = get_longhand_from_id!(property);
let auto = LengthPercentageOrAuto::Auto;
let prop = match_wrap_declared! { long,
Height => MozLength::auto(),
Width => MozLength::auto(),
Height => Size::auto(),
Width => Size::auto(),
MarginTop => auto,
MarginRight => auto,
MarginBottom => auto,