From ed4172b2c6ead3010faf010835adfb5025286829 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 4 Aug 2015 14:38:08 -0700 Subject: [PATCH] layout: Make sure anonymous table flows are statically positioned. The failing `float-applies-to-*` CSS 2.1 tests never really should have been passing in the first place; they depend on floats inside fixed-layout tables working properly, which they don't. Closes #6078. Closes #6709. Closes #6858. --- components/layout/block.rs | 10 +-- components/layout/construct.rs | 88 +++++++++++-------- components/layout/flow.rs | 56 +++++++----- components/layout/list_item.rs | 12 ++- components/layout/multicol.rs | 8 +- components/layout/table.rs | 7 +- components/layout/table_caption.rs | 6 +- components/layout/table_cell.rs | 2 +- components/layout/table_colgroup.rs | 12 ++- components/layout/table_row.rs | 6 +- components/layout/table_rowgroup.rs | 6 +- components/layout/table_wrapper.rs | 8 +- components/style/properties.mako.rs | 11 +++ ...spos-containing-block-initial-004c.htm.ini | 2 +- ...spos-containing-block-initial-004d.htm.ini | 2 +- ...spos-containing-block-initial-005b.htm.ini | 2 +- ...spos-containing-block-initial-005d.htm.ini | 2 +- .../html4/float-applies-to-001a.htm.ini | 4 + .../html4/float-applies-to-004a.htm.ini | 4 + .../html4/float-applies-to-005.htm.ini | 4 + .../html4/float-applies-to-006.htm.ini | 4 + 21 files changed, 142 insertions(+), 114 deletions(-) create mode 100644 tests/wpt/metadata-css/css21_dev/html4/float-applies-to-001a.htm.ini create mode 100644 tests/wpt/metadata-css/css21_dev/html4/float-applies-to-004a.htm.ini create mode 100644 tests/wpt/metadata-css/css21_dev/html4/float-applies-to-005.htm.ini create mode 100644 tests/wpt/metadata-css/css21_dev/html4/float-applies-to-006.htm.ini diff --git a/components/layout/block.rs b/components/layout/block.rs index c703542b5f9..00827a87b47 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -45,7 +45,6 @@ use layout_debug; use layout_task::DISPLAY_PORT_SIZE_FACTOR; use model::{IntrinsicISizes, MarginCollapseInfo}; use model::{MaybeAuto, CollapsibleMargins, specified, specified_or_none}; -use wrapper::ThreadSafeLayoutNode; use euclid::{Point2D, Rect, Size2D}; use gfx::display_list::{ClippingRegion, DisplayList}; @@ -572,13 +571,10 @@ impl Encodable for BlockFlowFlags { } impl BlockFlow { - pub fn from_node_and_fragment(node: &ThreadSafeLayoutNode, - fragment: Fragment, - float_kind: Option) - -> BlockFlow { - let writing_mode = node.style().writing_mode; + pub fn from_fragment(fragment: Fragment, float_kind: Option) -> BlockFlow { + let writing_mode = fragment.style().writing_mode; BlockFlow { - base: BaseFlow::new(Some((*node).clone()), writing_mode, match float_kind { + base: BaseFlow::new(Some(fragment.style()), writing_mode, match float_kind { Some(_) => ForceNonfloatedFlag::FloatIfNecessary, None => ForceNonfloatedFlag::ForceNonfloated, }), diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 5060eaa3bbd..b628a123f6d 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -363,27 +363,41 @@ impl<'a> FlowConstructor<'a> { } if child.is_table_cell() { - let fragment = Fragment::new(child_node, SpecificFragmentInfo::TableRow); - let mut new_child = FlowRef::new(box TableRowFlow::from_node_and_fragment(child_node, - fragment)); + let mut style = child_node.style().clone(); + properties::modify_style_for_anonymous_table_object(&mut style, display::T::table_row); + let fragment = Fragment::from_opaque_node_and_style(child_node.opaque(), + PseudoElementType::Normal, + style, + child_node.restyle_damage(), + SpecificFragmentInfo::TableRow); + let mut new_child = FlowRef::new(box TableRowFlow::from_fragment(fragment)); new_child.add_new_child(child.clone()); child.finish(); *child = new_child } if child.is_table_row() || child.is_table_rowgroup() { - let fragment = Fragment::new(child_node, SpecificFragmentInfo::Table); - let mut new_child = FlowRef::new(box TableFlow::from_node_and_fragment(child_node, - fragment)); + let mut style = child_node.style().clone(); + properties::modify_style_for_anonymous_table_object(&mut style, display::T::table); + let fragment = Fragment::from_opaque_node_and_style(child_node.opaque(), + PseudoElementType::Normal, + style, + child_node.restyle_damage(), + SpecificFragmentInfo::Table); + let mut new_child = FlowRef::new(box TableFlow::from_fragment(fragment)); new_child.add_new_child(child.clone()); child.finish(); *child = new_child } if child.is_table() { - let fragment = Fragment::new(child_node, SpecificFragmentInfo::TableWrapper); - let mut new_child = - FlowRef::new(box TableWrapperFlow::from_node_and_fragment(child_node, - fragment, - None)); + let mut style = child_node.style().clone(); + properties::modify_style_for_anonymous_table_object(&mut style, display::T::table); + let fragment = + Fragment::from_opaque_node_and_style(child_node.opaque(), + PseudoElementType::Normal, + style, + child_node.restyle_damage(), + SpecificFragmentInfo::TableWrapper); + let mut new_child = FlowRef::new(box TableWrapperFlow::from_fragment(fragment, None)); new_child.add_new_child(child.clone()); child.finish(); *child = new_child @@ -467,7 +481,8 @@ impl<'a> FlowConstructor<'a> { let (ascent, descent) = - inline_flow.compute_minimum_ascent_and_descent(&mut self.layout_context.font_context(), + inline_flow.compute_minimum_ascent_and_descent(&mut self.layout_context + .font_context(), &**node.style()); inline_flow.minimum_block_size_above_baseline = ascent; inline_flow.minimum_depth_below_baseline = descent; @@ -482,15 +497,15 @@ impl<'a> FlowConstructor<'a> { } } - fn build_block_flow_using_construction_result_of_child(&mut self, - flow: &mut FlowRef, - consecutive_siblings: &mut Vec, - node: &ThreadSafeLayoutNode, - kid: ThreadSafeLayoutNode, - inline_fragment_accumulator: - &mut InlineFragmentsAccumulator, - abs_descendants: &mut Descendants, - first_fragment: &mut bool) { + fn build_block_flow_using_construction_result_of_child( + &mut self, + flow: &mut FlowRef, + consecutive_siblings: &mut Vec, + node: &ThreadSafeLayoutNode, + kid: ThreadSafeLayoutNode, + inline_fragment_accumulator: &mut InlineFragmentsAccumulator, + abs_descendants: &mut Descendants, + first_fragment: &mut bool) { match kid.swap_out_construction_result() { ConstructionResult::None => {} ConstructionResult::Flow(mut kid_flow, kid_abs_descendants) => { @@ -731,9 +746,9 @@ impl<'a> FlowConstructor<'a> { -> ConstructionResult { let fragment = self.build_fragment_for_block(node); let flow = if node.style().is_multicol() { - box MulticolFlow::from_node_and_fragment(node, fragment, float_kind) as Box + box MulticolFlow::from_fragment(fragment, float_kind) as Box } else { - box BlockFlow::from_node_and_fragment(node, fragment, float_kind) as Box + box BlockFlow::from_fragment(fragment, float_kind) as Box }; self.build_flow_for_block_like(FlowRef::new(flow), node) } @@ -1039,12 +1054,12 @@ impl<'a> FlowConstructor<'a> { fn build_flow_for_table_wrapper(&mut self, node: &ThreadSafeLayoutNode, float_value: float::T) -> ConstructionResult { let fragment = Fragment::new(node, SpecificFragmentInfo::TableWrapper); - let wrapper_flow = box TableWrapperFlow::from_node_and_fragment( - node, fragment, FloatKind::from_property(float_value)); + let wrapper_flow = + box TableWrapperFlow::from_fragment(fragment, FloatKind::from_property(float_value)); let mut wrapper_flow = FlowRef::new(wrapper_flow as Box); let table_fragment = Fragment::new(node, SpecificFragmentInfo::Table); - let table_flow = box TableFlow::from_node_and_fragment(node, table_fragment); + let table_flow = box TableFlow::from_fragment(table_fragment); let table_flow = FlowRef::new(table_flow as Box); // First populate the table flow with its children. @@ -1102,7 +1117,7 @@ impl<'a> FlowConstructor<'a> { /// with possibly other `BlockFlow`s or `InlineFlow`s underneath it. fn build_flow_for_table_caption(&mut self, node: &ThreadSafeLayoutNode) -> ConstructionResult { let fragment = self.build_fragment_for_block(node); - let flow = box TableCaptionFlow::from_node_and_fragment(node, fragment) as Box; + let flow = box TableCaptionFlow::from_fragment(fragment) as Box; self.build_flow_for_block_like(FlowRef::new(flow), node) } @@ -1111,8 +1126,7 @@ impl<'a> FlowConstructor<'a> { fn build_flow_for_table_rowgroup(&mut self, node: &ThreadSafeLayoutNode) -> ConstructionResult { let fragment = Fragment::new(node, SpecificFragmentInfo::TableRow); - let flow = box TableRowGroupFlow::from_node_and_fragment(node, fragment); - let flow = flow as Box; + let flow = box TableRowGroupFlow::from_fragment(fragment) as Box; self.build_flow_for_block_like(FlowRef::new(flow), node) } @@ -1120,7 +1134,7 @@ impl<'a> FlowConstructor<'a> { /// possibly other `TableCellFlow`s underneath it. fn build_flow_for_table_row(&mut self, node: &ThreadSafeLayoutNode) -> ConstructionResult { let fragment = Fragment::new(node, SpecificFragmentInfo::TableRow); - let flow = box TableRowFlow::from_node_and_fragment(node, fragment) as Box; + let flow = box TableRowFlow::from_fragment(fragment) as Box; self.build_flow_for_block_like(FlowRef::new(flow), node) } @@ -1191,19 +1205,15 @@ impl<'a> FlowConstructor<'a> { let main_fragment = self.build_fragment_for_block(node); let flow = match node.style().get_list().list_style_position { list_style_position::T::outside => { - box ListItemFlow::from_node_fragments_and_flotation(node, - main_fragment, - marker_fragment, - flotation) + box ListItemFlow::from_fragments_and_flotation(main_fragment, + marker_fragment, + flotation) } list_style_position::T::inside => { if let Some(marker_fragment) = marker_fragment { initial_fragments.fragments.push_back(marker_fragment) } - box ListItemFlow::from_node_fragments_and_flotation(node, - main_fragment, - None, - flotation) + box ListItemFlow::from_fragments_and_flotation(main_fragment, None, flotation) } }; @@ -1250,7 +1260,7 @@ impl<'a> FlowConstructor<'a> { let specific = SpecificFragmentInfo::TableColumn(TableColumnFragmentInfo::new(node)); col_fragments.push(Fragment::new(node, specific)); } - let flow = box TableColGroupFlow::from_node_and_fragments(node, fragment, col_fragments); + let flow = box TableColGroupFlow::from_fragments(fragment, col_fragments); let mut flow = FlowRef::new(flow as Box); flow.finish(); diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 6d2d6df0070..aaab4a2507a 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -44,7 +44,7 @@ use table_row::TableRowFlow; use table_rowgroup::TableRowGroupFlow; use table_wrapper::TableWrapperFlow; use multicol::MulticolFlow; -use wrapper::ThreadSafeLayoutNode; +use wrapper::{PseudoElementType, ThreadSafeLayoutNode}; use euclid::{Point2D, Rect, Size2D}; use gfx::display_list::ClippingRegion; @@ -58,8 +58,8 @@ use std::raw; use std::slice::IterMut; use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering}; -use style::computed_values::{clear, empty_cells, float, position, text_align}; -use style::properties::ComputedValues; +use style::computed_values::{clear, display, empty_cells, float, position, text_align}; +use style::properties::{self, ComputedValues}; use style::values::computed::LengthOrPercentageOrAuto; use util::geometry::{Au, ZERO_RECT}; use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode}; @@ -968,19 +968,18 @@ pub enum ForceNonfloatedFlag { impl BaseFlow { #[inline] - pub fn new(node: Option, + pub fn new(style: Option<&ComputedValues>, writing_mode: WritingMode, force_nonfloated: ForceNonfloatedFlag) -> BaseFlow { let mut flags = FlowFlags::empty(); - match node { - Some(node) => { - let node_style = node.style(); - match node_style.get_box().position { + match style { + Some(style) => { + match style.get_box().position { position::T::absolute | position::T::fixed => { flags.insert(IS_ABSOLUTELY_POSITIONED); - let logical_position = node_style.logical_position(); + let logical_position = style.logical_position(); if logical_position.inline_start == LengthOrPercentageOrAuto::Auto && logical_position.inline_end == LengthOrPercentageOrAuto::Auto { flags.insert(INLINE_POSITION_IS_STATIC); @@ -994,14 +993,14 @@ impl BaseFlow { } if force_nonfloated == ForceNonfloatedFlag::FloatIfNecessary { - match node_style.get_box().float { + match style.get_box().float { float::T::none => {} float::T::left => flags.insert(FLOATS_LEFT), float::T::right => flags.insert(FLOATS_RIGHT), } } - match node_style.get_box().clear { + match style.get_box().clear { clear::T::none => {} clear::T::left => flags.insert(CLEARS_LEFT), clear::T::right => flags.insert(CLEARS_RIGHT), @@ -1011,8 +1010,8 @@ impl BaseFlow { } } - if !node_style.get_counters().counter_reset.0.is_empty() || - !node_style.get_counters().counter_increment.0.is_empty() { + if !style.get_counters().counter_reset.0.is_empty() || + !style.get_counters().counter_increment.0.is_empty() { flags.insert(AFFECTS_COUNTERS) } } @@ -1192,18 +1191,35 @@ impl<'a> ImmutableFlowUtils for &'a (Flow + 'a) { } /// 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(self, node: &ThreadSafeLayoutNode) -> FlowRef { + let mut style = node.style().clone(); let flow = match self.class() { FlowClass::Table | FlowClass::TableRowGroup => { - let fragment = - Fragment::new_anonymous_from_specific_info(node, - SpecificFragmentInfo::TableRow); - box TableRowFlow::from_node_and_fragment(node, fragment) as Box + 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.restyle_damage(), + SpecificFragmentInfo::TableRow); + box TableRowFlow::from_fragment(fragment) as Box }, FlowClass::TableRow => { - let fragment = - Fragment::new_anonymous_from_specific_info(node, - SpecificFragmentInfo::TableCell); + 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.restyle_damage(), + SpecificFragmentInfo::TableCell); let hide = node.style().get_inheritedtable().empty_cells == empty_cells::T::hide; box TableCellFlow::from_node_fragment_and_visibility_flag(node, fragment, !hide) as Box diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs index 78c88223afe..ac3913333d1 100644 --- a/components/layout/list_item.rs +++ b/components/layout/list_item.rs @@ -17,7 +17,6 @@ use generated_content; use incremental::RESOLVE_GENERATED_CONTENT; use inline::InlineMetrics; use text; -use wrapper::ThreadSafeLayoutNode; use euclid::{Point2D, Rect}; use gfx::display_list::DisplayList; @@ -39,13 +38,12 @@ pub struct ListItemFlow { } impl ListItemFlow { - pub fn from_node_fragments_and_flotation(node: &ThreadSafeLayoutNode, - main_fragment: Fragment, - marker_fragment: Option, - flotation: Option) - -> ListItemFlow { + pub fn from_fragments_and_flotation(main_fragment: Fragment, + marker_fragment: Option, + flotation: Option) + -> ListItemFlow { let mut this = ListItemFlow { - block_flow: BlockFlow::from_node_and_fragment(node, main_fragment, flotation), + block_flow: BlockFlow::from_fragment(main_fragment, flotation), marker: marker_fragment, }; diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs index 3e9ff257c9c..438b8b18830 100644 --- a/components/layout/multicol.rs +++ b/components/layout/multicol.rs @@ -11,7 +11,6 @@ use context::LayoutContext; use floats::FloatKind; use flow::{FlowClass, Flow, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator}; -use wrapper::ThreadSafeLayoutNode; use euclid::{Point2D, Rect}; use util::geometry::Au; @@ -25,12 +24,9 @@ pub struct MulticolFlow { } impl MulticolFlow { - pub fn from_node_and_fragment(node: &ThreadSafeLayoutNode, - fragment: Fragment, - float_kind: Option) - -> MulticolFlow { + pub fn from_fragment(fragment: Fragment, float_kind: Option) -> MulticolFlow { MulticolFlow { - block_flow: BlockFlow::from_node_and_fragment(node, fragment, float_kind) + block_flow: BlockFlow::from_fragment(fragment, float_kind) } } } diff --git a/components/layout/table.rs b/components/layout/table.rs index 197dc89db17..86eec90ffdd 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -19,7 +19,6 @@ use model::{IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto}; use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderProvenance}; use table_row::{TableRowFlow}; use table_wrapper::TableLayout; -use wrapper::ThreadSafeLayoutNode; use euclid::{Point2D, Rect}; use gfx::display_list::DisplayList; @@ -61,10 +60,8 @@ pub struct TableFlow { } impl TableFlow { - pub fn from_node_and_fragment(node: &ThreadSafeLayoutNode, - fragment: Fragment) - -> TableFlow { - let mut block_flow = BlockFlow::from_node_and_fragment(node, fragment, None); + pub fn from_fragment(fragment: Fragment) -> TableFlow { + let mut block_flow = BlockFlow::from_fragment(fragment, None); let table_layout = if block_flow.fragment().style().get_table().table_layout == table_layout::T::fixed { TableLayout::Fixed diff --git a/components/layout/table_caption.rs b/components/layout/table_caption.rs index 003f03c92c2..24cc912af66 100644 --- a/components/layout/table_caption.rs +++ b/components/layout/table_caption.rs @@ -10,7 +10,6 @@ use block::BlockFlow; use context::LayoutContext; use flow::{FlowClass, Flow, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator}; -use wrapper::ThreadSafeLayoutNode; use euclid::{Point2D, Rect}; use util::geometry::Au; @@ -25,10 +24,9 @@ pub struct TableCaptionFlow { } impl TableCaptionFlow { - pub fn from_node_and_fragment(node: &ThreadSafeLayoutNode, fragment: Fragment) - -> TableCaptionFlow { + pub fn from_fragment(fragment: Fragment) -> TableCaptionFlow { TableCaptionFlow { - block_flow: BlockFlow::from_node_and_fragment(node, fragment, None) + block_flow: BlockFlow::from_fragment(fragment, None) } } } diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs index 90cc27854cc..fea0fb61263 100644 --- a/components/layout/table_cell.rs +++ b/components/layout/table_cell.rs @@ -51,7 +51,7 @@ impl TableCellFlow { visible: bool) -> TableCellFlow { TableCellFlow { - block_flow: BlockFlow::from_node_and_fragment(node, fragment, None), + block_flow: BlockFlow::from_fragment(fragment, None), collapsed_borders: CollapsedBordersForCell::new(), column_span: node.get_unsigned_integer_attribute(UnsignedIntegerAttribute::ColSpan) .unwrap_or(1), diff --git a/components/layout/table_colgroup.rs b/components/layout/table_colgroup.rs index 3af39fe0347..65990e40599 100644 --- a/components/layout/table_colgroup.rs +++ b/components/layout/table_colgroup.rs @@ -10,7 +10,6 @@ use context::LayoutContext; use flow::{BaseFlow, FlowClass, Flow, ForceNonfloatedFlag, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo}; use layout_debug; -use wrapper::ThreadSafeLayoutNode; use euclid::{Point2D, Rect}; use util::geometry::{Au, ZERO_RECT}; @@ -39,13 +38,12 @@ pub struct TableColGroupFlow { } impl TableColGroupFlow { - pub fn from_node_and_fragments(node: &ThreadSafeLayoutNode, - fragment: Fragment, - fragments: Vec) - -> TableColGroupFlow { - let writing_mode = node.style().writing_mode; + pub fn from_fragments(fragment: Fragment, fragments: Vec) -> TableColGroupFlow { + let writing_mode = fragment.style().writing_mode; TableColGroupFlow { - base: BaseFlow::new(Some((*node).clone()), writing_mode, ForceNonfloatedFlag::ForceNonfloated), + base: BaseFlow::new(Some(fragment.style()), + writing_mode, + ForceNonfloatedFlag::ForceNonfloated), fragment: Some(fragment), cols: fragments, inline_sizes: vec!(), diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs index e1cde61b361..583749e65bb 100644 --- a/components/layout/table_row.rs +++ b/components/layout/table_row.rs @@ -16,7 +16,6 @@ use layout_debug; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt}; use table_cell::{CollapsedBordersForCell, TableCellFlow}; use model::MaybeAuto; -use wrapper::ThreadSafeLayoutNode; use cssparser::{Color, RGBA}; use euclid::{Point2D, Rect}; @@ -80,11 +79,10 @@ pub struct CellIntrinsicInlineSize { impl TableRowFlow { - pub fn from_node_and_fragment(node: &ThreadSafeLayoutNode, fragment: Fragment) - -> TableRowFlow { + pub fn from_fragment(fragment: Fragment) -> TableRowFlow { let writing_mode = fragment.style().writing_mode; TableRowFlow { - block_flow: BlockFlow::from_node_and_fragment(node, fragment, None), + block_flow: BlockFlow::from_fragment(fragment, None), cell_intrinsic_inline_sizes: Vec::new(), column_computed_inline_sizes: Vec::new(), spacing: border_spacing::T { diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs index f633d241218..36ca99e0131 100644 --- a/components/layout/table_rowgroup.rs +++ b/components/layout/table_rowgroup.rs @@ -14,7 +14,6 @@ use layout_debug; use style::computed_values::{border_collapse, border_spacing}; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow}; use table_row::{self, CollapsedBordersForRow}; -use wrapper::ThreadSafeLayoutNode; use euclid::{Point2D, Rect}; use rustc_serialize::{Encoder, Encodable}; @@ -63,11 +62,10 @@ impl Encodable for TableRowGroupFlow { } impl TableRowGroupFlow { - pub fn from_node_and_fragment(node: &ThreadSafeLayoutNode, fragment: Fragment) - -> TableRowGroupFlow { + pub fn from_fragment(fragment: Fragment) -> TableRowGroupFlow { let writing_mode = fragment.style().writing_mode; TableRowGroupFlow { - block_flow: BlockFlow::from_node_and_fragment(node, fragment, None), + block_flow: BlockFlow::from_fragment(fragment, None), column_intrinsic_inline_sizes: Vec::new(), column_computed_inline_sizes: Vec::new(), spacing: border_spacing::T { diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs index 0fc023e668d..57a1a1f0b9c 100644 --- a/components/layout/table_wrapper.rs +++ b/components/layout/table_wrapper.rs @@ -23,7 +23,6 @@ use fragment::{Fragment, FragmentBorderBoxIterator}; use model::MaybeAuto; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize}; use table_row; -use wrapper::ThreadSafeLayoutNode; use euclid::{Point2D, Rect}; use util::geometry::Au; @@ -56,11 +55,8 @@ pub struct TableWrapperFlow { } impl TableWrapperFlow { - pub fn from_node_and_fragment(node: &ThreadSafeLayoutNode, - fragment: Fragment, - float_kind: Option) - -> TableWrapperFlow { - let mut block_flow = BlockFlow::from_node_and_fragment(node, fragment, float_kind); + pub fn from_fragment(fragment: Fragment, float_kind: Option) -> TableWrapperFlow { + let mut block_flow = BlockFlow::from_fragment(fragment, float_kind); let table_layout = if block_flow.fragment().style().get_table().table_layout == table_layout::T::fixed { TableLayout::Fixed diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index 36c2787dc76..d7d1d71cfd0 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -6517,6 +6517,17 @@ pub fn modify_style_for_inline_sides(style: &mut Arc, } } +/// Adjusts the display and position properties as appropriate for an anonymous table object. +#[inline] +pub fn modify_style_for_anonymous_table_object( + style: &mut Arc, + new_display_value: longhands::display::computed_value::T) { + let mut style = Arc::make_unique(style); + let box_style = Arc::make_unique(&mut style.box_); + box_style.display = new_display_value; + box_style.position = longhands::position::computed_value::T::static_; +} + pub fn is_supported_property(property: &str) -> bool { match_ignore_ascii_case! { property, % for property in SHORTHANDS + LONGHANDS[:-1]: diff --git a/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-004c.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-004c.htm.ini index 2fa3d6dee49..df8045dce1f 100644 --- a/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-004c.htm.ini +++ b/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-004c.htm.ini @@ -1,3 +1,3 @@ [abspos-containing-block-initial-004c.htm] type: reftest - expected: TIMEOUT + expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-004d.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-004d.htm.ini index 41333d5111f..ee0b4424da5 100644 --- a/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-004d.htm.ini +++ b/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-004d.htm.ini @@ -1,3 +1,3 @@ [abspos-containing-block-initial-004d.htm] type: reftest - expected: TIMEOUT + expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-005b.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-005b.htm.ini index 5e3497692a8..02c3f7ec9dd 100644 --- a/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-005b.htm.ini +++ b/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-005b.htm.ini @@ -1,3 +1,3 @@ [abspos-containing-block-initial-005b.htm] type: reftest - expected: TIMEOUT + expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-005d.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-005d.htm.ini index c68b33b2cde..087e871ddf4 100644 --- a/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-005d.htm.ini +++ b/tests/wpt/metadata-css/css21_dev/html4/abspos-containing-block-initial-005d.htm.ini @@ -1,3 +1,3 @@ [abspos-containing-block-initial-005d.htm] type: reftest - expected: TIMEOUT + expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/float-applies-to-001a.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/float-applies-to-001a.htm.ini new file mode 100644 index 00000000000..09c9328f0a3 --- /dev/null +++ b/tests/wpt/metadata-css/css21_dev/html4/float-applies-to-001a.htm.ini @@ -0,0 +1,4 @@ +[float-applies-to-001a.htm] + type: reftest + expected: FAIL + diff --git a/tests/wpt/metadata-css/css21_dev/html4/float-applies-to-004a.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/float-applies-to-004a.htm.ini new file mode 100644 index 00000000000..907f547dd19 --- /dev/null +++ b/tests/wpt/metadata-css/css21_dev/html4/float-applies-to-004a.htm.ini @@ -0,0 +1,4 @@ +[float-applies-to-004a.htm] + type: reftest + expected: FAIL + diff --git a/tests/wpt/metadata-css/css21_dev/html4/float-applies-to-005.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/float-applies-to-005.htm.ini new file mode 100644 index 00000000000..d2296069444 --- /dev/null +++ b/tests/wpt/metadata-css/css21_dev/html4/float-applies-to-005.htm.ini @@ -0,0 +1,4 @@ +[float-applies-to-005.htm] + type: reftest + expected: FAIL + diff --git a/tests/wpt/metadata-css/css21_dev/html4/float-applies-to-006.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/float-applies-to-006.htm.ini new file mode 100644 index 00000000000..0c4036e734e --- /dev/null +++ b/tests/wpt/metadata-css/css21_dev/html4/float-applies-to-006.htm.ini @@ -0,0 +1,4 @@ +[float-applies-to-006.htm] + type: reftest + expected: FAIL +