code: function attribute_name_state(c) {
      switch(c) {
      case 0x0009: // CHARACTER TABULATION (tab)
      case 0x000A: // LINE FEED (LF)
      case 0x000C: // FORM FEED (FF)
      case 0x0020: // SPACE
      case 0x002F: // SOLIDUS
      case 0x003E: // GREATER-THAN SIGN
      case -1: // EOF
        reconsume(c, after_attribute_name_state);
        break;
      case 0x003D: // EQUALS SIGN
        tokenizer = before_attribute_value_state;
        break;
      case 0x0041:  // [A-Z]
      case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046:
      case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B:
      case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050:
      case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055:
      case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A:
        attrnamebuf += String.fromCharCode(c + 0x0020);
        break;
      case 0x0000: // NULL
        attrnamebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */);
        break;
      case 0x0022: // QUOTATION MARK
      case 0x0027: // APOSTROPHE
      case 0x003C: // LESS-THAN SIGN
        /* falls through */
      default:
        attrnamebuf += getMatchingChars(ATTRNAME);
        break;
      }
    }
docs: beginAttrName() must have been called before this point There is an active attribute in attrnamebuf (but not attrvaluebuf)