We were incorrectly assuming that setAttribute() could never fail here, even when passed an invalid name. Found by Domato. (cherry picked from commit 093f1dd805f699801079f55d0d490d80b463ccbb)