Menu

#15 Body element should be added if missing

closed-fixed
5
2009-02-09
2008-02-20
Anonymous
No

The following HTML document should be given an empty body element (I'm using square brackets instead of angled brackets, just to make sure it doesn't get mangled):

[html]
[head]
[title]Test[/title]
[/head]
[/html]

I believe a body element is already inserted correctly if there's trailing content between the end of the head section and the end of the html. However, the case where there is no content between the end of the head section and the end of the html is not being handled correctly.

Discussion

  • Benjamin McCann

    Benjamin McCann - 2008-02-24

    Logged In: YES
    user_id=2018412
    Originator: NO

    HTMLParser.addBodyToPageIfNecessary is a private method which is never called. It seems to me as if though it can simply be deleted.

     
  • Marc Guillemot

    Marc Guillemot - 2008-07-22

    Logged In: YES
    user_id=402164
    Originator: NO

    HTMLParser.addBodyToPageIfNecessary concerns HtmlUnit, not NekoHTML, and it is called!

    Nervertheless, this is correct, NekoHTML should add <head> and <body> automatically when missing.

     
  • Marc Guillemot

    Marc Guillemot - 2009-02-09

    Now fixed in SVN. In fact both HEAD and BODY should be added if missing.

     
  • Marc Guillemot

    Marc Guillemot - 2009-02-09
    • assigned_to: nobody --> mguillem
    • status: open --> closed-fixed
     

Log in to post a comment.