aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/flow.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2016-10-24 18:11:03 -0700
committerPatrick Walton <pcwalton@mimiga.net>2016-10-26 14:14:06 -0700
commita7f64f3d335ac79fb7e367f0cdc8a06c78ce8262 (patch)
tree225923c4de97605dc4f145f7852545755136dae6 /components/layout/flow.rs
parentbc2f5864bc10492e05fe6d68b5dba4120112df59 (diff)
downloadservo-a7f64f3d335ac79fb7e367f0cdc8a06c78ce8262.tar.gz
servo-a7f64f3d335ac79fb7e367f0cdc8a06c78ce8262.zip
layout: Remove the old anonymous table object generation code.
Diffstat (limited to 'components/layout/flow.rs')
-rw-r--r--components/layout/flow.rs81
1 files changed, 3 insertions, 78 deletions
diff --git a/components/layout/flow.rs b/components/layout/flow.rs
index 0a595cdc4aa..8959760bcee 100644
--- a/components/layout/flow.rs
+++ b/components/layout/flow.rs
@@ -33,7 +33,7 @@ use euclid::{Point2D, Size2D};
use floats::{Floats, SpeculatedFloatPlacement};
use flow_list::{FlowList, MutFlowListIterator};
use flow_ref::{self, FlowRef, WeakFlowRef};
-use fragment::{Fragment, FragmentBorderBoxIterator, Overflow, SpecificFragmentInfo};
+use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
use gfx::display_list::{ClippingRegion, StackingContext};
use gfx_traits::StackingContextId;
use gfx_traits::print_tree::PrintTree;
@@ -44,17 +44,16 @@ use parallel::FlowParallelInfo;
use rustc_serialize::{Encodable, Encoder};
use script_layout_interface::restyle_damage::{RECONSTRUCT_FLOW, REFLOW, REFLOW_OUT_OF_FLOW};
use script_layout_interface::restyle_damage::{REPAINT, REPOSITION, RestyleDamage};
-use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutNode};
use std::{fmt, mem, raw};
use std::iter::Zip;
use std::slice::IterMut;
use std::sync::Arc;
use std::sync::atomic::Ordering;
-use style::computed_values::{clear, display, empty_cells, float, overflow_x, position, text_align};
+use style::computed_values::{clear, float, overflow_x, position, text_align};
use style::context::SharedStyleContext;
use style::dom::TRestyleDamage;
use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
-use style::properties::{self, ServoComputedValues};
+use style::properties::ServoComputedValues;
use style::values::computed::LengthOrPercentageOrAuto;
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, TableFlow};
use table_caption::TableCaptionFlow;
@@ -470,12 +469,6 @@ pub trait ImmutableFlowUtils {
/// Returns true if this flow is one of table-related flows.
fn is_table_kind(self) -> bool;
- /// Returns true if anonymous flow is needed between this flow and child flow.
- fn need_anonymous_flow(self, child: &Flow) -> bool;
-
- /// Generates missing child flow of this flow.
- fn generate_missing_child_flow<N: ThreadSafeLayoutNode>(self, node: &N, ctx: &LayoutContext) -> FlowRef;
-
/// Returns true if this flow contains fragments that are roots of an absolute flow tree.
fn contains_roots_of_absolute_flow_tree(&self) -> bool;
@@ -1236,74 +1229,6 @@ impl<'a> ImmutableFlowUtils for &'a Flow {
}
}
- /// Returns true if anonymous flow is needed between this flow and child flow.
- /// Spec: http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes
- fn need_anonymous_flow(self, child: &Flow) -> bool {
- match self.class() {
- FlowClass::Table => !child.is_proper_table_child(),
- FlowClass::TableRowGroup => !child.is_table_row(),
- FlowClass::TableRow => !child.is_table_cell(),
- // FIXME(zentner): According to spec, anonymous flex items are only needed for text.
- FlowClass::Flex => child.is_inline_flow(),
- _ => false
- }
- }
-
- /// Generates missing child flow of this flow.
- ///
- /// FIXME(pcwalton): This duplicates some logic in
- /// `generate_anonymous_table_flows_if_necessary()`. We should remove this function eventually,
- /// as it's harder to understand.
- fn generate_missing_child_flow<N: ThreadSafeLayoutNode>(self, node: &N, ctx: &LayoutContext) -> FlowRef {
- let style_context = ctx.style_context();
- let mut style = node.style(style_context);
- match self.class() {
- FlowClass::Table | FlowClass::TableRowGroup => {
- properties::modify_style_for_anonymous_table_object(
- &mut style,
- display::T::table_row);
- let fragment = Fragment::from_opaque_node_and_style(
- node.opaque(),
- PseudoElementType::Normal,
- style,
- node.selected_style(style_context),
- node.restyle_damage(),
- SpecificFragmentInfo::TableRow);
- Arc::new(TableRowFlow::from_fragment(fragment))
- },
- FlowClass::TableRow => {
- properties::modify_style_for_anonymous_table_object(
- &mut style,
- display::T::table_cell);
- let fragment = Fragment::from_opaque_node_and_style(
- node.opaque(),
- PseudoElementType::Normal,
- style,
- node.selected_style(style_context),
- node.restyle_damage(),
- SpecificFragmentInfo::TableCell);
- let hide = node.style(style_context).get_inheritedtable().empty_cells == empty_cells::T::hide;
- Arc::new(TableCellFlow::from_node_fragment_and_visibility_flag(node, fragment, !hide))
- },
- FlowClass::Flex => {
- properties::modify_style_for_anonymous_flow(
- &mut style,
- display::T::block);
- let fragment =
- Fragment::from_opaque_node_and_style(node.opaque(),
- PseudoElementType::Normal,
- style,
- node.selected_style(style_context),
- node.restyle_damage(),
- SpecificFragmentInfo::Generic);
- Arc::new(BlockFlow::from_fragment(fragment, None))
- },
- _ => {
- panic!("no need to generate a missing child")
- }
- }
- }
-
/// Returns true if this flow contains fragments that are roots of an absolute flow tree.
fn contains_roots_of_absolute_flow_tree(&self) -> bool {
self.contains_relatively_positioned_fragments() || self.is_root()