Ticket #2057 (closed Bug: fixed)

Opened 2 years ago

Last modified 2 years ago

Strange behavior of fix for #1990 (IE selection re-work)

Reported by: MarkWB Owned by: martinkou
Priority: Normal Milestone: FCKeditor 2.6
Component: UI : Dialogs Version: SVN (FCKeditor)
Keywords: Confirmed IE Review+ Cc:

Description

It seems like the InsertHtml() function from a floating dialog is getting executed about 10 to 15 times. It is not noticeable using the 'insertbug' plugin as it is attached to #1990. However, if you replace the 'Insert Text' string that gets inserted with content that is taller than the editor window, you can then see the up/down rapid flickering from what appears like multiple re-insertions. Ultimately, it does end up working correctly, but the behavior is strange.

This doesn't happen with FF. However, the ultimate result isn't consistent between FF and IE. With FF, what gets inserted is not selected, but with IE it does end up selected.

SVN build 18515

Attachments

2057.patch Download (1.0 KB) - added by martinkou 2 years ago.

Change History

Changed 2 years ago by martinkou

I've done some code tracing with IE6 but I couldn't seem to reproduce the problem. Printing debug messages in FCKDialog.EnsureSelection() indicates that it is executed only once during the FCK.InsertHtml() call.

I performed my tests by modifying the JavaScript code in insertbug.html of the insertbug plugin to the following, to get a very long HTML to insert:

var oEditor = window.parent.InnerDialogLoaded();
var x = [];
var y = '<p>Inserted Text</p>';
for(var i=0;i<100;i++)
        x.push(y);
function InsertText() {
        oEditor.FCK.InsertHtml(x.join(''));
        window.parent.Cancel();
}

Changed 2 years ago by martinkou

My tests with IE7 also failed to reproduce the issue.

Changed 2 years ago by martinkou

  • keywords Confirmed IE added

Confirmed, I was able to reproduce the flicker when I put a lot of things into the editing document (long enough that a scrollbar appears) and then run the modified insertbug plugin command.

Changed 2 years ago by martinkou

  • owner set to martinkou
  • status changed from new to assigned

Changed 2 years ago by martinkou

Changed 2 years ago by martinkou

  • keywords Review? added

The bug was caused by FCKSelection.Restore() trying to re-select the editor document after the selection has already been restored. As long as the current selection's parent document is the editor document, FCKSelection.Restore() shouldn't do anything.

Changed 2 years ago by fredck

  • keywords Review+ added; Review? removed

Changed 2 years ago by martinkou

  • status changed from assigned to closed
  • resolution set to fixed

Fixed with [1818].

Click here for more info about our SVN system.

Note: See TracTickets for help on using tickets.