diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-04-08 03:57:36 -0500 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-04-08 03:57:36 -0500 |
commit | f4da0f0e94259e12adeb193fd9ecf6813457b883 (patch) | |
tree | ac1495a6909123ae0f6165dfe7f6d7e5a4b2978a /components | |
parent | 83d9ab3ba5c6a725632a954cf2b9f65832f89832 (diff) | |
parent | df9c0c7a26a773724b377a2d71112063a0905e22 (diff) | |
download | servo-f4da0f0e94259e12adeb193fd9ecf6813457b883.tar.gz servo-f4da0f0e94259e12adeb193fd9ecf6813457b883.zip |
Auto merge of #5584 - pcwalton:fix-a-float-redux, r=glennw
As far as I can tell, this is a cut-and-paste of old buggy code from
block flows. Delegating to the correct block flow code fixes the sidebar
float placement on Guardians of the Galaxy.
r? @glennw
Diffstat (limited to 'components')
-rw-r--r-- | components/layout/block.rs | 10 | ||||
-rw-r--r-- | components/layout/table_wrapper.rs | 19 |
2 files changed, 13 insertions, 16 deletions
diff --git a/components/layout/block.rs b/components/layout/block.rs index 24eac4f48ea..4b187082db7 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -1417,6 +1417,8 @@ impl BlockFlow { match style.get_box().display { display::T::table_cell | display::T::table_caption | + display::T::table_row_group | + display::T::table | display::T::inline_block => { FormattingContextType::Other } @@ -1693,7 +1695,7 @@ impl Flow for BlockFlow { fn assign_block_size<'a>(&mut self, ctx: &'a LayoutContext<'a>) { if self.is_replaced_content() { let _scope = layout_debug_scope!("assign_replaced_block_size_if_necessary {:x}", - self.base.debug_id()); + self.base.debug_id()); // Assign block-size for fragment if it is an image fragment. let containing_block_block_size = @@ -1704,10 +1706,12 @@ impl Flow for BlockFlow { } } else if self.is_root() || self.base.flags.is_float() || self.is_inline_block() { // Root element margins should never be collapsed according to CSS § 8.3.1. - debug!("assign_block_size: assigning block_size for root flow {:?}", flow::base(self).debug_id()); + debug!("assign_block_size: assigning block_size for root flow {:?}", + flow::base(self).debug_id()); self.assign_block_size_block_base(ctx, MarginsMayCollapseFlag::MarginsMayNotCollapse); } else { - debug!("assign_block_size: assigning block_size for block {:?}", flow::base(self).debug_id()); + debug!("assign_block_size: assigning block_size for block {:?}", + flow::base(self).debug_id()); self.assign_block_size_block_base(ctx, MarginsMayCollapseFlag::MarginsMayCollapse); } } diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs index a291224944e..f96e5efcd3c 100644 --- a/components/layout/table_wrapper.rs +++ b/components/layout/table_wrapper.rs @@ -336,9 +336,11 @@ impl Flow for TableWrapperFlow { } - fn assign_block_size<'a>(&mut self, ctx: &'a LayoutContext<'a>) { + fn assign_block_size<'a>(&mut self, layout_context: &'a LayoutContext<'a>) { debug!("assign_block_size: assigning block_size for table_wrapper"); - self.block_flow.assign_block_size_block_base(ctx, MarginsMayCollapseFlag::MarginsMayNotCollapse); + self.block_flow + .assign_block_size_block_base(layout_context, + MarginsMayCollapseFlag::MarginsMayNotCollapse); } fn compute_absolute_position(&mut self) { @@ -353,17 +355,8 @@ impl Flow for TableWrapperFlow { layout_context: &'a LayoutContext<'a>, parent_thread_id: u8) -> bool { - if self.block_flow.base.flags.is_float() { - self.block_flow.place_float(); - return true - } - - let impacted = self.block_flow.base.flags.impacted_by_floats(); - if impacted { - self.block_flow.base.thread_id = parent_thread_id; - self.assign_block_size(layout_context); - } - impacted + self.block_flow.assign_block_size_for_inorder_child_if_necessary(layout_context, + parent_thread_id) } fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) { |