diff options
author | bors-servo <release+servo@mozilla.com> | 2013-09-17 07:27:50 -0700 |
---|---|---|
committer | bors-servo <release+servo@mozilla.com> | 2013-09-17 07:27:50 -0700 |
commit | 585b047dda3e436a1127b36b867ab5dffb2a685a (patch) | |
tree | ac7088bf95e56824dccc9e6f0861539798fc4263 /src | |
parent | a67fda0f462a9956396ea19d057bb7637047c7b2 (diff) | |
parent | e5615705abf4e4945da94ead0e8f589b6e812148 (diff) | |
download | servo-585b047dda3e436a1127b36b867ab5dffb2a685a.tar.gz servo-585b047dda3e436a1127b36b867ab5dffb2a685a.zip |
auto merge of #903 : ILyoan/servo/margin_collapse_fix, r=metajack
Diffstat (limited to 'src')
-rw-r--r-- | src/components/main/layout/block.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/components/main/layout/block.rs b/src/components/main/layout/block.rs index ccfd546ca27..2795e16880c 100644 --- a/src/components/main/layout/block.rs +++ b/src/components/main/layout/block.rs @@ -7,7 +7,7 @@ use layout::box::{RenderBox}; use layout::context::LayoutContext; use layout::display_list_builder::{DisplayListBuilder, ExtraDisplayListData}; -use layout::flow::{BlockFlow, FlowContext, FlowData, InlineBlockFlow, FloatFlow}; +use layout::flow::{BlockFlow, FlowContext, FlowData, InlineBlockFlow, FloatFlow, InlineFlow}; use layout::inline::InlineLayout; use layout::model::{MaybeAuto, Specified, Auto}; use layout::float_context::{FloatContext, Invalid}; @@ -331,6 +331,7 @@ impl BlockFlowData { margin_bottom = model.margin.bottom; } } + for kid in self.common.child_iter() { match *kid { BlockFlow(ref info) => { @@ -357,10 +358,18 @@ impl BlockFlowData { } first_inflow = false; } + InlineFlow(ref info) => { + collapsing = Au(0); + // Non-empty inline flows prevent collapsing between the previous margion and the next. + if info.common.position.size.height > Au(0) { + collapsible = Au(0); + } + } // Margins between a floated box and any other box do not collapse. _ => { collapsing = Au(0); } + // TODO: Handling for AbsoluteFlow, InlineBlockFlow and TableFlow? } do kid.with_mut_base |child_node| { |