#4385 closed Bug (fixed)
CheckDirty is not returning the correct state
Reported by: | Senthil | Owned by: | Garry Yao |
---|---|---|---|
Priority: | Must have (possibly next milestone) | Milestone: | CKEditor 3.1 |
Component: | General | Version: | |
Keywords: | Oracle Confirmed Review+ | Cc: | Pranav, Senthil |
Description (last modified by )
When i set empty data to the editor using the setdata method, checkdirty is returing the wrong state. Please follow the below steps to see the issue.
- Open the attached "replacebycode.html" file in IE and click the checkdirty button, this will return the message as 'false'.
- Now refresh the page and focus the editor area using the mouse cursor and select the checkdirty button, now you will get a message as "true" eventhough we don't change anything inside the editor area.
Attachments (3)
Change History (12)
Changed 16 years ago by
Attachment: | replacebycode.html added |
---|
comment:1 Changed 16 years ago by
Priority: | Normal → High |
---|
comment:2 Changed 16 years ago by
Cc: | Pranav Senthil added; Pranav Senthil removed |
---|---|
Description: | modified (diff) |
Milestone: | CKEditor 3.x → CKEditor 3.1 |
Changed 16 years ago by
Attachment: | 4385.patch added |
---|
comment:3 Changed 16 years ago by
Keywords: | Confirmed Review? added |
---|---|
Owner: | set to Garry Yao |
Status: | new → assigned |
comment:4 Changed 16 years ago by
This's one opposite effect of our auto fixing functionality, where the editor's fixing on DOM structure were confusing the dirty checking mechanism, considering it's changes from the user, which is wrong, I've set up a defensive guard for any future auto fixing rules.
comment:5 Changed 16 years ago by
Keywords: | Review- added; Review? removed |
---|
The idea about restoring the dirty status is good. I'm only seeing a drawback in the proposed implementation: performance.
The fact is that the checkDirty call is a bit expensive, specially for long documents. Another fact is that the onSelectionChangeFixBody call is made several times during the document life cycle, even when simply typing inside the editor. These facts together may represent some execution overload.
The onSelectionChangeFixBody function will not always perform document fixes. Actually this should happen rarely. So the implementation could be changed to restore the dirty status only if fixes are supposed to happen to the document. It means that checkDirty should be called only if necessary.
comment:6 Changed 16 years ago by
Keywords: | Review? added; Review- removed |
---|
Changed 16 years ago by
Attachment: | 4385_2.patch added |
---|
Ticket Test added at : http://ckeditor.t/tt/4385/1.html.