Closed Bug 752304 Opened 12 years ago Closed 12 years ago

Logic error in nsHTMLEditor::SetInlinePropertyOnNodeImpl

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: ayg, Assigned: ayg)

References

Details

Attachments

(1 file)

if (nextNode && nextNode->Tag() == aProperty &&
        HasAttrVal(nextNode, aAttribute, *aValue) &&
        IsOnlyAttribute(priorNode, *aAttribute)) {
      // following sib is already right kind of inline node; slide this over into it
      return MoveNode(aNode->AsDOMNode(), nextNode->AsDOMNode(), 0);
    }

Do you spot the bug?  It says "priorNode" instead of "nextNode" on the IsOnlyAttribute line.  Ms2ger's use of MOZ_ASSERT in bug 750079 part a is hit by my editing tests because of this.  Yay for catching bugs via fast failure in comprehensive test suites!
Attached patch Patch v1Splinter Review
This will be tested by bug 751842, so I didn't add a separate test.
Attachment #621401 - Flags: review?(ehsan)
Flags: in-testsuite+
Attachment #621401 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/mozilla-central/rev/622145252703
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: