From afbd0476955d64201ab1aed0e25f4162ea3e0441 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 28 Jul 2016 16:02:05 -0700 Subject: [PATCH] Use explicit height of inline-block fragments Fixes #12492 --- components/layout/fragment.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 48499d7e36e..0fb5c6579c1 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -2005,9 +2005,10 @@ impl Fragment { // See CSS 2.1 ยง 10.8.1. let flow = &info.flow_ref; let block_flow = flow.as_block(); + let is_auto = self.style.get_position().height == LengthOrPercentageOrAuto::Auto; let baseline_offset = match flow.baseline_offset_of_last_line_box_in_flow() { - Some(baseline_offset) => baseline_offset, - None => block_flow.fragment.border_box.size.block, + Some(baseline_offset) if is_auto => baseline_offset, + _ => block_flow.fragment.border_box.size.block, }; let start_margin = block_flow.fragment.margin.block_start; let end_margin = block_flow.fragment.margin.block_end;