Menu

#1423 Tag balancer produces incorrect DOM

Latest SVN
closed
nobody
NekoHTML (24)
5
2016-04-02
2012-07-31
No

Hi team,

I've encountered another issue regarding the tag balancing in HtmlUnit.

Given the sample HTML:

<ul>
  <var data="fooBar">
    <a href="#">A sample link</a>
    <div>and a block</div>
    <li>Sample list item</li>
  </var>
</ul>

The tag balancer used in HtmlUnit (NekoHTML) produces:

<ul>
  <var data="fooBar">
    <a href="#">A sample link</a>
    <div>and a block</div>
  </var>
  <li>
    <var data="fooBar">
      Sample list item
    </var>
   </li>
</ul>

This behavior is not consistent as the <div>, a block-level element, is allowed but the <li> is not, although it is just another block-level element.
Furthermore, modern browsers, at least FF 4, leave the structure intact.

Discussion

  • Hartmut Arlt

    Hartmut Arlt - 2012-07-31

    Junit testcase

     
  • Hartmut Arlt

    Hartmut Arlt - 2012-07-31

    HTML resource file used by JUnit test

     
  • RBRi

    RBRi - 2012-07-31

    Hi Hartmut,

    will have a look at this during the next days. But don't expect a fix for this week. We already have some patches for NekoHtml in the queue, but Marcs time is really limited at the moment.
    So please be patient.

    Thanks for pointing this out and as usual thanks for the testcase.

    RBRi
    
     
  • RBRi

    RBRi - 2012-11-03
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -3,6 +3,8 @@
     I've encountered another issue regarding the tag balancing in HtmlUnit.
    
     Given the sample HTML:
    +
    +~~~~~~
     <ul>
       <var data="fooBar">
         <a href="#">A sample link</a>
    @@ -10,8 +12,11 @@
         <li>Sample list item</li>
       </var>
     </ul>
    +~~~~~~
    
     The tag balancer used in HtmlUnit (NekoHTML) produces:
    +
    +~~~~~~
     <ul>
       <var data="fooBar">
         <a href="#">A sample link</a>
    @@ -23,6 +28,7 @@
         </var>
        </li>
     </ul>
    +~~~~~~
    
    -This behavior is not consistent as the <div>, a block-level element, is allowed but the <li> is not, although it is just another block-level element.
    +This behavior is not consistent as the &lt;div>, a block-level element, is allowed but the &lt;li> is not, although it is just another block-level element.
     Furthermore, modern browsers, at least FF 4, leave the structure intact.
    
     
  • Mark H. Butler

    Mark H. Butler - 2013-08-23

    I am seeing this bug as well. It may be a duplicate of https://sourceforge.net/p/htmlunit/bugs/1046/

     
  • RBRi

    RBRi - 2015-10-31
    • assigned_to: RBRi --> nobody
     
  • RBRi

    RBRi - 2016-04-02

    Ok, this seems to be fixed at least with our own neko fork.
    Tescase added.

     
  • RBRi

    RBRi - 2016-04-02
    • status: open --> closed
     

Log in to post a comment.