England built on a first innings lead of 89, reaching 172 for three in their second innings at the close of play, an overall lead of 261 runs.
With plenty of time remaining in the match, England were prepared to grind out their runs with risk-free batting in the second innings, scoring at just over two-and-a-half runs an over on a slow, dry pitch which made fluent stroke play difficult.
Both Compton's chances were off Morkel, who also had Root dropped by a leaping De Villiers on six.
Dean Elgar carried his bat for South Africa, making a fighting 118 not out, but he had minimal support from his teammates as the hosts were bowled out for 214. Stuart Broad and Moeen Ali took four wickets each for England.
More From This Section
South Africa suffered a blow early in the second innings when Steyn left the field with a right shoulder strain after bowling two balls of his fourth over.
He went for a scan and was off the field for a lengthy period before returning to the field at the late afternoon drinks break. He did not bowl again.
Steyn, who missed most of a recent series in India with a groin injury, took four for 70 in the first innings in his first match appearance since November 5.
Off-spinner Dane Piedt took the first two wickets in the second innings, trapping England captain Alastair Cook leg before wicket for seven before having Alex Hales caught at long-on for 26.
Elgar was the sixth South African to bat unbeaten through a Test innings. Fellow left-hander Gary Kirsten was the most recent to perform the feat before Elgar, making 100 not out in a total of 239 against Pakistan in Faisalabad in 1997/98.
Broad followed up his three wickets on the second day with an early breakthrough on Monday, bowling Temba Bavuma off an inside edge with the second ball of the morning, without addition to the overnight total of 137 for four. Broad had figures of four for 25.
Ali ended the partnership shortly before the second new ball was due when Steyn lofted a catch to mid-off. He took four for 69.
Steven Finn wrapped up the innings, taking the last two wickets in the space of four balls in the second over with the new ball.