W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2007

[whatwg] Parsing: < in unquoted attribute values

From: Simon Pieters <zcorpan@gmail.com>
Date: Wed, 25 Apr 2007 00:03:40 +0200
Message-ID: <op.tra58eun7a8kvn@hp-a0a83fcd39d2>
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
Received on Tuesday, 24 April 2007 15:03:40 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:54 UTC