Opened 11 years ago
Last modified 10 years ago
#10675 confirmed Bug
Inline styles should be normalized when selection doesn't change
Reported by: | zacaway | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Styles | Version: | 4.0 |
Keywords: | Cc: |
Description
Attached video shows reproduction on ckeditor.com/demo#full. Summary:
- Click somewhere in the middle of a paragraph.
- Increase the font size significantly, the line height will increase accordingly (on Chrome).
- Decrease the font size back to the original setting.
- Observe the line height has not changed back to the original line height. Also, note the number of span elements created in the editor (one per font size change).
Change History (7)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Status: | new → confirmed |
---|---|
Summary: | Increasing then decreasing font size does not return to initial state → Inline styles should be normalized when selection doesn't change |
Version: | 4.2 → 4.0 |
- Background of why this issue was discovered - in HTML4 inserting
<span style="font-size:72px;"></span>
into paragraph won't be taken into account when considering line height. Only cursor was bigger but line-height was the same. In HTML5, inserting such empty span isn’t ignored and increases line height.
- This is very important issue - as discussed with @Reinmar - when selection doesn't change and new spans are added (especially with same style rule) editor should normalize those into one.
- Besides normalization, merging should also take place (many spans with different styles next to each other merged into one span). This has been reported in ticket #4505.
This ticket plus #4505 is one large issue to change how styles are working.
@zacaway - editor currently works in a way that it inserts new span element on every dropdown option press. Good news is that if these styles will remain empty they will be removed when you use getData function (e.g. during submit) or when you switch modes.
Another (and currently best) workaround is selecting part of text that contains these empty spans and using Remove Format button. Currently this is the only workaround until how styles work will be changed.
comment:3 Changed 11 years ago by
Thanks for the update. I noticed the styles get normalized after getData, which we are using whenever the user clicks away from the editor, so that will be fine as a workaround until there's a fix.
comment:4 Changed 11 years ago by
comment:6 Changed 11 years ago by
#12047 was marked as duplicate.
Please have a look at TC mentioned in that ticket.
comment:8 Changed 10 years ago by
Is this issue fixed? If not, can anybody help with a temporary fix that I can apply for solving this issue. Thanks.
File too large to upload. Link here instead: https://dl.dropboxusercontent.com/u/24882678/CKEditorBug10675.mov