Closed Bug 1621239 Opened 6 years ago Closed 6 years ago

Decimals in HTMLTooltip#calculate(Vertical|Horizontal)Position can lead to autocomplete popup "jumps"

Categories

(DevTools :: Shared Components, defect, P1)

defect

Tracking

(firefox76 fixed)

RESOLVED FIXED
Firefox 76
Tracking Status
firefox76 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

Details

Attachments

(1 file)

When typing in the console document, I sometimes see the autocomplete popup move 1px to the left/right as I type a letter.

I figured this is because the calculateHorizontalPosition would return a decimal for the left property, and in some case we'd get 152.99999923706054 (which when applied in the CSS would fall back to 152px), and sometimes 153, which explains the "jump".

Rounding values we get from those functions fix this issue.

There are currently cases where the HTMLTooltip would "jump"
when its content is updated whereas it shouldn't, as when
applying those result to CSS, decimals aren't taken into
account (so a "left" of 152.9999 would translate into a
CSS "left" property of 152px).
Rounding those values seems to fix the issue.

Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/217cb21a0d90 Round values returned by calculate(Horizontal|Vertical)Position in HTMLTooltip. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 76
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: