not sure about LLVM/Clang, but they based webkit on KHTML, leaving them no choice but to open source it. Apple does good for open source (CUPS being another example), but make no mistake: they're not doing it to be charitable
Who said they were? Better yet, who is? Which for-profit companies contributing to open source solely for charitable purposes? One of the primary reasons anybody — individual or company — invests time and energy into an open source project is because, when all is said and done, it's in their shared interest to do so. Sometimes the invested time pays dividends, sometimes it's mostly charity. But few people — and even fewer for-profit companies — participate in open source projects to be "charitable."