Opened 10 years ago

Closed 7 years ago

#3649 closed Bug (invalid)

Incorrect selected size item on FontSize menu on continous typing and font-size selection

Reported by: Dongqiang Bai Owned by:
Priority: Normal Milestone:
Component: Core : Styles Version: FCKeditor 2.6.4
Keywords: HasPatch Cc:

Description

Steps to reproduce

  1. Clear everything in the editor of "FCKeditor - Demo" page.
  2. Click inside editor, now we are redeay to enter text.
  3. Click "Size" menu, select "small".
  4. Enter "abc".
  5. Click "Size" menu, select "large".
  6. Enter "XYZ".
  7. Click "Size" menu.

Expected behavior

The selected size item on FontSize menu be "large".

Current behavior

The selected size item on FontSize menu is "small".

Browser

IE, Firefox

Attached

A screenshot to show the operation after last step 7.

Attachments (2)

selected-font.png (20.2 KB) - added by Dongqiang Bai 10 years ago.
Screenshot after reproduce step 7.
fcktoolbarfontscombo.patch (1.6 KB) - added by Dongqiang Bai 10 years ago.
Patch to fcktoolbarfontscombo.js, for both 2.6.3 and 2.6.4

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by Dongqiang Bai

Attachment: selected-font.png added

Screenshot after reproduce step 7.

comment:1 Changed 10 years ago by Dongqiang Bai

Analyze the problem

Look at the loop in function FCKToolbarFontsCombo.prototype.StyleCombo_OnBeforeClick of fcktoolbarfontscombo.js file.
The html generated by FCKeditor after our input is

<span style="font-size: small;">abc<span style="font-size: large;">XYZ</span></span>

The first element in path.Elements is the span tag enclosing XYZ with "large" font size, the second element from path.Elements is the span tag enclosing abc with "small" font size. The loop serches menu items at first, this has caused the second element "abc" style as alive style to be selected on font size menu, since "small" is priorior than "large", this is wrong.
Which expected is the first element of element path to be hit, and its font size style "large" to be selected on menu.
The correct logic will keep path elements as outer loop, and menu items as inner loop.

Changed 10 years ago by Dongqiang Bai

Attachment: fcktoolbarfontscombo.patch added

Patch to fcktoolbarfontscombo.js, for both 2.6.3 and 2.6.4

comment:2 Changed 10 years ago by Artur Formella

Keywords: font size font name removed

comment:3 Changed 10 years ago by Frederico Caldeira Knabben

Keywords: HasPatch added

comment:4 Changed 7 years ago by Jakub Ś

Resolution: invalid
Status: newclosed

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 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy