As Willy Wonka in Tim Burton's film of Charlie and the Chocolate Factory, Johnny Depp wears his hair in a bob that looks like he might have stolen it from Julie Christie in 1966, and he has milky translucent skin that gives him the appearance of a corpse made entirely of Muenster cheese. When he smiles, flashing teeth that are white and pearly enough to terrify Tony Robbins, it's less an invitation than a threat, as if his entire mouth were filled with fangs. Wearing a top hat and red velvet coat, speaking in a light effeminate voice of extreme fussiness, he looks and acts like a 19th-century vampire who is halfway through a sex change.
Wonka, the legendary candy maker, may be a stone freak, but he is also one of Burton's classic crackpot conjurers, like Beetlejuice or Ed Wood. Depp gives a performance that's an acrid, mocking put-on, delivering meta-sarcasms as if they were vicious tidbits meant only for his private amusement. At first, I thought he was doing his version of a manic Jim Carrey clown, surfing the channels of his own brain, but Depp, in his stylized way, never breaks character, never goes for the easy self-referential multimedia gag. He maintains the paradox, the mystery, of Willy Wonka: a misanthrope who has little patience for children, who can't even utter the word ''parents'' without gagging, yet who invents for those same kids the purest and most luscious candies out of the sugar dream of his imagination.
It's become an uncomfortable experience in movies to watch Burton, the prankish mod-goth fantasist, working to twist himself into ''mainstream'' shapes. His last two films, Big Fish and Planet of the Apes, lurched in and out of formula, but Charlie and the Chocolate Factory, which has been faithfully adapted from Roald Dahl's great 1964 children's novel, is a delectably sustained flight of fancy. It's filled with puckish, deranged Burton touches, like the all-singing, all-melting puppets that herald Wonka's arrival, but it's also a grand and transporting celebration of the primal pleasures of childhood namely, family and candy. As Wonka gives five children, who have all found his Golden Tickets, a tour of his famous factory, with its edible garden and chocolate waterfall, its kooky sci-fi chambers for testing out revolutionary new delights, he makes no secret of the fact that with the possible exception of Charlie (Freddie Highmore), a modest English lad as gracious as he is poor, he despises them all. He has good reason: The other children are brats, pigs, rich little bullies of entitlement. Burton gives us acidly funny new versions of the spoiled-rotten monsters you may remember from the 1971 Willy Wonka & the Chocolate Factory big babies like the German porker Augustus Gloop (Philip Wiegratz), the spiteful princess Veruca Salt (Julia Winter), and the television (now videogame) sociopath Mike Teavee (Jordan Fry). If anything, they seem timelier now, in an era when so many kids do get everything they want. As Wonka vents his disdain, though, it's still a comic shock to see an adult interact with children as if they were something he'd prefer to be roasting on a spit.
Charlie and the Chocolate Factory revives, in a sassier but more artful way, the pixilated whimsy of Willy Wonka & the Chocolate Factory. The earlier film was driven, of course, by the creepy cuddliness of Gene Wilder the smile of cozy dimpled warmth giving way to hysteria, then snapping back. Burton and Depp push Wonka further, making him into a sinister enigma, and in flashbacks to his childhood we see how he got that way: His father (Christopher Lee), a dentist, treated candy like poison and forced the boy to wear a torture chamber of a head brace. If that all sounds a bit Freudian, what it does is turn the entire film into a fairy-tale meditation on our relationship to candy: why it's wrong to love it too little, or too much.
As the children are vanquished, one by one, from the chocolate factory, each done in by greedy overindulgence, Burton makes the factory a place of blooming danger and wonder. The army of live squirrels shelling walnuts, the sight of Violet blowing up into a blueberry these are indelible Burton images. The director also has a blast reinventing Wonka's army of pint-size assistants, the Oompa-Loompas. All of them are played, with digital replication, by Deep Roy, who looks like the deadpan maître d' of an Indian restaurant, and they appear in songs of various styles and eras (Esther Williams, psychedelic rock), scored with catchy deviltry by Danny Elfman. Those Oompa-Loompas are the beat, and soul, of Burton's finest movie since Ed Wood: a madhouse kiddie musical with a sweet-and-sour heart.