diff options
author | Michael Howell <michael@notriddle.com> | 2015-09-09 12:22:56 -0700 |
---|---|---|
committer | Michael Howell <michael@notriddle.com> | 2015-09-09 12:24:28 -0700 |
commit | 029af815707333266e7192241b74bef0e129cf27 (patch) | |
tree | 87a6fd2352e611ed79bd2df1e7c7ead6bee89fb0 /components/layout/inline.rs | |
parent | 0d37e8f96b7f40d14bf4fbb0b66e42a01302a336 (diff) | |
download | servo-029af815707333266e7192241b74bef0e129cf27.tar.gz servo-029af815707333266e7192241b74bef0e129cf27.zip |
Actually store the overflow for inline-block elements.
Fixes #7571
Diffstat (limited to 'components/layout/inline.rs')
-rw-r--r-- | components/layout/inline.rs | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 5b137ceade2..00043037f9d 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -8,7 +8,7 @@ use block::{AbsoluteAssignBSizesTraversal, AbsoluteStoreOverflowTraversal}; use context::LayoutContext; use display_list_builder::{FragmentDisplayListBuilding, InlineFlowDisplayListBuilding}; use floats::{FloatKind, Floats, PlacementInfo}; -use flow::{MutableFlowUtils, OpaqueFlow}; +use flow::{MutableFlowUtils, EarlyAbsolutePositionInfo, OpaqueFlow}; use flow::{self, BaseFlow, FlowClass, Flow, ForceNonfloatedFlag, IS_ABSOLUTELY_POSITIONED}; use flow_ref; use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo}; @@ -1616,6 +1616,31 @@ impl Flow for InlineFlow { Au(0), -self.base.position.size.block)); + let containing_block_size = LogicalSize::new(writing_mode, + Au(0), + self.base.position.size.block); + self.mutate_fragments(&mut |f: &mut Fragment| { + match f.specific { + SpecificFragmentInfo::InlineBlock(ref mut info) => { + let block = flow_ref::deref_mut(&mut info.flow_ref); + flow::mut_base(block).early_absolute_position_info = EarlyAbsolutePositionInfo { + relative_containing_block_size: containing_block_size, + relative_containing_block_mode: writing_mode, + }; + (block.as_mut_block() as &mut Flow).late_store_overflow(layout_context); + } + SpecificFragmentInfo::InlineAbsolute(ref mut info) => { + let block = flow_ref::deref_mut(&mut info.flow_ref); + flow::mut_base(block).early_absolute_position_info = EarlyAbsolutePositionInfo { + relative_containing_block_size: containing_block_size, + relative_containing_block_mode: writing_mode, + }; + (block.as_mut_block() as &mut Flow).late_store_overflow(layout_context); + } + _ => (), + } + }); + self.base.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW); } @@ -1817,7 +1842,11 @@ impl Flow for InlineFlow { impl fmt::Debug for InlineFlow { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:?} - {:x} - {:?}", self.class(), self.base.debug_id(), self.fragments) + write!(f, "{:?} - {:x} - Ovr {:?} - {:?}", + self.class(), + self.base.debug_id(), + flow::base(self).overflow, + self.fragments) } } |