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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>55120</bug_id>
          
          <creation_ts>2011-02-24 00:45:13 -0800</creation_ts>
          <short_desc>&lt;input value=&quot;type=submit&quot;&gt; throws a warning (“HTML parse error”)</short_desc>
          <delta_ts>2022-08-06 07:46:16 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>OS X 10.6</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>data:text/html,&lt;form&gt;&lt;input value=&quot;type=submit&quot;&gt;&lt;/form&gt;</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mathias Bynens">mathias</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>eoconnor</cc>
    
    <cc>eric</cc>
    
    <cc>mathias</cc>
    
    <cc>priyajeet.hora</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>356733</commentid>
    <comment_count>0</comment_count>
    <who name="Mathias Bynens">mathias</who>
    <bug_when>2011-02-24 00:45:13 -0800</bug_when>
    <thetext>Open data:text/html,&lt;form&gt;&lt;input value=&quot;type=submit&quot;&gt;&lt;/form&gt; and open the Web Inspector Console. You’ll find that there’s a warning message: “HTML parse error (recovered gracefully)”.

There’s nothing wrong with this markup though, so it shouldn’t throw a warning.

This used to work fine. The latest stable Safari release, for example (version 5.0.3 / 6533.19.4) didn’t have this problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>356735</commentid>
    <comment_count>1</comment_count>
    <who name="Mathias Bynens">mathias</who>
    <bug_when>2011-02-24 00:49:33 -0800</bug_when>
    <thetext>Same goes for data:text/html,&lt;form&gt;&lt;input name=&quot;action|method|enctype&quot;&gt;&lt;/form&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357342</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-02-24 13:39:13 -0800</bug_when>
    <thetext>This document obviously isn&apos;t valid HTML, but I cannot tell what exactly the parser complains about. The warning printed to Web Inspector console is not helpful.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357383</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-24 14:11:40 -0800</bug_when>
    <thetext>Please feel free to remove the warnings.  I added them because folks complained about the warnings being missing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357423</commentid>
    <comment_count>4</comment_count>
    <who name="Mathias Bynens">mathias</who>
    <bug_when>2011-02-24 14:58:32 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; This document obviously isn&apos;t valid HTML, but I cannot tell what exactly the parser complains about. The warning printed to Web Inspector console is not helpful.

If you prefix them with &lt;!doctype html&gt;&lt;title&gt;&lt;/title&gt; both documents are perfectly valid.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357427</commentid>
    <comment_count>5</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-24 15:01:34 -0800</bug_when>
    <thetext>Surely you need &lt;html&gt;, &lt;head&gt;, and &lt;body&gt; tags somewhere.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357433</commentid>
    <comment_count>6</comment_count>
    <who name="Theresa O&apos;Connor">eoconnor</who>
    <bug_when>2011-02-24 15:09:18 -0800</bug_when>
    <thetext>Adam: no, Mathias is right; adding the doctype and &lt;title&gt; will do the trick. &lt;html&gt;, &lt;head&gt;, and &lt;body&gt; have optional start and end tags.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357442</commentid>
    <comment_count>7</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-24 15:14:06 -0800</bug_when>
    <thetext>Ah, ok.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357483</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-02-24 15:44:33 -0800</bug_when>
    <thetext>I think that there are two issues here:
1) What error does our parser think that it sees? No amount of boilerplate around this example seem to make the error go away.
2) The warning message should be improved or removed - it seems unlikely that it can help anyone in its current state (the only bit of information it has is a line number, which doesn&apos;t seem sufficient).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357487</commentid>
    <comment_count>9</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-24 15:46:46 -0800</bug_when>
    <thetext>&gt; 1) What error does our parser think that it sees? No amount of boilerplate around this example seem to make the error go away.

If you set a breakpoint in HTMLTreeBuilder::parseError, you&apos;ll see the stack that generates the message.  From the stack, you can look at the spec to see the instruction to emit a parse error.  That will let us diagnose whether the bug is in the spec or in the code.

&gt; 2) The warning message should be improved or removed - it seems unlikely that it can help anyone in its current state (the only bit of information it has is a line number, which doesn&apos;t seem sufficient).

I definitely agree.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357524</commentid>
    <comment_count>10</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-02-24 16:04:37 -0800</bug_when>
    <thetext>&gt; If you set a breakpoint in HTMLTreeBuilder::parseError, you&apos;ll see the stack that generates the message.

The stack is:

#0	0x1038072c3 in WebCore::HTMLTreeBuilder::parseError at HTMLTreeBuilder.cpp:2809
#1	0x103808345 in WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody at HTMLTreeBuilder.cpp:1563
#2	0x103811e93 in WebCore::HTMLTreeBuilder::processEndTagForInBody at HTMLTreeBuilder.cpp:1991
#3	0x10380eb79 in WebCore::HTMLTreeBuilder::processEndTag at HTMLTreeBuilder.cpp:2103
#4	0x10380e551 in WebCore::HTMLTreeBuilder::processToken at HTMLTreeBuilder.cpp:472
#5	0x103813108 in WebCore::HTMLTreeBuilder::constructTreeFromAtomicToken at HTMLTreeBuilder.cpp:450
#6	0x1038134a2 in WebCore::HTMLTreeBuilder::constructTreeFromToken at HTMLTreeBuilder.cpp:445
#7	0x103796c9e in WebCore::HTMLDocumentParser::pumpTokenizer at HTMLDocumentParser.cpp:269

The node in question is a &lt;body&gt;. It is not easy enough for me to read the spec to see if the code follows it here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357644</commentid>
    <comment_count>11</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-24 18:55:53 -0800</bug_when>
    <thetext>That code should match up with &lt;http://www.whatwg.org/specs/web-apps/current-work/#parsing-main-inbody&gt; under &quot;Any other end tag.&quot;  Specifically:

&quot;Otherwise, if node is in the special category, then this is a parse error; ignore the token, and abort these steps.&quot;

if (isSpecialNode(node)) {
    parseError(token);
    return;
}

From this list &lt;http://www.whatwg.org/specs/web-apps/current-work/#special&gt;, body is a special tag.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357645</commentid>
    <comment_count>12</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-24 18:56:31 -0800</bug_when>
    <thetext>The bug appears to be that we incorrect omit the &quot;Otherwise&quot; in the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357647</commentid>
    <comment_count>13</comment_count>
      <attachid>83760</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-24 19:00:20 -0800</bug_when>
    <thetext>Created attachment 83760
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357648</commentid>
    <comment_count>14</comment_count>
      <attachid>83760</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-24 19:02:25 -0800</bug_when>
    <thetext>Comment on attachment 83760
Patch

Nope.  That&apos;s not it.  There&apos;s no control flow from the previous if-block that reaches that line.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>358638</commentid>
    <comment_count>15</comment_count>
      <attachid>83965</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-26 22:13:29 -0800</bug_when>
    <thetext>Created attachment 83965
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>358639</commentid>
    <comment_count>16</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-26 22:14:09 -0800</bug_when>
    <thetext>These parse error messages aren&apos;t ready for prime time.  This patch just nukes them from obit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>358640</commentid>
    <comment_count>17</comment_count>
      <attachid>83965</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-02-26 22:33:44 -0800</bug_when>
    <thetext>Comment on attachment 83965
Patch

Someone recently posted a patch which plumbed all console messages up to the client.  That would make these testable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>358642</commentid>
    <comment_count>18</comment_count>
      <attachid>83965</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-26 22:53:37 -0800</bug_when>
    <thetext>Comment on attachment 83965
Patch

Clearing flags on attachment: 83965

Committed r79816: &lt;http://trac.webkit.org/changeset/79816&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1889378</commentid>
    <comment_count>19</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-06 07:45:05 -0700</bug_when>
    <thetext>This was landed as per Comment 18 and never backed-out, I checked by typing bug number in Webkit Github repo. I am going to mark this as &quot;RESOLVED FIXED&quot;, if I am incorrect, please mark it accordingly with updated comments. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1889379</commentid>
    <comment_count>20</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-08-06 07:46:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/98242250&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>83760</attachid>
            <date>2011-02-24 19:00:20 -0800</date>
            <delta_ts>2011-02-24 19:02:25 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-55120-20110224190019.patch</filename>
            <type>text/plain</type>
            <size>1456</size>
            <attacher name="Adam Barth">abarth</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDc5NjU3KQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTggQEAKKzIwMTEtMDItMjQgIEFkYW0gQmFy
dGggIDxhYmFydGhAd2Via2l0Lm9yZz4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9P
UFMhKS4KKworICAgICAgICA8aW5wdXQgdmFsdWU9InR5cGU9c3VibWl0Ij4gdGhyb3dzIGEgd2Fy
bmluZworICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NTUx
MjAKKworICAgICAgICBXZSdyZSBtaXNzaW5nIGFuICJvdGhlcndpc2UiIGluIHRoZSBzcGVjLCB3
aGljaCBtZWFucyB3ZSBvdXRwdXQgYW4KKyAgICAgICAgZXJyb3IgbWVzc2FnZSB0b28gb2Z0ZW4u
ICBUaGUgb25seSBjb25zZXF1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GVsc2UgaWYg
KGlzU3BlY2lhbE5vZGUobm9kZSkpIHsKICAgICAgICAgICAgIHBhcnNlRXJyb3IodG9rZW4pOwog
ICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>83965</attachid>
            <date>2011-02-26 22:13:29 -0800</date>
            <delta_ts>2011-02-26 22:53:37 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-55120-20110226221328.patch</filename>
            <type>text/plain</type>
            <size>1707</size>
            <attacher name="Adam Barth">abarth</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDc5ODE1KQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTggQEAKKzIwMTEtMDItMjYgIEFkYW0gQmFy
dGggIDxhYmFydGhAd2Via2l0Lm9yZz4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9P
UFMhKS4KKworICAgICAgICA8aW5wdXQgdmFsdWU9InR5cGU9c3VibWl0Ij4gdGhyb3dzIGEgd2Fy
bmluZyAo4oCcSFRNTCBwYXJzZSBlcnJvcuKAnSkKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtp
dC5vcmcvc2hvd19idWcuY2dpP2lkPTU1MTIwCisKKyAgICAgICAgVGhpcyBwYXRjaCByZW1vdmVz
IHBhcnNlIGVycm9yIG1lc3NhZ2VzIGZyb20gdGhlIEhUTUwgcGFyc2VyLiAgVGhlc2UKKyAgICAg
ICAgbWVzc2FnZXMgYXJlIGRpc3BsYXllZCBhdCB0aGUgd3Jvbmc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iAoIW1fcmVwb3J0RXJy
b3JzKQotICAgICAgICByZXR1cm47Ci0KLSAgICBET01XaW5kb3cqIGRvbVdpbmRvdyA9IG1fZG9j
dW1lbnQtPmRvbVdpbmRvdygpOwotICAgIGlmICghZG9tV2luZG93KQotICAgICAgICByZXR1cm47
Ci0KLSAgICBkb21XaW5kb3ctPmNvbnNvbGUoKS0+YWRkTWVzc2FnZShIVE1MTWVzc2FnZVNvdXJj
ZSwgTG9nTWVzc2FnZVR5cGUsIFdhcm5pbmdNZXNzYWdlTGV2ZWwsIHBhcnNlRXJyb3JNZXNzYWdl
LCBtX3BhcnNlci0+bGluZU51bWJlcigpLCBtX2RvY3VtZW50LT51cmwoKS5zdHJpbmcoKSk7CiB9
CiAKIGJvb2wgSFRNTFRyZWVCdWlsZGVyOjpzY3JpcHRFbmFibGVkKEZyYW1lKiBmcmFtZSkK
</data>

          </attachment>
      

    </bug>

</bugzilla>