Wikipedia collected 162m in revenue (no ads!) and spent 112m dollars! I'd be curious to dig into what % of that goes to core wikipedia and what % goes ancillary projects. You'd have to dig very deeply into their finances to figure that out.
Firefox should set apart a large chunk of that 400m/year in an endowment intended for Firefox to continue and to be independent in perpetuity. That could easily be a multiple-billion dollar endowment by now and their spending and growth from that spending should be on revenue from that endowment.
Competing with Google and Microsoft funded competitors ain't cheap. And requires more than developers. People don't play that nice, at least not when there's an advantage to playing dirty. And there is.