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

@ -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 }
}