Bug 1682607 - Normalize NaN in some other font-related lengths etc. r=jfkthame,layout-reviewers

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 fd47e3b3f3
commit 1691b8a61c
3 changed files with 22 additions and 2 deletions

View File

@ -925,7 +925,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.

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<style>
CITE::first-letter {
font-size: 0%;
margin-inline-start: 2682182284.200815ch
}
* {
font-size: 4294967295% !important;
}
</style>
</head>
<del>
<button>
<cite></cite>
</button>
</del>
</html>