File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
float-pigment-forest/tests/custom
float-pigment-layout/src/algo Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,19 @@ fn margin_collapse_1() {
81
81
)
82
82
}
83
83
84
+ #[ test]
85
+ fn margin_collapse_empty_inline_nodes ( ) {
86
+ assert_xml ! (
87
+ r#"
88
+ <div style="height: 800px;">
89
+ <div style="height: 100px; margin-bottom: 50px;"></div>
90
+ <div style="display: inline; height: 0;"></div>
91
+ <div style="margin-top: 40px;" expect_top="150"></div>
92
+ </div>
93
+ "#
94
+ )
95
+ }
96
+
84
97
#[ test]
85
98
fn margin_collapse_negative ( ) {
86
99
assert_xml ! (
Original file line number Diff line number Diff line change @@ -69,10 +69,12 @@ pub(crate) fn is_empty_block<L: LengthNum>(
69
69
padding_border_main_axis : L ,
70
70
min_main_size : L ,
71
71
node_inner_main_size : L ,
72
+ main_size : OptionNum < L > ,
72
73
) -> bool {
73
74
if !padding_border_main_axis. is_zero ( )
74
75
|| !min_main_size. is_zero ( )
75
76
|| !node_inner_main_size. is_zero ( )
77
+ || ( main_size. is_some ( ) && !main_size. val ( ) . unwrap ( ) . is_zero ( ) )
76
78
{
77
79
return false ;
78
80
}
@@ -800,6 +802,7 @@ impl<T: LayoutTreeNode> Flow<T> for LayoutUnit<T> {
800
802
padding_border. main_axis_sum ( axis_info. dir ) ,
801
803
min_max_limit. min_main_size ( axis_info. dir ) ,
802
804
total_main_size,
805
+ request. size . main_size ( axis_info. dir ) ,
803
806
) {
804
807
collapsed_margin. collapsed_through = true ;
805
808
}
You can’t perform that action at this time.
0 commit comments