Ticket #1666 (closed Bug: fixed)

Opened 5 months ago

Last modified 2 months ago

Domain relaxation not working for sub-menues

Reported by: martinkou Assigned to: martinkou
Priority: Normal Milestone: FCKeditor 2.6
Component: General Version: SVN
Keywords: Confirmed IE Review+ Cc:

Description

Steps to reproduce the bug:

  1. Make sample01.html accessible through both "www.fckeditor.local" and "fckeditor.local", change the hosts file if needed.
  2. Add the following line to sample01.html before creating the oFCKeditor object:
    document.domain = 'fckeditor.local' ;
    
  3. Open sample01.html from www.fckeditor.local in IE.
  4. Create an empty table.
  5. Right click on the table.
  6. Error: Permission denied.

Tracing the script execution shows the error comes from the creation of sub-menus in the table menu.

Attachments

1666.patch (2.1 kB) - added by martinkou on 03/06/08 07:17:41.

Change History

02/21/08 08:40:41 changed by martinkou

  • owner set to martinkou.
  • status changed from new to assigned.

02/23/08 22:28:11 changed by alfonsoml

I've tested now in IE7 and it seems to work for me (following the steps), the only problem is that the submenus aren't placed correctly at the right side of the main menu, but that's an old bug IIRC.

02/25/08 10:20:11 changed by martinkou

The issue occurs in IE6 only. Submenu works in IE7 in domain relaxation mode.

02/26/08 06:30:17 changed by martinkou

The error comes from fckpanel.js, at the final line of the following code segment:

                // document inside of it, and the set the proper domain for it. (#123)
                if ( FCK_IS_CUSTOM_DOMAIN )
                        document.domain = FCK_ORIGINAL_DOMAIN ;

                // Create the Popup that will hold the panel.
                this._Popup     = this._Window.createPopup() ;
                oDocument = this.Document = this._Popup.document ;
]}}

Apparently the document.domain line above was not working. It worked in the initial round of creating panels and the first menu, but it didn't work when submenus need to be created later.

There seems to be no way around this. I've tried to hack around it for a while but nothing worked. For fixing this we might have to revert to using iframes as floating panels in IE.

02/27/08 06:12:03 changed by martinkou

Found a little bit more today.

When the submenus are being created, the call to "new FCKPanel" results in a this._Window different from the window. And so modifying document.domain before this._Window.createPopup() has no effect.

Trying to modify this._Window.document.domain gives me another permission denied error, unfortunately.

03/06/08 07:17:28 changed by martinkou

  • keywords changed from Confirmed IE to Confirmed IE Review?.

Finally found a fix to this weird bug. The fix is very weird, but it works.

03/06/08 07:17:41 changed by martinkou

  • attachment 1666.patch added.

03/07/08 09:50:03 changed by fredck

  • keywords changed from Confirmed IE Review? to Confirmed IE Review+.

Nice fix Martin.

03/10/08 03:28:50 changed by martinkou

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed with [1686].

Click here for more info about our SVN system.