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 or Gael Monfils of France.
Not to be outdone, 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 win in a 4 hour 22 minute marathon.
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.
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," he added.
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.