Bug 786163 - sort out name calculation for HTML input buttons, r=tbsaunde