File tree Expand file tree Collapse file tree 3 files changed +69
-3
lines changed
components/layout_2020/flow
tests/css/CSS2/floats-clear Expand file tree Collapse file tree 3 files changed +69
-3
lines changed Original file line number Diff line number Diff line change @@ -733,10 +733,13 @@ fn layout_in_flow_replaced_block_level<'a>(
733
733
734
734
let mut clearance = Length :: zero ( ) ;
735
735
if let Some ( ref mut sequential_layout_state) = sequential_layout_state {
736
+ sequential_layout_state. adjoin_assign ( & CollapsedMargin :: new ( margin. block_start ) ) ;
736
737
sequential_layout_state. collapse_margins ( ) ;
737
738
clearance = sequential_layout_state. calculate_clearance ( ClearSide :: from_style ( style) ) ;
738
- sequential_layout_state
739
- . advance_block_position ( pbm. border . block_sum ( ) + pbm. padding . block_sum ( ) + size. block ) ;
739
+ sequential_layout_state. advance_block_position (
740
+ pbm. border . block_sum ( ) + pbm. padding . block_sum ( ) + size. block + clearance,
741
+ ) ;
742
+ sequential_layout_state. adjoin_assign ( & CollapsedMargin :: new ( margin. block_end ) ) ;
740
743
} ;
741
744
742
745
let content_rect = Rect {
@@ -756,7 +759,7 @@ fn layout_in_flow_replaced_block_level<'a>(
756
759
pbm. padding ,
757
760
pbm. border ,
758
761
margin,
759
- Length :: zero ( ) ,
762
+ clearance ,
760
763
block_margins_collapsed_with_children,
761
764
)
762
765
}
Original file line number Diff line number Diff line change 61742
61742
{}
61743
61743
]
61744
61744
],
61745
+ "clear-on-replaced-element.html": [
61746
+ "e5566b38326da17455d54c3d06d498f72bc4c693",
61747
+ [
61748
+ null,
61749
+ [
61750
+ [
61751
+ "/css/CSS2/reference/ref-filled-green-100px-square.xht",
61752
+ "=="
61753
+ ]
61754
+ ],
61755
+ {
61756
+ "fuzzy": [
61757
+ [
61758
+ null,
61759
+ [
61760
+ [
61761
+ 0,
61762
+ 2
61763
+ ],
61764
+ [
61765
+ 0,
61766
+ 1500
61767
+ ]
61768
+ ]
61769
+ ]
61770
+ ]
61771
+ }
61772
+ ]
61773
+ ],
61745
61774
"clear-with-top-margin-after-cleared-empty-block.html": [
61746
61775
"5d0fba7981f3f688b22442c1e8bef2ff8b146f5e",
61747
61776
[
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < title > Clear on block-level replaced element</ title >
3
+ < link rel ="
author "
title ="
Oriol Brufau "
href ="
[email protected] "
>
4
+ < link rel ="help " href ="https://www.w3.org/TR/CSS22/visuren.html#flow-control " title ="9.5.2 Controlling flow next to floats: the 'clear' property ">
5
+ < link rel ="help " href ="https://www.w3.org/TR/CSS22/conform.html#replaced-element ">
6
+ < link rel ="match " href ="../reference/ref-filled-green-100px-square.xht ">
7
+ < meta name ="fuzzy " content ="maxDifference=0-2;totalPixels=0-1500 ">
8
+ < style >
9
+ # wrapper {
10
+ width : 90px ;
11
+ border : 5px solid green;
12
+ background-image : linear-gradient (
13
+ to bottom,
14
+ red 30px , green 30px ,
15
+ green 50px , red 50px ,
16
+ red 60px , green 60px ,
17
+ green 70px , red 70px ,
18
+ red 80px , green 80px
19
+ )
20
+ }
21
+ # wrapper > * {
22
+ display : block;
23
+ width : 100% ;
24
+ background : green content-box;
25
+ }
26
+ </ style >
27
+
28
+ < p > Test passes if there is a filled green square and < strong > no red</ strong > .</ p >
29
+ < div id ="wrapper ">
30
+ < div style ="float: left; height: 20px "> </ div >
31
+ < canvas style ="clear: both; height: 10px; margin: 10px 0 "> </ canvas >
32
+ < canvas style ="float: left; height: 10px; margin: 10px 0 "> </ canvas >
33
+ < div style ="clear: both; height: 10px; padding-bottom: 10px "> </ div >
34
+ </ div >
You can’t perform that action at this time.
0 commit comments