diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2015-03-03 21:16:24 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2015-03-03 21:16:24 +0100 |
commit | 4c1d778ced267eeef790d4166e361d9348b933d3 (patch) | |
tree | ccdd9544f8f4b7a2f6299244915584fcbf5cfc18 /components/layout/table.rs | |
parent | 7a218b3f08c95b5c1a14ef1bbf09658d61b8d342 (diff) | |
download | servo-4c1d778ced267eeef790d4166e361d9348b933d3.tar.gz servo-4c1d778ced267eeef790d4166e361d9348b933d3.zip |
Revert "layout: Implement ordered lists, CSS counters, and `quotes` per CSS 2.1"
This reverts commit 30fd28d1077fbb3f47140f6ab1252c0d24f44d23.
Diffstat (limited to 'components/layout/table.rs')
-rw-r--r-- | components/layout/table.rs | 61 |
1 files changed, 38 insertions, 23 deletions
diff --git a/components/layout/table.rs b/components/layout/table.rs index 4a23db3f532..270143a21da 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -8,11 +8,12 @@ use block::{BlockFlow, ISizeAndMarginsComputer, MarginsMayCollapseFlag}; use block::{ISizeConstraintInput, ISizeConstraintSolution}; +use construct::FlowConstructor; use context::LayoutContext; use floats::FloatKind; use flow::{self, Flow, FlowClass, IMPACTED_BY_LEFT_FLOATS, IMPACTED_BY_RIGHT_FLOATS}; -use flow::{ImmutableFlowUtils}; -use fragment::{Fragment, FragmentBorderBoxIterator, FragmentMutator}; +use flow::ImmutableFlowUtils; +use fragment::{Fragment, FragmentBorderBoxIterator}; use layout_debug; use model::{IntrinsicISizes, IntrinsicISizesContribution}; use table_row::CellIntrinsicInlineSize; @@ -54,12 +55,12 @@ impl TableFlow { fragment: Fragment) -> TableFlow { let mut block_flow = BlockFlow::from_node_and_fragment(node, fragment); - let table_layout = - if block_flow.fragment().style().get_table().table_layout == table_layout::T::fixed { - TableLayout::Fixed - } else { - TableLayout::Auto - }; + let table_layout = if block_flow.fragment().style().get_table().table_layout == + table_layout::T::fixed { + TableLayout::Fixed + } else { + TableLayout::Auto + }; TableFlow { block_flow: block_flow, column_intrinsic_inline_sizes: Vec::new(), @@ -68,17 +69,35 @@ impl TableFlow { } } - pub fn float_from_node_and_fragment(node: &ThreadSafeLayoutNode, - fragment: Fragment, - float_kind: FloatKind) - -> TableFlow { - let mut block_flow = BlockFlow::float_from_node_and_fragment(node, fragment, float_kind); - let table_layout = - if block_flow.fragment().style().get_table().table_layout == table_layout::T::fixed { - TableLayout::Fixed - } else { - TableLayout::Auto - }; + pub fn from_node(constructor: &mut FlowConstructor, + node: &ThreadSafeLayoutNode) + -> TableFlow { + let mut block_flow = BlockFlow::from_node(constructor, node); + let table_layout = if block_flow.fragment().style().get_table().table_layout == + table_layout::T::fixed { + TableLayout::Fixed + } else { + TableLayout::Auto + }; + TableFlow { + block_flow: block_flow, + column_intrinsic_inline_sizes: Vec::new(), + column_computed_inline_sizes: Vec::new(), + table_layout: table_layout + } + } + + pub fn float_from_node(constructor: &mut FlowConstructor, + node: &ThreadSafeLayoutNode, + float_kind: FloatKind) + -> TableFlow { + let mut block_flow = BlockFlow::float_from_node(constructor, node, float_kind); + let table_layout = if block_flow.fragment().style().get_table().table_layout == + table_layout::T::fixed { + TableLayout::Fixed + } else { + TableLayout::Auto + }; TableFlow { block_flow: block_flow, column_intrinsic_inline_sizes: Vec::new(), @@ -377,10 +396,6 @@ impl Flow for TableFlow { stacking_context_position: &Point2D<Au>) { self.block_flow.iterate_through_fragment_border_boxes(iterator, stacking_context_position) } - - fn mutate_fragments(&mut self, mutator: &mut FragmentMutator) { - self.block_flow.mutate_fragments(mutator) - } } impl fmt::Debug for TableFlow { |