Argentine Juan Martin Del Potro was forced to pull out of his Madrid Open third-round clash against Rafael Nadal because of a hip injury.
The 2009 US Open champion has climbed back up to 32nd spot following last year's wrist surgery and now faces a race to be fit for the French Open.
"I have experience of injuries so I decided not to play," Del Potro said.
beat Guillermo Garcia-Lopez for his 29th consecutive win and
defeated Xavier Malisse.
Nadal, bidding for a third clay title in less than a month following victories at the Monte Carlo Masters and the Barcelona Open, will play
in the last eight after the unseeded Frenchman ousted Spanish qualifier Daniel Gimeno-Traver 1-6 6-4 7-6 (7-4).
Djokovic's winning streak now equals Ivan Lendl's run in 1986, with only Bjorn Borg's 33 matches in 1980 and John McEnroe's 42 in 1984 ahead of him.
He was 4-0 ahead in 15 minutes against Garcia-Lopez, the world number 29, took the first set in 23 minutes and won all 21 of his first-service points, wrapping up a 6-1 6-2 victory in 51 minutes.
The Serbian was not concerned by his new feat and said: "I am very flattered to be able to have the same amount of wins as this tennis legend but it's not something I think about.
"It's the least of my priorities. I just want to keep on winning and that's what it's all about.
"I know I'm playing great now but there is always something you can improve on - you can never be perfect. I'm winning service games comfortably. That's something I'm happy about and an encouraging fact for upcoming matches, especially on clay."
In the quarter-finals Djokovic will play sixth seed
who overcame Sergiy Stakhovsky of the Ukraine 6-3 7-6 (7-3).
Federer, who needed to save a match point in a gruelling encounter of three tie breaks against Feliciano Lopez on Wednesday evening, raced into a 3-0 lead in nine minutes against the unpredictable Malisse, ranked 49th.
The Belgian fought his way back into the set but Federer eventually took it 6-4.
Malisse saved three break points in the opening game of the second set but Federer needed only one chance to break in the sixth game.
Serving for the match he produced a sublime drive volley and successive aces, securing his 6-4 6-3 win in an hour and 10 minutes.
The world number three's next opponent will be Swede
after the fifth seed saw off Frenchman Jo-Wilfried Tsonga 7-6 (8-6) 7-5.
Referring to his late finish against Lopez on Wednesday Federer admitted: "Mentally I had to shift a bit. I just wanted to put in a good performance, which is what I did.
"It was a quick turnaround. I just had to get past this match to have the quarters in sight."