Backed out changeset 90d627f2471e (bug 564979) because it broke mochitests.

This commit is contained in:
Boris Zbarsky 2010-05-17 14:59:49 -04:00
Родитель 3bf9b562d1
Коммит 1039a51c26
4 изменённых файлов: 16 добавлений и 9 удалений

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

@ -922,6 +922,15 @@ public:
nsIContent* GetSelectionRootContent(nsIPresShell* aPresShell);
virtual nsINodeList* GetChildNodesList();
nsIContent* GetSibling(PRInt32 aOffset)
{
nsINode *parent = GetNodeParent();
if (!parent) {
return nsnull;
}
return parent->GetChildAt(parent->IndexOf(this) + aOffset);
}
nsIContent* GetFirstChild() const { return mFirstChild; }
nsIContent* GetLastChild() const
{

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

@ -514,7 +514,7 @@ nsINode::GetPreviousSibling(nsIDOMNode** aPrevSibling)
{
*aPrevSibling = nsnull;
nsIContent *sibling = GetPreviousSibling();
nsIContent *sibling = GetSibling(-1);
return sibling ? CallQueryInterface(sibling, aPrevSibling) : NS_OK;
}
@ -524,7 +524,7 @@ nsINode::GetNextSibling(nsIDOMNode** aNextSibling)
{
*aNextSibling = nsnull;
nsIContent *sibling = GetNextSibling();
nsIContent *sibling = GetSibling(1);
return sibling ? CallQueryInterface(sibling, aNextSibling) : NS_OK;
}

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

@ -134,7 +134,6 @@ typedef void (* OnLeaveNodeFunPtr)(nsIDOMNode* aNode, void* aClosure);
// Find the next node in the DOM tree in preorder. This isn't fast because
// one call to GetNextSibling can be O(N) in the number of siblings...
// Calls OnLeaveNodeFunPtr when the traversal leaves a node
// XXXbz if this used nsINode, this would be trivial
static nsIDOMNode*
FindNextNode(nsIDOMNode* aNode, nsIDOMNode* aRoot,
OnLeaveNodeFunPtr aOnLeaveNode = nsnull, void* aClosure = nsnull)
@ -189,8 +188,7 @@ FindNextTextNode(nsIDOMNode* aNode, PRInt32 aOffset, nsIDOMNode* aRoot)
} else {
// aOffset was beyond the end of the child list.
// goto next node in a preorder DOM traversal.
// XXXbz this is generally reimplementing GetNextNode.
nsINode* next = node->GetNextSibling();
nsINode* next = node->GetSibling(1);
if (!next) {
nsCOMPtr<nsINode> root = do_QueryInterface(aRoot);
while (!next) {
@ -200,7 +198,7 @@ FindNextTextNode(nsIDOMNode* aNode, PRInt32 aOffset, nsIDOMNode* aRoot)
return nsnull;
}
node = next;
next = node->GetNextSibling();
next = node->GetSibling(1);
}
}
checkNode = do_QueryInterface(next);

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

@ -565,12 +565,12 @@ CUSTOM_QS_TN = {
customMethodCalls = {
'nsIDOMNode_GetNextSibling': {
'thisType': 'nsINode',
'code': ' nsINode *result = self->GetNextSibling();',
'code': ' nsINode *result = self->GetSibling(1);',
'canFail': False
},
'nsIDOMNode_GetFirstChild': {
'thisType': 'nsINode',
'code': ' nsINode *result = self->GetFirstChild();',
'code': ' nsINode *result = self->GetChildAt(0);',
'canFail': False
},
'nsIDOMNode_GetChildNodes': {
@ -579,7 +579,7 @@ customMethodCalls = {
},
'nsIDOMNode_GetPreviousSibling': {
'thisType': 'nsINode',
'code': ' nsINode *result = self->GetPreviousSibling();',
'code': ' nsINode *result = self->GetSibling(-1);',
'canFail': False
},
'nsIDOMNode_GetLastChild': {