mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
7ed6b9d3ce
commit
c2819365f0
26 changed files with 280 additions and 333 deletions
|
@ -33,7 +33,7 @@ use style::computed_values::{position, table_layout};
|
|||
use style::context::SharedStyleContext;
|
||||
use style::logical_geometry::{LogicalRect, LogicalSize};
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::NonNegativeLengthPercentageOrAuto;
|
||||
use style::values::computed::Size;
|
||||
use style::values::CSSFloat;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Serialize)]
|
||||
|
@ -201,7 +201,7 @@ impl TableWrapperFlow {
|
|||
// says "the basic idea is the same as the shrink-to-fit width that CSS2.1 defines". So we
|
||||
// just use the shrink-to-fit inline size.
|
||||
let available_inline_size = match self.block_flow.fragment.style().content_inline_size() {
|
||||
NonNegativeLengthPercentageOrAuto::Auto => {
|
||||
Size::Auto => {
|
||||
self.block_flow
|
||||
.get_shrink_to_fit_inline_size(available_inline_size) -
|
||||
table_border_padding
|
||||
|
@ -841,7 +841,7 @@ fn initial_computed_inline_size(
|
|||
table_border_padding: Au,
|
||||
) -> MaybeAuto {
|
||||
match block.fragment.style.content_inline_size() {
|
||||
NonNegativeLengthPercentageOrAuto::Auto => {
|
||||
Size::Auto => {
|
||||
if preferred_width_of_all_columns + table_border_padding <= containing_block_inline_size
|
||||
{
|
||||
MaybeAuto::Specified(preferred_width_of_all_columns + table_border_padding)
|
||||
|
@ -851,7 +851,7 @@ fn initial_computed_inline_size(
|
|||
MaybeAuto::Auto
|
||||
}
|
||||
},
|
||||
NonNegativeLengthPercentageOrAuto::LengthPercentage(ref lp) => {
|
||||
Size::LengthPercentage(ref lp) => {
|
||||
let used = lp.to_used_value(containing_block_inline_size);
|
||||
MaybeAuto::Specified(max(
|
||||
used - table_border_padding,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue