In sparking a nationwide call for justice, Trayvon Martin’s parents painted the slain teenager as sweet, aspiring, and well-meaning – notions backed up by a baby-faced photo that led President Obama to suggest, “If I had a son, he’d look like Trayvon.”

But on Friday, a new judge in the second-degree murder case against George Zimmerman, the 29-year-old volunteer watchman accused of profiling, accosting, and then murdering an unarmed Trayvon on Feb. 26, made a major ruling that could alter that image.

Circuit Court Judge Debra Nelson allowed, with limitations, defense attorneys to dig deep into Trayvon’s social media scribblings and school records to determine whether the boy had a violent streak that may have put Mr. Zimmerman into a self-defense stance.

Gun nation: Inside America's gun-carry culture

Whether any evidence dug up by Zimmerman’s defense team ever makes it to the media or the public will be up to Judge Nelson. But the ruling opens up a major new break in what’s shaping up to be an emotional, heart-wrenching trial that will explore not just Zimmerman’s guilt, but the extent to which race played into both Zimmerman’s actions and decisions by police in the aftermath.

“I have had anecdotal evidence that there were videos out there suggesting that [Trayvon] involved himself in MMA (mixed martial arts) fighting, he had an experience level with that,” Mark O’Mara, Zimmerman’s attorney, said after Friday’s court hearing. “I think the judge hit it on head … that reputation for violence is an issue in this case.”

The shooting caused a national uproar about racial profiling and permissive gun laws when local police in Sanford, Fla., where Trayvon was killed, let Zimmerman go free, citing the 2005 “stand your ground” law in Florida, which negated the legal doctrine of “duty to retreat” in the face of an attack. Forty-four days later, a special prosecutor filed second degree murder charges against Zimmerman, who is now out on bond at an undisclosed location in Seminole County.

On Friday, Trayvon’s parents, Tracy Martin and Sybrina Fulton, called Judge Nelson’s decision to allow the school and social media subpoenas a travesty, suggesting that by opening up Trayvon’s records it would allow defense attorneys to “make a dead child seem as if they’re the perpetrator.”

Yet there’s a sound legal reason for the judge allowing the defense to go on the offense, says George Dekle, a law professor at the University of Florida. True, he says, the prosecution has stated that the basic facts of the case – a grown man profiles a boy as a criminal, instigates a confrontation, then shoots him dead when the boy defends himself – substantiate a second-degree murder conviction.

But under Florida law, the nuances of the confrontation, and the actions of the victim, are all admissible in a self-defense claim.

The stand-your-ground law, which was cited by police when they originally let Zimmerman off without an arrest, doesn’t allow someone to instigate a fight and then immediately use deadly force. But if the tables are turned and the person is backed into a corner – or ends up with his back on the ground, as Zimmerman claims – a defendant can still claim that they acted in self-defense, Mr. Dekle says.

“You could analyze a lot of cases that are stand-your-ground cases as not having anything to do with stand your ground, because the person wasn’t in a position to run away anyhow,” says Dekle.

To be sure, race continues to be a simmering undercurrent in the trial. In late September, a Trayvon family attorney, Ben Crump, told the Orlando Sentinel that, “Nobody believes that if you make Trayvon Martin white [and Zimmerman black], there’s no way he would not be arrested. That’s why race is involved in this case.”

But this week, Mr. O’Mara shot back in an online post, writing, “While it can be safely argued that it is largely the question of civil rights issues that has made the George Zimmerman case a national – and international – story, there is nothing to support the contention of racism in the Zimmerman case.”

Either way, following a summer in which Zimmerman’s credibility came under heavy scrutiny after he and his wife colluded to lie to the court about their financial situation, the judge’s ruling on Friday made it clear that Zimmerman’s defense team has found some traction in a case that’s scheduled to go to trial on next June.

And while the race issue continues to define the case more broadly, it became clear this week that the tension in the case has come to revolve around whether Trayvon’s personality and whether the boy’s actions – not his race or his hoodie, which in part drew Zimmerman’s attention on the night of the shooting – played a role in the tragedy.

Trayvon had been on a 10-day suspension from his high school when he was killed. The suspension came after school officials found an empty marijuana baggie on him. An eyewitness to the shooting has also testified that Trayvon was straddling Zimmerman, punching him “MMA-style” in the moments before he was shot.

“The rules of evidence permit the defense to introduce evidence of a pertinent character trait in support of Zimmerman’s claim that [Trayvon] Martin was the aggressor,” writes former defense attorney Frederick Leatherman on his popular law blog.

“For example, if Trayvon Martin was known to be an aggressive bully who started fights, the defense would be permitted to bring that out at trial,” Mr. Leatherman writes. “The defense would be limited to introducing the evidence as a character trait. Assuming such evidence exists, which I doubt, it might be in the school records. Therefore, I believe the defense has a legitimate reason to want to review the records.”

Gun nation: Inside America's gun-carry culture