diff options
author | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2018-01-17 14:01:45 +0100 |
---|---|---|
committer | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2018-01-22 11:38:39 +0100 |
commit | a241bed53c5686302a699060c6aa2e4b4a39ba38 (patch) | |
tree | a9fb289fe47fd0805fffcb30bf5eecd43eedb1d0 /components/layout/inline.rs | |
parent | 671b69c0b77f9a4bd0c098cb2a2f73c95dacb954 (diff) | |
download | servo-a241bed53c5686302a699060c6aa2e4b4a39ba38.tar.gz servo-a241bed53c5686302a699060c6aa2e4b4a39ba38.zip |
Do not leave space below baseline when it is not needed (i.e.there is no text)
Diffstat (limited to 'components/layout/inline.rs')
-rw-r--r-- | components/layout/inline.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 934e4aa1fc8..a934b95bafe 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -1143,7 +1143,11 @@ impl InlineFlow { let font_style = style.clone_font(); let font_metrics = text::font_metrics_for_style(font_context, font_style); let line_height = text::line_height_from_style(style, &font_metrics); - let inline_metrics = InlineMetrics::from_font_metrics(&font_metrics, line_height); + let inline_metrics = if fragments.iter().any(Fragment::is_text_or_replaced) { + InlineMetrics::from_font_metrics(&font_metrics, line_height) + } else { + InlineMetrics::new(Au(0), Au(0), Au(0)) + }; let mut line_metrics = LineMetrics::new(Au(0), MIN_AU); let mut largest_block_size_for_top_fragments = Au(0); |