开发者

Google Chrome parse error on closing form tag

开发者 https://www.devze.com 2023-02-14 10:15 出处:网络
I get a HTML parse error (recovered gracefully) warning on my console whenever I have a form with a closing tag.

I get a HTML parse error (recovered gracefully) warning on my console whenever I have a form with a closing tag.

So this gives a parsing error:

 <body>
    <form>
      ...some_form_fields
    </form>
  </body>

While this doesnt:

 <body>
    <form>
      ...some_form_fields
  </body>

This seems very weird. I checked the HTML 5 specs and there's nothing about closing form tags being forbidden. In fact, they are required.

I am using HTML 5 doctype. Google Chrome 11.

UPDATE开发者_Go百科: I tested using this very bare HTML and it still gives the warning

<!DOCTYPE html>

<html>
  <head>
  </head>

  <body>
    <form>
    </form>
  </body>

</html>


You're not doing anything (relevant) wrong.

See this bug report: http://code.google.com/p/chromium/issues/detail?id=73703

The test case in the issue is almost identical to yours:

<!DOCTYPE html>
<html>
<head>
<title>test</title>
<meta charset="utf-8">
</head>
<body>
<form>
</form>
</body>
</html>

And this: http://trac.webkit.org/changeset/79816

This patch removes parse error messages from the HTML parser. These messages are displayed at the wrong times, aren't tested, and aren't helpful. We'll try again with some more informative messages and better testing.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号