Use IsContentOfType instead of nsIDOMNode::type to check for an element. Bug
237213, r+sr=jst git-svn-id: svn://10.0.0.236/trunk@154740 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -647,20 +647,12 @@ nsContentList::Match(nsIContent *aContent)
|
||||
return PR_FALSE;
|
||||
|
||||
if (mMatchAtom) {
|
||||
if (!aContent->IsContentOfType(nsIContent::eELEMENT)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsINodeInfo *ni = aContent->GetNodeInfo();
|
||||
if (!ni)
|
||||
return PR_FALSE;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(aContent));
|
||||
|
||||
if (!node)
|
||||
return PR_FALSE;
|
||||
|
||||
PRUint16 type;
|
||||
node->GetNodeType(&type);
|
||||
|
||||
if (type != nsIDOMNode::ELEMENT_NODE)
|
||||
return PR_FALSE;
|
||||
NS_ASSERTION(ni, "Element without nodeinfo!");
|
||||
|
||||
if (mMatchNameSpaceId == kNameSpaceID_Unknown) {
|
||||
return (mMatchAll || ni->Equals(mMatchAtom));
|
||||
@@ -760,7 +752,7 @@ nsContentList::PopulateWithStartingAfter(nsIContent *aStartRoot,
|
||||
if (aStartRoot == mRootContent)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIContent> parent = aStartRoot->GetParent();
|
||||
nsIContent* parent = aStartRoot->GetParent();
|
||||
|
||||
if (parent)
|
||||
PopulateWithStartingAfter(parent, aStartRoot, aElementsToAppend);
|
||||
|
||||
Reference in New Issue
Block a user