W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2010

[whatwg] Allowing ">" in attribute values

From: Lachln Hunt <lachlan.hunt@lachy.id.au>
Date: Fri, 25 Jun 2010 14:18:22 +0200
Message-ID: <4C249E8E.9050600@lachy.id.au>
On 2010-06-25 11:46, Skrol29 wrote:
> A agree disallowing ">" chars in attributes greatly simplifies parsing. Not
> only with regular expressions, but any parsing.
> If ">" are allowed, it means that in order to found the end of the element
> you do have to read all attributes before. This is very costy. Just an
> example but they are many others:  let's image you'd like to convert an HTML
> document into flat text. To simplify you're algorithm you've chosen  to
> retrieve the content of the<body>  element and then to delete all elements
> in it. This is very fast if ">" are not allowed in attributes because you're
> able found elements bounds just by searching "<" and then">".  But if">"
> are allowed, the operation gets much more complicated, and you spend much
> more time to scan all elements.

You seem to be conflating document conformance requirements with parsing 
requirements.  Even if '>' was disallowed in attribute values for 
document conformance, parsers would still be required to handle it if it 
were present.  If your parser doesn't handle it because it just assumes 
that '>' is the end of the tag name, then your paser is broken. Changing 
the parsing requirements such that '>' is treated as the end of a tag, 
in places where it's currently treated as part of an attribute value, 
would break backwards compatibility.

Lachlan Hunt - Opera Software
Received on Friday, 25 June 2010 05:18:22 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:24 UTC