mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 744507 - Part a: Preparatory cleanup in GetPriorHTMLSibling/GetNextHTMLSibling; r=ehsan
This commit is contained in:
parent
015f88e50e
commit
b8f9cbba39
@ -4245,16 +4245,15 @@ nsresult
|
||||
nsHTMLEditor::GetPriorHTMLSibling(nsIDOMNode *inParent, PRInt32 inOffset, nsCOMPtr<nsIDOMNode> *outNode)
|
||||
{
|
||||
NS_ENSURE_TRUE(outNode && inParent, NS_ERROR_NULL_POINTER);
|
||||
nsresult res = NS_OK;
|
||||
*outNode = nsnull;
|
||||
if (inOffset <= 0) {
|
||||
// return null sibling if at offset zero
|
||||
nsCOMPtr<nsIDOMNode> node = nsEditor::GetChildAt(inParent,inOffset-1);
|
||||
if (!node) {
|
||||
// return null sibling if no sibling
|
||||
return NS_OK;
|
||||
}
|
||||
nsCOMPtr<nsIDOMNode> node = nsEditor::GetChildAt(inParent,inOffset-1);
|
||||
if (node && IsEditable(node)) {
|
||||
if (IsEditable(node)) {
|
||||
*outNode = node;
|
||||
return res;
|
||||
return NS_OK;
|
||||
}
|
||||
// else
|
||||
return GetPriorHTMLSibling(node, outNode);
|
||||
@ -4302,16 +4301,15 @@ nsresult
|
||||
nsHTMLEditor::GetNextHTMLSibling(nsIDOMNode *inParent, PRInt32 inOffset, nsCOMPtr<nsIDOMNode> *outNode)
|
||||
{
|
||||
NS_ENSURE_TRUE(outNode && inParent, NS_ERROR_NULL_POINTER);
|
||||
nsresult res = NS_OK;
|
||||
*outNode = nsnull;
|
||||
nsCOMPtr<nsIDOMNode> node = nsEditor::GetChildAt(inParent, inOffset + 1);
|
||||
if (!node) {
|
||||
// return null sibling if no sibling
|
||||
return NS_OK;
|
||||
}
|
||||
if (node && IsEditable(node)) {
|
||||
if (IsEditable(node)) {
|
||||
*outNode = node;
|
||||
return res;
|
||||
return NS_OK;
|
||||
}
|
||||
// else
|
||||
return GetNextHTMLSibling(node, outNode);
|
||||
|
Loading…
Reference in New Issue
Block a user