(CNN)Supreme Court Justice Ruth Bader Ginsburg's scathing comments about Donald Trump have created a political firestorm, but they may also have a dramatic impact on the final result of the race for the White House as well.

If the Supreme Court finds itself in the position of deciding the presidential election -- as it did in 2000 between Al Gore and George W. Bush -- some legal experts say the liberal icon would likely have to recuse herself.

"A federal law requires all federal judges, including the justices, to recuse themselves if their 'impartiality might reasonably be questioned'," said Stephen Gillers, a legal ethicist at New York University School of Law.

JUST WATCHED

Trump to Ginsburg: Resign

MUST WATCH

"Under this test, Justice Ginsburg's remarks would prevent her from sitting in the unlikely event of a 'Clinton v. Trump' case that determines the next president," he said.

Ginsburg attacked Trump in no uncertain terms this week, calling him a "faker" in an interview with CNN legal analyst Joan Biskupic. To The New York Times, Ginsburg said, "I can't imagine what this place would be -- I can't imagine what the country would be -- with Donald Trump as our president."

Read More

Gillers was referring to 28 U.S. Code 455 that says "Any justice, judge, or magistrate judge of the United States shall disqualify himself in any proceeding in which his impartiality might reasonably be questioned."

But the individual justices decide for themselves whether recusal is warranted or necessary.

"If a Trump election-related question made it to the Supreme Court, I expect that the Trump team would move for Justice Ginsburg to recuse herself," said Rick Hasen, an election law expert who runs the Election Law Blog.

"Justice Ginsburg herself would decide on that motion, as there is no other mechanism for recusal," Hasen said.

Steven Lubet, of Northwestern Pritzker School of Law, agrees with Gillers that Ginsburg would need to recuse herself in the event of a disputed election.

Taking the hypothetical Clinton v. Trump scenario even further, a Ginsburg recusal in such as lawsuit could mean only seven justices remain to decide the fate of the election. Senate Republicans have not acted -- and repeatedly say they will not act -- on the nomination of Judge Merrick Garland to replace the late Justice Antonin Scalia.

But Lubet said the question of Ginsburg's comments would not extend to cases that might arise dealing with policies or programs in a hypothetical Trump presidency.

"An administration is constantly before the court," Lubet said.

"Policies don't involve the personal fortunes of the president, so challenges on executive power or the legality of programs would not trigger disqualification," he added.

JUST WATCHED

Paul Ryan: Ginsburg's comments show inherent bias

MUST WATCH

Paul Ryan: Ginsburg's comments show inherent bias01:38

In 2003, for instance, Scalia recused himself from hearing a case concerning the Pledge of Allegiance after he had discussed the case in public.

A year later, however, he declined to recuse himself from a case involving Vice President Dick Cheney. The two had travelled together on a duck hunting trip and opponents questioned whether or not Scalia would be biased in the case. Scalia issued a 21-page memorandum explaining why he would not disqualify himself.

JUST WATCHED

Scalia jokes about hunting with Cheney

MUST WATCH

Scalia jokes about hunting with Cheney01:35

"In that case, I had accepted the invitation long before the case that was the alleged source of the conflict was before the court," Scalia told CNN's Piers Morgan in an interview in 2012. "Cheney was not personally the defendant. He was named because he was the head of the agency that was the defendant. And justices have never recused themselves because they are friends with the -- the named head of an agency."

JUST WATCHED

Justice Scalia on Bush vs. Gore

MUST WATCH

He added, "If we had to recuse ourselves every time one of our friends was named, even though his personal fortune was not at stake, we would not sit in a lot of cases."

There is nothing of course stopping politicians from criticizing the Supreme Court or judicial branch in general. Trump cased a firestorm by calling for Golanzo Curiel, a federal judge overseeing a lawsuit related to Trump University, to recuse himself from that case because of Curiel's "Mexican heritage." That is relevant, Trump argues, because Trump has proposed building a wall along the U.S.-Mexico border.

The question of recusal aside, debate is also ongoing over the wisdom of Ginsburg's remarks. The "Notorious RBG" is a liberal icon and her political leanings likely weren't in debate to begin with.

"I think it is valuable for people to hear what the justices have to say on important issues, " he wrote. "As a lawyer and as a citizen, I'd always rather know what justices and judges think rather than have enforced silence and pretend they have no views."

Ian Millhiser, an unabashed liberal, said he believes that Ginsburg "unquestionably broke rules that exist to preserve the illusion of an apolitical judiciary."

But Millhiser added that the court has long been a political institution.

"I'd rather Ginsburg be honest about the Court's political nature than pretend otherwise -- in no small part because the illusion of a non-political Court reduces public pressure that could help make it less political, " he said.

The Times editorial board said Ginsburg's decision to "descend toward his level and call her own commitment to impartiality into question," is "baffling."

"Washington is more than partisan enough without the spectacle of a Supreme Court justice flinging herself into the mosh pit," the paper said in an editorial Wednesday.

And Paul Begala, a CNN commentator and adviser to pro-Hillary Clinton super PAC Priorities USA, said Ginsburg may have been in the wrong but also alluded to the 2000 Bush v Gore case, in which the court essentially ended the presidential race with a 5-4 decision along ideological lines in favor of the Republican nominee Bush.

"Of course Justice Ginsburg wrong to state political views before election. Sup Crt is supposed to wait and then steal the election for GOP," Begala tweeted.

Of course Justice Ginsburg wrong to state political views before election. Sup Crt is supposed to wait and then steal the election for GOP

Recent Supreme Court recusals

Chief Justice John Roberts addressed the issue in a 2011 report on the federal judiciary. At the time he was responding indirectly to questions of whether some justices should recuse themselves from hearing a case about the Affordable Care Act. Roberts said that the justices "may consider recusal in response to a request from a party in a pending case, or on their own initiative."

Roberts noted that justices don't often withdraw from a case "as a matter of convenience or simply to avoid controversy." Unlike the lower court if a justice withdraws from a case, he or she cannot be replaced.

"I have complete confidence in the capability of my colleagues to determine when recusal is warranted," the chief wrote, adding that, "they are jurists of exceptional integrity and experience."

Recusals generally happen in cases when the justice has a financial conflict, such as if he or she owns own stock in a company that has business before the court.

There are other personal reasons as well. Justice Elena Kagan recused herself from hearing the recent affirmative action case, Fisher v. the University of Texas, most likely because she had dealt with it before in her previous job as solicitor general for the Obama administration. Justice Stephen Breyer recused himself in cases decided by his brother who serves on the United States District Court for the Northern District of California.