Fix servo build.

This commit is contained in:
Emilio Cobos Álvarez 2019-02-10 06:48:00 +01:00
parent 1cb235c81a
commit 6daebcc5df
18 changed files with 210 additions and 170 deletions

View file

@ -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::LengthPercentageOrAuto;
use style::values::computed::NonNegativeLengthPercentageOrAuto;
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() {
LengthPercentageOrAuto::Auto => {
NonNegativeLengthPercentageOrAuto::Auto => {
self.block_flow
.get_shrink_to_fit_inline_size(available_inline_size) -
table_border_padding
@ -840,12 +840,8 @@ fn initial_computed_inline_size(
preferred_width_of_all_columns: Au,
table_border_padding: Au,
) -> MaybeAuto {
let inline_size_from_style = MaybeAuto::from_style(
block.fragment.style.content_inline_size(),
containing_block_inline_size,
);
match inline_size_from_style {
MaybeAuto::Auto => {
match block.fragment.style.content_inline_size() {
NonNegativeLengthPercentageOrAuto::Auto => {
if preferred_width_of_all_columns + table_border_padding <= containing_block_inline_size
{
MaybeAuto::Specified(preferred_width_of_all_columns + table_border_padding)
@ -855,10 +851,13 @@ fn initial_computed_inline_size(
MaybeAuto::Auto
}
},
MaybeAuto::Specified(inline_size_from_style) => MaybeAuto::Specified(max(
inline_size_from_style - table_border_padding,
minimum_width_of_all_columns,
)),
NonNegativeLengthPercentageOrAuto::LengthPercentage(ref lp) => {
let used = lp.to_used_value(containing_block_inline_size);
MaybeAuto::Specified(max(
used - table_border_padding,
minimum_width_of_all_columns,
))
},
}
}