Opened 9 years ago
Last modified 8 years ago
#13206 review Bug
Style is not visible if it uses multiple classes
Reported by: | Lars Schultz | Owned by: | Tade0 |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Styles | Version: | 4.3 |
Keywords: | Cc: |
Description
When the classes are not sorted alphabetically (in the string), it will not be made available because it is deemed not "applicable", because it does not pass the test in objectCompare(element.attributes,clone.attributes).
Example: a style in stylesset with the following definition: {name:'Multi Class', element:'p', attributes:{class:'c b a'}}
Will not be selectable from the combo because when a clone is created from the element and then compared, the compared class-string is ordered alphabetically 'a b c';
1652 core/filter.js/processElement/updateElement loops through all possible classnames and then sorts them on line 1658 classesArr.sort().join( ' ' );
140 stylescombo/plugin.js style.checkApplicable() 366 core/style.js checkApplicable/filter.check() 744 core/filter.js CKEDITOR.toosl.objectCompare()
thus the object comparison fails...
Change History (8)
comment:1 Changed 9 years ago by
Keywords: | stylescombo filter class removed |
---|---|
Status: | new → confirmed |
Version: | 4.4.6 → 4.3 |
comment:5 Changed 8 years ago by
Owner: | set to Tade0 |
---|---|
Status: | confirmed → review |
Solved this by (non-invasively) sorting classes before comparison in filter.check().
Changes pushed to branch:t/13206.
comment:6 Changed 8 years ago by
Status: | review → assigned |
---|
Solved - or not. It's possible to apply the style multiple times and hence impossible to remove it.
comment:7 Changed 8 years ago by
Status: | assigned → review |
---|
Different approach: Sort classes when creating the style.
Switching modes sorts the classes anyway, so let's just ensure that the classes are sorted once the style is created.
Changes pushed to branch:t/13206a.
Problem can be reproduced from CKEditor 4.3 (works fine in 4.3 beta) in every browser.