Yesterday, Roseanne Barr tweeted racist slurs against Valerie Jarrett, one of President Barack Obama’s closest advisers. Social media erupted in outrage, and ABC swiftly canceled the relaunch of her eponymous sitcom, despite its ratings successes.

This action demonstrates the economic consequences stars can face for controversial activities — something celebrities across the political spectrum have experienced over the years.

But it also reveals something surprising about the nature of modern celebrity: It may be more democratic than our current-day politics. More so than politicians, celebrities depend on public opinion. And not just niche opinion: Their livelihood requires them to connect with large numbers of people. By contrast, politicians all too frequently respond to the demands of donors and interest groups, ignoring the public’s wishes (see, for instance, the raft of unpopular policies Republicans have pursued on health care, gun control and tax cuts). Celebrities don’t have that option. Not because of partisan affiliations or some lofty political ideas, but because their market is much broader than that of elected officials. While politicians in a post-Citizens United age in which voting restrictions are increasingly common may be able to skirt the public, celebrities cannot.

Hollywood has always been inherently political, because its economic success depends on cultivating the trust, interest and, most important, patronage of the public. Doing so meant careful management of the industry’s public image. In 1921, after lurid stories about comedian and silent film star Fatty Arbuckle’s three-day “gin party” that ended with the death of Virginia Rappe, the Motion Picture Producers and Distributors of America hired Will Hays to revamp the industry’s battered image and lobby for favorable policies in the process.

Here's what President Trump supporters had to say about the cancellation of "Roseanne” outside his rally in Nashville. (The Washington Post)

Studios had to balance both the allure of edginess and titillation, which attracted audiences, while avoiding controversy and fighting off censorship. When films broached topics of sex and violence in the early 1930s, Catholic priests threatened a boycott of “immoral films.” The result: the enforcement of a production code, guided by the principle that because “high trust and confidence” had been placed in motion pictures “by the people of the world,” the industry had a moral “responsibility to the public.” Overseen by Hays and enforced by Joseph Breen, the head of the Production Code Administration, this self-censorship brought a social conservatism to movies in an attempt to keep divisive political or cultural issues off the screen.

But it didn’t stop there. During the Great Depression, as millions of Americans struggled to put food on the table, studios were careful to project an image of Hollywood as a responsible player to the broader public, even as they raked in box-office dollars. Stars had to sign contracts with morality clauses that included public support for charity organizations. Studio executives constantly urged the biggest stars and top directors to donate their time and money to organizations such as the Motion Picture Relief Fund, the Community Chest, the Red Cross and — to curry favor with the sitting president — Franklin Roosevelt’s Warm Springs Foundation for Infantile Paralysis.

Volunteerism helped the industry maintain favor with the public, on whom it depended for success. Promoting the image of “civic Hollywood” in the public helped to redefine the meaning of celebrity beyond simply someone with serious acting chops. Celebrities became public figures — people with a responsibility to the public good.

This paved the way for entertainers to become involved in politics, but many soon learned that such political activity could also be a liability. The infamous House Un-American Activities Committee (HUAC) investigation into the motion-picture industry in 1947 — in which the “Hollywood Ten” faced contempt charges for refusing to answer whether they were communists — revealed the potentially disastrous economic consequences of political activism. While industry leaders defended Hollywood’s record to congressional investigators, they later signed the “Waldorf Statement,” firing the men for breaching the morality clause in their contract and promising not to knowingly hire any communists.

It wasn’t only suspected communists who felt the effect. When Edward G. Robinson was targeted by HUAC, the liberal actor struggled to find work, ultimately writing an embarrassing article, “How the Reds Made a Sucker Out of Me,” to salvage his reputation. Even Humphrey Bogart — one of Hollywood’s top stars — had to pen an apology for being an “American dope” and protesting the HUAC hearings through the Committee for the First Amendment. Without these apologies, studio magnates feared that the actors would be toxic to the anti-Communist American public.

The HUAC hearings helped to splinter an industry already struggling to adjust to high tariffs abroad and new competition from television in suburban living rooms at home. To recover, the studios launched another major public relations initiative to reassert the idea of celebrities as public servants. This included the “Movietime U.S.A.” tour in 1951, which aimed to celebrate Hollywood’s political, economic and cultural role in American civic life. Ronald Reagan cut his political teeth as vice president of the organization, as he and others traveled to Rotary, Lions, Kiwanis and veterans organizations, PTA clubs, Knights of Columbus and even churches to raise awareness about the importance of the motion-picture industry in local towns.

This campaign refuted the idea that Hollywood was filled with greed and communism, celebrating instead stories of going to church, raising families, donating time to charities and traveling Europe as “ambassadors of democracy.” Driven by financial concerns, industry spokesmen pursued a coordinated campaign to legitimize the acting profession in the public eye. And in many ways, it worked. These efforts paved the way for George Murphy and Ronald Reagan’s entrance into the GOP and for a variety of stars to mobilize for civil rights and the antiwar movement on the left.

But they did so with a new personal risk, because Hollywood itself changed. There were no more morality contracts. The production code was replaced by a ratings system in 1968, and the breakdown of the studio system gave actors, and their agents, more control over their productions and their public image. In many ways, the pressure has shifted to individual actors, not publicity departments, to cultivate their own brand and navigate the publicity fallout that could come with controversy.

But one thing has remained the same: Actors still depend on public opinion, and their public image is a professional asset or liability.

This is something that Roseanne Barr knows well.  She has cultivated a controversial public image since 1990, when she notoriously screeched the national anthem, then grabbing her crotch. Her Twitter feed has been filled with anti-Semitism, racism and conspiracy theories. When “Roseanne” launched, its producers and Barr herself claimed that they wanted to “bring a kind of dialogue back,” similar to the days of “All in the Family.

She brought back a dialogue, all right. But the one she brought back on Twitter was offensive and blatantly racist. That ABC and her co-stars refused to stand by her — whether for business or ideological reasons — gives insight into the industry’s sensitivity to public opinion, a sensitivity currently missing from politics.

Barr’s use of social media to spread lies, conspiracies and racist tropes is not so different from President Trump’s. Even Trump supporters don’t like the president’s Twitter screeds — a December 2017 poll showed 26 percent of Americans thought his Twitter use was appropriate (though 57 percent of Trump voters approved). But Trump is isolated from public opinion in a way networks and celebrities are not. And while few people would want politicians to be beholden to every swing in public opinion, it is worth contemplating whether we have moved too far in the other direction, draining democratic oversight from the places it is needed most.