From 09a4ba8d7560bdffee43b14c538261bb97b20cd6 Mon Sep 17 00:00:00 2001 From: Joel Feenstra Date: Thu, 20 Jun 2013 21:58:26 -0400 Subject: [PATCH] Fix computing line height for generic boxes and images. --- src/components/main/layout/inline.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/main/layout/inline.rs b/src/components/main/layout/inline.rs index 80ff4b62108..1e14c36dec9 100644 --- a/src/components/main/layout/inline.rs +++ b/src/components/main/layout/inline.rs @@ -786,6 +786,10 @@ impl InlineFlowData { let height = Au::from_px(size.get_or_default(Size2D(0, 0)).height); image_box.base.position.size.height = height; + if height > linebox_height { + linebox_height = height; + } + image_box.base.position.translate(&Point2D(Au(0), -height)) } TextRenderBoxClass(text_box) => { @@ -822,6 +826,9 @@ impl InlineFlowData { // and other replaced content. // FIXME(pcwalton): This seems clownshoes; can we remove? generic_box.position.size.height = Au::from_px(30); + if generic_box.position.size.height > linebox_height { + linebox_height = generic_box.position.size.height; + } generic_box.position } // FIXME(pcwalton): This isn't very type safe!