Opened 8 years ago

Last modified 8 years ago

#13772 confirmed Bug

Contents appear unstyled on Firefox when setData() called immediately

Reported by: Dusty Jewett Owned by:
Priority: Normal Milestone:
Component: General Version: 4.0
Keywords: Firefox Cc:


Steps to reproduce

  1. Initialize editor
  2. listen for 'instanceReady'
  3. call setData()

Example here:,js,output

Expected result

Content appears styled.

Actual result

Contents not styled. contents.css not loaded as expected.

The example uses a link to S3 which is fairly variable in it's response rates. When the response rate is > 100ms, the contents will not be styled. The example jsbin has a timeout you can adjust to see that the successful styling is directly related to the response times.

I'm guessing that the success rates for < 100ms have to do with the setTimeout(,100) in wysiwygarea's initialization.


  1. I believe that Firefox is canceling the open requests when ckeditor writes to the iframe.
  2. I believe that Firefox de-duplicates requests per iframe, ensuring that if the same document is referenced multiple times, it's only retrieved once.
  3. I believe that the canceling is actually asynchronous, such that the second time we write the content to the page, it de-duplicates it first, and then the request is canceled.
  4. When monitoring network traffic through Charles Proxy (it's awesome, you should try it if you haven't), it will report that the connection was closed by the client.

Possible Fix

Append cache-busting query string to css url. See:,js,output

Other details (browser, OS, CKEditor version, installed plugins)

Firefox 41, Windows, OSX & Linux

Attachments (1)

replacebycode2.html (1.6 KB) - added by Jakub Ś 8 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 8 years ago by Dusty Jewett

FYI: Looks like this was reported in June on bugzilla:

Changed 8 years ago by Jakub Ś

Attachment: replacebycode2.html added

comment:2 Changed 8 years ago by Jakub Ś

Keywords: Firefox added
Status: newconfirmed

Thank you for the detailed description and possible Fire Fox native issue. I took me a minute to figure it out though.

  1. Please use attached sample file. You need to put it into ckeditor/samples/old folder.
  2. To see the problem you need to comment whole buildStyleHtml. If you have loaded the sample before commenting the function, you will need to clear FF cache


  • With function commented and setTimeout set to some small value e.g. < 100 the text is black and CSS request in Firebug Net Tab is aborted.
  • With function commented and setTimeout set to some big value e.g. 500-3000 the text is red and CSS loads as expected
  • With function uncommented, no matter what the setTimeout is, the text will be red CSS will load as expected.

I have managed to reproduce this problem from CKEditor 4.0 but to my surprise it works as expected in CKEditor 3.6.6. There are two requests made to and one of them gets the response while other is in loading state (waited 2 min before giving up).

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