layout: Include padding in the content block-size when computing the

block-size value when `height: auto` is specified for
absolutely-positioned elements.

Improves "Edit links" on the Wikipedia sidebar.
This commit is contained in:
Patrick Walton 2015-04-10 14:38:46 -07:00
parent a8b0fb1e79
commit 2f3b3eb4c4
4 changed files with 43 additions and 1 deletions

View file

@ -1112,7 +1112,7 @@ impl BlockFlow {
let static_b_offset = self.static_b_offset;
// This is the stored content block-size value from assign-block-size
let content_block_size = self.fragment.content_box().size.block;
let content_block_size = self.fragment.border_box.size.block;
let mut solution = None;
{

View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<style>
section {
position: absolute;
background: peachpuff;
top: 0;
left: 0;
padding: 3em 0 0;
width: 10em;
height: auto;
}
</style>
</head>
<body>
<section>XXXXX</section>
</body>
</html>

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
margin: 0;
padding: 0;
}
section {
background: peachpuff;
padding: 3em 0 0;
width: 10em;
height: auto;
}
</style>
</head>
<body>
<section>XXXXX</section>
</body>
</html>

View file

@ -39,6 +39,7 @@ fragment=top != ../html/acid2.html acid2_ref.html
== 2dcontext/transform_a.html 2dcontext/transform_ref.html
== abs_float_pref_width_a.html abs_float_pref_width_ref.html
== absolute_content_height_a.html absolute_content_height_ref.html
== acid1_a.html acid1_b.html
== acid2_noscroll.html acid2_ref_broken.html
== after_block_iteration.html after_block_iteration_ref.html