style: Rename MozLength to Size, and MaxLength to MaxSize.

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
This commit is contained in:
Emilio Cobos Álvarez 2019-02-10 08:33:19 +01:00
parent 7ed6b9d3ce
commit c2819365f0
26 changed files with 280 additions and 333 deletions

View file

@ -29,7 +29,7 @@ use style::computed_values::border_spacing::T as BorderSpacing;
use style::computed_values::border_top_style::T as BorderStyle;
use style::logical_geometry::{LogicalSize, PhysicalSide, WritingMode};
use style::properties::ComputedValues;
use style::values::computed::{Color, NonNegativeLengthPercentageOrAuto};
use style::values::computed::{Color, Size};
#[allow(unsafe_code)]
unsafe impl crate::flow::HasBaseFlow for TableRowFlow {}
@ -429,24 +429,18 @@ impl Flow for TableRowFlow {
let child_base = kid.mut_base();
let child_column_inline_size = ColumnIntrinsicInlineSize {
minimum_length: match child_specified_inline_size {
NonNegativeLengthPercentageOrAuto::Auto => None,
NonNegativeLengthPercentageOrAuto::LengthPercentage(ref lp) => {
lp.0.maybe_to_used_value(None)
},
Size::Auto => None,
Size::LengthPercentage(ref lp) => lp.0.maybe_to_used_value(None),
}
.unwrap_or(child_base.intrinsic_inline_sizes.minimum_inline_size),
percentage: match child_specified_inline_size {
NonNegativeLengthPercentageOrAuto::Auto => 0.0,
NonNegativeLengthPercentageOrAuto::LengthPercentage(ref lp) => {
lp.0.as_percentage().map_or(0.0, |p| p.0)
},
Size::Auto => 0.0,
Size::LengthPercentage(ref lp) => lp.0.as_percentage().map_or(0.0, |p| p.0),
},
preferred: child_base.intrinsic_inline_sizes.preferred_inline_size,
constrained: match child_specified_inline_size {
NonNegativeLengthPercentageOrAuto::Auto => false,
NonNegativeLengthPercentageOrAuto::LengthPercentage(ref lp) => {
lp.0.maybe_to_used_value(None).is_some()
},
Size::Auto => false,
Size::LengthPercentage(ref lp) => lp.0.maybe_to_used_value(None).is_some(),
},
};
min_inline_size = min_inline_size + child_column_inline_size.minimum_length;