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.
This commit is contained in:
Patrick Walton 2016-09-27 18:28:03 -07:00
parent 22ba0e16e0
commit 3a56cc7f2f

View file

@ -1402,7 +1402,9 @@ impl<'a> ImmutableFlowUtils for &'a Flow {
fn baseline_offset_of_last_line_box_in_flow(self) -> Option<Au> {
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 &&