From 066775915ce2bd52b8ae3eeb1d2e0df6a7413c2e Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Sun, 25 Sep 2016 18:58:56 +0200 Subject: [PATCH] Simplify stacking context collection Simplify the way that stacking contexts are collected. Instead of passing the StackingContextId down the tree, pass the parent StackingContext itself. This will allow future patches to get more information about the parent stacking context (such as location). Also remove the return value of collect_stacking_contexts, which was unused. --- components/gfx/display_list/mod.rs | 49 ++++------ components/layout/block.rs | 9 +- components/layout/display_list_builder.rs | 105 +++++++++------------- components/layout/flex.rs | 8 +- components/layout/flow.rs | 11 +-- components/layout/inline.rs | 8 +- components/layout/list_item.rs | 8 +- components/layout/multicol.rs | 15 +--- components/layout/sequential.rs | 5 +- components/layout/table.rs | 8 +- components/layout/table_caption.rs | 8 +- components/layout/table_cell.rs | 8 +- components/layout/table_colgroup.rs | 8 +- components/layout/table_row.rs | 8 +- components/layout/table_rowgroup.rs | 8 +- components/layout/table_wrapper.rs | 8 +- 16 files changed, 89 insertions(+), 185 deletions(-) diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index 27ed5d6ace54..1b7195fa201e 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -618,7 +618,7 @@ pub struct StackingContext { pub layer_info: Option, /// Children of this StackingContext. - children: Vec>, + pub children: Vec>, } impl StackingContext { @@ -654,30 +654,9 @@ impl StackingContext { } } - pub fn set_children(&mut self, children: Vec>) { - debug_assert!(self.children.is_empty()); - // We need to take into account the possible transformations of the - // child stacking contexts. - for child in &children { - self.update_overflow_for_new_child(&child); - } - - self.children = children; - } - - pub fn add_child(&mut self, child: Box) { - self.update_overflow_for_new_child(&child); - self.children.push(child); - } - - pub fn add_children(&mut self, children: Vec>) { - if self.children.is_empty() { - return self.set_children(children); - } - - for child in children { - self.add_child(child); - } + pub fn add_child(&mut self, mut child: StackingContext) { + child.update_overflow_for_all_children(); + self.children.push(Box::new(child)); } pub fn child_at_mut(&mut self, index: usize) -> &mut StackingContext { @@ -688,16 +667,18 @@ impl StackingContext { &self.children } - fn update_overflow_for_new_child(&mut self, child: &StackingContext) { - if self.context_type == StackingContextType::Real && - child.context_type == StackingContextType::Real && - !self.scrolls_overflow_area { - // This child might be transformed, so we need to take into account - // its transformed overflow rect too, but at the correct position. - let overflow = - child.overflow_rect_in_parent_space(); + fn update_overflow_for_all_children(&mut self) { + for child in self.children.iter() { + if self.context_type == StackingContextType::Real && + child.context_type == StackingContextType::Real && + !self.scrolls_overflow_area { + // This child might be transformed, so we need to take into account + // its transformed overflow rect too, but at the correct position. + let overflow = + child.overflow_rect_in_parent_space(); - self.overflow = self.overflow.union(&overflow); + self.overflow = self.overflow.union(&overflow); + } } } diff --git a/components/layout/block.rs b/components/layout/block.rs index dc623d9871a7..566d95cc17bd 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -44,7 +44,7 @@ use flow_ref::FlowRef; use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, HAS_LAYER, Overflow}; use fragment::SpecificFragmentInfo; use gfx::display_list::{ClippingRegion, StackingContext}; -use gfx_traits::{LayerId, StackingContextId}; +use gfx_traits::LayerId; use gfx_traits::print_tree::PrintTree; use layout_debug; use model::{self, IntrinsicISizes, MarginCollapseInfo}; @@ -2172,11 +2172,8 @@ impl Flow for BlockFlow { } } - fn collect_stacking_contexts(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { - self.collect_stacking_contexts_for_block(parent_id, contexts) + fn collect_stacking_contexts(&mut self, parent: &mut StackingContext) { + self.collect_stacking_contexts_for_block(parent); } fn build_display_list(&mut self, state: &mut DisplayListBuildState) { diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 97d2c7c4b43f..c62518a9977b 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -292,7 +292,7 @@ pub trait FragmentDisplayListBuilding { base_flow: &BaseFlow, scroll_policy: ScrollPolicy, mode: StackingContextCreationMode) - -> Box; + -> StackingContext; } fn handle_overlapping_radii(size: &Size2D, radii: &BorderRadii) -> BorderRadii { @@ -1369,7 +1369,7 @@ impl FragmentDisplayListBuilding for Fragment { base_flow: &BaseFlow, scroll_policy: ScrollPolicy, mode: StackingContextCreationMode) - -> Box { + -> StackingContext { let use_webrender = opts::get().use_webrender; let border_box = match mode { StackingContextCreationMode::InnerScrollWrapper => { @@ -1510,18 +1510,18 @@ impl FragmentDisplayListBuilding for Fragment { _ => StackingContextType::Real, }; - Box::new(StackingContext::new(id, - context_type, - &border_box, - &overflow, - self.effective_z_index(), - filters, - self.style().get_effects().mix_blend_mode, - transform, - perspective, - establishes_3d_context, - scrolls_overflow_area, - layer_info)) + StackingContext::new(id, + context_type, + &border_box, + &overflow, + self.effective_z_index(), + filters, + self.style().get_effects().mix_blend_mode, + transform, + perspective, + establishes_3d_context, + scrolls_overflow_area, + layer_info) } fn adjust_clipping_region_for_children(&self, @@ -1721,25 +1721,19 @@ impl FragmentDisplayListBuilding for Fragment { } pub trait BlockFlowDisplayListBuilding { - fn collect_stacking_contexts_for_block(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId; + fn collect_stacking_contexts_for_block(&mut self, parent: &mut StackingContext); fn build_display_list_for_block(&mut self, state: &mut DisplayListBuildState, border_painting_mode: BorderPaintingMode); } impl BlockFlowDisplayListBuilding for BlockFlow { - fn collect_stacking_contexts_for_block(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { + fn collect_stacking_contexts_for_block(&mut self, parent: &mut StackingContext) { let block_stacking_context_type = self.block_stacking_context_type(); if block_stacking_context_type == BlockStackingContextType::NonstackingContext { - self.base.stacking_context_id = parent_id; - self.base.collect_stacking_contexts_for_children(parent_id, contexts); - return parent_id; + self.base.stacking_context_id = parent.id; + self.base.collect_stacking_contexts_for_children(parent); + return; } let has_scrolling_overflow = self.has_scrolling_overflow(); @@ -1758,9 +1752,6 @@ impl BlockFlowDisplayListBuilding for BlockFlow { stacking_context_id }; - let mut child_contexts = Vec::new(); - self.base.collect_stacking_contexts_for_children(inner_stacking_context_id, - &mut child_contexts); if block_stacking_context_type == BlockStackingContextType::PseudoStackingContext { let creation_mode = if self.base.flags.contains(IS_ABSOLUTELY_POSITIONED) || @@ -1771,25 +1762,25 @@ impl BlockFlowDisplayListBuilding for BlockFlow { StackingContextCreationMode::PseudoFloat }; - let stacking_context_index = contexts.len(); - contexts.push(self.fragment.create_stacking_context(stacking_context_id, - &self.base, - ScrollPolicy::Scrollable, - creation_mode)); - - let mut floating = vec![]; - for child_context in child_contexts.into_iter() { - if child_context.context_type == StackingContextType::PseudoFloat { - // Floating. - floating.push(child_context) + let mut new_context = self.fragment.create_stacking_context(stacking_context_id, + &self.base, + ScrollPolicy::Scrollable, + creation_mode); + self.base.collect_stacking_contexts_for_children(&mut new_context); + let new_children: Vec> = new_context.children.drain(..).collect(); + + let mut non_floating_children = Vec::new(); + for child in new_children { + if child.context_type == StackingContextType::PseudoFloat { + new_context.children.push(child); } else { - // Positioned. - contexts.push(child_context) + non_floating_children.push(child); } } - contexts[stacking_context_index].set_children(floating); - return stacking_context_id; + parent.add_child(new_context); + parent.children.append(&mut non_floating_children); + return; } let scroll_policy = if self.is_fixed() { @@ -1804,7 +1795,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow { &self.base, scroll_policy, StackingContextCreationMode::InnerScrollWrapper); - inner_stacking_context.set_children(child_contexts); + self.base.collect_stacking_contexts_for_children(&mut inner_stacking_context); let mut outer_stacking_context = self.fragment.create_stacking_context( stacking_context_id, @@ -1819,12 +1810,11 @@ impl BlockFlowDisplayListBuilding for BlockFlow { &self.base, scroll_policy, StackingContextCreationMode::Normal); - stacking_context.set_children(child_contexts); + self.base.collect_stacking_contexts_for_children(&mut stacking_context); stacking_context }; - contexts.push(stacking_context); - stacking_context_id + parent.add_child(stacking_context); } fn build_display_list_for_block(&mut self, @@ -1871,10 +1861,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow { } pub trait InlineFlowDisplayListBuilding { - fn collect_stacking_contexts_for_inline(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId; + fn collect_stacking_contexts_for_inline(&mut self, parent: &mut StackingContext); fn build_display_list_for_inline_fragment_at_index(&mut self, state: &mut DisplayListBuildState, index: usize); @@ -1882,36 +1869,32 @@ pub trait InlineFlowDisplayListBuilding { } impl InlineFlowDisplayListBuilding for InlineFlow { - fn collect_stacking_contexts_for_inline(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { - self.base.stacking_context_id = parent_id; + fn collect_stacking_contexts_for_inline(&mut self, parent: &mut StackingContext) { + self.base.stacking_context_id = parent.id; for mut fragment in self.fragments.fragments.iter_mut() { match fragment.specific { SpecificFragmentInfo::InlineBlock(ref mut block_flow) => { let block_flow = flow_ref::deref_mut(&mut block_flow.flow_ref); - block_flow.collect_stacking_contexts(parent_id, contexts); + block_flow.collect_stacking_contexts(parent); } SpecificFragmentInfo::InlineAbsoluteHypothetical(ref mut block_flow) => { let block_flow = flow_ref::deref_mut(&mut block_flow.flow_ref); - block_flow.collect_stacking_contexts(parent_id, contexts); + block_flow.collect_stacking_contexts(parent); } _ if fragment.establishes_stacking_context() => { fragment.stacking_context_id = StackingContextId::new_of_type(fragment.fragment_id(), fragment.fragment_type()); - contexts.push(fragment.create_stacking_context( + parent.add_child(fragment.create_stacking_context( fragment.stacking_context_id, &self.base, ScrollPolicy::Scrollable, StackingContextCreationMode::Normal)); } - _ => fragment.stacking_context_id = parent_id, + _ => fragment.stacking_context_id = parent.id, } } - parent_id } fn build_display_list_for_inline_fragment_at_index(&mut self, diff --git a/components/layout/flex.rs b/components/layout/flex.rs index 8ad36bf8d141..bce1e0f099f2 100644 --- a/components/layout/flex.rs +++ b/components/layout/flex.rs @@ -18,7 +18,6 @@ use flow::{INLINE_POSITION_IS_STATIC, IS_ABSOLUTELY_POSITIONED}; use flow_ref::{self, FlowRef}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; -use gfx_traits::StackingContextId; use layout_debug; use model::{Direction, IntrinsicISizes, MaybeAuto, MinMaxConstraint}; use model::{specified, specified_or_none}; @@ -940,11 +939,8 @@ impl Flow for FlexFlow { self.build_display_list_for_flex(state); } - fn collect_stacking_contexts(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { - self.block_flow.collect_stacking_contexts(parent_id, contexts) + fn collect_stacking_contexts(&mut self, parent: &mut StackingContext) { + self.block_flow.collect_stacking_contexts(parent); } fn repair_style(&mut self, new_style: &Arc) { diff --git a/components/layout/flow.rs b/components/layout/flow.rs index c8703272fd69..1f057c8364ab 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -224,10 +224,7 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static { None } - fn collect_stacking_contexts(&mut self, - _parent_id: StackingContextId, - _: &mut Vec>) - -> StackingContextId; + fn collect_stacking_contexts(&mut self, _parent: &mut StackingContext); /// If this is a float, places it. The default implementation does nothing. fn place_float_if_applicable<'a>(&mut self) {} @@ -1160,11 +1157,9 @@ impl BaseFlow { return self as *const BaseFlow as usize; } - pub fn collect_stacking_contexts_for_children(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) { + pub fn collect_stacking_contexts_for_children(&mut self, parent: &mut StackingContext) { for kid in self.children.iter_mut() { - kid.collect_stacking_contexts(parent_id, contexts); + kid.collect_stacking_contexts(parent); } } diff --git a/components/layout/inline.rs b/components/layout/inline.rs index ec1d223cd361..49e2e14302aa 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -20,7 +20,6 @@ use fragment::SpecificFragmentInfo; use gfx::display_list::{OpaqueNode, StackingContext}; use gfx::font::FontMetrics; use gfx::font_context::FontContext; -use gfx_traits::StackingContextId; use gfx_traits::print_tree::PrintTree; use layout_debug; use model::IntrinsicISizesContribution; @@ -1658,11 +1657,8 @@ impl Flow for InlineFlow { fn update_late_computed_block_position_if_necessary(&mut self, _: Au) {} - fn collect_stacking_contexts(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { - self.collect_stacking_contexts_for_inline(parent_id, contexts) + fn collect_stacking_contexts(&mut self, parent: &mut StackingContext) { + self.collect_stacking_contexts_for_inline(parent); } fn build_display_list(&mut self, state: &mut DisplayListBuildState) { diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs index 4616c22ae7a4..9bcb38cd5ade 100644 --- a/components/layout/list_item.rs +++ b/components/layout/list_item.rs @@ -18,7 +18,6 @@ use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, GeneratedC use fragment::Overflow; use generated_content; use gfx::display_list::StackingContext; -use gfx_traits::StackingContextId; use inline::InlineMetrics; use script_layout_interface::restyle_damage::RESOLVE_GENERATED_CONTENT; use std::sync::Arc; @@ -148,11 +147,8 @@ impl Flow for ListItemFlow { self.build_display_list_for_list_item(state); } - fn collect_stacking_contexts(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { - self.block_flow.collect_stacking_contexts(parent_id, contexts) + fn collect_stacking_contexts(&mut self, parent: &mut StackingContext) { + self.block_flow.collect_stacking_contexts(parent); } fn repair_style(&mut self, new_style: &Arc) { diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs index e64479ffb11a..b2283ad90155 100644 --- a/components/layout/multicol.rs +++ b/components/layout/multicol.rs @@ -17,7 +17,6 @@ use flow::{Flow, FlowClass, OpaqueFlow, mut_base, FragmentationContext}; use flow_ref::{self, FlowRef}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; -use gfx_traits::StackingContextId; use gfx_traits::print_tree::PrintTree; use std::cmp::{min, max}; use std::fmt; @@ -186,11 +185,8 @@ impl Flow for MulticolFlow { self.block_flow.build_display_list(state); } - fn collect_stacking_contexts(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { - self.block_flow.collect_stacking_contexts(parent_id, contexts) + fn collect_stacking_contexts(&mut self, parent: &mut StackingContext) { + self.block_flow.collect_stacking_contexts(parent); } fn repair_style(&mut self, new_style: &Arc) { @@ -271,11 +267,8 @@ impl Flow for MulticolColumnFlow { self.block_flow.build_display_list(state); } - fn collect_stacking_contexts(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { - self.block_flow.collect_stacking_contexts(parent_id, contexts) + fn collect_stacking_contexts(&mut self, parent: &mut StackingContext) { + self.block_flow.collect_stacking_contexts(parent); } fn repair_style(&mut self, new_style: &Arc) { diff --git a/components/layout/sequential.rs b/components/layout/sequential.rs index d59774c46d54..f2964976ed3e 100644 --- a/components/layout/sequential.rs +++ b/components/layout/sequential.rs @@ -78,10 +78,7 @@ pub fn build_display_list_for_subtree(flow_root: &mut Flow, root_stacking_context: &mut StackingContext, shared_layout_context: &SharedLayoutContext) -> Vec { - let mut children = vec![]; - flow_root.collect_stacking_contexts(root_stacking_context.id, - &mut children); - root_stacking_context.add_children(children); + flow_root.collect_stacking_contexts(root_stacking_context); let mut build_display_list = BuildDisplayList { state: DisplayListBuildState::new(shared_layout_context, flow::base(flow_root).stacking_context_id), diff --git a/components/layout/table.rs b/components/layout/table.rs index ebd2bb65e8a8..ab7c5e9f12e6 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -17,7 +17,6 @@ use flow::{BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ImmutableFlowUt use flow_list::MutFlowListIterator; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; -use gfx_traits::StackingContextId; use gfx_traits::print_tree::PrintTree; use layout_debug; use model::{IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto}; @@ -477,11 +476,8 @@ impl Flow for TableFlow { self.block_flow.build_display_list_for_block(state, border_painting_mode); } - fn collect_stacking_contexts(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { - self.block_flow.collect_stacking_contexts(parent_id, contexts) + fn collect_stacking_contexts(&mut self, parent: &mut StackingContext) { + self.block_flow.collect_stacking_contexts(parent); } fn repair_style(&mut self, new_style: &Arc) { diff --git a/components/layout/table_caption.rs b/components/layout/table_caption.rs index fc28b6c5833f..13e929035827 100644 --- a/components/layout/table_caption.rs +++ b/components/layout/table_caption.rs @@ -14,7 +14,6 @@ use euclid::Point2D; use flow::{Flow, FlowClass, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; -use gfx_traits::StackingContextId; use gfx_traits::print_tree::PrintTree; use std::fmt; use std::sync::Arc; @@ -83,11 +82,8 @@ impl Flow for TableCaptionFlow { self.block_flow.build_display_list(state); } - fn collect_stacking_contexts(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { - self.block_flow.collect_stacking_contexts(parent_id, contexts) + fn collect_stacking_contexts(&mut self, parent: &mut StackingContext) { + self.block_flow.collect_stacking_contexts(parent); } fn repair_style(&mut self, new_style: &Arc) { diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs index 83c5fb522e37..a1f1eab101a8 100644 --- a/components/layout/table_cell.rs +++ b/components/layout/table_cell.rs @@ -15,7 +15,6 @@ use euclid::{Point2D, Rect, SideOffsets2D, Size2D}; use flow::{self, Flow, FlowClass, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; -use gfx_traits::StackingContextId; use gfx_traits::print_tree::PrintTree; use layout_debug; use model::MaybeAuto; @@ -237,11 +236,8 @@ impl Flow for TableCellFlow { self.block_flow.build_display_list_for_block(state, border_painting_mode) } - fn collect_stacking_contexts(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { - self.block_flow.collect_stacking_contexts(parent_id, contexts) + fn collect_stacking_contexts(&mut self, parent: &mut StackingContext) { + self.block_flow.collect_stacking_contexts(parent); } fn repair_style(&mut self, new_style: &Arc) { diff --git a/components/layout/table_colgroup.rs b/components/layout/table_colgroup.rs index fb8f0048c3c4..795f24693b71 100644 --- a/components/layout/table_colgroup.rs +++ b/components/layout/table_colgroup.rs @@ -13,7 +13,6 @@ use euclid::Point2D; use flow::{BaseFlow, Flow, FlowClass, ForceNonfloatedFlag, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow, SpecificFragmentInfo}; use gfx::display_list::StackingContext; -use gfx_traits::StackingContextId; use layout_debug; use std::cmp::max; use std::fmt; @@ -96,12 +95,7 @@ impl Flow for TableColGroupFlow { // Table columns are invisible. fn build_display_list(&mut self, _: &mut DisplayListBuildState) { } - fn collect_stacking_contexts(&mut self, - parent_id: StackingContextId, - _: &mut Vec>) - -> StackingContextId { - parent_id - } + fn collect_stacking_contexts(&mut self, _parent: &mut StackingContext) { } fn repair_style(&mut self, _: &Arc) {} diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs index d40d7b1282e4..9b9a4767122e 100644 --- a/components/layout/table_row.rs +++ b/components/layout/table_row.rs @@ -16,7 +16,6 @@ use flow::{self, EarlyAbsolutePositionInfo, Flow, FlowClass, ImmutableFlowUtils, use flow_list::MutFlowListIterator; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; -use gfx_traits::StackingContextId; use gfx_traits::print_tree::PrintTree; use layout_debug; use model::MaybeAuto; @@ -455,11 +454,8 @@ impl Flow for TableRowFlow { self.block_flow.build_display_list_for_block(state, border_painting_mode); } - fn collect_stacking_contexts(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { - self.block_flow.collect_stacking_contexts(parent_id, contexts) + fn collect_stacking_contexts(&mut self, parent: &mut StackingContext) { + self.block_flow.collect_stacking_contexts(parent); } fn repair_style(&mut self, new_style: &Arc) { diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs index bc48a44838bd..0d5b6363783e 100644 --- a/components/layout/table_rowgroup.rs +++ b/components/layout/table_rowgroup.rs @@ -14,7 +14,6 @@ use euclid::Point2D; use flow::{Flow, FlowClass, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; -use gfx_traits::StackingContextId; use gfx_traits::print_tree::PrintTree; use layout_debug; use rustc_serialize::{Encodable, Encoder}; @@ -212,11 +211,8 @@ impl Flow for TableRowGroupFlow { self.block_flow.build_display_list(state); } - fn collect_stacking_contexts(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { - self.block_flow.collect_stacking_contexts(parent_id, contexts) + fn collect_stacking_contexts(&mut self, parent: &mut StackingContext) { + self.block_flow.collect_stacking_contexts(parent); } fn repair_style(&mut self, new_style: &Arc) { diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs index e07cee030847..f72aa481dd92 100644 --- a/components/layout/table_wrapper.rs +++ b/components/layout/table_wrapper.rs @@ -23,7 +23,6 @@ use floats::FloatKind; use flow::{Flow, FlowClass, ImmutableFlowUtils, INLINE_POSITION_IS_STATIC, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; -use gfx_traits::StackingContextId; use gfx_traits::print_tree::PrintTree; use model::MaybeAuto; use std::cmp::{max, min}; @@ -445,11 +444,8 @@ impl Flow for TableWrapperFlow { self.block_flow.build_display_list(state); } - fn collect_stacking_contexts(&mut self, - parent_id: StackingContextId, - contexts: &mut Vec>) - -> StackingContextId { - self.block_flow.collect_stacking_contexts(parent_id, contexts) + fn collect_stacking_contexts(&mut self, parent: &mut StackingContext) { + self.block_flow.collect_stacking_contexts(parent); } fn repair_style(&mut self, new_style: &Arc) {