From 986f81afa7e8747151f8448014bcafbd851568b0 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 1 May 2015 15:11:46 -0700 Subject: [PATCH] layout: Use the border box, not the margin box, for placement of block formatting contexts. Improves Amazon. --- components/layout/block.rs | 4 +-- tests/ref/basic.list | 1 + ..._formatting_context_float_placement_a.html | 28 +++++++++++++++++++ ...ormatting_context_float_placement_ref.html | 25 +++++++++++++++++ 4 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 tests/ref/block_formatting_context_float_placement_a.html create mode 100644 tests/ref/block_formatting_context_float_placement_ref.html diff --git a/components/layout/block.rs b/components/layout/block.rs index 34945dc5aea..e61ad3104c8 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -1395,9 +1395,7 @@ impl BlockFlow { } let info = PlacementInfo { - size: LogicalSize::new(self.fragment.style.writing_mode, - self.base.position.size.inline, - self.fragment.border_box.size.block), + size: self.fragment.border_box.size, ceiling: self.base.position.start.b, max_inline_size: MAX_AU, kind: FloatKind::Left, diff --git a/tests/ref/basic.list b/tests/ref/basic.list index 2c012b8e3f0..5409dba1486 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -66,6 +66,7 @@ flaky_cpu == append_style_a.html append_style_b.html == block_formatting_context_cleared_float_a.html block_formatting_context_cleared_float_ref.html == block_formatting_context_complex_a.html block_formatting_context_complex_ref.html == block_formatting_context_containing_floats_a.html block_formatting_context_containing_floats_ref.html +== block_formatting_context_float_placement_a.html block_formatting_context_float_placement_ref.html == block_formatting_context_relative_a.html block_formatting_context_ref.html == block_formatting_context_translation_a.html block_formatting_context_translation_ref.html == block_image.html 500x300_green.html diff --git a/tests/ref/block_formatting_context_float_placement_a.html b/tests/ref/block_formatting_context_float_placement_a.html new file mode 100644 index 00000000000..33cf261ef8d --- /dev/null +++ b/tests/ref/block_formatting_context_float_placement_a.html @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/tests/ref/block_formatting_context_float_placement_ref.html b/tests/ref/block_formatting_context_float_placement_ref.html new file mode 100644 index 00000000000..86e27d5582e --- /dev/null +++ b/tests/ref/block_formatting_context_float_placement_ref.html @@ -0,0 +1,25 @@ + + + + + + + + + +