diff options
Diffstat (limited to 'components/layout/table_cell.rs')
-rw-r--r-- | components/layout/table_cell.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs index d72a6670576..3bcc39f0193 100644 --- a/components/layout/table_cell.rs +++ b/components/layout/table_cell.rs @@ -12,7 +12,6 @@ use crate::display_list::{ use crate::flow::{Flow, FlowClass, FlowFlags, GetBaseFlow, OpaqueFlow}; use crate::fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use crate::layout_debug; -use crate::model::MaybeAuto; use crate::table::InternalTable; use crate::table_row::{CollapsedBorder, CollapsedBorderProvenance}; use app_units::Au; @@ -22,6 +21,7 @@ use script_layout_interface::wrapper_traits::ThreadSafeLayoutNode; use std::fmt; use style::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode}; use style::properties::ComputedValues; +use style::values::computed::length::NonNegativeLengthPercentageOrAuto; use style::values::computed::Color; use style::values::generics::box_::VerticalAlign; use style::values::specified::BorderStyle; @@ -162,8 +162,12 @@ impl TableCellFlow { // Call after block size calculation pub fn total_block_size(&mut self) -> Au { // TODO: Percentage block-size - let specified = MaybeAuto::from_style(self.fragment().style().content_block_size(), Au(0)) - .specified_or_zero(); + let specified = self + .fragment() + .style() + .content_block_size() + .to_used_value(Au(0)) + .unwrap_or(Au(0)); specified + self.fragment().border_padding.block_start_end() } } @@ -198,11 +202,11 @@ impl Flow for TableCellFlow { ); self.block_flow.bubble_inline_sizes_for_block(true); - let specified_inline_size = MaybeAuto::from_style( - self.block_flow.fragment.style().content_inline_size(), - Au(0), - ) - .specified_or_zero(); + let specified_inline_size = match self.block_flow.fragment.style().content_inline_size() { + NonNegativeLengthPercentageOrAuto::Auto => Au(0), + NonNegativeLengthPercentageOrAuto::LengthPercentage(ref lp) => lp.to_used_value(Au(0)), + }; + if self .block_flow .base |