Opened 6 years ago

Last modified 4 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:


Attached video shows reproduction on Summary:

  1. Click somewhere in the middle of a paragraph.
  2. Increase the font size significantly, the line height will increase accordingly (on Chrome).
  3. Decrease the font size back to the original setting.
  4. 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 6 years ago by zacaway

File too large to upload. Link here instead:

comment:2 Changed 6 years ago by Jakub Ś

Status: newconfirmed
Summary: Increasing then decreasing font size does not return to initial stateInline styles should be normalized when selection doesn't change
Version: 4.24.0
  1. 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.
  1. 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.
  1. 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.

Last edited 5 years ago by Jakub Ś (previous) (diff)

comment:3 Changed 6 years ago by zacaway

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 5 years ago by Jakub Ś

Other issues can be found in #10742, #10824, #4505, #5980 #11120.

Last edited 4 years ago by Jakub Ś (previous) (diff)

comment:6 Changed 5 years ago by Jakub Ś

#12047 was marked as duplicate.

Please have a look at TC mentioned in that ticket.

comment:7 Changed 5 years ago by Jakub Ś

Another one related: #1646.

comment:8 Changed 4 years ago by Sreekant Nandakumar

Is this issue fixed? If not, can anybody help with a temporary fix that I can apply for solving this issue. Thanks.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy