Not to contradict anything here, and I apologize if this has been mentioned already... but there is good evidence that the titanosaur sauropod _Paralititan_ lived in a mangrove environment.
Yes. Press articles at the time this discovery was announced said "this stuff supports hotels" about the compact sand ground in question.
Not only that, but the _Paralititan_ carcass was then scavenged by a theropod, which left a tooth behind (cf. _Carcharodontosaurus_) - so the theropod was presumably also comfortable in the mangrove habitat.
Utterly unsurprising -- theropods had large feet with long, somewhat splayed toes; even at the same weight, this means less risk of sinking in than for a pillar-footed sauropod.
Based on oxygen isotope ratios, we know that _Spinosaurus_ spent a lot of its time in water, despite its skeleton having few (if any) aquatic adaptations.
Oxygen isotope ratios tell us where *Spinosaurus* got its food from, not if it ever swum. I think it was a heron analogue.