Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#9217 closed Bug (invalid)

Line Feed key with absolut link in a frame (only Firefox)

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

Description

If I use CKEditor in a page, that is called in a frame with an absolute link, the Line Feed key doesn't work correct. This only happens in Firefox (newest version 14.0.1, Windows XP). If I press the Line Feed key a new line is created, but the cursor still remains on the old line.

By using a relative link or without frames or with any other browser, this problem doesn't occur and the cursor moves to the next line. Example: http://vereinslogistik.com/cke-frame.htm The html page that displays the CKEditor is http://www.vereinslogistik.com/pages/cke.htm If I call this html page directly, or if I use in the frame instead of the absolute link a relative link (pages/cke.htm), the error doesn't occur.

Attachments (2)

cke-frame.htm (360 bytes) - added by Jakub Ś 12 years ago.
cke.htm (657 bytes) - added by Jakub Ś 12 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 12 years ago by Jakub Ś

Keywords: Line Feed Firefox frame removed
Status: newpending
Version: 3.6.4

I see this problem in your pages but I'm not able to reproduce it. I have tried the same configuration on my machine but it works.

I have noticed that you have no doctypes set and script tag is not in head section. Could you perhaps make changes in your pages just like it was done in attached files and tell me if this has solved your problem?

Changed 12 years ago by Jakub Ś

Attachment: cke-frame.htm added

Changed 12 years ago by Jakub Ś

Attachment: cke.htm added

comment:2 Changed 12 years ago by Bernd Altmann

Last edited 12 years ago by Bernd Altmann (previous) (diff)

comment:3 in reply to:  1 Changed 12 years ago by Bernd Altmann

Replying to j.swiderski:

I see this problem in your pages but I'm not able to reproduce it. I have tried the same configuration on my machine but it works.

I have noticed that you have no doctypes set and script tag is not in head section. Could you perhaps make changes in your pages just like it was done in attached files and tell me if this has solved your problem?

I made the suggested changes, but unfortunately they have not solved my problem. In the version with frames the line feed key still does not work correct. You can see that if you click on my link again: ​http://vereinslogistik.com/cke-frame.htm Do you have an other idea?

comment:4 Changed 12 years ago by Jakub Ś

In order to say anything I have to know what is going on and right not this is working for me.

  1. What server and operating System are you using?
  2. Have you tried running your example with sole CKEditor or only when it is integrated in your webapp? Does the problem exist in sole CKEditor? Perhaps the problem is in integration?
  3. Have you tried running your example on different server?
  4. Current version of FF is 15. Have you tried it? Does the problem occur there also?

comment:5 in reply to:  4 Changed 12 years ago by Bernd Altmann

Replying to j.swiderski:

In order to say anything I have to know what is going on and right not this is working for me.

  1. What server and operating System are you using?
  2. Have you tried running your example with sole CKEditor or only when it is integrated in your webapp? Does the problem exist in sole CKEditor? Perhaps the problem is in integration?
  3. Have you tried running your example on different server?
  4. Current version of FF is 15. Have you tried it? Does the problem occur there also?

Thank you for your effort. I have determined in many other tests as follows:

  1. The error only occurs on the Linux server. There is an internal redirection. On the server are running 3 domains. Each domain has its own directory as home directory. If you use the Link with the domain name http://vereinslogistik.com/cke-frame.htm, the error occurs. If you use a link without redirection (name of the server and directory of the domain) http://h1872452.stratoserver.net/vl/cke-frame.htm, the error doesn't occur. It is probably due to the configuration of the server. (Since I have no influence, because the server is in a data center).
  1. The example that can be accessed using the link http://vereinslogistik.com/cke-frame.htm is not integrated into my webapp. I reduced the script to the absolute minimum to show the problem.
  1. On my Windows computer with apache-server the error doesn't occur.
  1. In the meantime I have also switched to FF version 15. This is still the same on the Linux-server.

comment:6 Changed 12 years ago by Jakub Ś

Resolution: invalid
Status: pendingclosed

I have looked once more into your issue. I haven't looked for the obvious but it seems that this redirect is to blame (making this ticket invalid).

Open http://vereinslogistik.com/cke-frame.htm in Chrome and FireFox, open webtools and firebug and start pressing enter.

Chrome will show:
Unsafe JavaScript attempt to access frame with URL http://vereinslogistik.com/cke-frame.htm from frame with URL http://h1872452.stratoserver.net/vl/pages/cke.htm. Domains, protocols and ports must match.

Firefox shows similar message but only in that browser this error results in not moving cursor Domain <http://h1872452.stratoserver.net> has no right to read property HTMLFrameElement.parentNode

Once you get rid of this error (by removing extra iframe for example) cursor will start working.

comment:7 Changed 12 years ago by Alfonso Martínez de Lizarrondo

The problem isn't the redirect, it's just that the CKEditor code tries to walk up the DOM, but when it reaches the frame it fails because it's a cross domain call.

Testing it is as simple as putting this in your server:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html>
<frameset rows="2,*" frameborder="NO" border="0" framespacing="0" cols="*">
  <frame name="topFrame" scrolling="NO" noresize src="" >
  <frame name="mainFrame" src="http://nightly.ckeditor.com/latest/ckeditor/_samples/replacebyclass.html">
</frameset>
</html>

So the title should have have been something along: Enter key fails if CKEditor is used in a cross domain frame.

comment:8 in reply to:  7 Changed 12 years ago by Bernd Altmann

Replying to alfonsoml:

The problem isn't the redirect, it's just that the CKEditor code tries to walk up the DOM, but when it reaches the frame it fails because it's a cross domain call.

Testing it is as simple as putting this in your server:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html>
<frameset rows="2,*" frameborder="NO" border="0" framespacing="0" cols="*">
  <frame name="topFrame" scrolling="NO" noresize src="" >
  <frame name="mainFrame" src="http://nightly.ckeditor.com/latest/ckeditor/_samples/replacebyclass.html">
</frameset>
</html>

So the title should have have been something along: Enter key fails if CKEditor is used in a cross domain frame.

Hello, thank you for the support. Will there be a change for CKEditor?

What is next now?

comment:9 Changed 12 years ago by Jakub Ś

When I was saying about redirect I actually meant cross-domain call. Sorry for not being clear on this.

AFAIK cross-domain is JavaScript problem so there is nothing CKEditor can do here. I think it should be user who will implement CKEditor in a way to avoid this problem.
@alfonsoml could I ask you to comment on this?

comment:10 Changed 12 years ago by Alfonso Martínez de Lizarrondo

Although the frame is loading a page from another domain, it isn't trying to interact with it; so it's the code in CKEditor the one that should prevent reaching the parent frame.

For example this rude change to the getParent function fixes this problem

		getParent : function()
		{
			try
			{
				var parent = this.$.parentNode;
				return ( parent && parent.nodeType == 1 ) ? new CKEDITOR.dom.node( parent ) : null;
			}
			catch (e)
			{
				return null;
			}
		},

comment:11 Changed 12 years ago by Jakub Ś

@alfonsoml your post means only that "CKEditor should prevent users from doing cross-domain calls". I think that another thicket for that should be opened based on your comments: 7 and 10.

Unfortunately this brings nothing new to the user. He still has to implement this differently to avoid cross domain call.

Version 0, edited 12 years ago by Jakub Ś (next)

comment:12 Changed 12 years ago by Jakub Ś

@alfonsoml I have created new ticket based on your comments #9305

@Baffo despite preventing cross-domain call by CKEditor this will not change much for you as you will still need to implement editor in a way to avoid this call.

comment:13 Changed 12 years ago by Bernd Altmann

Thanks for creating the new ticket.

Unfortunately I need in my application in the frame the absolute link, because this call switches to SSL encryption.

Can you please let me know if there will be a solution. Or can I get the information of ticket #9305 automatically?

comment:14 Changed 12 years ago by Jakub Ś

One more time - ticket #9305 will not solve your problem.

You are making cross-domain call which is not allowed in JavaScript (not CKEditor). You can either not do that call or google for some corss-domain bypass technique. You will probably find a lot under “same origin policy”

There are probably other ways in which you can implement CKEditor. Just experiment a little.

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