Chinese lawmakers passed new food-safety legislation meant to tighten supervision of manufacturers and impose tougher penalties on those who make bad products as the government seeks to restore public confidence after a spate of problems with tainted food.