Bug 125082 - use GetChildren in inDOMUtils and inDeepTreeWalker to get native anonymous content, too. r=roc

This commit is contained in:
Gijs Kruitbosch 2013-04-14 11:47:31 -07:00
Родитель eeb5fc7207
Коммит 9328549062
2 изменённых файлов: 8 добавлений и 21 удалений

Просмотреть файл

@ -132,14 +132,7 @@ inDOMUtils::GetChildrenForNode(nsIDOMNode* aNode,
if (aShowingAnonymousContent) {
nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
if (content) {
nsRefPtr<nsBindingManager> bindingManager =
inLayoutUtils::GetBindingManagerFor(aNode);
if (bindingManager) {
bindingManager->GetAnonymousNodesFor(content, getter_AddRefs(kids));
if (!kids) {
bindingManager->GetContentListFor(content, getter_AddRefs(kids));
}
}
kids = content->GetChildren(nsIContent::eAllChildren);
}
}

Просмотреть файл

@ -337,19 +337,13 @@ inDeepTreeWalker::PushNode(nsIDOMNode* aNode)
}
if (!kids) {
if (mShowAnonymousContent) {
nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
nsRefPtr<nsBindingManager> bindingManager;
if (content &&
(bindingManager = inLayoutUtils::GetBindingManagerFor(aNode))) {
bindingManager->GetAnonymousNodesFor(content, getter_AddRefs(kids));
if (!kids)
bindingManager->GetContentListFor(content, getter_AddRefs(kids));
} else {
aNode->GetChildNodes(getter_AddRefs(kids));
}
} else
aNode->GetChildNodes(getter_AddRefs(kids));
nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
if (content && mShowAnonymousContent) {
kids = content->GetChildren(nsIContent::eAllChildren);
}
}
if (!kids) {
aNode->GetChildNodes(getter_AddRefs(kids));
}
item.kids = kids;