[Webkit-unassigned] [Bug 19933] New: nodeIterator with filter fails on documents not in a frame

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 7 13:17:11 PDT 2008


           Summary: nodeIterator with filter fails on documents not in a
           Product: WebKit
           Version: 526+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: simon.fraser at apple.com

I'm trying to use node iterators on an XML document fetched via XMLHttpRequest,
like this:

function subElementWithNodeName(inElement, inName)
  var upperName = inName.toUpperCase();
  var iter = document.createNodeIterator(inElement, NodeFilter.SHOW_ELEMENT,
  var curNode;
  while (curNode = iter.nextNode())
    if (curNode.nodeName.toUpperCase() == upperName)
      return curNode;
  return null;

However, iter.nextNode() always returns null right away, without giving back
child elements of 'inElement' (which do exist).

Some debugging reveals this:

short JSNodeFilterCondition::acceptNode(Node* filterNode, JSValue*& exception)
    // FIXME: It makes no sense for this to depend on the document being in a
    Frame* frame = filterNode->document()->frame();
    if (!frame)
        return NodeFilter::FILTER_REJECT;


which is where it fails.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list