mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
'min-height' can prevent margin collapsing through an element, like 'height'
This commit is contained in:
parent
7ece5f92db
commit
3a829d084d
1 changed files with 11 additions and 2 deletions
|
@ -7,7 +7,7 @@
|
||||||
use layout::box_::Box;
|
use layout::box_::Box;
|
||||||
|
|
||||||
use computed = style::computed_values;
|
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::Au;
|
||||||
use servo_util::geometry;
|
use servo_util::geometry;
|
||||||
|
|
||||||
|
@ -112,7 +112,16 @@ impl MarginCollapseInfo {
|
||||||
AccumulatingCollapsibleTopMargin => {
|
AccumulatingCollapsibleTopMargin => {
|
||||||
match fragment.style().Box.get().height {
|
match fragment.style().Box.get().height {
|
||||||
LPA_Auto | LPA_Length(Au(0)) | LPA_Percentage(0.) => {
|
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
|
// If the box has an explicitly specified height, margins may not collapse
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue