diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-02-10 17:00:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-10 17:00:26 -0500 |
commit | aeeaf9dda1936acc82ab039fd6fdd887e6add043 (patch) | |
tree | fb16f7cd6bc983f2ac00f54767d102d0e2a186ab /components/layout/table_wrapper.rs | |
parent | a019ed1f80e9ecfe20d797d8e1304771e0fb0af7 (diff) | |
parent | 6daebcc5dfc4e57d2f9e9450aa01b8c67dd34986 (diff) | |
download | servo-aeeaf9dda1936acc82ab039fd6fdd887e6add043.tar.gz servo-aeeaf9dda1936acc82ab039fd6fdd887e6add043.zip |
Auto merge of #22861 - emilio:gecko-sync, r=emilio
style: Sync changes from mozilla-central.
See each individual commit for details.
<!-- 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/22861)
<!-- Reviewable:end -->
Diffstat (limited to 'components/layout/table_wrapper.rs')
-rw-r--r-- | components/layout/table_wrapper.rs | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs index 9e8f137e70a..b63da7d56e5 100644 --- a/components/layout/table_wrapper.rs +++ b/components/layout/table_wrapper.rs @@ -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, + )) + }, } } |