[HtmlUnit] [htmlunit:bugs] #1982 DomNodeIterator traverses Uncles of root

RBRi via HtmlUnit-develop <[email protected]> Thu, 09 Aug 2018 19:45:44 -0000
Newsgroups gmane.comp.java.htmlunit.devel
Message-ID </p/htmlunit/bugs/1982/3a71981800bd298950b86515ac202dbb09d5c055.bugs@htmlunit.p.sourceforge.net>
Fixed in SVN, thanks for the report.


---

** [bugs:#1982] DomNodeIterator traverses Uncles of root**

**Status:** accepted
**Group:** 2.32
**Created:** Thu Aug 09, 2018 04:42 AM UTC by Steve Harney
**Last Updated:** Thu Aug 09, 2018 06:39 PM UTC
**Owner:** RBRi
**Attachments:**

- [DocumentTraversalBug.java](https://sourceforge.net/p/htmlunit/bugs/1982/attachment/DocumentTraversalBug.java) (2.4 kB; application/octet-stream)


I have been working with a wrapper around htmlunit ( 2.32) it appears that the Document traversal is failng to stop at the root node during its back tracking.  there appears to be no check to see if the 

I have attached an example.  in this example i am searching a table from the td id='11' . 

I suspect the issue is in th DomeNodeIterator.getFirstUncle,   i *believe* this 
        final DomNode parent = node.getParentNode();
        if (parent == null) {
            return null;
        }
        
        should read
        
        final DomNode parent = node.getParentNode();
        if (parent == null || parent == root) {
            return null;
        }

Steve



---

Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
HtmlUnit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop