Second seed Djokovic took his winning run to 43 matches as he brushed aside France's Richard Gasquet 6-4, 6-4, 6-2 to set up a last eight clash with Fognini.
Federer, the 2009 champion and third seed, reached a record 28th successive grand slam quarter-final with a 6-3, 6-2, 7-5 win over best friend Stanislas Wawrinka.
He will next tackle either Spain's David Ferrer, the seventh seed, or ninth-seeded Gael Monfils of France.
That last 16 tie was suspended due to bad light with Monfils 6-4, 2-6, 7-5, 0-2 in the lead ahead of a Monday conclusion.
Unheralded Fognini, the world 49, became the first Italian man to reach the quarter-finals in 16 years by defeating Spain's Albert Montanes 4-6, 6-4, 3-6, 6-3, 11-9 in a 4 hour 22 minute battle.
Fognini saved five match points and needed a medical time-out for a left thigh injury which may yet rule him out of his first grand slam quarter-final.
The 24-year-old had been 4-1 down in the final set, then controversially called for treatment for cramping in his left thigh when he was two points from defeat in the 14th game of the decider.
But despite only able to move from side to side, and being called for a series of foot faults, he stunned his 30-year-old opponent, fighting off two match points in the 16th game of the final set and three more in the 18th.
"I am in a lot of pain. It's not cramp, I felt the muscle stretch," said Fognini, who committed 103 unforced errors in the match.
"I have 48 hours to recover. I don't know about the next match. I will go and see the doctor and then see what happens."
Djokovic rolls on
Unstoppable Djokovic is now just three wins short of matching Guillermo Vilas's record of 46 consecutive wins and one shy of John McEnroe's mark of 42 for an unbeaten start to a season set in 1984.
The red-hot Serb breezed to his fifth career win in six meetings against the 13th-seeded Gasquet.
"I'm happy with my game. I played a great match against a great player, but I got important breaks and made no mistakes after that," said Djokovic.
"I'm playing the best tennis of my life at the moment. But it's important to just focus on each match and see how far I can go."
Third seed Federer has reached the last eight without dropping a set as he continues to thrive at a Roland Garros tournament where the world's top two, Rafael Nadal and Djokovic, are expected to reach the final.
"Twenty-eight quarter-finals in a row, that's great, but that's another opportunity for me to go one step further," said Federer, who had shared the previous best of 27 with Jimmy Connors.
"That's why I'm very proud I accomplished that, and I hope I can go one step further than last year, and then we'll see."
In what was a repeat of the match-up at the same stage of Roland Garros last year, 16-time major winner Federer took his career record to 9-1 against Wawrinka, his Beijing Olympics doubles gold medal-winning partner.
Federer will be a comfortable favourite to win his quarter-final -- he holds an 11-0 record against Ferrer and is 5-1 with Monfils.
-AFPTags: sport, tennis, france First posted May 30, 2011 06:03:00