aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/inline.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/inline.rs')
-rw-r--r--components/layout/inline.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/components/layout/inline.rs b/components/layout/inline.rs
index 700ffa56602..b9901a3f13b 100644
--- a/components/layout/inline.rs
+++ b/components/layout/inline.rs
@@ -943,7 +943,14 @@ impl InlineFlow {
/// `style` is the style of the block.
pub fn compute_minimum_ascent_and_descent(&self,
font_context: &mut FontContext,
- style: &ComputedValues) -> (Au, Au) {
+ style: &ComputedValues)
+ -> (Au, Au) {
+ // As a special case, if this flow contains only hypothetical fragments, then the entire
+ // flow is hypothetical and takes up no space. See CSS 2.1 § 10.3.7.
+ if self.fragments.fragments.iter().all(|fragment| fragment.is_hypothetical()) {
+ return (Au(0), Au(0))
+ }
+
let font_style = text::computed_style_to_font_style(style);
let font_metrics = text::font_metrics_for_style(font_context, &font_style);
let line_height = text::line_height_from_style(style, &font_metrics);