Opened 10 years ago

Closed 10 years ago

#1633 closed Bug (fixed)

[FF] styles on iframe elements affect the editor and panels

Reported by: Alfonso Martínez de Lizarrondo Owned by: Martin Kou
Priority: Normal Milestone: FCKeditor 2.6.1
Component: General Version: FCKeditor 2.5.1
Keywords: Confirmed Firefox Review+ Cc:

Description

Add

	<style type="text/css">
		iframe {
			width: 100%;
			height: 400px;
			border: 3px solid red;
			background-color: blue;
		}
	</style>

to a test page and you'll see that they make impossible to use the editor. I think that we should force some styles on the generated iframes to avoid this kind of problems.

Reported in http://www.fckeditor.net/forums/viewtopic.php?f=6&t=7759

Attachments (3)

1633_pre.patch (4.8 KB) - added by Martin Kou 10 years ago.
1633.patch (5.3 KB) - added by Martin Kou 10 years ago.
1633_2.patch (5.4 KB) - added by Martin Kou 10 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 10 years ago by Wojciech Olchawa

Keywords: Confirmed Firefox added
Summary: styles on iframe elements affect the editor and panels[FF] styles on iframe elements affect the editor and panels
Version: SVN

Confirmed in FF. Works in IE.

The big occurs in stable 2.5.1 and in the SVN version.

comment:2 Changed 10 years ago by Wojciech Olchawa

The *big occurs in stable 2.5.1 and in the SVN version.

  • THE BUG :)

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

Version: SVNFCKeditor 2.5.1

comment:4 Changed 10 years ago by Frederico Caldeira Knabben

Milestone: FCKeditor 2.6.1

As pointed by Alfonso, the solution for #1948 could be generalized to fix this one too.

comment:5 Changed 10 years ago by Martin Kou

Owner: set to Martin Kou
Status: newassigned

comment:6 Changed 10 years ago by Martin Kou

I've written a patch such that the editor iframe and floating panels in sample*.html are not longer affected by external styles. However, I've noticed that the changes would touch the integration code in $FCKeditor/fckeditor.<lang> files, and I've only changed the fckeditor.js file for that.

Changed 10 years ago by Martin Kou

Attachment: 1633_pre.patch added

comment:7 Changed 10 years ago by Martin Kou

My test case for the page:

        <style type="text/css">
                iframe {
                        width: 500px;
                        height: 400px;
                        border: 3px solid red;
                        background-color: blue;
                        padding: 20px;
                        margin: 20px;
                }
        </style>

Changed 10 years ago by Martin Kou

Attachment: 1633.patch added

comment:8 Changed 10 years ago by Martin Kou

Keywords: Review? added

I've found a way to reset the styles of the editor iframe without modifying any integration code. The updated patch is ready for review.

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

Keywords: Review- added; Review? removed

the

/^\d+$/.test( width ) && ( width += 'px' ) ; 
/^\d+$/.test( height ) && ( height += 'px' ) ; 

code seems too complex, I think that it's easier to understand it this way (if I have understood properly the code)

 if (/^\d+$/.test( width ) ) width += 'px' ; 
 if (/^\d+$/.test( height ) ) height += 'px' ; 

also, instead of naming the variable "sy" you could name it "style", it will be compressed anyway, so there's no need to do it right now.

Changed 10 years ago by Martin Kou

Attachment: 1633_2.patch added

comment:10 Changed 10 years ago by Martin Kou

Keywords: Review? added; Review- removed

Updated patch according to suggestions.

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

Keywords: Review+ added; Review? removed

comment:12 Changed 10 years ago by Martin Kou

Resolution: fixed
Status: assignedclosed

Fixed with [1950].

Click here for more info about our SVN system.

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