How a 23-year-old first-time Firefox coder fixed a 22-year-old bug

How a 23-year-old first-time Firefox coder fixed a 22-year-old bug

Talk about focus —

Tiny text boxes, lingering on screens like ghosts, exorcised after 2 decades.


Red fox eyes up a flying bug

Enlarge / Some bugs are just perennially out of reach. (We are aware this is not a red panda, but we lack for images illustrating such a creature being lightly annoyed by a particular kind of insect).

Getty Images

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.

“If I mouseover a toolbar link, and wait for a second, a little yellow box with the description of the link appears. If I now use command-tab to move Mozilla to the background, the little yellow box stays there, in the foreground. The only way to get rid of it is to put mozilla in the foreground again, and move the mouse off the toolbar,” Price wrote on June 2. There were a few other bugs related to this issue, but Price set down a reproducible issue, confirmed by many others in the weeks to come—and months to come, years to come, and more than two decades to come.

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

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, wrote to Ars that they first encountered the bug in Thunderbird on Linux, as “seemingly random segments of text floating on my screen.” Switching frequently between virtual desktops left subject lines floating on their screen, which was “extremely annoying.” Zhu learned to switch back to either Firefox or Thunderbird and move their cursor before switching back.

But it grew on them, so they researched and sought to submit the bug, but “To my horror, I realized this bug report has been open for more than 20 years, and still hasn’t been fixed.” Because it was “a minor ‘cosmetic’ issue not causing crashes,” there was a good chance nobody would fix it—”Unless I do it myself,” Zhu wrote.

Zhu was motivated and knew how to program but had “zero experience in projects as complicated as the Firefox browser” and had “never contributed to open source projects before.” But it was the summer before their PhD program started. “So, why not?”

Their start was inauspicious, to say the least. “I just searched for ‘tooltip’ in the entire code base, examined stuff for possible candidates, and inserted debugging print statements to follow the execution,” Zhu wrote. This eventually bore answers. “When the mouse hovers over some element, a timer is started to display the tooltip. The timer would be canceled on a mouse-out event, which Firefox wasn’t getting when I used keyboard shortcuts to switch windows or virtual desktops.”

Zhu pushed a commit that made tooltip display based on Firefox losing focus, rather than the mouse leaving the application. In the next few hours, they heard from Emilio Cobos Álvarez, who refined Zhu’s approach and helped get the commit into the code base. While the fix has created some regression, that bug is seeing work, too.

Zhu, born in 1999, just three years before this bug was submitted, had just finished their undergrad and Masters work at Stanford when they went work on it. They are just starting their PhD in electrical engineering. They can only guess why a bug like this has lasted for most of their life. Their guess it that it’s both a cosmetic inconvenience and tricky to reproduce, leaving other, more serious bugs with perennially higher ranking.

Cobos Álvarez, who shepherded Zhu’s fix into a commit, wrote to us that “this area is rather tricky,” given various Firefox configurations and how they respond to different operating systems. Finding a solution that elegantly dealt with a lack of input on when a Mozilla app wasn’t in focus, without guarantee of OS input, was tricky. “Pretty impressive for his first Firefox contribution!”

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.

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.

This story was updated with responses from Yifan Zhu at 5:45 pm ET on October 10. It was also updated to correct an error in the headline regarding Zhu’s age.

Read More

Leave a Reply

Your email address will not be published. Required fields are marked *