Open Bug 480184 Opened 12 years ago Updated 12 years ago

Editor undo for whole content replacement should restore selection range

Categories

(Core :: DOM: Editor, enhancement)

enhancement
Not set
normal

Tracking

()

UNCONFIRMED

People

(Reporter: yurivkhan, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009020911 Ubuntu/8.10 (intrepid) Firefox/3.0.6
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009020911 Ubuntu/8.10 (intrepid) Firefox/3.0.6

If a script replaces the whole content of a textarea, this is recorded in the undo stack. When this change is undone, the whole content is selected, no matter what the selection was before the script did its change.

Reproducible: Always

Steps to Reproduce:
1. Open attached test file.
2. Type 'abcdef' into the textarea.
3. Select 'cd'.
4. Press Ctrl+9. (The selected characters are enclosed in parentheses: 'ab(cd)ef'.)
5. Invoke the Undo function.
Actual Results:  
The textarea content is restored to 'abcdef', the way it was before step 4.
The whole content is selected.

Expected Results:  
The textarea content is restored to 'abcdef', the way it was before step 4.
The letters 'cd' are selected, the way it was before step 4.
You need to log in before you can comment on or make changes to this bug.