style: Normalize NaN in some other font-related lengths etc.

Depends on D104563

Differential Revision: https://phabricator.services.mozilla.com/D104565
This commit is contained in:
Emilio Cobos Álvarez 2021-02-10 15:30:40 +00:00
parent db03b2cf8e
commit 3a64fa2006
2 changed files with 2 additions and 2 deletions

View file

@ -933,7 +933,7 @@ impl FontSize {
// If the parent font was keyword-derived, this is too.
// Tack the % onto the factor
info = compose_keyword(pc.0);
base_size.resolve(context) * pc.0
(base_size.resolve(context) * pc.0).normalized()
},
FontSize::Length(LengthPercentage::Calc(ref calc)) => {
let calc = calc.to_computed_value_zoomed(context, base_size);

View file

@ -135,7 +135,7 @@ impl FontRelativeLength {
base_size: FontBaseSize,
) -> computed::Length {
let (reference_size, length) = self.reference_font_size_and_length(context, base_size);
reference_size * length
(reference_size * length).normalized()
}
/// Return reference font size.