Closed Bug 1486409 Opened 6 years ago Closed 6 years ago

Font editor: guard against zero as value for font properties

Categories

(DevTools :: Inspector, defect, P2)

defect

Tracking

(firefox63 verified, firefox64 verified)

VERIFIED FIXED
Firefox 63
Tracking Status
firefox63 --- verified
firefox64 --- verified

People

(Reporter: rcaliman, Assigned: rcaliman)

References

Details

Attachments

(2 files)

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'.
Attached image font-size: 0
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 rcaliman@mozilla.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
https://hg.mozilla.org/mozilla-central/rev/f10df314fc4d
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Flags: qe-verify+
QA Contact: catalin.sasca
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).
Status: RESOLVED → VERIFIED
Flags: qe-verify+
Component: Inspector: Fonts → Inspector
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: