Auto merge of #22864 - emilio:gecko-sync, r=emilio

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

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22864)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-02-11 20:28:35 -05:00 committed by GitHub
commit 92369cca21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 280 additions and 333 deletions

View file

@ -718,11 +718,9 @@ impl LayoutElementHelpers for LayoutDom<Element> {
specified::NoCalcLength::ServoCharacterWidth(specified::CharacterWidth(size));
hints.push(from_declaration(
shared_lock,
PropertyDeclaration::Width(
specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative(
specified::LengthPercentage::Length(value),
)),
),
PropertyDeclaration::Width(specified::Size::LengthPercentage(NonNegative(
specified::LengthPercentage::Length(value),
))),
));
}
@ -747,22 +745,20 @@ impl LayoutElementHelpers for LayoutDom<Element> {
match width {
LengthOrPercentageOrAuto::Auto => {},
LengthOrPercentageOrAuto::Percentage(percentage) => {
let width_value =
specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative(
specified::LengthPercentage::Percentage(computed::Percentage(percentage)),
));
let width_value = specified::Size::LengthPercentage(NonNegative(
specified::LengthPercentage::Percentage(computed::Percentage(percentage)),
));
hints.push(from_declaration(
shared_lock,
PropertyDeclaration::Width(width_value),
));
},
LengthOrPercentageOrAuto::Length(length) => {
let width_value =
specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative(
specified::LengthPercentage::Length(specified::NoCalcLength::Absolute(
specified::AbsoluteLength::Px(length.to_f32_px()),
)),
));
let width_value = specified::Size::LengthPercentage(NonNegative(
specified::LengthPercentage::Length(specified::NoCalcLength::Absolute(
specified::AbsoluteLength::Px(length.to_f32_px()),
)),
));
hints.push(from_declaration(
shared_lock,
PropertyDeclaration::Width(width_value),
@ -783,22 +779,20 @@ impl LayoutElementHelpers for LayoutDom<Element> {
match height {
LengthOrPercentageOrAuto::Auto => {},
LengthOrPercentageOrAuto::Percentage(percentage) => {
let height_value =
specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative(
specified::LengthPercentage::Percentage(computed::Percentage(percentage)),
));
let height_value = specified::Size::LengthPercentage(NonNegative(
specified::LengthPercentage::Percentage(computed::Percentage(percentage)),
));
hints.push(from_declaration(
shared_lock,
PropertyDeclaration::Height(height_value),
));
},
LengthOrPercentageOrAuto::Length(length) => {
let height_value =
specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative(
specified::LengthPercentage::Length(specified::NoCalcLength::Absolute(
specified::AbsoluteLength::Px(length.to_f32_px()),
)),
));
let height_value = specified::Size::LengthPercentage(NonNegative(
specified::LengthPercentage::Length(specified::NoCalcLength::Absolute(
specified::AbsoluteLength::Px(length.to_f32_px()),
)),
));
hints.push(from_declaration(
shared_lock,
PropertyDeclaration::Height(height_value),
@ -825,11 +819,9 @@ impl LayoutElementHelpers for LayoutDom<Element> {
specified::NoCalcLength::ServoCharacterWidth(specified::CharacterWidth(cols));
hints.push(from_declaration(
shared_lock,
PropertyDeclaration::Width(
specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative(
specified::LengthPercentage::Length(value),
)),
),
PropertyDeclaration::Width(specified::Size::LengthPercentage(NonNegative(
specified::LengthPercentage::Length(value),
))),
));
}
@ -851,11 +843,9 @@ impl LayoutElementHelpers for LayoutDom<Element> {
));
hints.push(from_declaration(
shared_lock,
PropertyDeclaration::Height(
specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative(
specified::LengthPercentage::Length(value),
)),
),
PropertyDeclaration::Height(specified::Size::LengthPercentage(NonNegative(
specified::LengthPercentage::Length(value),
))),
));
}