Opened 9 years ago

Closed 8 years ago

#1666 closed Bug (fixed)

Domain relaxation not working for sub-menues

Reported by: martinkou Owned by: martinkou
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 martinkou 8 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 8 years ago by martinkou

  • Owner set to martinkou
  • Status changed from new to assigned

comment:2 Changed 8 years ago 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.

comment:3 Changed 8 years ago by martinkou

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

comment:4 Changed 8 years ago 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.

comment:5 Changed 8 years ago 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.

comment:6 Changed 8 years ago by martinkou

  • Keywords Review? added

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

Changed 8 years ago by martinkou

comment:7 Changed 8 years ago by fredck

  • Keywords Review+ added; Review? removed

Nice fix Martin.

comment:8 Changed 8 years ago by martinkou

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed with [1686].

Click here for more info about our SVN system.

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