
Artist’s impression of the eastern flank of the Antarctic Peninsula during the Maastrichtian (Artist: James McKay, University of Leeds.)
Dinosaurs had diverse feeding mechanisms that strongly influenced their ecology and evolution. Herbivory probably evolved independently in derived silesaurids and various dinosaur groups. Although in the early Late Triassic, dinosaur herbivores were rare, by the early Middle Jurassic until the end of the Cretaceous, they became the dominant vertebrate herbivores.
Herbivory requires numerous physiological, anatomical, and behavioral adaptations, including cranial modifications and specialization of the gastrointestinal tract. On the contrary, plants have developed certain features to dissuade herbivores, and evolved to compensate the effects of herbivory by extending growing periods, delaying leaf senescence, and improving nutrient and water availability to surviving leaves (Barret, 2014). Notwithstanding, some plants attract herbivores to enable seed dispersal or pollination, usually by producing fleshy fruits or nectar. The sum of these factors lead to diverse mutualistic interactions between plants and vertebrate herbivores.

Possible interactions between anatomical and physiological traits in herbivorous dinosaurs. From Barret, 2014
The evolution of sauropod herbivory was intimately associated with increased body size and quadrupedal locomotion. In Gondwanan faunas, titanosaurian sauropods were the principal herbivorous dinosaurs.
Several anatomical features enabled sauropods to ingest and digest massive quantities of vegetation (approximately up to 40 kg per day), much of it probably low in nutritional quality. Their long necks helped them to reach vegetation inaccessible to other herbivores, and their large bodies enabled the slower passage of plants through the gut with longer periods of gut fermentation, which allowed that enzymes chemically degrade very hard plants or large amounts of foliage, without employ other mechanical methods for breaking down food (although, is very common found sauropod skeletons with gastroliths).
Differences in body size, skull morphology, neck length, mobility, and dental features probably allowed coexisting sauropods to target different food sources and feed in distinct ways. Bonitasaura, a small sauropod from the Late Cretaceous of Argentina, may have been adapted for feeding on harder vegetation close to the ground. This is very different to the usual image of sauropods browsing high in the treetops and may have been a common feeding strategy among sauropods (Brusatte, 2012).

Triassic cycadophytes from Argentina: A) Pseudoctenis spatulata Du Toit; B) Taeniopteris Brongniart . From Cúneo et al, 2010
There were profound changes in floral composition and structure during the Mesozoic, including the rise of ferns, cycadophytes, and conifers during the Triassic and Jurassic, followed by the sharp decline of cycadophyte abundance and richness in the Early Cretaceous, and the origin and subsequent diversification of angiosperms. All these floral events have been linked to changes in dinosaur ecology, but currently the evidence for coevolutionary interactions between plants and dinosaurs is weak.
Reference:
Paul Barret, Paleobiology of Herbivorous Dinosaurs, Annu. Rev. Earth Planet. Sci. 2014. 42:207–30, DOI: 10.1146/annurev-earth-042711-105515
Brusatte SL, Benton MJ, Ruta M, Lloyd GT. 2008. The first 50 Myr of dinosaur evolution: macroevolutionary pattern and morphological disparity. Biol. Lett. 4:733–36
Langer MC, Ezcurra MD, Bittencourt JS, Novas FE. 2010. The origin and early evolution of dinosaurs. Biol. Rev. 85:55–110
Martínez RN, Sereno PC, Alcober OA, Colombi CE, Renne PR, et al. 2011. A basal dinosaur from the dawn of the dinosaur era in southwestern Pangaea. Science 311:206–10
Tiffney BH. 1992. The role of vertebrate herbivory in the evolution of land plants. Palaeobotanist 41:87–97