add handling of autofocus attribute. fixes #837