Opened 16 years ago
Closed 13 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
- Clear everything in the editor of "FCKeditor - Demo" page.
- Click inside editor, now we are redeay to enter text.
- Click "Size" menu, select "small".
- Enter "abc".
- Click "Size" menu, select "large".
- Enter "XYZ".
- 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)
Change History (6)
Changed 16 years ago by
Attachment: | selected-font.png added |
---|
comment:1 Changed 16 years ago by
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 16 years ago by
Attachment: | fcktoolbarfontscombo.patch added |
---|
Patch to fcktoolbarfontscombo.js, for both 2.6.3 and 2.6.4
comment:2 Changed 16 years ago by
Keywords: | font size font name removed |
---|
comment:3 Changed 16 years ago by
Keywords: | HasPatch added |
---|
comment:4 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
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.
Screenshot after reproduce step 7.