22-year-old Firefox tooltip bug fixed in a few lines, offering hope to us all

Back in June 2002, Ubuntu founder Mark Shuttleworth was experiencing space for the first time, the Department of Justice’s antitrust case against Microsoft was reaching its final arguments, and Adam Price, using what was then called Mozilla on a Mac, had an issue with persistent tooltips.

Firefox tooltip lingering over an Applications window in Mac OS X, captured 12 years ago.

Over the years, people would check in on the thread or mark other bugs as duplicates of this one issue. It would occasionally seem fixed, only for coders and commenters to discover that it was just a little different in different versions or that prior fixes were seemingly accidental. Sometimes it seemed to appear in Windows or Linux, too. One commenter, denis, noted that at the 21-year mark: “I’m kinda partial to let it be forever. It feels like a relic from the past.”

That relic is no more, as a fix to Bug 148624 was pushed in early September, with the fix appearing in build 119. I tried to replicate the tooltip on my not-yet-updated 118.0.1 Firefox browser on Mac but could not experience this rite of passage for myself. The patch itself is quite small, adding a check for whether a document has focus to the tooltip-showing code.

Yifan Zhu, who wrote the patch to Firefox’s Tooltip Listener (with notable help from Emilio Cobos Álvarez), appears to be a Stanford University student, based on their likely Github profile. This indicates that the bug they fixed could be older than they are. It’s also notable that Yifan Zhu created their Bugzilla account just two days before submitting the first version of their fix, offering some credence to the power of fresh eyes.

Cobos Álvarez wrote to us that “this area is rather tricky,”with versions of the bug difficult to reproduce in the many desktops and configurations of Firefox. “The underlying issue is that the operating system might not send us a mouseout event consistently (which is what we use otherwise to make the tooltip go away), especially on situations when Firefox gets occluded, minimized, [or] switched to another workspace.”

As such, Firefox hides tooltips when Firefox loses focus; a tooltip might open later, however, at the exact moment between mouse-over and when Firefox is not focused. That’s what Yifan Zhu worked on, Cobos Álvarez wrote. “Pretty impressive for his first Firefox contribution!”He noted, too, that one could technically argue that keeping tooltips from opening on a background window is a regression, “but the trade-off seems worth it, having a ‘stuck’ tooltip is extremely annoying.”

We reached out to Yifan Zhu and will update this post with any information we receive. We also asked Mozilla for comment.

On social media, especially the Mastodon instances where you might expect to find people with opinions on Mozilla’s XML User Interface Language, there was much rejoicing. Some noted their amazement that Bugzilla itself, the bug reporting tool, had lasted even longer than the bug (25 years as of August). Some suggested that this fix countered the prevalence of “stalebots,”which single out old, unresolved issues for deletion. And one drafted a full hero’s journey:

Were that we could all conquer the formative software of our youth.

Not anyone can make a great commit, but a great commit can come from anywhere.

CDN CTB