Bug 743632 - Fix nsHTMLEditor::GetNextHTMLSibling to return the correct node; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 09 Apr 2012 12:46:28 -0400
changeset 94584 6f73c94b04eab5f1dcd8dde4920313db70f34a4e
parent 94583 0edeaa911e1c41a4358217d2588bc120c7ac2391
child 94585 9095ac6a0f0196eac8dc877f977797e6ae36b73a
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs743632
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 743632 - Fix nsHTMLEditor::GetNextHTMLSibling to return the correct node; r=roc
editor/libeditor/html/nsHTMLEditor.cpp
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -4299,27 +4299,27 @@ nsHTMLEditor::GetNextHTMLSibling(nsIDOMN
 //                   takes a parent/offset instead of a node.
 //                       
 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);
+  nsCOMPtr<nsIDOMNode> node = nsEditor::GetChildAt(inParent, inOffset + 1);
   if (!node) {
     // return null sibling if no sibling
     return NS_OK;
   }
   if (node && IsEditable(node)) {
     *outNode = node;
     return res;
   }
   // else
-  return GetPriorHTMLSibling(node, outNode);
+  return GetNextHTMLSibling(node, outNode);
 }
 
 
 
 ///////////////////////////////////////////////////////////////////////////
 // GetPriorHTMLNode: returns the previous editable leaf node, if there is
 //                   one within the <body>
 //