<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>21940</bug_id>
          
          <creation_ts>2013-05-06 19:28:21 +0000</creation_ts>
          <short_desc>[HTML] editorial: handling attributes with the same name</short_desc>
          <delta_ts>2013-07-15 22:46:55 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Dyck">jmdyck</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>87279</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2013-05-06 19:28:21 +0000</bug_when>
    <thetext>In 12.2.4.35 &quot;Attribute name state&quot;,
the final paragraph says:
    When the user agent leaves the attribute name state (and before emitting
    the tag token, if appropriate), the complete attribute&apos;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&apos;s handled. The problem
is that, at this point, a user agent can&apos;t fully handle the error, because
the value to be dropped (if any) hasn&apos;t been collected yet.

Presumably, the user agent, if it doesn&apos;t abort processing, must continue to
run the tokenizer through its states, which will generally append characters
to &quot;the current attribute&apos;s value&quot;, where &quot;the current attribute&quot; must be
interpreted as referring to the attribute that&apos;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&apos;s rather a lot of them. You could reduce them drastically
by introducing an &quot;after attribute value&quot; state and redirecting most
attribute-ending transitions through it. [In fact, &quot;after attribute value (quoted) state&quot; could do the job just by deleting &quot;(quoted)&quot;.] Then you could
say, okay *this* state is where you drop a same-name attribute. But I suspect
that&apos;s more change than this issue is worth.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88921</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-06-07 21:44:38 +0000</bug_when>
    <thetext>I don&apos;t think it&apos;s a problem to drop something but have that thing remain the current thing. I&apos;ve tried to clarify it, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88922</commentid>
    <comment_count>2</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-06-07 21:44:55 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7936.
Check-in comment: Clarification.
http://html5.org/tools/web-apps-tracker?from=7935&amp;to=7936</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>