Opened 16 years ago
Closed 16 years ago
#3656 closed Bug (fixed)
CKEDITOR.dom.range::trim() is destroying text ranges.
Reported by: | Martin Kou | Owned by: | Martin Kou |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.0 |
Component: | General | Version: | SVN (CKEditor) - OLD |
Keywords: | Review+ | Cc: |
Description
To reproduce:
- Open replacebyclass.html.
- Run the following in Firebug console, or any browser console that allows JavaScript execution:
var p = CKEDITOR.dom.element.createFromHtml ('<p>abcdabcd</p>'); var range = new CKEDITOR.dom.range(); range.setStart(p.getFirst(), 2); range.setEnd(p.getFirst(), 6); console.log(range.collapsed); range.trim(); console.log(range.collapsed);
- range becomes collapsed after running trim() on a non-empty text range, this is wrong.
Attachments (2)
Change History (7)
Changed 16 years ago by
Attachment: | 3656.patch added |
---|
comment:1 Changed 16 years ago by
Keywords: | Review? added |
---|
comment:2 Changed 16 years ago by
Changed 16 years ago by
Attachment: | 3656_2.patch added |
---|
comment:4 Changed 16 years ago by
Keywords: | Review+ added; Review? removed |
---|
comment:5 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed with [3624].
Click here for more info about our SVN system.
This bug is caused by endContainer and endOffset being improperly updated after the first part of trim() changed this.endContainer and this.endOffset.