Webkit still is open source. Apple never owned the full copyright to it and they would have to do a complete rewrite to get out of that license, which is GPL and always has been. Safari is indeed closed source. But it uses webkit. For the same reason, Google is stuck with the same license and copyright situation. Whether they like it or not, webkit/kml/chromium are forever GPL. Nothing short of a complete rewrite can fix that.
I think you are grossly underestimating how dependent both companies are on various open source projects. It's definitely true that they also do a lot of in house code of course; and they also contribute a lot of their own projects. And of course especially Google is a repeat offender when it comes to creating a lot of dead projects, reinventing the wheel, etc. It looks like their attempt to create their own operating system kernel is slowly dying now. Fuchsia is all but dead at this point. So they are back to Linux being their only future. There's the whole Kotlin ecosystem, which they helped create, which is starting to compete with flutter. And so on.
WebKit isn't GPL, it's LGPL, which is why Safari is closed source.
I'm not really underestimating anything. I worked on the Google codebase for years. It has very little dependence on open source code relative to its overall size.
I think you are grossly underestimating how dependent both companies are on various open source projects. It's definitely true that they also do a lot of in house code of course; and they also contribute a lot of their own projects. And of course especially Google is a repeat offender when it comes to creating a lot of dead projects, reinventing the wheel, etc. It looks like their attempt to create their own operating system kernel is slowly dying now. Fuchsia is all but dead at this point. So they are back to Linux being their only future. There's the whole Kotlin ecosystem, which they helped create, which is starting to compete with flutter. And so on.