Ticket #7607 (closed Bug: wontfix)

Opened 3 years ago

Last modified 3 years ago

Style attribute is deleted from the sourcecode while switching from Source to WYSIWYG

Reported by: tiagoesferreira Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: CantFix Cc:

Description

In version 2.X or 3.X of CKEditor, the "style" attribute is deleted from the sourcecode while switching from Source to WYSIWYG. On FCKeditor latest version (and nightly build), the problem is solved for Fire Fox and Chrome, but remains in IE (tested in the Demo at CK website).

A small test case would be, using IE6 or above (with WinXP or above):

  1. Move to Source view on the Editor;
  1. Add following html code:
<div class="test" style="#styleTest#"> test </div>
  1. Move to WYSIWYG view;
  1. Move back to Source view.

Note that if the style attribute includes regular css expressions it works just fine. I've tested it by replacing the code on step 2 for:

<div class="test" style="background-color: red">
   test
</div>

Thanks in advanced,

Tiago

Change History

comment:1 Changed 3 years ago by j.swiderski

  • Status changed from new to confirmed
  • Keywords Clearing; Style Attribute; IE; removed
  • Version changed from 3.5.3 to 3.0

I will confirm this ticket just in case but it looks like browser dependable.

In FF4, webkit, Opera - the code stays untouched.

In FF3.6 the contents of style attribute are removed but the attribute itself stays untouched.

In IE whole attribute is removed.

It has worked that way from CKEditor 3.0.

comment:2 Changed 3 years ago by tiagoesferreira

Hi j.swiderski, thanks for your time, reviewing the ticket! Do you think this bug is going to be fixed to IE? Is that a lot of people uses the browser and it's kind of an interesting feature.

Best regards, Tiago

comment:3 Changed 3 years ago by j.swiderski

I’ve based my judgment on a simple test. I have prepared a HTML page with a sample code (I did not use CKEditor):

<body contenteditable="true">
	<div class="test" style="#styleTest#"> test </div>
</body>

All browsers behaved just like described above.

If any one else from CKEditor core development team confirms that it's a browser dependable issue than it may (not necessarily) be treated as "won't fix". If it's not browser dependable than it most likely will be fixed.

comment:4 Changed 3 years ago by fredck

  • Keywords CantFix added
  • Status changed from confirmed to closed
  • Resolution set to wontfix

The problem here is that we feed the browser with the provided HTML. The browser itself cleanup invalid HMTML, so the style attribute is dropped.

There is nothing we can do here. My recommendation would be using a style syntax that is acceptable by the browser.

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