Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8065562

org.w3c.dom.Node.getChildNodes() returns incorrect NodeList

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Incomplete
    • Affects Version/s: 8u25
    • Fix Version/s: None
    • Component/s: xml
    • Labels:

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_20"
      Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
      Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Darwin dwu.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Using Firefox Firebug to get page DOM

      A DESCRIPTION OF THE PROBLEM :
      org.w3c.dom.Node.getChildNodes() returns incorrect childnodes. For certain pages, it will return a list that contains nodes that are not direct children of a node. This also happens when a page specifies a div in the header.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Go to pinterest.com/<your user>/<any board>
      getChildNodes for the body Node
      See that div (class=inputWrapper) is counted as a child of body (in Firefox)

      Go to plnkr.co/edit/
      Get the Node for the html tag
      getChildNodes() for this Node
      See that the div in the header is counted as a div for the body

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      getChildNodes for body for pinterest.com/<your user>/<any board> returns 9 divs
      ACTUAL -
      getChildNodes for body for pinterest.com/<your user>/<any board> returns 11 divs because the divs (class = "inputWrapper") are counted, even though they are not direct children of body

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Activity

            People

            Assignee:
            joehw Joe Wang
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: