Opened 7 years ago

Closed 7 years ago

#3782 closed Bug (fixed)

Removing lists in table cells results in collapsed table cells.

Reported by: martinkou Owned by: martinkou
Priority: Normal Milestone: CKEditor 3.0
Component: Core : Lists Version: SVN (CKEditor) - OLD
Keywords: Review+ Cc:

Description

To reproduce:

  1. Open replacebyclass.html in Firefox/Safari/Opera.
  2. Create a table.
  3. Put caret to first cell.
  4. Press Insert/Remove Unordered List twice.
  5. Now the table cell cannot be selected in Firefox, or will give you strange caret positions in Safari/Opera.

Attachments (2)

3782.patch (1.4 KB) - added by martinkou 7 years ago.
3782_2.patch (2.8 KB) - added by garry.yao 7 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 7 years ago by martinkou

This is caused by lines 340 - 344 in list plugin.js. But I'm not sure what these four lines were originally meant to fix.

comment:2 Changed 7 years ago by garry.yao

These lines were for the logic of a special case regarding maintaining paragraph after remove list:

// Original Source
line1
<ul>
<li>item</li>
</ul>
<br />

// After arrayTolist, which append br for every line of items->

line1<br />
item<br />
<br />

// After L340 - 344, which figure out the br after item is redundant.
line1<br />
item
<br />

A simple fix I can imagine but not tested is:

var rootParent = groupObj.root.getParent();
newList.listNode.replace( groupObj.root );
rootParent.appendBogus();

}}}

Changed 7 years ago by martinkou

comment:3 Changed 7 years ago by martinkou

  • Keywords Review? added

Garry's suggestion works, I've just added some safety checks for it.

comment:4 Changed 7 years ago by garry.yao

  • Keywords Review- added; Review? removed

The safety check may not be necessary, even the root is guaranteed to be a block, could you give me an special case for it?

Changed 7 years ago by garry.yao

comment:5 Changed 7 years ago by garry.yao

  • Keywords Review? added; Review- removed

comment:6 Changed 7 years ago by martinkou

  • Keywords Review+ added; Review? removed

comment:7 Changed 7 years ago by martinkou

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

Fixed with [3903].

Click here for more info about our SVN system.

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