Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#9807 closed Bug (invalid)

CKEditor throws error when <iframe> present on page

Reported by: Robert Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Code is as follows:

<body>
<script src="/blog/ckeditor/ckeditor.js"></script>
<center>
<form id="AddEntry" name="AddEntry" method="POST" action="addentrydb.asp">  
<textarea name="entrytext" id="entrytext"></textarea>
<script>
CKEDITOR.replace("entrytext");
CKEDITOR.on('instanceReady', function() { 
alert('loaded');
 }
);
</script>
<br>
<input type=submit value="save"  >&nbsp;&nbsp;<input type=button value="cancel" onclick="history.back">
</form>
</center>
<!-- //<iframe width=100% src="thisweek2.asp" target="_blank"></iframe> -->
</body>

The OnInstanceReady function serves for debugging. It never fires when the <iframe> is uncommented.

Whenever the <iframe> is active, CKEditor throws an error on the following line:

return new CKEDITOR.dom.element(this.$.activeElement)

If this error is left unhandled, the form data remains empty for the editor when passed to the form handler.

This error only occurs on IE9, regardless of document mode.

Attachments (5)

iframeTest2.html (975 bytes) - added by Jakub Ś 6 years ago.
iframeTest.html (1.0 KB) - added by Jakub Ś 6 years ago.
frameset.html (103 bytes) - added by nrone 6 years ago.
Frameset .req frame
frame.html (325 bytes) - added by nrone 6 years ago.
HowFreamesetShouldLookLike.zip (749 bytes) - added by Jakub Ś 6 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 Changed 6 years ago by Jakub Ś

Keywords: iframe javascript error removed
Status: newpending
Version: 4.0.1 (GitHub - master)

I have tried this sample code in different forms, in different versions of editor and it has always worked (instance ready was executed).
The editor didn't have any customizations or config settings except default ones.

@Watashifr:

  1. Could you provide sample that can be reproduced in plain CKEditor?
  2. Have you used any configuration settings to get this effect?

comment:2 Changed 6 years ago by Robert

After adding a config.height to config.js, this problem is resolved.

comment:3 Changed 6 years ago by Jakub Ś

From your comment it sounds like it happens in default editor.

  1. Does this problem occur in default editor without any customizations?
  2. If so, are you able to provide sample HTML page (the above code works) that allows reproducing this problem in default editor?

Could you please answer to both of these questions?

comment:4 Changed 6 years ago by Robert

I can no longer reproduce the problem. It may have been a version issue, as the site had an older version of FCKEditor which was still used by one page. After updating this page to use CKEditor 4, the error has disappeared.

EDIT: the error has reappeared. Like before, with the iframe present on the page, the editor does not pass a value to the form handler.

Last edited 6 years ago by Robert (previous) (diff)

comment:5 Changed 6 years ago by Robert

I will set up a test page to demonstrate the error.

comment:6 Changed 6 years ago by Robert

While setting up the test I've discovered the following: the problem ONLY occurs (with any variant of the code as listed originally) when run IN A FRAMESET (don't ask why this code is running in a frameset, but it is). When the page inside the frameset is running separately (i.e. individually and not as part of a frameset) the error does not occur.

comment:7 Changed 6 years ago by Robert

So to recap the problem: CKEditor throws an error from "return new CKEDITOR.dom.element(this.$.activeElement)" when the following conditions are met:

  • CKEditor is loaded in a page that is part of a frameset
  • the page loading CKEditor contains an <iframe>

I've suggested to the client to drop the frameset, providing a workaround.

Changed 6 years ago by Jakub Ś

Attachment: iframeTest2.html added

Changed 6 years ago by Jakub Ś

Attachment: iframeTest.html added

comment:8 Changed 6 years ago by Jakub Ś

Resolution: invalid
Status: pendingclosed

@Watashifr I have tried both frameset declarations and they have worked for me.

I closing this ticket as I think there is no error here.

Please provide working sample (working html page like mine) and I will reopen this issue.

comment:9 Changed 6 years ago by nrone

I whould like to get this reopend.

The problem is still occurring with 4.0.1

  1. Simply make a page with a frameset, and put the editor inside the frame.
  2. Open it in IE9 and try to open a dialog(popup) and it wont load content.

Note: If you change page to I8 and back to 9, it works, till the browser is closed.

comment:10 Changed 6 years ago by Jakub Ś

I have tried few times to reproduce this. If you want to have this reopened:

  1. Please provide reduced sample (something that can be put in samples foleder and will work). Please have a look at samples I have attached.
  2. Provide exact steps to reproduce this issue.

Note: If you change page to I8 and back to 9, it works, till the browser is closed.

You can't use dev-tools to reproduce issues. Only doctype or XUA tag. Standard users don't use dev-tools and second they can give different result.

comment:11 Changed 6 years ago by Robert

I have set up a test environment at ​http://www.mentaljam.com/test/ (please disregard the missing images, this is for testing purposes only). Using the link "new", CK opens with an iframe on the page, rendering it inoperative. Using the "new without iframe" link opens the same page with the iframe removed, which renders things operative as expected.

Changed 6 years ago by nrone

Attachment: frameset.html added

Frameset .req frame

Changed 6 years ago by nrone

Attachment: frame.html added

comment:12 Changed 6 years ago by nrone

I have made this file, it seems that IE10 dosent work eaiter.

Lets hope this can help finding the issue

comment:13 Changed 6 years ago by nrone

http://www.screenr.com/T3m7

I made a fast screencast that shows the problem.

comment:14 in reply to:  13 ; Changed 6 years ago by Robert

Replying to nrone:

http://www.screenr.com/T3m7

I made a fast screencast that shows the problem.

This looks like a completely different problem.

comment:15 in reply to:  14 Changed 6 years ago by nrone

An older issue fixed my problem, http://dev.ckeditor.com/ticket/8287

comment:16 Changed 6 years ago by Jakub Ś

I was about to paste this here.

@nrone your problem is a duplicate of #8287 (which will be invalidated in a minute).

In your example you have made a couple of mistakes.

  1. You have used HTML5 doctype declaration for frameset while frames are not supported in HTML5. Here HTML4 frames set declaration is needed.
  2. You have forgotten to use head section in frameset page
  3. You have forgotten to put doctype declaration (HTML4 transitional or loose) in frame page. This resulted in mixed doctypes.

Please have a look attached zip file.

Also please note that frames are dead!!!

Changed 6 years ago by Jakub Ś

comment:17 Changed 6 years ago by Robert

You're right, frames ARE dead. The project has been converted to a modern interface, the error does not occur in the new environment. Thanks for your support, let's close this case.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy