[whatwg] Parsing: < in unquoted attribute values

Simon Pieters zcorpan at gmail.com
Tue Apr 24 15:03:40 PDT 2007

The parsing section says that < in an unquoted attribute value terminates  
the tag. However, according to my testing[1], IE7, Gecko, Opera and Webkit  
don't do this -- they append the < to the attribute value. So I think the  
parsing section is wrong here.

Relevant part of the spec:

    Attribute value (unquoted) state

        Consume the next input character:

        U+003C LESS-THAN SIGN (<)
            Parse error. Emit the current tag token. Reconsume the character
            in the data state.

s/U+003C LESS-THAN SIGN (<)//

Additionally, the syntax section says that authors are not allowed to use  
< in unquoted attribute values, which should probably be changed if the  
parsing section is changed.

Relevant part of the spec:

    Unquoted attribute value syntax

        The attribute name, followed by zero or more space characters,
        followed by a single U+003D EQUALS SIGN character, followed by zero
        or more space characters, followed by the attribute value, which, in
        addition to the requirements given above for attribute values, must
        not contain any literal space characters, U+003E GREATER-THAN SIGN
        (>) characters, or U+003C LESS-THAN SIGN (<) characters, and must
        not, furthermore, start with either a literal U+0022 QUOTATION MARK
        (") character or a literal U+0027 APOSTROPHE (') character.

s/, U+003E/, or U+003E/
s/, or U+003C LESS-THAN SIGN (<) characters//

[1] http://simon.html5.org/test/html/parsing/tokenisation/unquoted/

Simon Pieters

More information about the whatwg mailing list