Opened 9 years ago
Last modified 9 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: |
Description
Steps to reproduce
- Initialize editor
- listen for 'instanceReady'
- call setData()
Example here: https://jsbin.com/vaqexu/2/edit?html,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.
Hypothesis
- I believe that Firefox is canceling the open requests when ckeditor writes to the iframe.
- I believe that Firefox de-duplicates requests per iframe, ensuring that if the same document is referenced multiple times, it's only retrieved once.
- 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.
- 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: https://jsbin.com/woyeze/edit?html,js,output
Other details (browser, OS, CKEditor version, installed plugins)
Firefox 41, Windows, OSX & Linux
Attachments (1)
Change History (3)
comment:1 Changed 9 years ago by
Changed 9 years ago by
Attachment: | replacebycode2.html added |
---|
comment:2 Changed 9 years ago by
Keywords: | Firefox added |
---|---|
Status: | new → confirmed |
Version: | 4.5.3 → 4.0 |
Thank you for the detailed description and possible Fire Fox native issue. I took me a minute to figure it out though.
- Please use attached sample file. You need to put it into
ckeditor/samples/old
folder. - 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
Results:
- 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 amazonaws.com and one of them gets the response while other is in loading state (waited 2 min before giving up).
FYI: Looks like this was reported in June on bugzilla:
https://bugzilla.mozilla.org/show_bug.cgi?id=1174782