Opened 16 years ago

Closed 16 years ago

#1666 closed Bug (fixed)

Domain relaxation not working for sub-menues

Reported by: Martin Kou Owned by: Martin Kou
Priority: Normal Milestone: FCKeditor 2.6
Component: General Version: SVN (FCKeditor) - Retired
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 (1)

1666.patch (2.1 KB) - added by Martin Kou 16 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 16 years ago by Martin Kou

Owner: set to Martin Kou
Status: newassigned

comment:2 Changed 16 years ago by Alfonso Martínez de Lizarrondo

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.

comment:3 Changed 16 years ago by Martin Kou

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

comment:4 Changed 16 years ago by Martin Kou

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.

comment:5 Changed 16 years ago by Martin Kou

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.

comment:6 Changed 16 years ago by Martin Kou

Keywords: Review? added

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

Changed 16 years ago by Martin Kou

Attachment: 1666.patch added

comment:7 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

Nice fix Martin.

comment:8 Changed 16 years ago by Martin Kou

Resolution: fixed
Status: assignedclosed

Fixed with [1686].

Click here for more info about our SVN system.

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