From 3a56cc7f2f123fed90729f3160702e30352c9d27 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 27 Sep 2016 18:28:03 -0700 Subject: [PATCH] layout: When searching for the baseline offset of the last in-flow line and an inline flow has no applicable lines, continue checking previous sibling flows. Improves Twitter by placing the favorite icon in the right place. --- components/layout/flow.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 36b8da6cc48..af6448547d7 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -1402,7 +1402,9 @@ impl<'a> ImmutableFlowUtils for &'a Flow { fn baseline_offset_of_last_line_box_in_flow(self) -> Option { for kid in base(self).children.iter().rev() { if kid.is_inline_flow() { - return kid.as_inline().baseline_offset_of_last_line() + if let Some(baseline_offset) = kid.as_inline().baseline_offset_of_last_line() { + return Some(baseline_offset) + } } if kid.is_block_like() && kid.as_block().formatting_context_type() == FormattingContextType::None &&