Ken Kocienda's book "Creative Selection: Inside Apple's Design Process During the Golden Age of Steve Jobs" has more details about the Safari team's evaluation of Mozilla code and KHTML. Ken was engineer #2 on the Safari team.
I went looking into this, and it appears that I was confused. Google was a big contributor to Firefox in the early naughties, which is the period I was thinking of. Chrome didn't come out until a good while later.
Edit: It was widely speculated that Apple would use gecko for Safari and a shock when they announced they would use the relatively little known KHTML engine. The decision was based on KHTML having much cleaner code. I haven't looked at the Mozilla code in many years, but it was pretty gnarly back then. Lots of old cruft from the Netscape days. In comparison, KHTML was beautiful.