A Supreme Court ruling striking down the Defense of Marriage Act (DOMA) would be a huge win for the gay-rights movement, giving some same-sex couples access to thousands of federal benefits they’re currently barred from receiving. But it could also create massive chaos and confusion over just who counts as married, while leaving many gay couples out in the cold.

“It’s going to open up a lot of questions about who’s actually going to get all of these benefits,” Anthony Infanti, a law professor at the University of Pittsburgh and an expert on the application of tax law to gay couples, told msnbc. “And there could still be a lot of disparity.”

The question of who qualifies as married is shaping up as the next big battle for same-sex marriage advocates. It’s “fundamental to where this issue goes next,” Fred Sainz of the Human Rights Campaign told msnbc.

Here’s why: passed in 1996, DOMA bars the federal government from offering marriage benefits to same-sex couples. So if the law goes down in a ruling expected this month, a married gay couple living in, say, Massachusetts, could expect to receive the full range of benefits, rights, and protections available to straight couples—all 1,138 of them, according to the government’s count.

But what about a couple that married in Massachusetts, then moved to Texas, which doesn’t recognize gay marriage? That’s where it gets tricky.

Eligibility for some federal benefits—for instance, veterans’ benefits, and issues relating to immigration—are determined based on where the marriage was celebrated, meaning the Massachusetts-to-Texas couple would still qualify. But for most categories of benefits—including two of the most valuable: tax breaks for married couples, and Social Security survivors’ benefits—it’s where the couple currently lives that matters. So when it comes to those benefits, the couple that moved to Texas would lose out.

AT 12:15 MONDAY, JOIN msnbc’S THOMAS ROBERTS FOR AN ON-AIR GOOGLE+ HANGOUT ON THE DOMA AND PROP 8 DECISIONS.

That creates a situation ripe for litigation, said Douglas NeJaime, a professor at Loyola Law School in Los Angeles. “We probably will see a lot of couples moving to states, discovering they don’t have the benefit anymore, and maybe filing a lawsuit,” NeJaime told msnbc.

Infanti himself is a case study for how the demise of DOMA likely would still leave many gay couples on the outside looking in. He and his partner were married in Canada, he said, and live in Pennsylvania. The couple would like to move Infanti’s partner onto the health insurance plan that Infanti gets through his employer, the University of Pittsburgh. But because they’re not counted by the federal government as a married couple, they’d pay federal tax on the value of the health benefit, making it not worthwhile for them. (Married couples get the benefit tax-free). And even if DOMA were struck down, they likely still wouldn’t get the tax break—barring a change in IRS policy—since Pennsylvania doesn’t recognize their marriage.

To address the issue, gay activists are calling on President Obama to issue an executive order instructing all federal agencies to use the more generous “place of celebration” definition, as The Washington Post reported Friday.

THE TOP 5 BENEFITS, RIGHTS, AND PROTECTIONS THAT GAY COUPLES ARE CURRENTLY BARRED UNDER DOMA FROM RECEIVING (go here for a full rundown from the Human Rights Campaign): • Social Security survivor’s benefits.



• Tax-free health-insurance benefits for an employee’s spouse.



• Exemption from estate taxes (DOMA plaintiff Edith Windsor was required to pay over $363,000 in estate taxes upon the death of her partner).



• Guaranteed leave from work, under the Family and Medical Leave Act, to care for a sick partner.



• The right to petition for their partner to receive a green card or immigrant visa.



Even that might not clarify things entirely, though. For one thing, Infanti asked, what about a same-sex couple married and living in Massachusetts, who get in a car accident while driving through Pennsylvania? If legal issues relating to hospital visitation rights or insurance arise, does the couple count as married or not?

“Nobody’s an island anymore,” said Infanti. “People tend to cross state borders a lot.”

In addition, some federal agencies’ marriage definitions were set by statute, meaning they can be changed only by an act of Congress and not by presidential decree.

That’s why gay-rights activists are also readying to lobby Congress to pass the Respect for Marriage Act, Sainz said, which would make all federal benefits apply to married same-sex couples wherever they live.

Given the GOP’s current opposition to marriage equality, that figures to be a heavy lift. And even if such a law did pass, there’s still the question of how civil unions would be treated. In 2011, the IRS put out informal guidance—in the form of a letter to the tax preparer H&R Block—suggesting that those in such partnerships might count as married for federal tax purposes (the letter referred only to opposite-sex civil unions, so as not to conflict with DOMA). But the agency hasn’t said definitively.

What would clear things up once and for all? A Supreme Court ruling, in the accompanying case concerning California’s Proposition 8, that there’s a universal right to gay marriage. But few expect such a sweeping opinion in that case.

That means that the confusion and the unequal treatment—not just between gay and straight couples, but also between gay couples in different places—is likely to continue for the forseeable future.

“The way it is right now is pretty untenable, and it’s almost going to get worse,” said Infanti. But he would still consider a ruling that struck down DOMA as a clear blow for equality. “It’s one step forward, getting punished for your step forward, trying to make more steps forward. It’s an incremental process.”