Bug 752304 - Logic error in nsHTMLEditor::SetInlinePropertyOnNodeImpl; r=ehsan
authorAryeh Gregor <ayg@aryeh.name>
Mon, 07 May 2012 08:54:54 +0300
changeset 95749 622145252703ce32fd9809945f8ee02644df5cc4
parent 95748 8396c8f870d353e0a2d554a38ff2e7f7f8b273ec
child 95750 9212a3b98a660865e5c4d73c4a52e7c98fc3b36d
push id1439
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 20:19:22 +0000
treeherdermozilla-aurora@ea74834dccd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs752304
milestone15.0a1
Bug 752304 - Logic error in nsHTMLEditor::SetInlinePropertyOnNodeImpl; r=ehsan
editor/libeditor/html/nsHTMLEditorStyle.cpp
--- a/editor/libeditor/html/nsHTMLEditorStyle.cpp
+++ b/editor/libeditor/html/nsHTMLEditorStyle.cpp
@@ -452,17 +452,17 @@ nsHTMLEditor::SetInlinePropertyOnNodeImp
         IsOnlyAttribute(priorNode, *aAttribute)) {
       // previous sib is already right kind of inline node; slide this over into it
       return MoveNode(aNode->AsDOMNode(), priorNode->AsDOMNode(), -1);
     }
 
     nsIContent* nextNode = GetNextHTMLSibling(aNode);
     if (nextNode && nextNode->Tag() == aProperty &&
         HasAttrVal(nextNode, aAttribute, *aValue) &&
-        IsOnlyAttribute(priorNode, *aAttribute)) {
+        IsOnlyAttribute(nextNode, *aAttribute)) {
       // following sib is already right kind of inline node; slide this over into it
       return MoveNode(aNode->AsDOMNode(), nextNode->AsDOMNode(), 0);
     }
   }
 
   // ok, chuck it in its very own container
   nsCOMPtr<nsIDOMNode> tmp;
   return InsertContainerAbove(aNode->AsDOMNode(), address_of(tmp), tag,