diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index b6c5e00a4e8..924f3eaf80f 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -2175,6 +2175,19 @@ impl Fragment { overflow = overflow.union(&border_box.inflate(outline_width, outline_width)) } + // Include the overflow of the block flow, if any. + match self.specific { + SpecificFragmentInfo::InlineBlock(ref info) => { + let block_flow = info.flow_ref.as_block(); + overflow = overflow.union(&block_flow.compute_overflow()); + } + SpecificFragmentInfo::InlineAbsolute(ref info) => { + let block_flow = info.flow_ref.as_block(); + overflow = overflow.union(&block_flow.compute_overflow()); + } + _ => (), + } + // FIXME(pcwalton): Sometimes excessively fancy glyphs can make us draw outside our border // box too. overflow diff --git a/tests/ref/basic.list b/tests/ref/basic.list index b25d3e9efa8..2c59c96f43f 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -267,6 +267,7 @@ flaky_cpu == linebreak_simple_a.html linebreak_simple_b.html != overconstrained_block.html overconstrained_block_ref.html == overflow_auto.html overflow_simple_b.html == overflow_auto_stacking_order_a.html overflow_auto_stacking_order_ref.html +== overflow_position_abs_inline_block.html overflow_position_abs_inline_block_ref.html # Should be ==? != overflow_position_abs_inside_normal_a.html overflow_position_abs_inside_normal_b.html == overflow_position_abs_simple_a.html overflow_position_abs_simple_b.html diff --git a/tests/ref/overflow_position_abs_inline_block.html b/tests/ref/overflow_position_abs_inline_block.html new file mode 100644 index 00000000000..1769d59e59b --- /dev/null +++ b/tests/ref/overflow_position_abs_inline_block.html @@ -0,0 +1,23 @@ + + +
+
+
+
+ diff --git a/tests/ref/overflow_position_abs_inline_block_ref.html b/tests/ref/overflow_position_abs_inline_block_ref.html new file mode 100644 index 00000000000..f1ef2d9a577 --- /dev/null +++ b/tests/ref/overflow_position_abs_inline_block_ref.html @@ -0,0 +1,23 @@ + + +
+
+
+
+