This is pretty much expected for a huge multimillion line C++ codebases, like all web browsers currently are. All have crufty parts (not sure why GP thinks one browser has nicer code overall? That's not my opinion based on the code I've read.)
WebKit forked KHTML in 2005.
KHTML actually started in late '98 if memory serves, when we rebooted Mozilla around Gecko.