Menu

#473 Exception with script tag that uses html comments

closed
None
5
2012-10-21
2007-05-08
No

HtmlUnit can't handle the case where a starting
html comment exists in a script tag, but not the
ending one. For instance:

<script>

Discussion

  • Marc Guillemot

    Marc Guillemot - 2007-05-21

    Logged In: YES
    user_id=402164
    Originator: NO

    in your example xxx is ignored by a "normal" browser. Correct?

     
  • Ahmed Ashour

    Ahmed Ashour - 2007-05-21

    Logged In: YES
    user_id=950730
    Originator: NO

    xxx is ignored in browsers becuase it is the first line in comment, subsequent lines won't be ignored.

    Note also that HtmlUniti doesn't parse correct comments, because of the issue raised for EventTest#testCommentInEventHandlerDeclaration because of 'non-normalized' values during parsing.

     
  • Marc Guillemot

    Marc Guillemot - 2007-05-21

    Logged In: YES
    user_id=402164
    Originator: NO

    htmlunit already behaves correctly when script contains multiple lines. Here the problem seems just to be with an useless script with a single line starting by a comment.

     
  • Ahmed Ashour

    Ahmed Ashour - 2007-05-21

    Logged In: YES
    user_id=950730
    Originator: NO

    Sorry, you are right about correct handling of comments inside <script>.

    Will fix this 'incorrectness' handling soon.

     
  • Marc Guillemot

    Marc Guillemot - 2007-05-21

    Logged In: YES
    user_id=402164
    Originator: NO

    Now fixed in SVN.

     
  • Andre Soereng

    Andre Soereng - 2007-05-21

    Logged In: YES
    user_id=1400162
    Originator: YES

    Almost :)

    My first case above still fails: <script><!-- </script>

     
  • Marc Guillemot

    Marc Guillemot - 2007-05-21

    Logged In: YES
    user_id=402164
    Originator: NO

    Case now unit tested and fixed too. Thanks.

     

Log in to post a comment.