Opened 15 years ago
Closed 15 years ago
#5559 closed Bug (fixed)
setData affected by iframe loading
Reported by: | Garry Yao | Owned by: | Garry Yao |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.3 |
Component: | General | Version: | 3.2 |
Keywords: | Confirmed IE Review+ | Cc: | Damian, joek |
Description
Environment
IE with browser cache enabled.
Reproducing Procedures
- Open the 'api' sample page;
- Click on "Set Editor Contents" to send editor the default content provided;
- Refresh the page;
- Modify the default content by adding 'Another' before word 'Test';
- Click on "Set Editor Contents" again to send the modified content;
- Actual Result: The document content is the same with the first time's result.
Attachments (5)
Change History (17)
comment:1 Changed 15 years ago by
Owner: | set to Garry Yao |
---|---|
Status: | new → assigned |
Version: | → 3.2 |
Changed 15 years ago by
Attachment: | 5559.patch added |
---|
comment:2 Changed 15 years ago by
Keywords: | Review? added |
---|
Avoid loading the data from "src" resolves the problem, the patch has been well tested in all browsers.
comment:3 Changed 15 years ago by
Keywords: | Review- added; Review? removed |
---|
After the patch, with IE8:
- Load the API sample.
- Click the "Set Editor Contents" button.
- Refresh the page.
- Click the "Set Editor Contents" button again.
A js error is thrown.
Changed 15 years ago by
Attachment: | 5559_2.patch added |
---|
comment:4 follow-up: 5 Changed 15 years ago by
Keywords: | Review? added; Review- removed |
---|
I don't understand the reason of caching such as 'html' element, performance boost really?
comment:5 Changed 15 years ago by
Keywords: | Review- added; Review? removed |
---|
Replying to garry.yao:
I don't understand the reason of caching such as 'html' element, performance boost really?
Yes, performance, but nothing to be worried about.
In any case, the new patch doesn't make any difference for me. I still have the problem described on my previous comment.
Changed 15 years ago by
Attachment: | 5559_3.patch added |
---|
comment:6 Changed 15 years ago by
Keywords: | Review? added; Review- removed |
---|
Changes of the previous patch is for the bug reproduced by skipping Step 3 of the previous TC.
New patch targeting both issues.
comment:7 Changed 15 years ago by
Keywords: | Review- added; Review? removed |
---|
- There is a new "isFrameLoading" variable which is never used.
- The "frameLoaded" variable usage now gets confusing. It's set to 0 to indicate that it's loaded. For clarity, it should be set to 1 inside the load event function, and then reset to 0 inside contentDomReady after a !frameLoaded check.
- I still don't understand the reason why _source/core/dom/document.js is being changed. I've reverted the changes and tried the previous tc without step 3 and it worked well, with no errors. Can you provide us a tc that justified it?
comment:8 follow-up: 9 Changed 15 years ago by
Keywords: | Review? added; Review- removed |
---|
The "frameLoaded" indicate three status:
- undefined - The actual loading is not started yet. (this's useful to reject invalid invoking from cached iframe content)
- 0 - Indicate the loading has started and is not yet finished.
- 1 - Indicate the data is already loaded into frame.
It's turned out the changes to wysiwyg plugin in the 2nd patch also fix the problem that changes to document.js was targeting. To make situation less confused, I've excluded the changes outside the new patch, but the bug could be easily triggered by making changes in the future.
Changed 15 years ago by
Attachment: | 5559_4.patch added |
---|
comment:9 Changed 15 years ago by
Keywords: | Review- added; Review? removed |
---|
Replying to garry.yao:
The "frameLoaded" indicate three status
Yes, I understood your logic, but at the code logic instead, the status "undefined" and "1" from your explanation have exactly the same meaning and results, making the tri-state useless.
Just to clarify, what I'm talking about, here you have the relative change:
-
D:/CKEditor/SVN/CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js
289 289 if ( iframe ) 290 290 iframe.remove(); 291 291 292 frameLoaded = 0;293 294 292 var setDataFn = !CKEDITOR.env.gecko && CKEDITOR.tools.addFunction( function( doc ) 295 293 { 296 294 CKEDITOR.tools.removeFunction( setDataFn ); … … 322 320 // With FF, it's better to load the data on iframe.load. (#3894,#4058) 323 321 CKEDITOR.env.gecko && iframe.on( 'load', function( ev ) 324 322 { 323 frameLoaded = 1; 325 324 ev.removeListener(); 326 325 327 326 var doc = iframe.getFrameDocument().$; … … 345 344 // Editing area bootstrap code. 346 345 var contentDomReady = function( domWindow ) 347 346 { 348 if ( frameLoaded )347 if ( !frameLoaded ) 349 348 return; 350 frameLoaded = 1;349 frameLoaded = 0; 351 350 352 351 editor.fire( 'ariaWidget', iframe );
For the rest, everything is ok. Even the current patch is acceptable, but the above change may still be considered just to KISS.
Changed 15 years ago by
Attachment: | 5559_5.patch added |
---|
comment:11 Changed 15 years ago by
Keywords: | Review+ added; Review? removed |
---|
comment:12 Changed 15 years ago by
Cc: | Damian joek added |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Fixed with [5395].
This's a regression of [5159], affected by the way how we load data in IE, actually by using the the "src=javascript:void(...)" approach, sometimes IE will just use a cached content instead of really executing the passed codes.