From 2f3b3eb4c4fb1f2858efeab3e5367cd2f69b9a9d Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 10 Apr 2015 14:38:46 -0700 Subject: [PATCH] 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. --- components/layout/block.rs | 2 +- tests/ref/absolute_content_height_a.html | 20 ++++++++++++++++++++ tests/ref/absolute_content_height_ref.html | 21 +++++++++++++++++++++ tests/ref/basic.list | 1 + 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 tests/ref/absolute_content_height_a.html create mode 100644 tests/ref/absolute_content_height_ref.html diff --git a/components/layout/block.rs b/components/layout/block.rs index 580a81c2a4f..704d592e06d 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -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; { diff --git a/tests/ref/absolute_content_height_a.html b/tests/ref/absolute_content_height_a.html new file mode 100644 index 00000000000..8f12b89aef8 --- /dev/null +++ b/tests/ref/absolute_content_height_a.html @@ -0,0 +1,20 @@ + + + + + + +
XXXXX
+ + + diff --git a/tests/ref/absolute_content_height_ref.html b/tests/ref/absolute_content_height_ref.html new file mode 100644 index 00000000000..bb239ed179f --- /dev/null +++ b/tests/ref/absolute_content_height_ref.html @@ -0,0 +1,21 @@ + + + + + + +
XXXXX
+ + + diff --git a/tests/ref/basic.list b/tests/ref/basic.list index 31186763f0d..30af1f25250 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -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