diff --git a/components/layout/block.rs b/components/layout/block.rs index d3211d89c79..f803580bfb0 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -1646,8 +1646,12 @@ impl Flow for BlockFlow { fn assign_block_size<'a>(&mut self, ctx: &'a LayoutContext<'a>) { if self.is_replaced_content() { + let _scope = layout_debug_scope!("assign_replaced_block_size_if_necessary {:s}", + self.base.debug_id()); + // Assign block-size for fragment if it is an image fragment. self.fragment.assign_replaced_block_size_if_necessary(); + self.base.position.size.block = self.fragment.border_box.size.block; } else if self.is_float() { debug!("assign_block_size_float: assigning block_size for float"); self.assign_block_size_float(ctx); diff --git a/tests/ref/basic.list b/tests/ref/basic.list index 9ce245a914d..7f5a9ee7fa6 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -133,3 +133,4 @@ flaky_gpu,flaky_linux == acid2_noscroll.html acid2_ref_broken.html == percent_height.html percent_height_ref.html == inline_block_with_margin_a.html inline_block_with_margin_ref.html == table_padding_a.html table_padding_ref.html +== img_block_display_a.html img_block_display_ref.html diff --git a/tests/ref/img_block_display_a.html b/tests/ref/img_block_display_a.html new file mode 100644 index 00000000000..be879b37b4c --- /dev/null +++ b/tests/ref/img_block_display_a.html @@ -0,0 +1,25 @@ + + +
+ + + +