mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Merge pull request #2859 from glennw/wiki-layout-1
Partial fix for footer layout issues on wikipedia, ref #2554.
This commit is contained in:
commit
bfde6ac0a7
4 changed files with 53 additions and 4 deletions
|
@ -1050,9 +1050,6 @@ impl BlockFlow {
|
|||
floats = flow::mut_base(kid).floats.clone();
|
||||
}
|
||||
|
||||
// Floats establish a block formatting context, so we discard the output floats here.
|
||||
drop(floats);
|
||||
|
||||
let top_offset = self.fragment.margin.top + self.fragment.border_padding.top;
|
||||
let mut cur_y = top_offset;
|
||||
|
||||
|
@ -1065,7 +1062,12 @@ impl BlockFlow {
|
|||
cur_y = cur_y + child_base.position.size.height;
|
||||
}
|
||||
|
||||
let content_height = cur_y - top_offset;
|
||||
// Intrinsic height should include floating descendants with a margin
|
||||
// below the element's bottom edge (see CSS Section 10.6.7).
|
||||
let content_height = geometry::max(cur_y - top_offset, floats.clearance(ClearBoth));
|
||||
|
||||
// Floats establish a block formatting context, so we discard the output floats here.
|
||||
drop(floats);
|
||||
|
||||
// The associated fragment has the border box of this flow.
|
||||
self.fragment.border_box.origin.y = self.fragment.margin.top;
|
||||
|
|
|
@ -83,3 +83,4 @@
|
|||
== position_fixed_overflow_a.html position_fixed_overflow_b.html
|
||||
== noscript.html noscript_ref.html
|
||||
== pseudo_inherit.html pseudo_inherit_ref.html
|
||||
== float_intrinsic_height.html float_intrinsic_height_ref.html
|
||||
|
|
24
src/test/ref/float_intrinsic_height.html
Normal file
24
src/test/ref/float_intrinsic_height.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
.otherprojects {
|
||||
background-color: red;
|
||||
float: left;
|
||||
width: 200px;
|
||||
}
|
||||
.otherprojects-item {
|
||||
background-color: yellow;
|
||||
float: left;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="otherprojects">
|
||||
<div class="otherprojects-item">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
22
src/test/ref/float_intrinsic_height_ref.html
Normal file
22
src/test/ref/float_intrinsic_height_ref.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
.otherprojects {
|
||||
background-color: red;
|
||||
width: 200px;
|
||||
}
|
||||
.otherprojects-item {
|
||||
background-color: yellow;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="otherprojects">
|
||||
<div class="otherprojects-item">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue