I wasted ages because this works in Firefox 5 and Opera 11, but not WebKit. Turns out that <map id="foo"> works in those browsers but not WebKit. <map name="foo"> is the correct way to do it.