Logo Search packages:      
Sourcecode: xulrunner version File versions  Download package

PRBool nsContentList::MatchSelf ( nsIContent aContent  )  [protected]

Match recursively. See if anything in the subtree rooted at aContent matches our criterion.

Parameters:
aContent the root of the subtree to match against
Returns:
whether we match something in the tree rooted at aContent

Definition at line 682 of file nsContentList.cpp.

References nsINode::GetChildAt(), nsINode::GetChildCount(), nsINode::GetNodeParent(), Match(), and mDeep.

{
  NS_PRECONDITION(aContent, "Can't match null stuff, you know");
  NS_PRECONDITION(mDeep || aContent->GetNodeParent() == mRootNode,
                  "MatchSelf called on a node that we can't possibly match");
  
  if (Match(aContent))
    return PR_TRUE;

  if (!mDeep)
    return PR_FALSE;

  PRUint32 i, count = aContent->GetChildCount();

  for (i = 0; i < count; i++) {
    if (MatchSelf(aContent->GetChildAt(i))) {
      return PR_TRUE;
    }
  }
  
  return PR_FALSE;
}


Generated by  Doxygen 1.6.0   Back to index