Opened 12 years ago

Last modified 12 years ago

#10404 confirmed Bug

Strange insertHTML behaviour with FF 20.0.1 after selectRanges and hide/show

Reported by: martin Owned by:
Priority: Normal Milestone:
Component: Core : Editable Version: 3.6.4
Keywords: Firefox Cc:

Description

Firefox Version: 20.0.1

I am not sure if this is a ckeditor issue or a FF bug. But since I wasn't able to reproduce it with a plain contentEditable div I am reporting it here first.

Reproducible on the Demo Page:

http://ckeditor.com/demo

Copy/execute the code line by line, don't execute the block as a whole. Apperently there is a timing component to this bug, that I wasn't able to reproduce it with setTimeout.

var cke = CKEDITOR.instances.editor1;
var r = cke.getSelection().getRanges();
jQuery('#demo-standard').hide();
jQuery('#demo-standard').show();
cke.getSelection().selectRanges(r);
cke.insertHtml('<img src="http://b.cksource.com/a/1/img/sample.jpg" />');

After that, if you doubleclick the inserted img. A phantom image appears that is not inside the Browser DOM and dissapears when the text is edited.

I tested this against release/4.1.x 3cb9cc24ed187a8ad29b810798f3427cc45a6fcf

This Code is my attempt at a workaround for Issue #10402. Any tips on how to workaround those two problems is appreciated.

Change History (1)

comment:1 Changed 12 years ago by Jakub Ś

Keywords: Firefox added
Status: newconfirmed
Version: 4.1.13.6.4

I have tried this in latest Firefox 21. Executing whole code worked for me without problems but executing code one line by one caused phantom image to appear when double-clicking on inserted image.
This particular problem can be reproduced in Firefox only from CKEditor 3.6.4 rev. [7517] and is also reproducible in CKE 4.x

To test this is local branches you may use:

var cke = CKEDITOR.instances.editor1;
var r = cke.getSelection().getRanges();

document.getElementById('cke_editor1').style.display='none';
document.getElementById('cke_editor1').style.display='';
cke.getSelection().selectRanges(r);

cke.insertHtml('<img src="http://b.cksource.com/a/1/img/sample.jpg" />');
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy