Closed Bug 1486409 Opened Last year Closed Last year
Font editor: guard against zero as value for font properties
The CSS `font-size` value may be zero and that causes unexpected results when using it for unit conversion or line-height computation. Steps: - go to https://news.google.com/ - inspect a headline, select its parent `<article>` element - observe the font editor in the Fonts panel Expected: Size should be shown as 0px (same as from Computed panel). Line height should show 0. Result: Size field is not populated. Line height is shown as NaN because of the division by zero. A few other cases are impacted by `font-size: 0`, such as converting between relative units which use the font-size value, for example converting from 'px' to 'em'.
Comment on attachment 9004189 [details] Bug 1486409 - Guard against a font property value of zero. Catch NaN and Infinity in unit conversion. r=gl Gabriel [:gl] (ΦωΦ) has approved the revision.
Attachment #9004189 - Flags: review+
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/f10df314fc4d Guard against a font property value of zero. Catch NaN and Infinity in unit conversion. r=gl
I successfully reproduced the issue on Firefox Nightly 63.0a1 (2018-08-27) under Windows 10 (x64) using the STR from Comment 0. The issue is no longer reproducible on Firefox Beta 63.0b13 and latest Firefox 64.0a1 (2018-10-09). Tests were performed on Windows 10 (x64), macOS 10.13 and Ubuntu 16.04 (x64).
You need to log in before you can comment on or make changes to this bug.