Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#9063 closed Bug (fixed)

Font styling lost on sub-lists when the indent on the parent list is decreased

Reported by: tmonahan Owned by: garry.yao
Priority: Normal Milestone: CKEditor 3.6.4
Component: Core : Lists Version: 3.6.4
Keywords: IBM Cc: damo, satya

Description

To reproduce:

  • Copy the following into the Source view of the editor:
<ul style="font-size: 10px;">
	<li>Level 1 - size 10
		<ul style="font-size: 24px;">
			<li>Level 2 - size 24</li>
		</ul>
	</li>
	<li>Level 1 - size 10</li>
</ul>

  • Switch to wysiwyg mode and select the entire editor contents.
  • Select 'Decrease Indent' on the toolbar. The margin of both lists will be decreased and the level 1 list will no longer be a list.

Expected result: The level 2 list should remain a list and should keep its font styling.

Actual result: The level 2 list remains as a list but its font styling is lost.

The markup after the 'Decrease Indent' action looks like:

<p>
	Level 1 - size 10</p>
<ul>
	<li>Level 2 - size 24</li>
</ul>
<p>
	Level 1 - size 10</p>

It should be:

<p>
	Level 1 - size 10</p>
<ul style="font-size: 24px;">
	<li>Level 2 - size 24</li>
</ul>
<p>
	Level 1 - size 10</p>

Attachments (2)

9063.patch (3.5 KB) - added by garry.yao 4 years ago.
9063_2.patch (2.8 KB) - added by garry.yao 4 years ago.

Download all attachments as: .zip

Change History (12)

Changed 4 years ago by garry.yao

comment:1 Changed 4 years ago by garry.yao

  • Owner set to garry.yao
  • Status changed from new to review

comment:2 Changed 4 years ago by garry.yao

  • Component changed from General to Core : Lists

comment:3 Changed 4 years ago by fredck

  • Status changed from review to review_failed

This test fails after patch: http://ckeditor.t/tt/8997/1.html

comment:4 Changed 4 years ago by garry.yao

  • Milestone set to CKEditor 3.6.4

Changed 4 years ago by garry.yao

comment:5 Changed 4 years ago by garry.yao

  • Status changed from review_failed to review

comment:6 Changed 4 years ago by fredck

  • Status changed from review to review_passed

comment:7 follow-up: Changed 4 years ago by garry.yao

  • Resolution set to fixed
  • Status changed from review_passed to closed

Fixed with [7522].

comment:8 in reply to: ↑ 7 Changed 4 years ago by tmonahan

Replying to garry.yao:

Fixed with [7522].

The supplied fix results in the following HTML after the 'Decrease Indent' action:

<p style="font-size: 10px;">
	Level 1 - size 10</p>
<ul style="font-size: 24px;">
	<li>Level 2 - size 24</li>
</ul>
<p style="font-size: 10px;">
	Level 1 - size 10</p>

The problem with this is that the font-size is not reflected in the toolbar for the paragraph elements. Even if the user does change the font size on the paragraph text, the original font-size will still remain on the P element:

<p style="font-size: 10px;">
	<span style="font-size:14px;">Level 1 - size 10</span></p>

Can this font-size be moved into a span tag for the paragraph contents instead when the list is outdented, so that the font-size is reflected on the toolbar? i.e.

<p>
	<span style="font-size:10px;">Level 1 - size 10</span></p>
<ul style="font-size: 24px;">
	<li>Level 2 - size 24</li>
</ul>
<p>
	<span style="font-size:10px;">Level 1 - size 10</span></p>

If this is too complex a change right now, would it be possible to only keep the font-size style for UL and OL elements? i.e.

<p>
	Level 1 - size 10</p>
<ul style="font-size: 24px;">
	<li>Level 2 - size 24</li>
</ul>
<p>
	Level 1 - size 10</p>

comment:9 Changed 4 years ago by j.swiderski

@tmonahan I have moved your comment to new ticket #9076.

Let's consider this one as fixed and continue in that other ticket.

comment:10 Changed 4 years ago by garry.yao

The unexpected style inheritance is now reverted with [7535].

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