Web browsers composite layers just like CoreAnimation, and the browser ostensibly knows how big each element is. Seems like they could invent some kind of heuristic for the web just like they ostensibly already have for UIKit.
That will only happen if governments enforce anti trust to include web as a type of third-party app store.
I don't think the UIKit heuristic is that intelligent, it's simply "is this a transition between two view controllers". Again, the lack of any formalised notion of "root views" or whatever on the web would be a blocker here I think. That said I'd be curious what happens with the View Transitions API, since it's about as close as you'll get to that.