Federer extended his quarterfinal streak at major tournaments to 28 with a 6-3, 6-2, 7-5 victory over Olympic gold medal doubles partner Stanislas Wawrinka.
"Twenty-eight quarterfinals in a row, that's great," Federer said. "But that's another opportunity for me to go one step further."
Shortly after Federer's match on Court Philippe Chatrier, Djokovic maintained his perfect season and stretched his overall winning streak to 43 matches by beating Richard Gasquet of France 6-4, 6-4, 6-2.
"I'm definitely playing the best tennis of my life," Djokovic said, "and I'm trying to stay focused on each game and we'll see how far I can go."
"I didn't expect it to be easy, that's for sure," added Serbia's Djokovic, who briefly addressed the crowd in French, drawing laughter and cheers. "Maybe the scoreline says differently, but I really ... had to work."
Each match carries extra meaning these days for Djokovic, whose winning streak began with two Davis Cup victories in December and is the third longest since the Open era began in 1968. Now 41-0 in 2011, he's one win shy of John McEnroe's mark of 42-0 in 1984.
"As soon as he hits a return, he grabs you by the throat," said France's Gasquet, a former top-10 player and 2007 Wimbledon semifinalist who was supported by a partisan crowd Sunday. "To beat him, you need to produce the perfect match and not make any mistakes."
"He plays fast. He hits the ball really early. His return is colossal," Gasquet said. "He's got no weakness."
Federer and Djokovic could meet in the semifinals.
Federer, a 16-time major champion who completed a career Grand Slam at Roland Garros in 2009, improved on the mark he shared with Jimmy Connors. The last time Federer failed to reach the quarterfinals at a major was at the 2004 French Open, when he was the top-seeded player but lost to Gustavo Kuerten in the third round.
Federer again dominated with his serve Sunday. He was broken once early in the third set, but broke back twice to remain one of four players to have won every match in straight sets.
"I was playing with the wind against me, and it was a bad game because all of a sudden there was more wind, and I had the feeling that I was playing against the wind and not against Stan," Federer said of the third set. "So in the end I made wrong decisions."
Federer also beat Wawrinka, his Davis Cup teammate, in the quarterfinals of the Australian Open. In 2008, the Swiss pair teamed up to win the doubles gold at the Beijing Olympics.
"In the third set I had a few openings, and if I had managed to serve a little better and hold on to my break, maybe anything could have happened," Wawrinka said.
Besides his record 16 major titles, Federer also set a record of 23 straight Grand Slam semifinal appearances. That run ended at last year's French Open, when he was beaten in the quarterfinals.
Federer set his quarterfinal streak in 28 consecutive Grand Slam tournaments, while Connors skipped some in his run.
The seventh-seeded Ferrer broke Monfils to take a 2-0 in the fourth set before the chair umpire said it was too dark to continue.
The pair will attempt to finish the fourth-round match on Court Suzanne Lenglen on Monday.
Djokovic is 41-0 in 2011, including a pair of clay-court final wins over top-ranked Rafael Nadal. If he beats unseeded Fabio Fognini in the quarterfinals, he will match John McEnroe's record for the best start to the season.
With three more wins, Djokovic will equal Guillermo Vilas' overall Open era record of 46 consecutive wins.
"Actually, I think I'm playing really well at this moment," said Djokovic. "And this match today I think I even increased a level since the last match, which makes me even happier."
Fognini, the first Italian to reach the quarterfinals at Roland Garros since 1995, overcame a cramping left leg and five match points to defeat Albert Montanes of Spain 4-6, 6-4, 3-6, 6-3, 11-9.
The match lasted 4 hours, 22 minutes, with the temperature in the 70s, and by the end, the 49th-ranked Fognini essentially would stand in place on court, immobile, yet would win exchanges with a winner or when Montanes would make an unforced error.
"I have to be honest. I didn't think I could win the match," Fognini said. "I couldn't move. I couldn't serve."
He explained that his only choice was to swing away at the ball, "and if it went in, it went in."
Djokovic saluted Fognini in Italian via Twitter, writing about his pal's "big victory" and "mental strength."
While trailing 7-6 and serving at 15-30 -- meaning Montanes was two points from victory -- Fognini winced in pain at the baseline after hitting a serve and clutched at his left leg. He called for the trainer and sat down in his changeover chair for a massage while play was halted. When action resumed, Fognini won three points in a row to hold serve for 7-all.
The 38th-ranked Montanes was broken while serving for the match at 5-3 in the fifth, and he later failed to convert match points on Fognini's serve at 8-7 and at 9-8.
Fognini broke Montanes to lead 10-9, then served out the victory, closing it with a backhand winner.
On point after point, Montanes would hit the ball right near Fognini, rather than forcing the Italian to move around more to get to shots.
"He was hitting so hard I didn't want to take too many risks," Montanes said. "It's always easy to say, 'You could have done that. You should have done this. You should have seized more opportunities and been more aggressive on these points.' "
Fognini's take on the way his opponent played down the stretch: "It's not easy when you see someone across the net who can't move."
Information from The Associated Press was used in this report.