aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/fragment.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/fragment.rs')
-rw-r--r--components/layout/fragment.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index 520e4c5ab66..f2da09b734c 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -1971,6 +1971,11 @@ impl Fragment {
}
}
SpecificFragmentInfo::ScannedText(ref text_fragment) => {
+ // Fragments with no glyphs don't contribute any inline metrics.
+ // TODO: Filter out these fragments during flow construction?
+ if text_fragment.content_size.inline == Au(0) {
+ return InlineMetrics::new(Au(0), Au(0), Au(0));
+ }
// See CSS 2.1 § 10.8.1.
let line_height = self.calculate_line_height(layout_context);
let font_derived_metrics =