Opened 15 years ago

Closed 11 years ago

#2682 closed Bug (wontfix)

Setting and clearing background colour does not work with 'non-canonical' styling

Reported by: thiloplanz Owned by:
Priority: Normal Milestone:
Component: Core : Styles Version: FCKeditor 2.4
Keywords: Cc:


When setting and clearing background colour settings, it is necessary to parse and update the currently active settings (the same process that as applying other styling). Unfortunately, there are many different ways to specify background colour, and only a very narrow combination of them works. Basically, any background colour that has been set using a different method then the current FCK/browser combination would do it, is likely do not work properly.

The effect (on the HTML) of applying a background colour differs by browser:

  • Firefox creates <span style="background-color: rgb(255, 0, 0);">
  • IE creates <span style="background-color: #ff0000">
  • Firefox automatically converts the IE-style into its own style, even when not changing anything in the editor
  • HTML received from other sources (e.g. copy-paste, or legacy data after updating the rich text editor to FCK) can also use <span style='background-color: red'>
  • it is also possible to get HTML that does not use "background-color", but the composite "background" style property

By going to the source pane on the FCK demo site, and changing the style setting to reflect the above variations, a number of situations where the background colour button does not work properly can be demonstrated.

  • Display of background colours works correctly, because all browsers supports all combinations. Applying additional background colour styling however fails in some cases.
  • Operations on the complete range usually work (they just need to rewrite the outer-most style). It can still fail when nested styling would need to be removed.
  • Operations on incomplete ranges or super-ranges usually do not work. These operations involve splitting ranges and properly parsing the style settings of nested elements, which mostly fails.
  • Clearing the background colour is more difficult than applying extra background colour, because this needs to remove existing styling rather than just piling on new spans (which in the absence of nesting works).
  • Operation on ranges using "background" instead of "background-colour" create additional complications.

While the priority of supporting arbitrary styling from external sources may be low, it is possible to create a text that does not work properly by just editing it in FCK repeatedly with different browsers.

Workaround: use the "style clear" button to remove all styles (which works reliably), and then re-apply.

Change History (3)

comment:1 Changed 15 years ago by thiloplanz

It is possible to create situations where the background colour cannot be cleared, even without touching the source view and without switching browsers.

  1. go to FCK demo site
  2. in the demo text, give "This is" a red background colour, and " some" a yellow background colour.
  3. select "is so" (a part that spans both colours) and clear the background colour
  4. "is" will still be red, only " so" got cleared

Workaround: select and clear the different parts indivually

comment:2 Changed 15 years ago by Artur Formella

Keywords: Confirmed added
Version: FCKeditor 2.6.3FCKeditor 2.4

comment:3 Changed 11 years ago by Jakub Ś

Resolution: wontfix
Status: confirmedclosed

FCKeditor was retired and is no longer supported. All active development was moved to its successor, CKEditor 3.x, that is a fully mature and far superior product. We recommend you upgrade as soon as possible since this issue is no longer a problem in current code base.

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