England twice had to dig deep, when they were 92-3 with Tom Westley's departure, and then at 187-5 when Root was lbw for 52 to Duanne Olivier.
South Africa knew Vernon Philander was struggling before the Third Test began, but picked him anyway because he is crucial to their bowling attack.
When Keshav Maharaj was lbw to give Moeen his 20th wicket of the series and Quinton de Kock edged Stuart Broad behind, South Africa were in danger of being bowled out before the close. However, that is exactly what Stokes did during his brilliant knock of 112 in the first innings.
"Test cricket is a harsh world to come into and the tough thing for him is that there is talk about players being found out at global level".
Adding 102 runs to their overnight 260-6 and once again destroying the South Africa batting made it an excellent day for England, but it could have been even better if they had taken just some of the hard chances that came their way. Olivier draws first blood for the visitors.
Cook did have one moment of discomfort against the sharp pace of Rabada, who hurried him on the pull as he combated a round-the-wicket bouncer, and gloved a top-edge over the keeper's head for four. Having nearly nicked Morkel behind, the captain then followed the bad example set by his departed team-mates in offering a thick edge of his own, only for De Kock to inexplicably fail to dive.
Malan's third Test innings brought a third failure, as he was tempted to drive at Morne Morkel outside off stump and was caught at second slip for 18.
Farbrace on Haseeb Hameed's presence in the England dressing room: "If you're in the England team there is always, and should always be, someone knocking on the door for your place, whether they're here at the ground breathing down your neck or doing it in the championship".
In the next 33 deliveries England scored no runs and lost Westley too, Rabada forcing the mistake and De Kock flinging himself to the right to pouch a superb catch.
England were rocking a touch before a solid partnership of Stokes and Jonny Bairstow calmed proceedings for Root's men.
Root- He remains the hottest pick as far as batsman are concerned.
Moeen finally ended Elgar's dogged resistance for a 228-ball 136 and the spinner snapped up Rabada with the last ball of his over, both batsmen caught at slip by man-of-the-match Ben Stokes.