diff options
author | bors-servo <release+servo@mozilla.com> | 2014-04-04 23:04:37 -0400 |
---|---|---|
committer | bors-servo <release+servo@mozilla.com> | 2014-04-04 23:04:37 -0400 |
commit | 0f0b0b33bf7375d834138a3bd3af9ba1921d390d (patch) | |
tree | 0ce43374882b1260e85d27cedfb41b3f10678250 /src | |
parent | e3cc46a7825ef60a36a25f2ff2f18c1f02ed8b50 (diff) | |
parent | 3a829d084df8320a342ff596554a77dc5b89f4cd (diff) | |
download | servo-0f0b0b33bf7375d834138a3bd3af9ba1921d390d.tar.gz servo-0f0b0b33bf7375d834138a3bd3af9ba1921d390d.zip |
auto merge of #2038 : SimonSapin/servo/min-height-collapse, r=pcwalton
[Relevant spec](http://dev.w3.org/csswg/css2/box.html#collapsing-margins):
> top and bottom margins of a box that does not establish a new block formatting context and that has zero computed 'min-height', zero or 'auto' computed 'height', and no in-flow children
Diffstat (limited to 'src')
-rw-r--r-- | src/components/main/layout/model.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/components/main/layout/model.rs b/src/components/main/layout/model.rs index 378c43d1bb6..098e238a252 100644 --- a/src/components/main/layout/model.rs +++ b/src/components/main/layout/model.rs @@ -7,7 +7,7 @@ use layout::box_::Box; use computed = style::computed_values; -use style::computed_values::{LPA_Auto, LPA_Length, LPA_Percentage}; +use style::computed_values::{LPA_Auto, LPA_Length, LPA_Percentage, LP_Length, LP_Percentage}; use servo_util::geometry::Au; use servo_util::geometry; @@ -112,7 +112,16 @@ impl MarginCollapseInfo { AccumulatingCollapsibleTopMargin => { match fragment.style().Box.get().height { LPA_Auto | LPA_Length(Au(0)) | LPA_Percentage(0.) => { - MarginsCollapseThroughFinalMarginState + match fragment.style().Box.get().min_height { + LP_Length(Au(0)) | LP_Percentage(0.) => { + MarginsCollapseThroughFinalMarginState + }, + _ => { + // If the box has non-zero min-height, margins may not collapse + // through it. + BottomMarginCollapsesFinalMarginState + } + } }, _ => { // If the box has an explicitly specified height, margins may not collapse |