This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21940 - [HTML] editorial: handling attributes with the same name
Summary: [HTML] editorial: handling attributes with the same name
Status: CLOSED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-06 19:28 UTC by Michael Dyck
Modified: 2013-07-15 22:46 UTC (History)
2 users (show)

See Also:


Attachments

Description Michael Dyck 2013-05-06 19:28:21 UTC
In 12.2.4.35 "Attribute name state",
the final paragraph says:
    When the user agent leaves the attribute name state (and before emitting
    the tag token, if appropriate), the complete attribute's name must be
    compared to the other attributes on the same token; if there is already an
    attribute on the token with the exact same name, then this is a parse error
    and the new attribute must be dropped, along with the value that gets
    associated with it (if any).

I realize that this is the earliest point at which to detect this error, and
also the most convenient point at which to say how it's handled. The problem
is that, at this point, a user agent can't fully handle the error, because
the value to be dropped (if any) hasn't been collected yet.

Presumably, the user agent, if it doesn't abort processing, must continue to
run the tokenizer through its states, which will generally append characters
to "the current attribute's value", where "the current attribute" must be
interpreted as referring to the attribute that's (supposedly) already been
dropped.

To clarify things, perhaps change:
    the new attribute must be dropped, along with the value that gets
    associated with it (if any)
to:
    the new attribute must be dropped as soon as its value is complete
or:
    ... as soon as characters can no longer be appended to its value

(Of course, you could identify the points in the state machine where this
occurs, but there's rather a lot of them. You could reduce them drastically
by introducing an "after attribute value" state and redirecting most
attribute-ending transitions through it. [In fact, "after attribute value (quoted) state" could do the job just by deleting "(quoted)".] Then you could
say, okay *this* state is where you drop a same-name attribute. But I suspect
that's more change than this issue is worth.)
Comment 1 Ian 'Hixie' Hickson 2013-06-07 21:44:38 UTC
I don't think it's a problem to drop something but have that thing remain the current thing. I've tried to clarify it, though.
Comment 2 contributor 2013-06-07 21:44:55 UTC
Checked in as WHATWG revision r7936.
Check-in comment: Clarification.
http://html5.org/tools/web-apps-tracker?from=7935&to=7936