Closed Bug 359121 Opened 18 years ago Closed 18 years ago

First enter-press is ignored in midas

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: sicking, Assigned: sicking)

References

Details

(Keywords: regression)

Attachments

(1 file)

Steps to reproduce:

1. Go to http://www.mozilla.org/editor/midasdemo/
2. Focus the editable area and press 'enter' three times
3. Check the 'View HTML Source' checkbox
4. Click far right in the editable area
5. Press 'enter'

Expected result:
The cursor should move to the next line

Actual result:
Nothing happens. Pressing enter once more does move the cursor though.


This is a regression from bug 358073 and possibly from bug 357445 as well.
Attached patch Patch to fixSplinter Review
Assignee: traversal-range → bugmail
Status: NEW → ASSIGNED
Attachment #244378 - Flags: superreview?(jst)
Attachment #244378 - Flags: review?(jst)
So the problem was that the old nSDetach and Detach weren't exactly the same as I thought in bug 358073. nSDetach didn't actually set the mIsDetached flag, so the range could be reattached to a document. I added nsIRange::Reset to do the same thing.

The change to nsHTMLEditRules::UpdateDocChangeRange is due to that CompareBoundaryPoints now throws if called on an uninitialized range. Not sure if it's technically needed for this bug, but it's the right thing to do. I added the following comment:

  // This will happen is mDocChangeRange is non-null, but the range is
  // uninitialized. In this case we'll set the start to aRange start.
  // The same test won't be needed further down since after we've set
  // the start the range will be collapsed to that point.
Comment on attachment 244378 [details] [diff] [review]
Patch to fix

r+sr=jst
Attachment #244378 - Flags: superreview?(jst)
Attachment #244378 - Flags: superreview+
Attachment #244378 - Flags: review?(jst)
Attachment #244378 - Flags: review+
Checked in, thanks for the quick review
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
This seems to be fixed for me using build 2006-11-03-06 of SeaMonkey trunk under Windows XP with the Midas demo at http://www.mozilla.org/editor/midasdemo/, following the steps to reproduce in comment 0.
Status: RESOLVED → VERIFIED
Component: DOM: Traversal-Range → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.